From 7cc84b983d9b6262a9717267862bf6538d3d6972 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Thu, 26 Sep 2024 14:28:49 +0200 Subject: [PATCH 01/67] Add GitHub Action workflow --- .github/workflows/openapi-check.yml | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/openapi-check.yml diff --git a/.github/workflows/openapi-check.yml b/.github/workflows/openapi-check.yml new file mode 100644 index 00000000..8239a4a8 --- /dev/null +++ b/.github/workflows/openapi-check.yml @@ -0,0 +1,36 @@ + name: OpenAPI Check + + on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + + jobs: + check-openapi: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + - name: Install dependencies + run: npm ci + - name: Start server + run: python -m uvicorn server.intelligence-service.app.main:app --host 0.0.0.0 --port 8000 & + - name: Wait for server + run: sleep 10 + - name: Generate Java client + run: npm run generate-java-client + - name: Check for changes + run: | + if [[ `git status --porcelain` ]]; then + echo "Changes detected in the generated client. Please regenerate and commit the changes." + exit 1 + fi \ No newline at end of file From 96ec9b1807d7d6e4de3c2057d92af45253f41a20 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Mon, 30 Sep 2024 22:20:02 +0200 Subject: [PATCH 02/67] Add generate-java-client --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0239ce68..91ea8f83 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,11 @@ "generate:api:clean": "rimraf webapp/src/app/core/modules/openapi", "generate:api:application-server-specs": "cd server/application-server && mvn verify -DskipTests=true && node ../../scripts/clean-openapi-specs.js", "generate:api:application-server-client": "npx openapi-generator-cli generate -i server/application-server/openapi.yaml -g typescript-angular -o webapp/src/app/core/modules/openapi --additional-properties fileNaming=kebab-case,withInterfaces=true --generate-alias-as-model", - "generate:api": "npm run generate:api:application-server-specs && npm run generate:api:clean && npm run generate:api:application-server-client" + "generate:api": "npm run generate:api:application-server-specs && npm run generate:api:clean && npm run generate:api:application-server-client", + "generate-java-client": "openapi-generator-cli generate -i http://localhost:8000/openapi.json -g java -o ./java-client" }, "devDependencies": { - "@openapitools/openapi-generator-cli": "2.13.5", + "@openapitools/openapi-generator-cli": "^2.13.5", "rimraf": "6.0.1" } } From c0e1119122b187d9a425522769d1907204508471 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Mon, 30 Sep 2024 22:20:40 +0200 Subject: [PATCH 03/67] Store the OpenAPI specifications --- server/intelligence-service/app/main.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/server/intelligence-service/app/main.py b/server/intelligence-service/app/main.py index 22560ae7..ead40a90 100644 --- a/server/intelligence-service/app/main.py +++ b/server/intelligence-service/app/main.py @@ -1,9 +1,13 @@ from fastapi import FastAPI, HTTPException from pydantic import BaseModel from .model import model +from fastapi.openapi.utils import get_openapi -app = FastAPI() - +app = FastAPI( + title="Intelligence Service API", + description="API for interacting with the LLM model", + version="1.0.0", +) class ChatRequest(BaseModel): message: str @@ -16,3 +20,18 @@ async def chat(request: ChatRequest): return { "response": response.content } except Exception as e: raise HTTPException(status_code=500, detail=str(e)) + +def custom_openapi(): + if app.openapi_schema: + return app.openapi_schema + openapi_schema = get_openapi( + title="Intelligence Service API", + version="1.0.0", + description="API for interacting with the LLM model", + routes=app.routes, + ) + app.openapi_schema = openapi_schema + return app.openapi_schema + + +app.openapi = custom_openapi \ No newline at end of file From 5deb2b0a821f9aa017f6fde04bf4348208539886 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Mon, 30 Sep 2024 22:20:59 +0200 Subject: [PATCH 04/67] Fix of FastAPI start --- server/intelligence-service/app/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/intelligence-service/app/model.py b/server/intelligence-service/app/model.py index e890fed0..395702d8 100644 --- a/server/intelligence-service/app/model.py +++ b/server/intelligence-service/app/model.py @@ -6,7 +6,7 @@ model: BaseChatModel if settings.is_openai_available: - model = ChatOpenAI() + model = ChatOpenAI(api_key=settings.OPENAI_API_KEY) elif settings.is_azure_openai_available: model = AzureChatOpenAI() else: From 754c24d5b53a0b72247c1fbd192b190a9adbd1b3 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Mon, 30 Sep 2024 22:21:17 +0200 Subject: [PATCH 05/67] Update devDependencies --- package-lock.json | 68 ++++++++++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index bdb067ac..6f96f9a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "webapp/*" ], "devDependencies": { - "@openapitools/openapi-generator-cli": "2.13.5", + "@openapitools/openapi-generator-cli": "^2.13.5", "rimraf": "6.0.1" } }, @@ -140,9 +140,9 @@ } }, "node_modules/@nestjs/axios": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.0.2.tgz", - "integrity": "sha512-Z6GuOUdNQjP7FX+OuV2Ybyamse+/e0BFdTWBX5JxpBDKA+YkdLynDgG6HTF04zy6e9zPa19UX0WA2VDoehwhXQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.0.3.tgz", + "integrity": "sha512-h6TCn3yJwD6OKqqqfmtRS5Zo4E46Ip2n+gK1sqwzNBC+qxQ9xpCu+ODVRFur6V3alHSCSBxb3nNtt73VEdluyA==", "dev": true, "license": "MIT", "peerDependencies": { @@ -152,14 +152,14 @@ } }, "node_modules/@nestjs/common": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.3.0.tgz", - "integrity": "sha512-DGv34UHsZBxCM3H5QGE2XE/+oLJzz5+714JQjBhjD9VccFlQs3LRxo/epso4l7nJIiNlZkPyIUC8WzfU/5RTsQ==", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.4.3.tgz", + "integrity": "sha512-4hbLd3XIJubHSylYd/1WSi4VQvG68KM/ECYpMDqA3k3J1/T17SAg40sDoq3ZoO5OZgU0xuNyjuISdOTjs11qVg==", "dev": true, "license": "MIT", "dependencies": { "iterare": "1.2.1", - "tslib": "2.6.2", + "tslib": "2.7.0", "uid": "2.0.2" }, "funding": { @@ -169,7 +169,7 @@ "peerDependencies": { "class-transformer": "*", "class-validator": "*", - "reflect-metadata": "^0.1.12", + "reflect-metadata": "^0.1.12 || ^0.2.0", "rxjs": "^7.1.0" }, "peerDependenciesMeta": { @@ -181,10 +181,17 @@ } } }, + "node_modules/@nestjs/common/node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "dev": true, + "license": "0BSD" + }, "node_modules/@nestjs/core": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.3.0.tgz", - "integrity": "sha512-N06P5ncknW/Pm8bj964WvLIZn2gNhHliCBoAO1LeBvNImYkecqKcrmLbY49Fa1rmMfEM3MuBHeDys3edeuYAOA==", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.4.3.tgz", + "integrity": "sha512-6OQz+5C8mT8yRtfvE5pPCq+p6w5jDot+oQku1KzQ24ABn+lay1KGuJwcKZhdVNuselx+8xhdMxknZTA8wrGLIg==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -192,8 +199,8 @@ "@nuxtjs/opencollective": "0.3.2", "fast-safe-stringify": "2.1.1", "iterare": "1.2.1", - "path-to-regexp": "3.2.0", - "tslib": "2.6.2", + "path-to-regexp": "3.3.0", + "tslib": "2.7.0", "uid": "2.0.2" }, "funding": { @@ -205,7 +212,7 @@ "@nestjs/microservices": "^10.0.0", "@nestjs/platform-express": "^10.0.0", "@nestjs/websockets": "^10.0.0", - "reflect-metadata": "^0.1.12", + "reflect-metadata": "^0.1.12 || ^0.2.0", "rxjs": "^7.1.0" }, "peerDependenciesMeta": { @@ -220,6 +227,13 @@ } } }, + "node_modules/@nestjs/core/node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "dev": true, + "license": "0BSD" + }, "node_modules/@nuxtjs/opencollective": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz", @@ -240,16 +254,16 @@ } }, "node_modules/@openapitools/openapi-generator-cli": { - "version": "2.13.5", - "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.13.5.tgz", - "integrity": "sha512-9VgeKOTiiatKSwZDKKB3C86cW8tN9eDcFohotD4eisdK38UQswk/4Ysoq9KChRCbymjoMp6AIDHPtK1DQ2fTgw==", + "version": "2.13.9", + "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.13.9.tgz", + "integrity": "sha512-GJaWGcHmLsvj/G1mRDytm9PTDwRGSYUDTf1uA/2FYxQAb5sq4nkZz1tD4Z7qDlZ3xTYSTw4Z8BQUdlsnrA8rcw==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@nestjs/axios": "3.0.2", - "@nestjs/common": "10.3.0", - "@nestjs/core": "10.3.0", + "@nestjs/axios": "3.0.3", + "@nestjs/common": "10.4.3", + "@nestjs/core": "10.4.3", "@nuxtjs/opencollective": "0.3.2", "axios": "1.7.4", "chalk": "4.1.2", @@ -830,9 +844,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.6", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", - "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", "dev": true, "funding": [ { @@ -1372,9 +1386,9 @@ } }, "node_modules/path-to-regexp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz", - "integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.3.0.tgz", + "integrity": "sha512-qyCH421YQPS2WFDxDjftfc1ZR5WKQzVzqsp4n9M2kQhVOo/ByahFoUNJfl58kOcEGfQ//7weFTDhm+ss8Ecxgw==", "dev": true, "license": "MIT" }, From 237b891895ed8114b89069f4ab87540f9ce14b5d Mon Sep 17 00:00:00 2001 From: milenasrb Date: Mon, 30 Sep 2024 22:29:34 +0200 Subject: [PATCH 06/67] Update --- .github/workflows/openapi-check.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/openapi-check.yml b/.github/workflows/openapi-check.yml index 8239a4a8..c3afd9ed 100644 --- a/.github/workflows/openapi-check.yml +++ b/.github/workflows/openapi-check.yml @@ -10,27 +10,30 @@ check-openapi: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up JDK 11 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: java-version: '11' distribution: 'adopt' - name: Set up Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '16' - name: Install dependencies run: npm ci - name: Start server run: python -m uvicorn server.intelligence-service.app.main:app --host 0.0.0.0 --port 8000 & - - name: Wait for server + - name: Wait for server to start run: sleep 10 - name: Generate Java client run: npm run generate-java-client - name: Check for changes run: | - if [[ `git status --porcelain` ]]; then - echo "Changes detected in the generated client. Please regenerate and commit the changes." - exit 1 - fi \ No newline at end of file + git status + if [[ `git status --porcelain` ]]; then + echo "Changes detected in the generated client. Please regenerate and commit the changes." + exit 1 + else + echo "No changes detected in the generated client." + fi \ No newline at end of file From a1050a9b487c4ce698848f47d0a101c32bdb86ab Mon Sep 17 00:00:00 2001 From: milenasrb Date: Mon, 30 Sep 2024 23:18:42 +0200 Subject: [PATCH 07/67] Add OpenAPI specification storage --- server/intelligence-service/openapi.yaml | 62 ++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 server/intelligence-service/openapi.yaml diff --git a/server/intelligence-service/openapi.yaml b/server/intelligence-service/openapi.yaml new file mode 100644 index 00000000..2b09083e --- /dev/null +++ b/server/intelligence-service/openapi.yaml @@ -0,0 +1,62 @@ +openapi: 3.0.1 +info: + title: Hephaestus API + description: API documentation for the Hephaestus intelligence service. + contact: + name: Felix T.J. Dietrich + email: felixtj.dietrich@tum.de + license: + name: MIT License + url: https://github.com/ls1intum/Hephaestus/blob/develop/LICENSE + version: 0.0.1 +servers: + - url: http://localhost:8080 + description: Local development server +paths: + /chat: + post: + summary: Chat with LLM + operationId: chatWithLLM + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChatRequest' + responses: + '200': + description: Successful response from LLM + content: + application/json: + schema: + $ref: '#/components/schemas/ChatResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' +components: + schemas: + ChatRequest: + type: object + properties: + message: + type: string + description: The message to be sent to the LLM + required: + - message + ChatResponse: + type: object + properties: + response: + type: string + description: The response generated by the LLM + required: + - response + ErrorResponse: + type: object + properties: + detail: + type: string + description: Error message in case of failure \ No newline at end of file From 9e3484c59914c754497db55fa74811efc9182a3e Mon Sep 17 00:00:00 2001 From: milenasrb Date: Mon, 30 Sep 2024 23:28:54 +0200 Subject: [PATCH 08/67] Delete unnecassary code --- server/intelligence-service/app/main.py | 29 +++++-------------------- 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/server/intelligence-service/app/main.py b/server/intelligence-service/app/main.py index ead40a90..b8f7fb86 100644 --- a/server/intelligence-service/app/main.py +++ b/server/intelligence-service/app/main.py @@ -1,37 +1,18 @@ from fastapi import FastAPI, HTTPException from pydantic import BaseModel from .model import model -from fastapi.openapi.utils import get_openapi -app = FastAPI( - title="Intelligence Service API", - description="API for interacting with the LLM model", - version="1.0.0", -) +app = FastAPI() class ChatRequest(BaseModel): message: str +class ChatResponse(BaseModel): + response: str - -@app.post("/chat", response_model=dict, summary="Chat with LLM") +@app.post("/chat", response_model=ChatResponse, summary="Chat with LLM") async def chat(request: ChatRequest): try: response = model.invoke(request.message) return { "response": response.content } except Exception as e: - raise HTTPException(status_code=500, detail=str(e)) - -def custom_openapi(): - if app.openapi_schema: - return app.openapi_schema - openapi_schema = get_openapi( - title="Intelligence Service API", - version="1.0.0", - description="API for interacting with the LLM model", - routes=app.routes, - ) - app.openapi_schema = openapi_schema - return app.openapi_schema - - -app.openapi = custom_openapi \ No newline at end of file + raise HTTPException(status_code=500, detail=str(e)) \ No newline at end of file From 87aae8122238ac6be105894023a9060935b057f0 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Mon, 30 Sep 2024 23:50:10 +0200 Subject: [PATCH 09/67] Update Git WorkFlow --- .../{openapi-check.yml => check-api-client.yml} | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) rename .github/workflows/{openapi-check.yml => check-api-client.yml} (77%) diff --git a/.github/workflows/openapi-check.yml b/.github/workflows/check-api-client.yml similarity index 77% rename from .github/workflows/openapi-check.yml rename to .github/workflows/check-api-client.yml index c3afd9ed..e53ddfc2 100644 --- a/.github/workflows/openapi-check.yml +++ b/.github/workflows/check-api-client.yml @@ -1,4 +1,4 @@ - name: OpenAPI Check + name: Check Java Client is Up-to-Date on: push: @@ -22,12 +22,9 @@ node-version: '16' - name: Install dependencies run: npm ci - - name: Start server - run: python -m uvicorn server.intelligence-service.app.main:app --host 0.0.0.0 --port 8000 & - - name: Wait for server to start - run: sleep 10 + - name: Generate Java client - run: npm run generate-java-client + run: npm run generate:java-client - name: Check for changes run: | git status From 9d573cb6a9d0a6661ec8e72194ad01c06f8a9e04 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 1 Oct 2024 09:05:07 +0200 Subject: [PATCH 10/67] Update with right config --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 91ea8f83..5dce8e7b 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "generate:api:application-server-specs": "cd server/application-server && mvn verify -DskipTests=true && node ../../scripts/clean-openapi-specs.js", "generate:api:application-server-client": "npx openapi-generator-cli generate -i server/application-server/openapi.yaml -g typescript-angular -o webapp/src/app/core/modules/openapi --additional-properties fileNaming=kebab-case,withInterfaces=true --generate-alias-as-model", "generate:api": "npm run generate:api:application-server-specs && npm run generate:api:clean && npm run generate:api:application-server-client", - "generate-java-client": "openapi-generator-cli generate -i http://localhost:8000/openapi.json -g java -o ./java-client" + "generate:java-client": "npx @openapitools/openapi-generator-cli generate -i server/intelligence-service/openapi.yaml -g java -o server/intelligence-service/java-client" }, "devDependencies": { "@openapitools/openapi-generator-cli": "^2.13.5", From 93fb2227f9ec7ac8b0a7a0c07ea35a2381c5daff Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 1 Oct 2024 09:19:48 +0200 Subject: [PATCH 11/67] Add Java Client --- .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.gitignore | 21 + .../java-client/.openapi-generator-ignore | 23 + .../java-client/.openapi-generator/FILES | 42 + .../java-client/.openapi-generator/VERSION | 1 + .../java-client/.travis.yml | 22 + .../java-client/README.md | 141 ++ .../java-client/api/openapi.yaml | 72 + .../java-client/build.gradle | 168 ++ .../java-client/build.sbt | 28 + .../java-client/docs/ChatRequest.md | 13 + .../java-client/docs/ChatResponse.md | 13 + .../java-client/docs/DefaultApi.md | 70 + .../java-client/docs/ErrorResponse.md | 13 + .../java-client/git_push.sh | 57 + .../java-client/gradle.properties | 6 + .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 43453 bytes .../gradle/wrapper/gradle-wrapper.properties | 7 + .../intelligence-service/java-client/gradlew | 249 +++ .../java-client/gradlew.bat | 92 + .../intelligence-service/java-client/pom.xml | 344 ++++ .../java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1564 +++++++++++++++++ .../org/openapitools/client/ApiException.java | 167 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 403 +++++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 59 + .../openapitools/client/ServerVariable.java | 24 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 204 +++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 55 + .../client/auth/HttpBearerAuth.java | 75 + .../client/model/AbstractOpenApiSchema.java | 146 ++ .../client/model/ChatRequest.java | 214 +++ .../client/model/ChatResponse.java | 214 +++ .../client/model/ErrorResponse.java | 206 +++ .../client/api/DefaultApiTest.java | 48 + .../client/model/ChatRequestTest.java | 48 + .../client/model/ChatResponseTest.java | 48 + .../client/model/ErrorResponseTest.java | 48 + server/intelligence-service/openapitools.json | 7 + 50 files changed, 5609 insertions(+) create mode 100644 server/intelligence-service/java-client/.github/workflows/maven.yml create mode 100644 server/intelligence-service/java-client/.gitignore create mode 100644 server/intelligence-service/java-client/.openapi-generator-ignore create mode 100644 server/intelligence-service/java-client/.openapi-generator/FILES create mode 100644 server/intelligence-service/java-client/.openapi-generator/VERSION create mode 100644 server/intelligence-service/java-client/.travis.yml create mode 100644 server/intelligence-service/java-client/README.md create mode 100644 server/intelligence-service/java-client/api/openapi.yaml create mode 100644 server/intelligence-service/java-client/build.gradle create mode 100644 server/intelligence-service/java-client/build.sbt create mode 100644 server/intelligence-service/java-client/docs/ChatRequest.md create mode 100644 server/intelligence-service/java-client/docs/ChatResponse.md create mode 100644 server/intelligence-service/java-client/docs/DefaultApi.md create mode 100644 server/intelligence-service/java-client/docs/ErrorResponse.md create mode 100644 server/intelligence-service/java-client/git_push.sh create mode 100644 server/intelligence-service/java-client/gradle.properties create mode 100644 server/intelligence-service/java-client/gradle/wrapper/gradle-wrapper.jar create mode 100644 server/intelligence-service/java-client/gradle/wrapper/gradle-wrapper.properties create mode 100644 server/intelligence-service/java-client/gradlew create mode 100644 server/intelligence-service/java-client/gradlew.bat create mode 100644 server/intelligence-service/java-client/pom.xml create mode 100644 server/intelligence-service/java-client/settings.gradle create mode 100644 server/intelligence-service/java-client/src/main/AndroidManifest.xml create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ChatRequest.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ChatResponse.java create mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ErrorResponse.java create mode 100644 server/intelligence-service/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ChatRequestTest.java create mode 100644 server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ChatResponseTest.java create mode 100644 server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ErrorResponseTest.java create mode 100644 server/intelligence-service/openapitools.json diff --git a/server/intelligence-service/java-client/.github/workflows/maven.yml b/server/intelligence-service/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000..1705ebcc --- /dev/null +++ b/server/intelligence-service/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hephaestus API + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 17, 21 ] + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/server/intelligence-service/java-client/.gitignore b/server/intelligence-service/java-client/.gitignore new file mode 100644 index 00000000..a530464a --- /dev/null +++ b/server/intelligence-service/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/server/intelligence-service/java-client/.openapi-generator-ignore b/server/intelligence-service/java-client/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/server/intelligence-service/java-client/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/server/intelligence-service/java-client/.openapi-generator/FILES b/server/intelligence-service/java-client/.openapi-generator/FILES new file mode 100644 index 00000000..f8e5de0f --- /dev/null +++ b/server/intelligence-service/java-client/.openapi-generator/FILES @@ -0,0 +1,42 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/ChatRequest.md +docs/ChatResponse.md +docs/DefaultApi.md +docs/ErrorResponse.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/ChatRequest.java +src/main/java/org/openapitools/client/model/ChatResponse.java +src/main/java/org/openapitools/client/model/ErrorResponse.java diff --git a/server/intelligence-service/java-client/.openapi-generator/VERSION b/server/intelligence-service/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000..1985849f --- /dev/null +++ b/server/intelligence-service/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.7.0 diff --git a/server/intelligence-service/java-client/.travis.yml b/server/intelligence-service/java-client/.travis.yml new file mode 100644 index 00000000..1b6741c0 --- /dev/null +++ b/server/intelligence-service/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/server/intelligence-service/java-client/README.md b/server/intelligence-service/java-client/README.md new file mode 100644 index 00000000..d6dcebe0 --- /dev/null +++ b/server/intelligence-service/java-client/README.md @@ -0,0 +1,141 @@ +# openapi-java-client + +Hephaestus API +- API version: 0.0.1 + - Build date: 2024-09-30T23:43:50.516482+02:00[Europe/Berlin] + - Generator version: 7.7.0 + +API documentation for the Hephaestus intelligence service. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 0.0.1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:0.0.1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-0.0.1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:8080"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + ChatRequest chatRequest = new ChatRequest(); // ChatRequest | + try { + ChatResponse result = apiInstance.chatWithLLM(chatRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#chatWithLLM"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:8080* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**chatWithLLM**](docs/DefaultApi.md#chatWithLLM) | **POST** /chat | Chat with LLM + + +## Documentation for Models + + - [ChatRequest](docs/ChatRequest.md) + - [ChatResponse](docs/ChatResponse.md) + - [ErrorResponse](docs/ErrorResponse.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + +felixtj.dietrich@tum.de + diff --git a/server/intelligence-service/java-client/api/openapi.yaml b/server/intelligence-service/java-client/api/openapi.yaml new file mode 100644 index 00000000..89fa19ab --- /dev/null +++ b/server/intelligence-service/java-client/api/openapi.yaml @@ -0,0 +1,72 @@ +openapi: 3.0.1 +info: + contact: + email: felixtj.dietrich@tum.de + name: Felix T.J. Dietrich + description: API documentation for the Hephaestus intelligence service. + license: + name: MIT License + url: https://github.com/ls1intum/Hephaestus/blob/develop/LICENSE + title: Hephaestus API + version: 0.0.1 +servers: +- description: Local development server + url: http://localhost:8080 +paths: + /chat: + post: + operationId: chatWithLLM + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ChatResponse' + description: Successful response from LLM + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Internal Server Error + summary: Chat with LLM + x-content-type: application/json + x-accepts: + - application/json +components: + schemas: + ChatRequest: + example: + message: message + properties: + message: + description: The message to be sent to the LLM + type: string + required: + - message + type: object + ChatResponse: + example: + response: response + properties: + response: + description: The response generated by the LLM + type: string + required: + - response + type: object + ErrorResponse: + example: + detail: detail + properties: + detail: + description: Error message in case of failure + type: string + type: object + diff --git a/server/intelligence-service/java-client/build.gradle b/server/intelligence-service/java-client/build.gradle new file mode 100644 index 00000000..0bd3df18 --- /dev/null +++ b/server/intelligence-service/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '0.0.1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.12.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.9.0' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/server/intelligence-service/java-client/build.sbt b/server/intelligence-service/java-client/build.sbt new file mode 100644 index 00000000..a87a753c --- /dev/null +++ b/server/intelligence-service/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "0.0.1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.12.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/server/intelligence-service/java-client/docs/ChatRequest.md b/server/intelligence-service/java-client/docs/ChatRequest.md new file mode 100644 index 00000000..12a6a2b1 --- /dev/null +++ b/server/intelligence-service/java-client/docs/ChatRequest.md @@ -0,0 +1,13 @@ + + +# ChatRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**message** | **String** | The message to be sent to the LLM | | + + + diff --git a/server/intelligence-service/java-client/docs/ChatResponse.md b/server/intelligence-service/java-client/docs/ChatResponse.md new file mode 100644 index 00000000..574832e9 --- /dev/null +++ b/server/intelligence-service/java-client/docs/ChatResponse.md @@ -0,0 +1,13 @@ + + +# ChatResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**response** | **String** | The response generated by the LLM | | + + + diff --git a/server/intelligence-service/java-client/docs/DefaultApi.md b/server/intelligence-service/java-client/docs/DefaultApi.md new file mode 100644 index 00000000..a706ad23 --- /dev/null +++ b/server/intelligence-service/java-client/docs/DefaultApi.md @@ -0,0 +1,70 @@ +# DefaultApi + +All URIs are relative to *http://localhost:8080* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**chatWithLLM**](DefaultApi.md#chatWithLLM) | **POST** /chat | Chat with LLM | + + + +# **chatWithLLM** +> ChatResponse chatWithLLM(chatRequest) + +Chat with LLM + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:8080"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + ChatRequest chatRequest = new ChatRequest(); // ChatRequest | + try { + ChatResponse result = apiInstance.chatWithLLM(chatRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#chatWithLLM"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **chatRequest** | [**ChatRequest**](ChatRequest.md)| | | + +### Return type + +[**ChatResponse**](ChatResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful response from LLM | - | +| **500** | Internal Server Error | - | + diff --git a/server/intelligence-service/java-client/docs/ErrorResponse.md b/server/intelligence-service/java-client/docs/ErrorResponse.md new file mode 100644 index 00000000..4741376c --- /dev/null +++ b/server/intelligence-service/java-client/docs/ErrorResponse.md @@ -0,0 +1,13 @@ + + +# ErrorResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**detail** | **String** | Error message in case of failure | [optional] | + + + diff --git a/server/intelligence-service/java-client/git_push.sh b/server/intelligence-service/java-client/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/server/intelligence-service/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/server/intelligence-service/java-client/gradle.properties b/server/intelligence-service/java-client/gradle.properties new file mode 100644 index 00000000..a3408578 --- /dev/null +++ b/server/intelligence-service/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/server/intelligence-service/java-client/gradle/wrapper/gradle-wrapper.jar b/server/intelligence-service/java-client/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..e6441136f3d4ba8a0da8d277868979cfbc8ad796 GIT binary patch literal 43453 zcma&N1CXTcmMvW9vTb(Rwr$&4wr$(C?dmSu>@vG-+vuvg^_??!{yS%8zW-#zn-LkA z5&1^$^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0NIyrm)HOn5W#7;f4pQci# zDW!FI(g4e668kI9{2+mLwB+=#9bfqgX%!B34V-$wwSN(_cm*^{y0jQtv*4}eO^sOV z*9xoNvX)c9isB}Tgx&ZRjp3kwhTVK?r9;n!x>^XYT z@Q^7zp{rkIs{2mUSE^2!Gf6$6;j~&4=-0cSJJDizZp6LTe8b45;{AKM%v99}{{FfC zz709%u0mC=1KXTo(=TqmZQ;c?$M3z(!xah>aywrj40sc2y3rKFw4jCq+Y+u=CH@_V zxz|qeTwa>+<|H%8Dz5u>ZI5MmjTFwXS-Fv!TDd*`>3{krWoNVx$<133`(ftS?ZPyY z&4@ah^3^i`vL$BZa>O|Nt?ucewzsF)0zX3qmM^|waXr=T0pfIb0*$AwU=?Ipl|1Y; z*Pk6{C-p4MY;j@IJ|DW>QHZQJcp;Z~?8(Q+Kk3^0qJ}SCk^*n4W zu9ZFwLHUx-$6xvaQ)SUQcYd6fF8&x)V`1bIuX@>{mE$b|Yd(qomn3;bPwnDUc0F=; zh*6_((%bqAYQWQ~odER?h>1mkL4kpb3s7`0m@rDKGU*oyF)$j~Ffd4fXV$?`f~rHf zB%Y)@5SXZvfwm10RY5X?TEo)PK_`L6qgBp=#>fO49$D zDq8Ozj0q6213tV5Qq=;fZ0$|KroY{Dz=l@lU^J)?Ko@ti20TRplXzphBi>XGx4bou zEWrkNjz0t5j!_ke{g5I#PUlEU$Km8g8TE|XK=MkU@PT4T><2OVamoK;wJ}3X0L$vX zgd7gNa359*nc)R-0!`2X@FOTB`+oETOPc=ubp5R)VQgY+5BTZZJ2?9QwnO=dnulIUF3gFn;BODC2)65)HeVd%t86sL7Rv^Y+nbn+&l z6BAJY(ETvwI)Ts$aiE8rht4KD*qNyE{8{x6R|%akbTBzw;2+6Echkt+W+`u^XX z_z&x%n '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { +echo "$*" +} >&2 + +die () { +echo +echo "$*" +echo +exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/server/intelligence-service/java-client/gradlew.bat b/server/intelligence-service/java-client/gradlew.bat new file mode 100644 index 00000000..25da30db --- /dev/null +++ b/server/intelligence-service/java-client/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/server/intelligence-service/java-client/pom.xml b/server/intelligence-service/java-client/pom.xml new file mode 100644 index 00000000..05a76f17 --- /dev/null +++ b/server/intelligence-service/java-client/pom.xml @@ -0,0 +1,344 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 0.0.1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://github.com/ls1intum/Hephaestus/blob/develop/LICENSE + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.4.1 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.6.1 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.5.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.6.3 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.2.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.9.0 + 4.11.0 + 2.10.1 + 3.14.0 + 0.2.6 + 1.3.5 + 5.10.2 + 1.10.0 + 2.1.1 + 1.1.1 + UTF-8 + 2.43.0 + + diff --git a/server/intelligence-service/java-client/settings.gradle b/server/intelligence-service/java-client/settings.gradle new file mode 100644 index 00000000..369ba54a --- /dev/null +++ b/server/intelligence-service/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/server/intelligence-service/java-client/src/main/AndroidManifest.xml b/server/intelligence-service/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000..54fbcb3d --- /dev/null +++ b/server/intelligence-service/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000..e0e9bbf9 --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiClient.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000..f30d7d45 --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1564 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

+ */ +public class ApiClient { + + private String basePath = "http://localhost:8080"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "http://localhost:8080", + "Local development server", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Basic constructor with custom OkHttpClient + * + * @param client a {@link okhttp3.OkHttpClient} object + */ + public ApiClient(OkHttpClient client) { + init(); + + httpClient = client; + + // Setup authentications (key: authentication name, value: authentication). + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/0.0.1/java"); + + authentications = new HashMap(); + } + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g http://localhost:8080 + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + this.serverIndex = null; + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client, which must never be null. + * + * @param newHttpClient An instance of OkHttpClient + * @return Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

Getter for the field keyManagers.

+ * + * @return an array of {@link javax.net.ssl.KeyManager} objects + */ + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. + * Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + /** + *

Getter for the field dateFormat.

+ * + * @return a {@link java.text.DateFormat} object + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + *

Setter for the field dateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + JSON.setDateFormat(dateFormat); + return this; + } + + /** + *

Set SqlDateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + JSON.setSqlDateFormat(dateFormat); + return this; + } + + /** + *

Set OffsetDateTimeFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + *

Set LocalDateFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateFormat(dateFormat); + return this; + } + + /** + *

Set LenientOnJson.

+ * + * @param lenientOnJson a boolean + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setLenientOnJson(boolean lenientOnJson) { + JSON.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param sessionToken Session Token + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return ApiClient + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); + } else { + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default temporary folder. + * + * @see createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.connectTimeoutMillis(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.readTimeoutMillis(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.writeTimeoutMillis(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = JSON.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(o); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder(); + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws org.openapitools.client.ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws org.openapitools.client.ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + return RequestBody.create(content, MediaType.parse(contentType)); + } else if (obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws org.openapitools.client.ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @return Prepared file for the download + * @throws java.io.IOException If fail to prepare file for download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @return ApiResponse<T> + * @throws org.openapitools.client.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws org.openapitools.client.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + * @see #execute(Call, Type) + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Call call, Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } catch (Exception e) { + callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Type + * @throws org.openapitools.client.ApiException If the response has an unsuccessful status code or + * fail to deserialize the response body + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (Exception e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP call + * @throws org.openapitools.client.ApiException If fail to serialize the request body object + */ + public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP request + * @throws org.openapitools.client.ApiException If fail to serialize the request body object + */ + public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + String contentTypePure = contentType; + if (contentTypePure != null && contentTypePure.contains(";")) { + contentTypePure = contentType.substring(0, contentType.indexOf(";")); + } + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentTypePure)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); + } + } else { + reqBody = serialize(body, contentType); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + + // Associate callback with request (if not null) so interceptor can + // access it when creating ProgressResponseBody + reqBuilder.tag(callback); + + Request request = null; + + if (callback != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param baseUrl The base URL + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() + )); + } + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + url.append(baseURL).append(path); + } + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Set cookie parameters to the request builder, including default cookies. + * + * @param cookieParams Cookie parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { + for (Entry param : cookieParams.entrySet()) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws org.openapitools.client.ApiException If fails to update the parameters + */ + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RuntimeException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List list = (List) param.getValue(); + for (Object item: list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiException.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000..44345834 --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,167 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Map; +import java.util.List; + + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

+ */ + public ApiException() {} + + /** + *

Constructor for ApiException.

+ * + * @param throwable a {@link java.lang.Throwable} object + */ + public ApiException(Throwable throwable) { + super(throwable); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + */ + public ApiException(String message) { + super(message); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, Map> responseHeaders, String responseBody) { + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message a {@link java.lang.String} object + */ + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000..0ad969ec --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + /** + *

Get the status code.

+ * + * @return the status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + *

Get the headers.

+ * + * @return a {@link java.util.Map} of headers + */ + public Map> getHeaders() { + return headers; + } + + /** + *

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/Configuration.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000..a494d8ad --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class Configuration { + public static final String VERSION = "0.0.1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000..9defa62e --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/JSON.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000..9630f790 --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,403 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ChatRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ChatResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ErrorResponse.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/Pair.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000..44ae7b43 --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000..0875f209 --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000..45b35a33 --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000..7dae208c --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,59 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000..46efd869 --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,24 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/StringUtil.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000..efc1e4bd --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000..4bf0a527 --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,204 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.ChatRequest; +import org.openapitools.client.model.ChatResponse; +import org.openapitools.client.model.ErrorResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for chatWithLLM + * @param chatRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Successful response from LLM -
500 Internal Server Error -
+ */ + public okhttp3.Call chatWithLLMCall(ChatRequest chatRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = chatRequest; + + // create path and map variables + String localVarPath = "/chat"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call chatWithLLMValidateBeforeCall(ChatRequest chatRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'chatRequest' is set + if (chatRequest == null) { + throw new ApiException("Missing the required parameter 'chatRequest' when calling chatWithLLM(Async)"); + } + + return chatWithLLMCall(chatRequest, _callback); + + } + + /** + * Chat with LLM + * + * @param chatRequest (required) + * @return ChatResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Successful response from LLM -
500 Internal Server Error -
+ */ + public ChatResponse chatWithLLM(ChatRequest chatRequest) throws ApiException { + ApiResponse localVarResp = chatWithLLMWithHttpInfo(chatRequest); + return localVarResp.getData(); + } + + /** + * Chat with LLM + * + * @param chatRequest (required) + * @return ApiResponse<ChatResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Successful response from LLM -
500 Internal Server Error -
+ */ + public ApiResponse chatWithLLMWithHttpInfo(ChatRequest chatRequest) throws ApiException { + okhttp3.Call localVarCall = chatWithLLMValidateBeforeCall(chatRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Chat with LLM (asynchronously) + * + * @param chatRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Successful response from LLM -
500 Internal Server Error -
+ */ + public okhttp3.Call chatWithLLMAsync(ChatRequest chatRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = chatWithLLMValidateBeforeCall(chatRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000..c187f03a --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000..0a0c173f --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000..4e184b88 --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,55 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000..9d87659b --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,75 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000..d376479d --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,146 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ChatRequest.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ChatRequest.java new file mode 100644 index 00000000..fb2581a1 --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ChatRequest.java @@ -0,0 +1,214 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ChatRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class ChatRequest { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public ChatRequest() { + } + + public ChatRequest message(String message) { + this.message = message; + return this; + } + + /** + * The message to be sent to the LLM + * @return message + */ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChatRequest chatRequest = (ChatRequest) o; + return Objects.equals(this.message, chatRequest.message); + } + + @Override + public int hashCode() { + return Objects.hash(message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChatRequest {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("message"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ChatRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ChatRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ChatRequest is not found in the empty JSON string", ChatRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ChatRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ChatRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ChatRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ChatRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ChatRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ChatRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ChatRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ChatRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ChatRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ChatRequest + * @throws IOException if the JSON string is invalid with respect to ChatRequest + */ + public static ChatRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ChatRequest.class); + } + + /** + * Convert an instance of ChatRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ChatResponse.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ChatResponse.java new file mode 100644 index 00000000..37c7c518 --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ChatResponse.java @@ -0,0 +1,214 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ChatResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class ChatResponse { + public static final String SERIALIZED_NAME_RESPONSE = "response"; + @SerializedName(SERIALIZED_NAME_RESPONSE) + private String response; + + public ChatResponse() { + } + + public ChatResponse response(String response) { + this.response = response; + return this; + } + + /** + * The response generated by the LLM + * @return response + */ + @javax.annotation.Nonnull + public String getResponse() { + return response; + } + + public void setResponse(String response) { + this.response = response; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChatResponse chatResponse = (ChatResponse) o; + return Objects.equals(this.response, chatResponse.response); + } + + @Override + public int hashCode() { + return Objects.hash(response); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChatResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("response"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("response"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ChatResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ChatResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ChatResponse is not found in the empty JSON string", ChatResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ChatResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ChatResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ChatResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("response").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ChatResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ChatResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ChatResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ChatResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ChatResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ChatResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ChatResponse + * @throws IOException if the JSON string is invalid with respect to ChatResponse + */ + public static ChatResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ChatResponse.class); + } + + /** + * Convert an instance of ChatResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ErrorResponse.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ErrorResponse.java new file mode 100644 index 00000000..89d4ae55 --- /dev/null +++ b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ErrorResponse.java @@ -0,0 +1,206 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ErrorResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class ErrorResponse { + public static final String SERIALIZED_NAME_DETAIL = "detail"; + @SerializedName(SERIALIZED_NAME_DETAIL) + private String detail; + + public ErrorResponse() { + } + + public ErrorResponse detail(String detail) { + this.detail = detail; + return this; + } + + /** + * Error message in case of failure + * @return detail + */ + @javax.annotation.Nullable + public String getDetail() { + return detail; + } + + public void setDetail(String detail) { + this.detail = detail; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorResponse errorResponse = (ErrorResponse) o; + return Objects.equals(this.detail, errorResponse.detail); + } + + @Override + public int hashCode() { + return Objects.hash(detail); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponse {\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("detail"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ErrorResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ErrorResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorResponse is not found in the empty JSON string", ErrorResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ErrorResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("detail") != null && !jsonObj.get("detail").isJsonNull()) && !jsonObj.get("detail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `detail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("detail").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorResponse + * @throws IOException if the JSON string is invalid with respect to ErrorResponse + */ + public static ErrorResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorResponse.class); + } + + /** + * Convert an instance of ErrorResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/server/intelligence-service/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/server/intelligence-service/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000..cdf75c51 --- /dev/null +++ b/server/intelligence-service/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,48 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.ChatRequest; +import org.openapitools.client.model.ChatResponse; +import org.openapitools.client.model.ErrorResponse; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Chat with LLM + * + * @throws ApiException if the Api call fails + */ + @Test + public void chatWithLLMTest() throws ApiException { + ChatRequest chatRequest = null; + ChatResponse response = api.chatWithLLM(chatRequest); + // TODO: test validations + } + +} diff --git a/server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ChatRequestTest.java b/server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ChatRequestTest.java new file mode 100644 index 00000000..6ca278c2 --- /dev/null +++ b/server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ChatRequestTest.java @@ -0,0 +1,48 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ChatRequest + */ +public class ChatRequestTest { + private final ChatRequest model = new ChatRequest(); + + /** + * Model tests for ChatRequest + */ + @Test + public void testChatRequest() { + // TODO: test ChatRequest + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + +} diff --git a/server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ChatResponseTest.java b/server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ChatResponseTest.java new file mode 100644 index 00000000..e1f003d8 --- /dev/null +++ b/server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ChatResponseTest.java @@ -0,0 +1,48 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ChatResponse + */ +public class ChatResponseTest { + private final ChatResponse model = new ChatResponse(); + + /** + * Model tests for ChatResponse + */ + @Test + public void testChatResponse() { + // TODO: test ChatResponse + } + + /** + * Test the property 'response' + */ + @Test + public void responseTest() { + // TODO: test response + } + +} diff --git a/server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ErrorResponseTest.java b/server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ErrorResponseTest.java new file mode 100644 index 00000000..db51c938 --- /dev/null +++ b/server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ErrorResponseTest.java @@ -0,0 +1,48 @@ +/* + * Hephaestus API + * API documentation for the Hephaestus intelligence service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ErrorResponse + */ +public class ErrorResponseTest { + private final ErrorResponse model = new ErrorResponse(); + + /** + * Model tests for ErrorResponse + */ + @Test + public void testErrorResponse() { + // TODO: test ErrorResponse + } + + /** + * Test the property 'detail' + */ + @Test + public void detailTest() { + // TODO: test detail + } + +} diff --git a/server/intelligence-service/openapitools.json b/server/intelligence-service/openapitools.json new file mode 100644 index 00000000..2f4612ce --- /dev/null +++ b/server/intelligence-service/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.8.0" + } +} From bc719d1b965ed5e086e5bb564bd1c845d1abe83c Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 1 Oct 2024 09:30:08 +0200 Subject: [PATCH 12/67] Upgrade to com.squareup.okio:okio-jvm:3.4.0 --- .../java-client/build.gradle | 1 + .../intelligence-service/java-client/pom.xml | 76 ++++++++++--------- 2 files changed, 42 insertions(+), 35 deletions(-) diff --git a/server/intelligence-service/java-client/build.gradle b/server/intelligence-service/java-client/build.gradle index 0bd3df18..d6bed062 100644 --- a/server/intelligence-service/java-client/build.gradle +++ b/server/intelligence-service/java-client/build.gradle @@ -117,6 +117,7 @@ dependencies { implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + implementation 'com.squareup.okio:okio-jvm:3.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' testImplementation 'org.mockito:mockito-core:3.12.4' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' diff --git a/server/intelligence-service/java-client/pom.xml b/server/intelligence-service/java-client/pom.xml index 05a76f17..664c1493 100644 --- a/server/intelligence-service/java-client/pom.xml +++ b/server/intelligence-service/java-client/pom.xml @@ -33,7 +33,7 @@ - + org.apache.maven.plugins maven-compiler-plugin 3.8.1 @@ -43,7 +43,8 @@ 512m -Xlint:all - -J-Xss4m + -J-Xss4m + @@ -89,6 +90,11 @@ junit-jupiter-engine ${junit-version} + + com.squareup.okio + okio-jvm + 3.4.0 + @@ -193,42 +199,42 @@ Ref: https://github.com/diffplug/spotless/tree/main/plugin-maven --> - com.diffplug.spotless - spotless-maven-plugin - ${spotless.version} - - - - - - - .gitignore - - - - - - true - 4 - - - - - - + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + - - - 1.8 - - true - + + + 1.8 + + true + - - + + - - + + From c4f2b44dd9e472a1a27008e2406639175c248fb3 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 1 Oct 2024 12:28:12 +0200 Subject: [PATCH 13/67] Add support of the .env file --- server/intelligence-service/app/config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/intelligence-service/app/config.py b/server/intelligence-service/app/config.py index f153b6d8..ac754375 100644 --- a/server/intelligence-service/app/config.py +++ b/server/intelligence-service/app/config.py @@ -1,5 +1,7 @@ from pydantic_settings import BaseSettings +from dotenv import load_dotenv +load_dotenv() class Settings(BaseSettings): OPENAI_API_KEY: str = "" From 4e8098cc4f20e581b535d5f0ba9b3a9fbf874378 Mon Sep 17 00:00:00 2001 From: Milena Serbinova <45200178+milesha@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:40:16 +0200 Subject: [PATCH 14/67] Update check-api-client.yml --- .github/workflows/check-api-client.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check-api-client.yml b/.github/workflows/check-api-client.yml index e53ddfc2..985028a1 100644 --- a/.github/workflows/check-api-client.yml +++ b/.github/workflows/check-api-client.yml @@ -10,12 +10,12 @@ check-openapi: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v4 with: - java-version: '11' - distribution: 'adopt' + java-version: '21' + distribution: 'temurin' - name: Set up Node.js uses: actions/setup-node@v3 with: @@ -33,4 +33,4 @@ exit 1 else echo "No changes detected in the generated client." - fi \ No newline at end of file + fi From 27ef5d2659ff07b61666270ff9fad4fedaced164 Mon Sep 17 00:00:00 2001 From: Milena Serbinova <45200178+milesha@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:41:09 +0200 Subject: [PATCH 15/67] Change the openapi version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5dce8e7b..f736978b 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "generate:java-client": "npx @openapitools/openapi-generator-cli generate -i server/intelligence-service/openapi.yaml -g java -o server/intelligence-service/java-client" }, "devDependencies": { - "@openapitools/openapi-generator-cli": "^2.13.5", + "@openapitools/openapi-generator-cli": "2.13.5", "rimraf": "6.0.1" } } From 59702a7d5c391ec18bb7ebe9cec3e9d057f9c195 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 1 Oct 2024 14:48:02 +0200 Subject: [PATCH 16/67] Add model configuration for .env --- server/intelligence-service/app/config.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/server/intelligence-service/app/config.py b/server/intelligence-service/app/config.py index ac754375..16800afb 100644 --- a/server/intelligence-service/app/config.py +++ b/server/intelligence-service/app/config.py @@ -1,9 +1,8 @@ -from pydantic_settings import BaseSettings -from dotenv import load_dotenv - -load_dotenv() +from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): + model_config = SettingsConfigDict(validate_key=False) + OPENAI_API_KEY: str = "" AZURE_OPENAI_API_KEY: str = "" @@ -18,4 +17,4 @@ def is_openai_available(self): def is_azure_openai_available(self): return bool(self.AZURE_OPENAI_API_KEY) and bool(self.AZURE_OPENAI_ENDPOINT) and bool(self.AZURE_OPENAI_API_VERSION) -settings = Settings() +settings = Settings(_env_file=".env") From c2709a6781bbfb75f2beef2e22fb97cd519b435a Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 1 Oct 2024 16:38:48 +0200 Subject: [PATCH 17/67] Change titile --- server/intelligence-service/openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/intelligence-service/openapi.yaml b/server/intelligence-service/openapi.yaml index 2b09083e..ca178284 100644 --- a/server/intelligence-service/openapi.yaml +++ b/server/intelligence-service/openapi.yaml @@ -1,6 +1,6 @@ openapi: 3.0.1 info: - title: Hephaestus API + title: Hephaestus Intelligence API description: API documentation for the Hephaestus intelligence service. contact: name: Felix T.J. Dietrich From b862557bf712d1b14404567018b4f40cbd3b6534 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 1 Oct 2024 16:42:46 +0200 Subject: [PATCH 18/67] Update dependencies --- package-lock.json | 62 ++++++++++++++++++----------------------------- 1 file changed, 24 insertions(+), 38 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6f96f9a6..ec6d7178 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "webapp/*" ], "devDependencies": { - "@openapitools/openapi-generator-cli": "^2.13.5", + "@openapitools/openapi-generator-cli": "2.13.5", "rimraf": "6.0.1" } }, @@ -140,9 +140,9 @@ } }, "node_modules/@nestjs/axios": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.0.3.tgz", - "integrity": "sha512-h6TCn3yJwD6OKqqqfmtRS5Zo4E46Ip2n+gK1sqwzNBC+qxQ9xpCu+ODVRFur6V3alHSCSBxb3nNtt73VEdluyA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.0.2.tgz", + "integrity": "sha512-Z6GuOUdNQjP7FX+OuV2Ybyamse+/e0BFdTWBX5JxpBDKA+YkdLynDgG6HTF04zy6e9zPa19UX0WA2VDoehwhXQ==", "dev": true, "license": "MIT", "peerDependencies": { @@ -152,14 +152,14 @@ } }, "node_modules/@nestjs/common": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.4.3.tgz", - "integrity": "sha512-4hbLd3XIJubHSylYd/1WSi4VQvG68KM/ECYpMDqA3k3J1/T17SAg40sDoq3ZoO5OZgU0xuNyjuISdOTjs11qVg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.3.0.tgz", + "integrity": "sha512-DGv34UHsZBxCM3H5QGE2XE/+oLJzz5+714JQjBhjD9VccFlQs3LRxo/epso4l7nJIiNlZkPyIUC8WzfU/5RTsQ==", "dev": true, "license": "MIT", "dependencies": { "iterare": "1.2.1", - "tslib": "2.7.0", + "tslib": "2.6.2", "uid": "2.0.2" }, "funding": { @@ -169,7 +169,7 @@ "peerDependencies": { "class-transformer": "*", "class-validator": "*", - "reflect-metadata": "^0.1.12 || ^0.2.0", + "reflect-metadata": "^0.1.12", "rxjs": "^7.1.0" }, "peerDependenciesMeta": { @@ -181,17 +181,10 @@ } } }, - "node_modules/@nestjs/common/node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", - "dev": true, - "license": "0BSD" - }, "node_modules/@nestjs/core": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.4.3.tgz", - "integrity": "sha512-6OQz+5C8mT8yRtfvE5pPCq+p6w5jDot+oQku1KzQ24ABn+lay1KGuJwcKZhdVNuselx+8xhdMxknZTA8wrGLIg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.3.0.tgz", + "integrity": "sha512-N06P5ncknW/Pm8bj964WvLIZn2gNhHliCBoAO1LeBvNImYkecqKcrmLbY49Fa1rmMfEM3MuBHeDys3edeuYAOA==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -199,8 +192,8 @@ "@nuxtjs/opencollective": "0.3.2", "fast-safe-stringify": "2.1.1", "iterare": "1.2.1", - "path-to-regexp": "3.3.0", - "tslib": "2.7.0", + "path-to-regexp": "3.2.0", + "tslib": "2.6.2", "uid": "2.0.2" }, "funding": { @@ -212,7 +205,7 @@ "@nestjs/microservices": "^10.0.0", "@nestjs/platform-express": "^10.0.0", "@nestjs/websockets": "^10.0.0", - "reflect-metadata": "^0.1.12 || ^0.2.0", + "reflect-metadata": "^0.1.12", "rxjs": "^7.1.0" }, "peerDependenciesMeta": { @@ -227,13 +220,6 @@ } } }, - "node_modules/@nestjs/core/node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", - "dev": true, - "license": "0BSD" - }, "node_modules/@nuxtjs/opencollective": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz", @@ -254,16 +240,16 @@ } }, "node_modules/@openapitools/openapi-generator-cli": { - "version": "2.13.9", - "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.13.9.tgz", - "integrity": "sha512-GJaWGcHmLsvj/G1mRDytm9PTDwRGSYUDTf1uA/2FYxQAb5sq4nkZz1tD4Z7qDlZ3xTYSTw4Z8BQUdlsnrA8rcw==", + "version": "2.13.5", + "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.13.5.tgz", + "integrity": "sha512-9VgeKOTiiatKSwZDKKB3C86cW8tN9eDcFohotD4eisdK38UQswk/4Ysoq9KChRCbymjoMp6AIDHPtK1DQ2fTgw==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@nestjs/axios": "3.0.3", - "@nestjs/common": "10.4.3", - "@nestjs/core": "10.4.3", + "@nestjs/axios": "3.0.2", + "@nestjs/common": "10.3.0", + "@nestjs/core": "10.3.0", "@nuxtjs/opencollective": "0.3.2", "axios": "1.7.4", "chalk": "4.1.2", @@ -1386,9 +1372,9 @@ } }, "node_modules/path-to-regexp": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.3.0.tgz", - "integrity": "sha512-qyCH421YQPS2WFDxDjftfc1ZR5WKQzVzqsp4n9M2kQhVOo/ByahFoUNJfl58kOcEGfQ//7weFTDhm+ss8Ecxgw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz", + "integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA==", "dev": true, "license": "MIT" }, From 62ace3fbbe777cdfcecfb54983f52ec16136aa7d Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 1 Oct 2024 16:58:15 +0200 Subject: [PATCH 19/67] Delete unused code --- .github/workflows/check-api-client.yml | 36 -------------------------- 1 file changed, 36 deletions(-) delete mode 100644 .github/workflows/check-api-client.yml diff --git a/.github/workflows/check-api-client.yml b/.github/workflows/check-api-client.yml deleted file mode 100644 index 985028a1..00000000 --- a/.github/workflows/check-api-client.yml +++ /dev/null @@ -1,36 +0,0 @@ - name: Check Java Client is Up-to-Date - - on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - - jobs: - check-openapi: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 21 - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'temurin' - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '16' - - name: Install dependencies - run: npm ci - - - name: Generate Java client - run: npm run generate:java-client - - name: Check for changes - run: | - git status - if [[ `git status --porcelain` ]]; then - echo "Changes detected in the generated client. Please regenerate and commit the changes." - exit 1 - else - echo "No changes detected in the generated client." - fi From baa1660ab01d81bdbf6b2560bb531b67f2ecb6c6 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 1 Oct 2024 17:01:36 +0200 Subject: [PATCH 20/67] Re-name generate function --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f736978b..0e2c75ec 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "generate:api:application-server-specs": "cd server/application-server && mvn verify -DskipTests=true && node ../../scripts/clean-openapi-specs.js", "generate:api:application-server-client": "npx openapi-generator-cli generate -i server/application-server/openapi.yaml -g typescript-angular -o webapp/src/app/core/modules/openapi --additional-properties fileNaming=kebab-case,withInterfaces=true --generate-alias-as-model", "generate:api": "npm run generate:api:application-server-specs && npm run generate:api:clean && npm run generate:api:application-server-client", - "generate:java-client": "npx @openapitools/openapi-generator-cli generate -i server/intelligence-service/openapi.yaml -g java -o server/intelligence-service/java-client" + "generate:api:intelligence-service-client": "npx @openapitools/openapi-generator-cli generate -i server/intelligence-service/openapi.yaml -g java -o server/intelligence-service/java-client" }, "devDependencies": { "@openapitools/openapi-generator-cli": "2.13.5", From 955cbeb9742d07aa29ed0d082ba3e8fc13dba32a Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 1 Oct 2024 17:05:12 +0200 Subject: [PATCH 21/67] Update model config --- server/intelligence-service/app/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/intelligence-service/app/config.py b/server/intelligence-service/app/config.py index 16800afb..aec01a99 100644 --- a/server/intelligence-service/app/config.py +++ b/server/intelligence-service/app/config.py @@ -1,7 +1,7 @@ from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): - model_config = SettingsConfigDict(validate_key=False) + model_config = SettingsConfigDict(env_file=".env") OPENAI_API_KEY: str = "" @@ -17,4 +17,4 @@ def is_openai_available(self): def is_azure_openai_available(self): return bool(self.AZURE_OPENAI_API_KEY) and bool(self.AZURE_OPENAI_ENDPOINT) and bool(self.AZURE_OPENAI_API_VERSION) -settings = Settings(_env_file=".env") +settings = Settings() From 987e08e0f67bb74c31d2d4f1022131048e45e04e Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 1 Oct 2024 17:07:02 +0200 Subject: [PATCH 22/67] Format --- server/intelligence-service/app/main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/intelligence-service/app/main.py b/server/intelligence-service/app/main.py index b8f7fb86..07eedb8f 100644 --- a/server/intelligence-service/app/main.py +++ b/server/intelligence-service/app/main.py @@ -4,15 +4,19 @@ app = FastAPI() + class ChatRequest(BaseModel): message: str + + class ChatResponse(BaseModel): response: str + @app.post("/chat", response_model=ChatResponse, summary="Chat with LLM") async def chat(request: ChatRequest): try: response = model.invoke(request.message) - return { "response": response.content } + return {"response": response.content} except Exception as e: - raise HTTPException(status_code=500, detail=str(e)) \ No newline at end of file + raise HTTPException(status_code=500, detail=str(e)) From cf72601a970c458a2b40c2fccb85d2ea32907c01 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 1 Oct 2024 17:24:57 +0200 Subject: [PATCH 23/67] Change .env usage --- server/intelligence-service/app/config.py | 10 ++++++++-- server/intelligence-service/app/model.py | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/server/intelligence-service/app/config.py b/server/intelligence-service/app/config.py index aec01a99..5383e680 100644 --- a/server/intelligence-service/app/config.py +++ b/server/intelligence-service/app/config.py @@ -1,5 +1,9 @@ +from dotenv import load_dotenv from pydantic_settings import BaseSettings, SettingsConfigDict +load_dotenv() + + class Settings(BaseSettings): model_config = SettingsConfigDict(env_file=".env") @@ -12,9 +16,11 @@ class Settings(BaseSettings): @property def is_openai_available(self): return bool(self.OPENAI_API_KEY) - + @property def is_azure_openai_available(self): - return bool(self.AZURE_OPENAI_API_KEY) and bool(self.AZURE_OPENAI_ENDPOINT) and bool(self.AZURE_OPENAI_API_VERSION) + return bool(self.AZURE_OPENAI_API_KEY) and bool(self.AZURE_OPENAI_ENDPOINT) and bool( + self.AZURE_OPENAI_API_VERSION) + settings = Settings() diff --git a/server/intelligence-service/app/model.py b/server/intelligence-service/app/model.py index 395702d8..12ef4930 100644 --- a/server/intelligence-service/app/model.py +++ b/server/intelligence-service/app/model.py @@ -1,12 +1,12 @@ from langchain.chat_models.base import BaseChatModel from langchain_openai import ChatOpenAI, AzureChatOpenAI -from .config import settings +from .config import settings model: BaseChatModel if settings.is_openai_available: - model = ChatOpenAI(api_key=settings.OPENAI_API_KEY) + model = ChatOpenAI() elif settings.is_azure_openai_available: model = AzureChatOpenAI() else: From e24285c020995e7beaa310f1eb7bb944cfb9aa50 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Wed, 2 Oct 2024 13:30:29 +0200 Subject: [PATCH 24/67] Add specification generation --- package.json | 3 +- .../app/generate_openapi_yaml.py | 30 ++++++ server/intelligence-service/app/main.py | 8 +- server/intelligence-service/openapi.yaml | 102 +++++++++++------- 4 files changed, 100 insertions(+), 43 deletions(-) create mode 100644 server/intelligence-service/app/generate_openapi_yaml.py diff --git a/package.json b/package.json index 0e2c75ec..b1dfd8a9 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "generate:api:application-server-specs": "cd server/application-server && mvn verify -DskipTests=true && node ../../scripts/clean-openapi-specs.js", "generate:api:application-server-client": "npx openapi-generator-cli generate -i server/application-server/openapi.yaml -g typescript-angular -o webapp/src/app/core/modules/openapi --additional-properties fileNaming=kebab-case,withInterfaces=true --generate-alias-as-model", "generate:api": "npm run generate:api:application-server-specs && npm run generate:api:clean && npm run generate:api:application-server-client", - "generate:api:intelligence-service-client": "npx @openapitools/openapi-generator-cli generate -i server/intelligence-service/openapi.yaml -g java -o server/intelligence-service/java-client" + "generate:api:intelligence-service-specs": "python -m server.intelligence-service.app.generate_openapi_yaml", + "generate:api:intelligence-service-client": "npx @openapitools/openapi-generator-cli generate -i server/intelligence-service/openapi.yaml -g java -o server/intelligence-service/java-client", }, "devDependencies": { "@openapitools/openapi-generator-cli": "2.13.5", diff --git a/server/intelligence-service/app/generate_openapi_yaml.py b/server/intelligence-service/app/generate_openapi_yaml.py new file mode 100644 index 00000000..0469045d --- /dev/null +++ b/server/intelligence-service/app/generate_openapi_yaml.py @@ -0,0 +1,30 @@ +from . import main +from fastapi.openapi.utils import get_openapi +import yaml + + +def get_openapi_specs(): + openapi_json = get_openapi( + title=main.app.title, + version=main.app.version, + description=main.app.description, + contact=main.app.contact, + routes=main.app.routes, + ) + openapi_yaml = yaml.dump(openapi_json) + return openapi_yaml + + +def convert(): + try: + yaml_spec = get_openapi_specs() + with open("server/intelligence-service/openapi.yaml", "w") as f: + f.write(yaml_spec) + print("OpenAPI YAML specification generated successfully.") + except Exception as e: + print(f"Error generating OpenAPI specs: {e}") + exit(1) + + +if __name__ == "__main__": + convert() diff --git a/server/intelligence-service/app/main.py b/server/intelligence-service/app/main.py index 07eedb8f..ac362b0c 100644 --- a/server/intelligence-service/app/main.py +++ b/server/intelligence-service/app/main.py @@ -2,7 +2,13 @@ from pydantic import BaseModel from .model import model -app = FastAPI() + +app = FastAPI( + title="Hephaestus Intelligence Service API", + description="API documentation for the Hephaestus Intelligence Service.", + version="0.0.1", + contact={"name": "Felix T.J. Dietrich", "email": "felixtj.dietrich@tum.de"}, +) class ChatRequest(BaseModel): diff --git a/server/intelligence-service/openapi.yaml b/server/intelligence-service/openapi.yaml index ca178284..305d241e 100644 --- a/server/intelligence-service/openapi.yaml +++ b/server/intelligence-service/openapi.yaml @@ -1,62 +1,82 @@ -openapi: 3.0.1 +components: + schemas: + ChatRequest: + properties: + message: + title: Message + type: string + required: + - message + title: ChatRequest + type: object + ChatResponse: + properties: + response: + title: Response + type: string + required: + - response + title: ChatResponse + type: object + HTTPValidationError: + properties: + detail: + items: + $ref: '#/components/schemas/ValidationError' + title: Detail + type: array + title: HTTPValidationError + type: object + ValidationError: + properties: + loc: + items: + anyOf: + - type: string + - type: integer + title: Location + type: array + msg: + title: Message + type: string + type: + title: Error Type + type: string + required: + - loc + - msg + - type + title: ValidationError + type: object info: - title: Hephaestus Intelligence API - description: API documentation for the Hephaestus intelligence service. contact: - name: Felix T.J. Dietrich email: felixtj.dietrich@tum.de - license: - name: MIT License - url: https://github.com/ls1intum/Hephaestus/blob/develop/LICENSE + name: Felix T.J. Dietrich + description: API documentation for the Hephaestus Intelligence Service. + title: Hephaestus Intelligence Service API version: 0.0.1 -servers: - - url: http://localhost:8080 - description: Local development server +openapi: 3.1.0 paths: /chat: post: - summary: Chat with LLM - operationId: chatWithLLM + operationId: chat_chat_post requestBody: - required: true content: application/json: schema: $ref: '#/components/schemas/ChatRequest' + required: true responses: '200': - description: Successful response from LLM content: application/json: schema: $ref: '#/components/schemas/ChatResponse' - '500': - description: Internal Server Error + description: Successful Response + '422': content: application/json: schema: - $ref: '#/components/schemas/ErrorResponse' -components: - schemas: - ChatRequest: - type: object - properties: - message: - type: string - description: The message to be sent to the LLM - required: - - message - ChatResponse: - type: object - properties: - response: - type: string - description: The response generated by the LLM - required: - - response - ErrorResponse: - type: object - properties: - detail: - type: string - description: Error message in case of failure \ No newline at end of file + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + summary: Chat with LLM From f496e69e15cbbad55a6284895033ccb9ee902f18 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Wed, 2 Oct 2024 16:17:04 +0200 Subject: [PATCH 25/67] Delete comma crushing the build --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b1dfd8a9..72eb1a1e 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "generate:api:application-server-client": "npx openapi-generator-cli generate -i server/application-server/openapi.yaml -g typescript-angular -o webapp/src/app/core/modules/openapi --additional-properties fileNaming=kebab-case,withInterfaces=true --generate-alias-as-model", "generate:api": "npm run generate:api:application-server-specs && npm run generate:api:clean && npm run generate:api:application-server-client", "generate:api:intelligence-service-specs": "python -m server.intelligence-service.app.generate_openapi_yaml", - "generate:api:intelligence-service-client": "npx @openapitools/openapi-generator-cli generate -i server/intelligence-service/openapi.yaml -g java -o server/intelligence-service/java-client", + "generate:api:intelligence-service-client": "npx @openapitools/openapi-generator-cli generate -i server/intelligence-service/openapi.yaml -g java -o server/intelligence-service/java-client" }, "devDependencies": { "@openapitools/openapi-generator-cli": "2.13.5", From 6828d36fe1fa3f5b6f298ef413469562ff80aed5 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Wed, 2 Oct 2024 16:17:52 +0200 Subject: [PATCH 26/67] Add allow_unicode --- server/intelligence-service/app/generate_openapi_yaml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/intelligence-service/app/generate_openapi_yaml.py b/server/intelligence-service/app/generate_openapi_yaml.py index 0469045d..c9c2f3ce 100644 --- a/server/intelligence-service/app/generate_openapi_yaml.py +++ b/server/intelligence-service/app/generate_openapi_yaml.py @@ -11,7 +11,7 @@ def get_openapi_specs(): contact=main.app.contact, routes=main.app.routes, ) - openapi_yaml = yaml.dump(openapi_json) + openapi_yaml = yaml.dump(openapi_json, allow_unicode=True) return openapi_yaml From 62b7f2ddfcaacea1005e0dd01dd7d07664aaaa5b Mon Sep 17 00:00:00 2001 From: milenasrb Date: Sun, 13 Oct 2024 20:54:41 +0200 Subject: [PATCH 27/67] Delete Java client from the wrong directory --- .../java-client/.github/workflows/maven.yml | 30 - .../java-client/.gitignore | 21 - .../java-client/.openapi-generator-ignore | 23 - .../java-client/.openapi-generator/FILES | 42 - .../java-client/.openapi-generator/VERSION | 1 - .../java-client/.travis.yml | 22 - .../java-client/README.md | 141 -- .../java-client/api/openapi.yaml | 72 - .../java-client/build.gradle | 169 -- .../java-client/build.sbt | 28 - .../java-client/docs/ChatRequest.md | 13 - .../java-client/docs/ChatResponse.md | 13 - .../java-client/docs/DefaultApi.md | 70 - .../java-client/docs/ErrorResponse.md | 13 - .../java-client/git_push.sh | 57 - .../java-client/gradle.properties | 6 - .../gradle/wrapper/gradle-wrapper.jar | Bin 43453 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 7 - .../intelligence-service/java-client/gradlew | 249 --- .../java-client/gradlew.bat | 92 - .../intelligence-service/java-client/pom.xml | 350 ---- .../java-client/settings.gradle | 1 - .../java-client/src/main/AndroidManifest.xml | 3 - .../org/openapitools/client/ApiCallback.java | 62 - .../org/openapitools/client/ApiClient.java | 1564 ----------------- .../org/openapitools/client/ApiException.java | 167 -- .../org/openapitools/client/ApiResponse.java | 76 - .../openapitools/client/Configuration.java | 41 - .../client/GzipRequestInterceptor.java | 85 - .../java/org/openapitools/client/JSON.java | 403 ----- .../java/org/openapitools/client/Pair.java | 57 - .../client/ProgressRequestBody.java | 73 - .../client/ProgressResponseBody.java | 70 - .../client/ServerConfiguration.java | 59 - .../openapitools/client/ServerVariable.java | 24 - .../org/openapitools/client/StringUtil.java | 83 - .../openapitools/client/api/DefaultApi.java | 204 --- .../openapitools/client/auth/ApiKeyAuth.java | 80 - .../client/auth/Authentication.java | 36 - .../client/auth/HttpBasicAuth.java | 55 - .../client/auth/HttpBearerAuth.java | 75 - .../client/model/AbstractOpenApiSchema.java | 146 -- .../client/model/ChatRequest.java | 214 --- .../client/model/ChatResponse.java | 214 --- .../client/model/ErrorResponse.java | 206 --- .../client/api/DefaultApiTest.java | 48 - .../client/model/ChatRequestTest.java | 48 - .../client/model/ChatResponseTest.java | 48 - .../client/model/ErrorResponseTest.java | 48 - 49 files changed, 5609 deletions(-) delete mode 100644 server/intelligence-service/java-client/.github/workflows/maven.yml delete mode 100644 server/intelligence-service/java-client/.gitignore delete mode 100644 server/intelligence-service/java-client/.openapi-generator-ignore delete mode 100644 server/intelligence-service/java-client/.openapi-generator/FILES delete mode 100644 server/intelligence-service/java-client/.openapi-generator/VERSION delete mode 100644 server/intelligence-service/java-client/.travis.yml delete mode 100644 server/intelligence-service/java-client/README.md delete mode 100644 server/intelligence-service/java-client/api/openapi.yaml delete mode 100644 server/intelligence-service/java-client/build.gradle delete mode 100644 server/intelligence-service/java-client/build.sbt delete mode 100644 server/intelligence-service/java-client/docs/ChatRequest.md delete mode 100644 server/intelligence-service/java-client/docs/ChatResponse.md delete mode 100644 server/intelligence-service/java-client/docs/DefaultApi.md delete mode 100644 server/intelligence-service/java-client/docs/ErrorResponse.md delete mode 100644 server/intelligence-service/java-client/git_push.sh delete mode 100644 server/intelligence-service/java-client/gradle.properties delete mode 100644 server/intelligence-service/java-client/gradle/wrapper/gradle-wrapper.jar delete mode 100644 server/intelligence-service/java-client/gradle/wrapper/gradle-wrapper.properties delete mode 100644 server/intelligence-service/java-client/gradlew delete mode 100644 server/intelligence-service/java-client/gradlew.bat delete mode 100644 server/intelligence-service/java-client/pom.xml delete mode 100644 server/intelligence-service/java-client/settings.gradle delete mode 100644 server/intelligence-service/java-client/src/main/AndroidManifest.xml delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiCallback.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiClient.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiException.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiResponse.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/Configuration.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/JSON.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/Pair.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/ServerVariable.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/StringUtil.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/Authentication.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ChatRequest.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ChatResponse.java delete mode 100644 server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ErrorResponse.java delete mode 100644 server/intelligence-service/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java delete mode 100644 server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ChatRequestTest.java delete mode 100644 server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ChatResponseTest.java delete mode 100644 server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ErrorResponseTest.java diff --git a/server/intelligence-service/java-client/.github/workflows/maven.yml b/server/intelligence-service/java-client/.github/workflows/maven.yml deleted file mode 100644 index 1705ebcc..00000000 --- a/server/intelligence-service/java-client/.github/workflows/maven.yml +++ /dev/null @@ -1,30 +0,0 @@ -# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven -# -# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) - -name: Java CI with Maven - -on: - push: - branches: [ main, master ] - pull_request: - branches: [ main, master ] - -jobs: - build: - name: Build Hephaestus API - runs-on: ubuntu-latest - strategy: - matrix: - java: [ 17, 21 ] - steps: - - uses: actions/checkout@v4 - - name: Set up JDK - uses: actions/setup-java@v4 - with: - java-version: ${{ matrix.java }} - distribution: 'temurin' - cache: maven - - name: Build with Maven - run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/server/intelligence-service/java-client/.gitignore b/server/intelligence-service/java-client/.gitignore deleted file mode 100644 index a530464a..00000000 --- a/server/intelligence-service/java-client/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -*.class - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.ear - -# exclude jar for gradle wrapper -!gradle/wrapper/*.jar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -# build files -**/target -target -.gradle -build diff --git a/server/intelligence-service/java-client/.openapi-generator-ignore b/server/intelligence-service/java-client/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/server/intelligence-service/java-client/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/server/intelligence-service/java-client/.openapi-generator/FILES b/server/intelligence-service/java-client/.openapi-generator/FILES deleted file mode 100644 index f8e5de0f..00000000 --- a/server/intelligence-service/java-client/.openapi-generator/FILES +++ /dev/null @@ -1,42 +0,0 @@ -.github/workflows/maven.yml -.gitignore -.travis.yml -README.md -api/openapi.yaml -build.gradle -build.sbt -docs/ChatRequest.md -docs/ChatResponse.md -docs/DefaultApi.md -docs/ErrorResponse.md -git_push.sh -gradle.properties -gradle/wrapper/gradle-wrapper.jar -gradle/wrapper/gradle-wrapper.properties -gradlew -gradlew.bat -pom.xml -settings.gradle -src/main/AndroidManifest.xml -src/main/java/org/openapitools/client/ApiCallback.java -src/main/java/org/openapitools/client/ApiClient.java -src/main/java/org/openapitools/client/ApiException.java -src/main/java/org/openapitools/client/ApiResponse.java -src/main/java/org/openapitools/client/Configuration.java -src/main/java/org/openapitools/client/GzipRequestInterceptor.java -src/main/java/org/openapitools/client/JSON.java -src/main/java/org/openapitools/client/Pair.java -src/main/java/org/openapitools/client/ProgressRequestBody.java -src/main/java/org/openapitools/client/ProgressResponseBody.java -src/main/java/org/openapitools/client/ServerConfiguration.java -src/main/java/org/openapitools/client/ServerVariable.java -src/main/java/org/openapitools/client/StringUtil.java -src/main/java/org/openapitools/client/api/DefaultApi.java -src/main/java/org/openapitools/client/auth/ApiKeyAuth.java -src/main/java/org/openapitools/client/auth/Authentication.java -src/main/java/org/openapitools/client/auth/HttpBasicAuth.java -src/main/java/org/openapitools/client/auth/HttpBearerAuth.java -src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java -src/main/java/org/openapitools/client/model/ChatRequest.java -src/main/java/org/openapitools/client/model/ChatResponse.java -src/main/java/org/openapitools/client/model/ErrorResponse.java diff --git a/server/intelligence-service/java-client/.openapi-generator/VERSION b/server/intelligence-service/java-client/.openapi-generator/VERSION deleted file mode 100644 index 1985849f..00000000 --- a/server/intelligence-service/java-client/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.7.0 diff --git a/server/intelligence-service/java-client/.travis.yml b/server/intelligence-service/java-client/.travis.yml deleted file mode 100644 index 1b6741c0..00000000 --- a/server/intelligence-service/java-client/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -# -# Generated by OpenAPI Generator: https://openapi-generator.tech -# -# Ref: https://docs.travis-ci.com/user/languages/java/ -# -language: java -jdk: - - openjdk12 - - openjdk11 - - openjdk10 - - openjdk9 - - openjdk8 -before_install: - # ensure gradlew has proper permission - - chmod a+x ./gradlew -script: - # test using maven - #- mvn test - # test using gradle - - gradle test - # test using sbt - # - sbt test diff --git a/server/intelligence-service/java-client/README.md b/server/intelligence-service/java-client/README.md deleted file mode 100644 index d6dcebe0..00000000 --- a/server/intelligence-service/java-client/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# openapi-java-client - -Hephaestus API -- API version: 0.0.1 - - Build date: 2024-09-30T23:43:50.516482+02:00[Europe/Berlin] - - Generator version: 7.7.0 - -API documentation for the Hephaestus intelligence service. - - -*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* - - -## Requirements - -Building the API client library requires: -1. Java 1.8+ -2. Maven (3.8.3+)/Gradle (7.2+) - -## Installation - -To install the API client library to your local Maven repository, simply execute: - -```shell -mvn clean install -``` - -To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: - -```shell -mvn clean deploy -``` - -Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. - -### Maven users - -Add this dependency to your project's POM: - -```xml - - org.openapitools - openapi-java-client - 0.0.1 - compile - -``` - -### Gradle users - -Add this dependency to your project's build file: - -```groovy - repositories { - mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. - mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. - } - - dependencies { - implementation "org.openapitools:openapi-java-client:0.0.1" - } -``` - -### Others - -At first generate the JAR by executing: - -```shell -mvn clean package -``` - -Then manually install the following JARs: - -* `target/openapi-java-client-0.0.1.jar` -* `target/lib/*.jar` - -## Getting Started - -Please follow the [installation](#installation) instruction and execute the following Java code: - -```java - -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.DefaultApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost:8080"); - - DefaultApi apiInstance = new DefaultApi(defaultClient); - ChatRequest chatRequest = new ChatRequest(); // ChatRequest | - try { - ChatResponse result = apiInstance.chatWithLLM(chatRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#chatWithLLM"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:8080* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*DefaultApi* | [**chatWithLLM**](docs/DefaultApi.md#chatWithLLM) | **POST** /chat | Chat with LLM - - -## Documentation for Models - - - [ChatRequest](docs/ChatRequest.md) - - [ChatResponse](docs/ChatResponse.md) - - [ErrorResponse](docs/ErrorResponse.md) - - - -## Documentation for Authorization - -Endpoints do not require authorization. - - -## Recommendation - -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. - -## Author - -felixtj.dietrich@tum.de - diff --git a/server/intelligence-service/java-client/api/openapi.yaml b/server/intelligence-service/java-client/api/openapi.yaml deleted file mode 100644 index 89fa19ab..00000000 --- a/server/intelligence-service/java-client/api/openapi.yaml +++ /dev/null @@ -1,72 +0,0 @@ -openapi: 3.0.1 -info: - contact: - email: felixtj.dietrich@tum.de - name: Felix T.J. Dietrich - description: API documentation for the Hephaestus intelligence service. - license: - name: MIT License - url: https://github.com/ls1intum/Hephaestus/blob/develop/LICENSE - title: Hephaestus API - version: 0.0.1 -servers: -- description: Local development server - url: http://localhost:8080 -paths: - /chat: - post: - operationId: chatWithLLM - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ChatRequest' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ChatResponse' - description: Successful response from LLM - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - description: Internal Server Error - summary: Chat with LLM - x-content-type: application/json - x-accepts: - - application/json -components: - schemas: - ChatRequest: - example: - message: message - properties: - message: - description: The message to be sent to the LLM - type: string - required: - - message - type: object - ChatResponse: - example: - response: response - properties: - response: - description: The response generated by the LLM - type: string - required: - - response - type: object - ErrorResponse: - example: - detail: detail - properties: - detail: - description: Error message in case of failure - type: string - type: object - diff --git a/server/intelligence-service/java-client/build.gradle b/server/intelligence-service/java-client/build.gradle deleted file mode 100644 index d6bed062..00000000 --- a/server/intelligence-service/java-client/build.gradle +++ /dev/null @@ -1,169 +0,0 @@ -apply plugin: 'idea' -apply plugin: 'eclipse' -apply plugin: 'java' -apply plugin: 'com.diffplug.spotless' - -group = 'org.openapitools' -version = '0.0.1' - -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' - } -} - -repositories { - mavenCentral() -} -sourceSets { - main.java.srcDirs = ['src/main/java'] -} - -if(hasProperty('target') && target == 'android') { - - apply plugin: 'com.android.library' - apply plugin: 'com.github.dcendents.android-maven' - - android { - compileSdkVersion 25 - buildToolsVersion '25.0.2' - defaultConfig { - minSdkVersion 14 - targetSdkVersion 25 - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - // Rename the aar correctly - libraryVariants.all { variant -> - variant.outputs.each { output -> - def outputFile = output.outputFile - if (outputFile != null && outputFile.name.endsWith('.aar')) { - def fileName = "${project.name}-${variant.baseName}-${version}.aar" - output.outputFile = new File(outputFile.parent, fileName) - } - } - } - - dependencies { - provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - } - } - - afterEvaluate { - android.libraryVariants.all { variant -> - def task = project.tasks.create "jar${variant.name.capitalize()}", Jar - task.description = "Create jar artifact for ${variant.name}" - task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDirectory - task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") - task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task) - } - } - - task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' - } - - artifacts { - archives sourcesJar - } - -} else { - - apply plugin: 'java' - apply plugin: 'maven-publish' - - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - - publishing { - publications { - maven(MavenPublication) { - artifactId = 'openapi-java-client' - from components.java - } - } - } - - task execute(type:JavaExec) { - main = System.getProperty('mainClass') - classpath = sourceSets.main.runtimeClasspath - } -} - -ext { - jakarta_annotation_version = "1.3.5" -} - -dependencies { - implementation 'io.swagger:swagger-annotations:1.6.8' - implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.12.0' - implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' - implementation 'com.google.code.gson:gson:2.9.1' - implementation 'io.gsonfire:gson-fire:1.9.0' - implementation 'javax.ws.rs:jsr311-api:1.1.1' - implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' - implementation 'org.openapitools:jackson-databind-nullable:0.2.6' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' - implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - implementation 'com.squareup.okio:okio-jvm:3.4.0' - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' - testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' -} - -javadoc { - options.tags = [ "http.response.details:a:Http Response Details" ] -} - -// Use spotless plugin to automatically format code, remove unused import, etc -// To apply changes directly to the file, run `gradlew spotlessApply` -// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle -spotless { - // comment out below to run spotless as part of the `check` task - enforceCheck false - - format 'misc', { - // define the files (e.g. '*.gradle', '*.md') to apply `misc` to - target '.gitignore' - - // define the steps to apply to those files - trimTrailingWhitespace() - indentWithSpaces() // Takes an integer argument if you don't like 4 - endWithNewline() - } - java { - // don't need to set target, it is inferred from java - - // apply a specific flavor of google-java-format - googleJavaFormat('1.8').aosp().reflowLongStrings() - - removeUnusedImports() - importOrder() - } -} - -test { - // Enable JUnit 5 (Gradle 4.6+). - useJUnitPlatform() - - // Always run tests, even when nothing changed. - dependsOn 'cleanTest' - - // Show test results. - testLogging { - events "passed", "skipped", "failed" - } - -} diff --git a/server/intelligence-service/java-client/build.sbt b/server/intelligence-service/java-client/build.sbt deleted file mode 100644 index a87a753c..00000000 --- a/server/intelligence-service/java-client/build.sbt +++ /dev/null @@ -1,28 +0,0 @@ -lazy val root = (project in file(".")). - settings( - organization := "org.openapitools", - name := "openapi-java-client", - version := "0.0.1", - scalaVersion := "2.11.4", - scalacOptions ++= Seq("-feature"), - javacOptions in compile ++= Seq("-Xlint:deprecation"), - publishArtifact in (Compile, packageDoc) := false, - resolvers += Resolver.mavenLocal, - libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.6.5", - "com.squareup.okhttp3" % "okhttp" % "4.12.0", - "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", - "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", - "javax.ws.rs" % "jsr311-api" % "1.1.1", - "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", - "org.openapitools" % "jackson-databind-nullable" % "0.2.6", - "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", - "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", - "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test", - "org.mockito" % "mockito-core" % "3.12.4" % "test" - ) - ) diff --git a/server/intelligence-service/java-client/docs/ChatRequest.md b/server/intelligence-service/java-client/docs/ChatRequest.md deleted file mode 100644 index 12a6a2b1..00000000 --- a/server/intelligence-service/java-client/docs/ChatRequest.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# ChatRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**message** | **String** | The message to be sent to the LLM | | - - - diff --git a/server/intelligence-service/java-client/docs/ChatResponse.md b/server/intelligence-service/java-client/docs/ChatResponse.md deleted file mode 100644 index 574832e9..00000000 --- a/server/intelligence-service/java-client/docs/ChatResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# ChatResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**response** | **String** | The response generated by the LLM | | - - - diff --git a/server/intelligence-service/java-client/docs/DefaultApi.md b/server/intelligence-service/java-client/docs/DefaultApi.md deleted file mode 100644 index a706ad23..00000000 --- a/server/intelligence-service/java-client/docs/DefaultApi.md +++ /dev/null @@ -1,70 +0,0 @@ -# DefaultApi - -All URIs are relative to *http://localhost:8080* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**chatWithLLM**](DefaultApi.md#chatWithLLM) | **POST** /chat | Chat with LLM | - - - -# **chatWithLLM** -> ChatResponse chatWithLLM(chatRequest) - -Chat with LLM - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.DefaultApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost:8080"); - - DefaultApi apiInstance = new DefaultApi(defaultClient); - ChatRequest chatRequest = new ChatRequest(); // ChatRequest | - try { - ChatResponse result = apiInstance.chatWithLLM(chatRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#chatWithLLM"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **chatRequest** | [**ChatRequest**](ChatRequest.md)| | | - -### Return type - -[**ChatResponse**](ChatResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful response from LLM | - | -| **500** | Internal Server Error | - | - diff --git a/server/intelligence-service/java-client/docs/ErrorResponse.md b/server/intelligence-service/java-client/docs/ErrorResponse.md deleted file mode 100644 index 4741376c..00000000 --- a/server/intelligence-service/java-client/docs/ErrorResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# ErrorResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**detail** | **String** | Error message in case of failure | [optional] | - - - diff --git a/server/intelligence-service/java-client/git_push.sh b/server/intelligence-service/java-client/git_push.sh deleted file mode 100644 index f53a75d4..00000000 --- a/server/intelligence-service/java-client/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/server/intelligence-service/java-client/gradle.properties b/server/intelligence-service/java-client/gradle.properties deleted file mode 100644 index a3408578..00000000 --- a/server/intelligence-service/java-client/gradle.properties +++ /dev/null @@ -1,6 +0,0 @@ -# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). -# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. -# -# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties -# For example, uncomment below to build for Android -#target = android diff --git a/server/intelligence-service/java-client/gradle/wrapper/gradle-wrapper.jar b/server/intelligence-service/java-client/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index e6441136f3d4ba8a0da8d277868979cfbc8ad796..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43453 zcma&N1CXTcmMvW9vTb(Rwr$&4wr$(C?dmSu>@vG-+vuvg^_??!{yS%8zW-#zn-LkA z5&1^$^{lnmUON?}LBF8_K|(?T0Ra(xUH{($5eN!MR#ZihR#HxkUPe+_R8Cn`RRs(P z_^*#_XlXmGv7!4;*Y%p4nw?{bNp@UZHv1?Um8r6)Fei3p@ClJn0ECfg1hkeuUU@Or zDaPa;U3fE=3L}DooL;8f;P0ipPt0Z~9P0)lbStMS)ag54=uL9ia-Lm3nh|@(Y?B`; zx_#arJIpXH!U{fbCbI^17}6Ri*H<>OLR%c|^mh8+)*h~K8Z!9)DPf zR2h?lbDZQ`p9P;&DQ4F0s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8Dz5u>ZI5MmjTFwXS-Fv!TDd*`>3{krWoNVx$<133`(ftS?ZPyY z&4@ah^3^i`vL$BZa>O|Nt?ucewzsF)0zX3qmM^|waXr=T0pfIb0*$AwU=?Ipl|1Y; z*Pk6{C-p4MY;j@IJ|DW>QHZQJcp;Z~?8(Q+Kk3^0qJ}SCk^*n4W zu9ZFwLHUx-$6xvaQ)SUQcYd6fF8&x)V`1bIuX@>{mE$b|Yd(qomn3;bPwnDUc0F=; zh*6_((%bqAYQWQ~odER?h>1mkL4kpb3s7`0m@rDKGU*oyF)$j~Ffd4fXV$?`f~rHf zB%Y)@5SXZvfwm10RY5X?TEo)PK_`L6qgBp=#>fO49$D zDq8Ozj0q6213tV5Qq=;fZ0$|KroY{Dz=l@lU^J)?Ko@ti20TRplXzphBi>XGx4bou zEWrkNjz0t5j!_ke{g5I#PUlEU$Km8g8TE|XK=MkU@PT4T><2OVamoK;wJ}3X0L$vX zgd7gNa359*nc)R-0!`2X@FOTB`+oETOPc=ubp5R)VQgY+5BTZZJ2?9QwnO=dnulIUF3gFn;BODC2)65)HeVd%t86sL7Rv^Y+nbn+&l z6BAJY(ETvwI)Ts$aiE8rht4KD*qNyE{8{x6R|%akbTBzw;2+6Echkt+W+`u^XX z_z&x%n '} -case $link in #( -/*) app_path=$link ;; #( -*) app_path=$APP_HOME$link ;; -esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { -echo "$*" -} >&2 - -die () { -echo -echo "$*" -echo -exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( -CYGWIN* ) cygwin=true ;; #( -Darwin* ) darwin=true ;; #( -MSYS* | MINGW* ) msys=true ;; #( -NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then -if [ -x "$JAVA_HOME/jre/sh/java" ] ; then -# IBM's JDK on AIX uses strange locations for the executables -JAVACMD=$JAVA_HOME/jre/sh/java -else -JAVACMD=$JAVA_HOME/bin/java -fi -if [ ! -x "$JAVACMD" ] ; then -die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -else -JAVACMD=java -if ! command -v java >/dev/null 2>&1 -then -die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then -case $MAX_FD in #( -max*) -# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. -# shellcheck disable=SC2039,SC3045 -MAX_FD=$( ulimit -H -n ) || -warn "Could not query maximum file descriptor limit" -esac -case $MAX_FD in #( -'' | soft) :;; #( -*) -# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. -# shellcheck disable=SC2039,SC3045 -ulimit -n "$MAX_FD" || -warn "Could not set maximum file descriptor limit to $MAX_FD" -esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then -APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) -CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - -JAVACMD=$( cygpath --unix "$JAVACMD" ) - -# Now convert the arguments - kludge to limit ourselves to /bin/sh -for arg do -if -case $arg in #( --*) false ;; # don't mess with options #( -/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath -[ -e "$t" ] ;; #( -*) false ;; -esac -then -arg=$( cygpath --path --ignore --mixed "$arg" ) -fi -# Roll the args list around exactly as many times as the number of -# args, so each arg winds up back in the position where it started, but -# possibly modified. -# -# NB: a `for` loop captures its iteration list before it begins, so -# changing the positional parameters here affects neither the number of -# iterations, nor the values presented in `arg`. -shift # remove old arg -set -- "$@" "$arg" # push replacement arg -done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. - -set -- \ -"-Dorg.gradle.appname=$APP_BASE_NAME" \ --classpath "$CLASSPATH" \ -org.gradle.wrapper.GradleWrapperMain \ -"$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then -die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( -printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | -xargs -n1 | -sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | -tr '\n' ' ' -)" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/server/intelligence-service/java-client/gradlew.bat b/server/intelligence-service/java-client/gradlew.bat deleted file mode 100644 index 25da30db..00000000 --- a/server/intelligence-service/java-client/gradlew.bat +++ /dev/null @@ -1,92 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/server/intelligence-service/java-client/pom.xml b/server/intelligence-service/java-client/pom.xml deleted file mode 100644 index 664c1493..00000000 --- a/server/intelligence-service/java-client/pom.xml +++ /dev/null @@ -1,350 +0,0 @@ - - 4.0.0 - org.openapitools - openapi-java-client - jar - openapi-java-client - 0.0.1 - https://github.com/openapitools/openapi-generator - OpenAPI Java - - scm:git:git@github.com:openapitools/openapi-generator.git - scm:git:git@github.com:openapitools/openapi-generator.git - https://github.com/openapitools/openapi-generator - - - - - Unlicense - https://github.com/ls1intum/Hephaestus/blob/develop/LICENSE - repo - - - - - - OpenAPI-Generator Contributors - team@openapitools.org - OpenAPITools.org - http://openapitools.org - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - true - 128m - 512m - - -Xlint:all - -J-Xss4m - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.4.1 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.2 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - 10 - - - - - org.junit.jupiter - junit-jupiter-engine - ${junit-version} - - - com.squareup.okio - okio-jvm - 3.4.0 - - - - - maven-dependency-plugin - 3.6.1 - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.3.0 - - - - test-jar - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.5.0 - - - add_sources - generate-sources - - add-source - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.6.3 - - - attach-javadocs - - jar - - - - - none - - - http.response.details - a - Http Response Details: - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.3.0 - - - attach-sources - - jar-no-fork - - - - - - - com.diffplug.spotless - spotless-maven-plugin - ${spotless.version} - - - - - - - .gitignore - - - - - - true - 4 - - - - - - - - - - 1.8 - - true - - - - - - - - - - - - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.2.1 - - - sign-artifacts - verify - - sign - - - - - - - - - - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.squareup.okhttp3 - okhttp - ${okhttp-version} - - - com.squareup.okhttp3 - logging-interceptor - ${okhttp-version} - - - com.google.code.gson - gson - ${gson-version} - - - io.gsonfire - gson-fire - ${gson-fire-version} - - - org.apache.commons - commons-lang3 - ${commons-lang3-version} - - - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation-version} - provided - - - org.openapitools - jackson-databind-nullable - ${jackson-databind-nullable-version} - - - javax.ws.rs - jsr311-api - ${jsr311-api-version} - - - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api-version} - - - - org.junit.jupiter - junit-jupiter-engine - ${junit-version} - test - - - org.junit.platform - junit-platform-runner - ${junit-platform-runner.version} - test - - - - 1.8 - ${java.version} - ${java.version} - 1.9.0 - 4.11.0 - 2.10.1 - 3.14.0 - 0.2.6 - 1.3.5 - 5.10.2 - 1.10.0 - 2.1.1 - 1.1.1 - UTF-8 - 2.43.0 - - diff --git a/server/intelligence-service/java-client/settings.gradle b/server/intelligence-service/java-client/settings.gradle deleted file mode 100644 index 369ba54a..00000000 --- a/server/intelligence-service/java-client/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/server/intelligence-service/java-client/src/main/AndroidManifest.xml b/server/intelligence-service/java-client/src/main/AndroidManifest.xml deleted file mode 100644 index 54fbcb3d..00000000 --- a/server/intelligence-service/java-client/src/main/AndroidManifest.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiCallback.java deleted file mode 100644 index e0e9bbf9..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiCallback.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -import java.io.IOException; - -import java.util.Map; -import java.util.List; - -/** - * Callback for asynchronous API call. - * - * @param The return type - */ -public interface ApiCallback { - /** - * This is called when the API call fails. - * - * @param e The exception causing the failure - * @param statusCode Status code of the response if available, otherwise it would be 0 - * @param responseHeaders Headers of the response if available, otherwise it would be null - */ - void onFailure(ApiException e, int statusCode, Map> responseHeaders); - - /** - * This is called when the API call succeeded. - * - * @param result The result deserialized from response - * @param statusCode Status code of the response - * @param responseHeaders Headers of the response - */ - void onSuccess(T result, int statusCode, Map> responseHeaders); - - /** - * This is called when the API upload processing. - * - * @param bytesWritten bytes Written - * @param contentLength content length of request body - * @param done write end - */ - void onUploadProgress(long bytesWritten, long contentLength, boolean done); - - /** - * This is called when the API download processing. - * - * @param bytesRead bytes Read - * @param contentLength content length of the response - * @param done Read end - */ - void onDownloadProgress(long bytesRead, long contentLength, boolean done); -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiClient.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiClient.java deleted file mode 100644 index f30d7d45..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiClient.java +++ /dev/null @@ -1,1564 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -import okhttp3.*; -import okhttp3.internal.http.HttpMethod; -import okhttp3.internal.tls.OkHostnameVerifier; -import okhttp3.logging.HttpLoggingInterceptor; -import okhttp3.logging.HttpLoggingInterceptor.Level; -import okio.Buffer; -import okio.BufferedSink; -import okio.Okio; - -import javax.net.ssl.*; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Type; -import java.net.URI; -import java.net.URLConnection; -import java.net.URLEncoder; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.security.GeneralSecurityException; -import java.security.KeyStore; -import java.security.SecureRandom; -import java.security.cert.Certificate; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; -import java.text.DateFormat; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.TimeUnit; -import java.util.function.Supplier; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.openapitools.client.auth.Authentication; -import org.openapitools.client.auth.HttpBasicAuth; -import org.openapitools.client.auth.HttpBearerAuth; -import org.openapitools.client.auth.ApiKeyAuth; - -/** - *

ApiClient class.

- */ -public class ApiClient { - - private String basePath = "http://localhost:8080"; - protected List servers = new ArrayList(Arrays.asList( - new ServerConfiguration( - "http://localhost:8080", - "Local development server", - new HashMap() - ) - )); - protected Integer serverIndex = 0; - protected Map serverVariables = null; - private boolean debugging = false; - private Map defaultHeaderMap = new HashMap(); - private Map defaultCookieMap = new HashMap(); - private String tempFolderPath = null; - - private Map authentications; - - private DateFormat dateFormat; - private DateFormat datetimeFormat; - private boolean lenientDatetimeFormat; - private int dateLength; - - private InputStream sslCaCert; - private boolean verifyingSsl; - private KeyManager[] keyManagers; - - private OkHttpClient httpClient; - private JSON json; - - private HttpLoggingInterceptor loggingInterceptor; - - /** - * Basic constructor for ApiClient - */ - public ApiClient() { - init(); - initHttpClient(); - - // Setup authentications (key: authentication name, value: authentication). - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - /** - * Basic constructor with custom OkHttpClient - * - * @param client a {@link okhttp3.OkHttpClient} object - */ - public ApiClient(OkHttpClient client) { - init(); - - httpClient = client; - - // Setup authentications (key: authentication name, value: authentication). - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - private void initHttpClient() { - initHttpClient(Collections.emptyList()); - } - - private void initHttpClient(List interceptors) { - OkHttpClient.Builder builder = new OkHttpClient.Builder(); - builder.addNetworkInterceptor(getProgressInterceptor()); - for (Interceptor interceptor: interceptors) { - builder.addInterceptor(interceptor); - } - - httpClient = builder.build(); - } - - private void init() { - verifyingSsl = true; - - json = new JSON(); - - // Set default User-Agent. - setUserAgent("OpenAPI-Generator/0.0.1/java"); - - authentications = new HashMap(); - } - - /** - * Get base path - * - * @return Base path - */ - public String getBasePath() { - return basePath; - } - - /** - * Set base path - * - * @param basePath Base path of the URL (e.g http://localhost:8080 - * @return An instance of OkHttpClient - */ - public ApiClient setBasePath(String basePath) { - this.basePath = basePath; - this.serverIndex = null; - return this; - } - - public List getServers() { - return servers; - } - - public ApiClient setServers(List servers) { - this.servers = servers; - return this; - } - - public Integer getServerIndex() { - return serverIndex; - } - - public ApiClient setServerIndex(Integer serverIndex) { - this.serverIndex = serverIndex; - return this; - } - - public Map getServerVariables() { - return serverVariables; - } - - public ApiClient setServerVariables(Map serverVariables) { - this.serverVariables = serverVariables; - return this; - } - - /** - * Get HTTP client - * - * @return An instance of OkHttpClient - */ - public OkHttpClient getHttpClient() { - return httpClient; - } - - /** - * Set HTTP client, which must never be null. - * - * @param newHttpClient An instance of OkHttpClient - * @return Api Client - * @throws java.lang.NullPointerException when newHttpClient is null - */ - public ApiClient setHttpClient(OkHttpClient newHttpClient) { - this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); - return this; - } - - /** - * Get JSON - * - * @return JSON object - */ - public JSON getJSON() { - return json; - } - - /** - * Set JSON - * - * @param json JSON object - * @return Api client - */ - public ApiClient setJSON(JSON json) { - this.json = json; - return this; - } - - /** - * True if isVerifyingSsl flag is on - * - * @return True if isVerifySsl flag is on - */ - public boolean isVerifyingSsl() { - return verifyingSsl; - } - - /** - * Configure whether to verify certificate and hostname when making https requests. - * Default to true. - * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. - * - * @param verifyingSsl True to verify TLS/SSL connection - * @return ApiClient - */ - public ApiClient setVerifyingSsl(boolean verifyingSsl) { - this.verifyingSsl = verifyingSsl; - applySslSettings(); - return this; - } - - /** - * Get SSL CA cert. - * - * @return Input stream to the SSL CA cert - */ - public InputStream getSslCaCert() { - return sslCaCert; - } - - /** - * Configure the CA certificate to be trusted when making https requests. - * Use null to reset to default. - * - * @param sslCaCert input stream for SSL CA cert - * @return ApiClient - */ - public ApiClient setSslCaCert(InputStream sslCaCert) { - this.sslCaCert = sslCaCert; - applySslSettings(); - return this; - } - - /** - *

Getter for the field keyManagers.

- * - * @return an array of {@link javax.net.ssl.KeyManager} objects - */ - public KeyManager[] getKeyManagers() { - return keyManagers; - } - - /** - * Configure client keys to use for authorization in an SSL session. - * Use null to reset to default. - * - * @param managers The KeyManagers to use - * @return ApiClient - */ - public ApiClient setKeyManagers(KeyManager[] managers) { - this.keyManagers = managers; - applySslSettings(); - return this; - } - - /** - *

Getter for the field dateFormat.

- * - * @return a {@link java.text.DateFormat} object - */ - public DateFormat getDateFormat() { - return dateFormat; - } - - /** - *

Setter for the field dateFormat.

- * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setDateFormat(DateFormat dateFormat) { - JSON.setDateFormat(dateFormat); - return this; - } - - /** - *

Set SqlDateFormat.

- * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setSqlDateFormat(DateFormat dateFormat) { - JSON.setSqlDateFormat(dateFormat); - return this; - } - - /** - *

Set OffsetDateTimeFormat.

- * - * @param dateFormat a {@link java.time.format.DateTimeFormatter} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - JSON.setOffsetDateTimeFormat(dateFormat); - return this; - } - - /** - *

Set LocalDateFormat.

- * - * @param dateFormat a {@link java.time.format.DateTimeFormatter} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - JSON.setLocalDateFormat(dateFormat); - return this; - } - - /** - *

Set LenientOnJson.

- * - * @param lenientOnJson a boolean - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setLenientOnJson(boolean lenientOnJson) { - JSON.setLenientOnJson(lenientOnJson); - return this; - } - - /** - * Get authentications (key: authentication name, value: authentication). - * - * @return Map of authentication objects - */ - public Map getAuthentications() { - return authentications; - } - - /** - * Get authentication for the given name. - * - * @param authName The authentication name - * @return The authentication, null if not found - */ - public Authentication getAuthentication(String authName) { - return authentications.get(authName); - } - - - /** - * Helper method to set username for the first HTTP basic authentication. - * - * @param username Username - */ - public void setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set password for the first HTTP basic authentication. - * - * @param password Password - */ - public void setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set API key value for the first API key authentication. - * - * @param apiKey API key - */ - public void setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set API key prefix for the first API key authentication. - * - * @param apiKeyPrefix API key prefix - */ - public void setApiKeyPrefix(String apiKeyPrefix) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set access token for the first OAuth2 authentication. - * - * @param accessToken Access token - */ - public void setAccessToken(String accessToken) { - throw new RuntimeException("No OAuth2 authentication configured!"); - } - - /** - * Helper method to set credentials for AWSV4 Signature - * - * @param accessKey Access Key - * @param secretKey Secret Key - * @param region Region - * @param service Service to access to - */ - public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { - throw new RuntimeException("No AWS4 authentication configured!"); - } - - /** - * Helper method to set credentials for AWSV4 Signature - * - * @param accessKey Access Key - * @param secretKey Secret Key - * @param sessionToken Session Token - * @param region Region - * @param service Service to access to - */ - public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { - throw new RuntimeException("No AWS4 authentication configured!"); - } - - /** - * Set the User-Agent header's value (by adding to the default header map). - * - * @param userAgent HTTP request's user agent - * @return ApiClient - */ - public ApiClient setUserAgent(String userAgent) { - addDefaultHeader("User-Agent", userAgent); - return this; - } - - /** - * Add a default header. - * - * @param key The header's key - * @param value The header's value - * @return ApiClient - */ - public ApiClient addDefaultHeader(String key, String value) { - defaultHeaderMap.put(key, value); - return this; - } - - /** - * Add a default cookie. - * - * @param key The cookie's key - * @param value The cookie's value - * @return ApiClient - */ - public ApiClient addDefaultCookie(String key, String value) { - defaultCookieMap.put(key, value); - return this; - } - - /** - * Check that whether debugging is enabled for this API client. - * - * @return True if debugging is enabled, false otherwise. - */ - public boolean isDebugging() { - return debugging; - } - - /** - * Enable/disable debugging for this API client. - * - * @param debugging To enable (true) or disable (false) debugging - * @return ApiClient - */ - public ApiClient setDebugging(boolean debugging) { - if (debugging != this.debugging) { - if (debugging) { - loggingInterceptor = new HttpLoggingInterceptor(); - loggingInterceptor.setLevel(Level.BODY); - httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); - } else { - final OkHttpClient.Builder builder = httpClient.newBuilder(); - builder.interceptors().remove(loggingInterceptor); - httpClient = builder.build(); - loggingInterceptor = null; - } - } - this.debugging = debugging; - return this; - } - - /** - * The path of temporary folder used to store downloaded files from endpoints - * with file response. The default value is null, i.e. using - * the system's default temporary folder. - * - * @see createTempFile - * @return Temporary folder path - */ - public String getTempFolderPath() { - return tempFolderPath; - } - - /** - * Set the temporary folder path (for downloading files) - * - * @param tempFolderPath Temporary folder path - * @return ApiClient - */ - public ApiClient setTempFolderPath(String tempFolderPath) { - this.tempFolderPath = tempFolderPath; - return this; - } - - /** - * Get connection timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getConnectTimeout() { - return httpClient.connectTimeoutMillis(); - } - - /** - * Sets the connect timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param connectionTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setConnectTimeout(int connectionTimeout) { - httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Get read timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getReadTimeout() { - return httpClient.readTimeoutMillis(); - } - - /** - * Sets the read timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param readTimeout read timeout in milliseconds - * @return Api client - */ - public ApiClient setReadTimeout(int readTimeout) { - httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Get write timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getWriteTimeout() { - return httpClient.writeTimeoutMillis(); - } - - /** - * Sets the write timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param writeTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setWriteTimeout(int writeTimeout) { - httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - - /** - * Format the given parameter object into string. - * - * @param param Parameter - * @return String representation of the parameter - */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { - //Serialize to json string and remove the " enclosing characters - String jsonStr = JSON.serialize(param); - return jsonStr.substring(1, jsonStr.length() - 1); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for (Object o : (Collection) param) { - if (b.length() > 0) { - b.append(","); - } - b.append(o); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /** - * Formats the specified query parameter to a list containing a single {@code Pair} object. - * - * Note that {@code value} must not be a collection. - * - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list containing a single {@code Pair} object. - */ - public List parameterToPair(String name, Object value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value instanceof Collection) { - return params; - } - - params.add(new Pair(name, parameterToString(value))); - return params; - } - - /** - * Formats the specified collection query parameters to a list of {@code Pair} objects. - * - * Note that the values of each of the returned Pair objects are percent-encoded. - * - * @param collectionFormat The collection format of the parameter. - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list of {@code Pair} objects. - */ - public List parameterToPairs(String collectionFormat, String name, Collection value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value.isEmpty()) { - return params; - } - - // create the params based on the collection format - if ("multi".equals(collectionFormat)) { - for (Object item : value) { - params.add(new Pair(name, escapeString(parameterToString(item)))); - } - return params; - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - // escape all delimiters except commas, which are URI reserved - // characters - if ("ssv".equals(collectionFormat)) { - delimiter = escapeString(" "); - } else if ("tsv".equals(collectionFormat)) { - delimiter = escapeString("\t"); - } else if ("pipes".equals(collectionFormat)) { - delimiter = escapeString("|"); - } - - StringBuilder sb = new StringBuilder(); - for (Object item : value) { - sb.append(delimiter); - sb.append(escapeString(parameterToString(item))); - } - - params.add(new Pair(name, sb.substring(delimiter.length()))); - - return params; - } - - /** - * Formats the specified collection path parameter to a string value. - * - * @param collectionFormat The collection format of the parameter. - * @param value The value of the parameter. - * @return String representation of the parameter - */ - public String collectionPathParameterToString(String collectionFormat, Collection value) { - // create the value based on the collection format - if ("multi".equals(collectionFormat)) { - // not valid for path params - return parameterToString(value); - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - if ("ssv".equals(collectionFormat)) { - delimiter = " "; - } else if ("tsv".equals(collectionFormat)) { - delimiter = "\t"; - } else if ("pipes".equals(collectionFormat)) { - delimiter = "|"; - } - - StringBuilder sb = new StringBuilder() ; - for (Object item : value) { - sb.append(delimiter); - sb.append(parameterToString(item)); - } - - return sb.substring(delimiter.length()); - } - - /** - * Sanitize filename by removing path. - * e.g. ../../sun.gif becomes sun.gif - * - * @param filename The filename to be sanitized - * @return The sanitized filename - */ - public String sanitizeFilename(String filename) { - return filename.replaceAll(".*[/\\\\]", ""); - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * "* / *" is also default to JSON - * @param mime MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); - } - - /** - * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) - * - * @param accepts The accepts array to select from - * @return The Accept header to use. If the given array is empty, - * null will be returned (not to set the Accept header explicitly). - */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { - return null; - } - for (String accept : accepts) { - if (isJsonMime(accept)) { - return accept; - } - } - return StringUtil.join(accepts, ","); - } - - /** - * Select the Content-Type header's value from the given array: - * if JSON exists in the given array, use it; - * otherwise use the first one of the array. - * - * @param contentTypes The Content-Type array to select from - * @return The Content-Type header to use. If the given array is empty, - * returns null. If it matches "any", JSON will be used. - */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { - return null; - } - - if (contentTypes[0].equals("*/*")) { - return "application/json"; - } - - for (String contentType : contentTypes) { - if (isJsonMime(contentType)) { - return contentType; - } - } - - return contentTypes[0]; - } - - /** - * Escape the given string to be used as URL query value. - * - * @param str String to be escaped - * @return Escaped string - */ - public String escapeString(String str) { - try { - return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); - } catch (UnsupportedEncodingException e) { - return str; - } - } - - /** - * Deserialize response body to Java object, according to the return type and - * the Content-Type response header. - * - * @param Type - * @param response HTTP response - * @param returnType The type of the Java object - * @return The deserialized Java object - * @throws org.openapitools.client.ApiException If fail to deserialize response body, i.e. cannot read response body - * or the Content-Type of the response is not supported. - */ - @SuppressWarnings("unchecked") - public T deserialize(Response response, Type returnType) throws ApiException { - if (response == null || returnType == null) { - return null; - } - - if ("byte[]".equals(returnType.toString())) { - // Handle binary response (byte array). - try { - return (T) response.body().bytes(); - } catch (IOException e) { - throw new ApiException(e); - } - } else if (returnType.equals(File.class)) { - // Handle file downloading. - return (T) downloadFileFromResponse(response); - } - - String respBody; - try { - if (response.body() != null) - respBody = response.body().string(); - else - respBody = null; - } catch (IOException e) { - throw new ApiException(e); - } - - if (respBody == null || "".equals(respBody)) { - return null; - } - - String contentType = response.headers().get("Content-Type"); - if (contentType == null) { - // ensuring a default content type - contentType = "application/json"; - } - if (isJsonMime(contentType)) { - return JSON.deserialize(respBody, returnType); - } else if (returnType.equals(String.class)) { - // Expecting string, return the raw response body. - return (T) respBody; - } else { - throw new ApiException( - "Content type \"" + contentType + "\" is not supported for type: " + returnType, - response.code(), - response.headers().toMultimap(), - respBody); - } - } - - /** - * Serialize the given Java object into request body according to the object's - * class and the request Content-Type. - * - * @param obj The Java object - * @param contentType The request Content-Type - * @return The serialized request body - * @throws org.openapitools.client.ApiException If fail to serialize the given object - */ - public RequestBody serialize(Object obj, String contentType) throws ApiException { - if (obj instanceof byte[]) { - // Binary (byte array) body parameter support. - return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); - } else if (obj instanceof File) { - // File body parameter support. - return RequestBody.create((File) obj, MediaType.parse(contentType)); - } else if ("text/plain".equals(contentType) && obj instanceof String) { - return RequestBody.create((String) obj, MediaType.parse(contentType)); - } else if (isJsonMime(contentType)) { - String content; - if (obj != null) { - content = JSON.serialize(obj); - } else { - content = null; - } - return RequestBody.create(content, MediaType.parse(contentType)); - } else if (obj instanceof String) { - return RequestBody.create((String) obj, MediaType.parse(contentType)); - } else { - throw new ApiException("Content type \"" + contentType + "\" is not supported"); - } - } - - /** - * Download file from the given response. - * - * @param response An instance of the Response object - * @throws org.openapitools.client.ApiException If fail to read file content from response and write to disk - * @return Downloaded file - */ - public File downloadFileFromResponse(Response response) throws ApiException { - try { - File file = prepareDownloadFile(response); - BufferedSink sink = Okio.buffer(Okio.sink(file)); - sink.writeAll(response.body().source()); - sink.close(); - return file; - } catch (IOException e) { - throw new ApiException(e); - } - } - - /** - * Prepare file for download - * - * @param response An instance of the Response object - * @return Prepared file for the download - * @throws java.io.IOException If fail to prepare file for download - */ - public File prepareDownloadFile(Response response) throws IOException { - String filename = null; - String contentDisposition = response.header("Content-Disposition"); - if (contentDisposition != null && !"".equals(contentDisposition)) { - // Get filename from the Content-Disposition header. - Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); - Matcher matcher = pattern.matcher(contentDisposition); - if (matcher.find()) { - filename = sanitizeFilename(matcher.group(1)); - } - } - - String prefix = null; - String suffix = null; - if (filename == null) { - prefix = "download-"; - suffix = ""; - } else { - int pos = filename.lastIndexOf("."); - if (pos == -1) { - prefix = filename + "-"; - } else { - prefix = filename.substring(0, pos) + "-"; - suffix = filename.substring(pos); - } - // Files.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) - prefix = "download-"; - } - - if (tempFolderPath == null) - return Files.createTempFile(prefix, suffix).toFile(); - else - return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); - } - - /** - * {@link #execute(Call, Type)} - * - * @param Type - * @param call An instance of the Call object - * @return ApiResponse<T> - * @throws org.openapitools.client.ApiException If fail to execute the call - */ - public ApiResponse execute(Call call) throws ApiException { - return execute(call, null); - } - - /** - * Execute HTTP call and deserialize the HTTP response body into the given return type. - * - * @param returnType The return type used to deserialize HTTP response body - * @param The return type corresponding to (same with) returnType - * @param call Call - * @return ApiResponse object containing response status, headers and - * data, which is a Java object deserialized from response body and would be null - * when returnType is null. - * @throws org.openapitools.client.ApiException If fail to execute the call - */ - public ApiResponse execute(Call call, Type returnType) throws ApiException { - try { - Response response = call.execute(); - T data = handleResponse(response, returnType); - return new ApiResponse(response.code(), response.headers().toMultimap(), data); - } catch (IOException e) { - throw new ApiException(e); - } - } - - /** - * {@link #executeAsync(Call, Type, ApiCallback)} - * - * @param Type - * @param call An instance of the Call object - * @param callback ApiCallback<T> - */ - public void executeAsync(Call call, ApiCallback callback) { - executeAsync(call, null, callback); - } - - /** - * Execute HTTP call asynchronously. - * - * @param Type - * @param call The callback to be executed when the API call finishes - * @param returnType Return type - * @param callback ApiCallback - * @see #execute(Call, Type) - */ - @SuppressWarnings("unchecked") - public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { - call.enqueue(new Callback() { - @Override - public void onFailure(Call call, IOException e) { - callback.onFailure(new ApiException(e), 0, null); - } - - @Override - public void onResponse(Call call, Response response) throws IOException { - T result; - try { - result = (T) handleResponse(response, returnType); - } catch (ApiException e) { - callback.onFailure(e, response.code(), response.headers().toMultimap()); - return; - } catch (Exception e) { - callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); - return; - } - callback.onSuccess(result, response.code(), response.headers().toMultimap()); - } - }); - } - - /** - * Handle the given response, return the deserialized object when the response is successful. - * - * @param Type - * @param response Response - * @param returnType Return type - * @return Type - * @throws org.openapitools.client.ApiException If the response has an unsuccessful status code or - * fail to deserialize the response body - */ - public T handleResponse(Response response, Type returnType) throws ApiException { - if (response.isSuccessful()) { - if (returnType == null || response.code() == 204) { - // returning null if the returnType is not defined, - // or the status code is 204 (No Content) - if (response.body() != null) { - try { - response.body().close(); - } catch (Exception e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); - } - } - return null; - } else { - return deserialize(response, returnType); - } - } else { - String respBody = null; - if (response.body() != null) { - try { - respBody = response.body().string(); - } catch (IOException e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); - } - } - throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); - } - } - - /** - * Build HTTP call with the given options. - * - * @param baseUrl The base URL - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP call - * @throws org.openapitools.client.ApiException If fail to serialize the request body object - */ - public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); - - return httpClient.newCall(request); - } - - /** - * Build an HTTP request with the given options. - * - * @param baseUrl The base URL - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP request - * @throws org.openapitools.client.ApiException If fail to serialize the request body object - */ - public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams - List allQueryParams = new ArrayList(queryParams); - allQueryParams.addAll(collectionQueryParams); - - final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); - - // prepare HTTP request body - RequestBody reqBody; - String contentType = headerParams.get("Content-Type"); - String contentTypePure = contentType; - if (contentTypePure != null && contentTypePure.contains(";")) { - contentTypePure = contentType.substring(0, contentType.indexOf(";")); - } - if (!HttpMethod.permitsRequestBody(method)) { - reqBody = null; - } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { - reqBody = buildRequestBodyFormEncoding(formParams); - } else if ("multipart/form-data".equals(contentTypePure)) { - reqBody = buildRequestBodyMultipart(formParams); - } else if (body == null) { - if ("DELETE".equals(method)) { - // allow calling DELETE without sending a request body - reqBody = null; - } else { - // use an empty request body (for POST, PUT and PATCH) - reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); - } - } else { - reqBody = serialize(body, contentType); - } - - // update parameters with authentication settings - updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); - - final Request.Builder reqBuilder = new Request.Builder().url(url); - processHeaderParams(headerParams, reqBuilder); - processCookieParams(cookieParams, reqBuilder); - - // Associate callback with request (if not null) so interceptor can - // access it when creating ProgressResponseBody - reqBuilder.tag(callback); - - Request request = null; - - if (callback != null && reqBody != null) { - ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); - request = reqBuilder.method(method, progressRequestBody).build(); - } else { - request = reqBuilder.method(method, reqBody).build(); - } - - return request; - } - - /** - * Build full URL by concatenating base path, the given sub path and query parameters. - * - * @param baseUrl The base URL - * @param path The sub path - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @return The full URL - */ - public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { - final StringBuilder url = new StringBuilder(); - if (baseUrl != null) { - url.append(baseUrl).append(path); - } else { - String baseURL; - if (serverIndex != null) { - if (serverIndex < 0 || serverIndex >= servers.size()) { - throw new ArrayIndexOutOfBoundsException(String.format( - "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() - )); - } - baseURL = servers.get(serverIndex).URL(serverVariables); - } else { - baseURL = basePath; - } - url.append(baseURL).append(path); - } - - if (queryParams != null && !queryParams.isEmpty()) { - // support (constant) query string in `path`, e.g. "/posts?draft=1" - String prefix = path.contains("?") ? "&" : "?"; - for (Pair param : queryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - url.append(escapeString(param.getName())).append("=").append(escapeString(value)); - } - } - } - - if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { - String prefix = url.toString().contains("?") ? "&" : "?"; - for (Pair param : collectionQueryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - // collection query parameter value already escaped as part of parameterToPairs - url.append(escapeString(param.getName())).append("=").append(value); - } - } - } - - return url.toString(); - } - - /** - * Set header parameters to the request builder, including default headers. - * - * @param headerParams Header parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { - for (Entry param : headerParams.entrySet()) { - reqBuilder.header(param.getKey(), parameterToString(param.getValue())); - } - for (Entry header : defaultHeaderMap.entrySet()) { - if (!headerParams.containsKey(header.getKey())) { - reqBuilder.header(header.getKey(), parameterToString(header.getValue())); - } - } - } - - /** - * Set cookie parameters to the request builder, including default cookies. - * - * @param cookieParams Cookie parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { - for (Entry param : cookieParams.entrySet()) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); - } - for (Entry param : defaultCookieMap.entrySet()) { - if (!cookieParams.containsKey(param.getKey())) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); - } - } - } - - /** - * Update query and header parameters based on authentication settings. - * - * @param authNames The authentications to apply - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - * @param payload HTTP request body - * @param method HTTP method - * @param uri URI - * @throws org.openapitools.client.ApiException If fails to update the parameters - */ - public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, - Map cookieParams, String payload, String method, URI uri) throws ApiException { - for (String authName : authNames) { - Authentication auth = authentications.get(authName); - if (auth == null) { - throw new RuntimeException("Authentication undefined: " + authName); - } - auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); - } - } - - /** - * Build a form-encoding request body with the given form parameters. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyFormEncoding(Map formParams) { - okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); - for (Entry param : formParams.entrySet()) { - formBuilder.add(param.getKey(), parameterToString(param.getValue())); - } - return formBuilder.build(); - } - - /** - * Build a multipart (file uploading) request body with the given form parameters, - * which could contain text fields and file fields. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyMultipart(Map formParams) { - MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); - for (Entry param : formParams.entrySet()) { - if (param.getValue() instanceof File) { - File file = (File) param.getValue(); - addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); - } else if (param.getValue() instanceof List) { - List list = (List) param.getValue(); - for (Object item: list) { - if (item instanceof File) { - addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); - } else { - addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); - } - } - } else { - addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); - } - } - return mpBuilder.build(); - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - public String guessContentTypeFromFile(File file) { - String contentType = URLConnection.guessContentTypeFromName(file.getName()); - if (contentType == null) { - return "application/octet-stream"; - } else { - return contentType; - } - } - - /** - * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. - * - * @param mpBuilder MultipartBody.Builder - * @param key The key of the Header element - * @param file The file to add to the Header - */ - private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); - } - - /** - * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. - * - * @param mpBuilder MultipartBody.Builder - * @param key The key of the Header element - * @param obj The complex object to add to the Header - */ - private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { - RequestBody requestBody; - if (obj instanceof String) { - requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); - } else { - String content; - if (obj != null) { - content = JSON.serialize(obj); - } else { - content = null; - } - requestBody = RequestBody.create(content, MediaType.parse("application/json")); - } - - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); - mpBuilder.addPart(partHeaders, requestBody); - } - - /** - * Get network interceptor to add it to the httpClient to track download progress for - * async requests. - */ - private Interceptor getProgressInterceptor() { - return new Interceptor() { - @Override - public Response intercept(Interceptor.Chain chain) throws IOException { - final Request request = chain.request(); - final Response originalResponse = chain.proceed(request); - if (request.tag() instanceof ApiCallback) { - final ApiCallback callback = (ApiCallback) request.tag(); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), callback)) - .build(); - } - return originalResponse; - } - }; - } - - /** - * Apply SSL related settings to httpClient according to the current values of - * verifyingSsl and sslCaCert. - */ - private void applySslSettings() { - try { - TrustManager[] trustManagers; - HostnameVerifier hostnameVerifier; - if (!verifyingSsl) { - trustManagers = new TrustManager[]{ - new X509TrustManager() { - @Override - public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return new java.security.cert.X509Certificate[]{}; - } - } - }; - hostnameVerifier = new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; - } else { - TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - - if (sslCaCert == null) { - trustManagerFactory.init((KeyStore) null); - } else { - char[] password = null; // Any password will work. - CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); - Collection certificates = certificateFactory.generateCertificates(sslCaCert); - if (certificates.isEmpty()) { - throw new IllegalArgumentException("expected non-empty set of trusted certificates"); - } - KeyStore caKeyStore = newEmptyKeyStore(password); - int index = 0; - for (Certificate certificate : certificates) { - String certificateAlias = "ca" + (index++); - caKeyStore.setCertificateEntry(certificateAlias, certificate); - } - trustManagerFactory.init(caKeyStore); - } - trustManagers = trustManagerFactory.getTrustManagers(); - hostnameVerifier = OkHostnameVerifier.INSTANCE; - } - - SSLContext sslContext = SSLContext.getInstance("TLS"); - sslContext.init(keyManagers, trustManagers, new SecureRandom()); - httpClient = httpClient.newBuilder() - .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) - .hostnameVerifier(hostnameVerifier) - .build(); - } catch (GeneralSecurityException e) { - throw new RuntimeException(e); - } - } - - private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { - try { - KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); - keyStore.load(null, password); - return keyStore; - } catch (IOException e) { - throw new AssertionError(e); - } - } - - /** - * Convert the HTTP request body to a string. - * - * @param requestBody The HTTP request object - * @return The string representation of the HTTP request body - * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string - */ - private String requestBodyToString(RequestBody requestBody) throws ApiException { - if (requestBody != null) { - try { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return buffer.readUtf8(); - } catch (final IOException e) { - throw new ApiException(e); - } - } - - // empty http request body - return ""; - } -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiException.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiException.java deleted file mode 100644 index 44345834..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiException.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -import java.util.Map; -import java.util.List; - - -/** - *

ApiException class.

- */ -@SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class ApiException extends Exception { - private static final long serialVersionUID = 1L; - - private int code = 0; - private Map> responseHeaders = null; - private String responseBody = null; - - /** - *

Constructor for ApiException.

- */ - public ApiException() {} - - /** - *

Constructor for ApiException.

- * - * @param throwable a {@link java.lang.Throwable} object - */ - public ApiException(Throwable throwable) { - super(throwable); - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - */ - public ApiException(String message) { - super(message); - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - * @param throwable a {@link java.lang.Throwable} object - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { - super(message, throwable); - this.code = code; - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(String message, int code, Map> responseHeaders, String responseBody) { - this(message, (Throwable) null, code, responseHeaders, responseBody); - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - * @param throwable a {@link java.lang.Throwable} object - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - */ - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { - this(message, throwable, code, responseHeaders, null); - } - - /** - *

Constructor for ApiException.

- * - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(int code, Map> responseHeaders, String responseBody) { - this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); - } - - /** - *

Constructor for ApiException.

- * - * @param code HTTP status code - * @param message a {@link java.lang.String} object - */ - public ApiException(int code, String message) { - super(message); - this.code = code; - } - - /** - *

Constructor for ApiException.

- * - * @param code HTTP status code - * @param message the error message - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(int code, String message, Map> responseHeaders, String responseBody) { - this(code, message); - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } - - /** - * Get the HTTP status code. - * - * @return HTTP status code - */ - public int getCode() { - return code; - } - - /** - * Get the HTTP response headers. - * - * @return A map of list of string - */ - public Map> getResponseHeaders() { - return responseHeaders; - } - - /** - * Get the HTTP response body. - * - * @return Response body in the form of string - */ - public String getResponseBody() { - return responseBody; - } - - /** - * Get the exception message including HTTP response data. - * - * @return The exception message - */ - public String getMessage() { - return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", - super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); - } -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiResponse.java deleted file mode 100644 index 0ad969ec..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ApiResponse.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -import java.util.List; -import java.util.Map; - -/** - * API response returned by API call. - */ -public class ApiResponse { - final private int statusCode; - final private Map> headers; - final private T data; - - /** - *

Constructor for ApiResponse.

- * - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - */ - public ApiResponse(int statusCode, Map> headers) { - this(statusCode, headers, null); - } - - /** - *

Constructor for ApiResponse.

- * - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - * @param data The object deserialized from response bod - */ - public ApiResponse(int statusCode, Map> headers, T data) { - this.statusCode = statusCode; - this.headers = headers; - this.data = data; - } - - /** - *

Get the status code.

- * - * @return the status code - */ - public int getStatusCode() { - return statusCode; - } - - /** - *

Get the headers.

- * - * @return a {@link java.util.Map} of headers - */ - public Map> getHeaders() { - return headers; - } - - /** - *

Get the data.

- * - * @return the data - */ - public T getData() { - return data; - } -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/Configuration.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/Configuration.java deleted file mode 100644 index a494d8ad..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/Configuration.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class Configuration { - public static final String VERSION = "0.0.1"; - - private static ApiClient defaultApiClient = new ApiClient(); - - /** - * Get the default API client, which would be used when creating API - * instances without providing an API client. - * - * @return Default API client - */ - public static ApiClient getDefaultApiClient() { - return defaultApiClient; - } - - /** - * Set the default API client, which would be used when creating API - * instances without providing an API client. - * - * @param apiClient API client - */ - public static void setDefaultApiClient(ApiClient apiClient) { - defaultApiClient = apiClient; - } -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java deleted file mode 100644 index 9defa62e..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -import okhttp3.*; -import okio.Buffer; -import okio.BufferedSink; -import okio.GzipSink; -import okio.Okio; - -import java.io.IOException; - -/** - * Encodes request bodies using gzip. - * - * Taken from https://github.com/square/okhttp/issues/350 - */ -class GzipRequestInterceptor implements Interceptor { - @Override - public Response intercept(Chain chain) throws IOException { - Request originalRequest = chain.request(); - if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { - return chain.proceed(originalRequest); - } - - Request compressedRequest = originalRequest.newBuilder() - .header("Content-Encoding", "gzip") - .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) - .build(); - return chain.proceed(compressedRequest); - } - - private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return new RequestBody() { - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() { - return buffer.size(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - sink.write(buffer.snapshot()); - } - }; - } - - private RequestBody gzip(final RequestBody body) { - return new RequestBody() { - @Override - public MediaType contentType() { - return body.contentType(); - } - - @Override - public long contentLength() { - return -1; // We don't know the compressed length in advance! - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); - body.writeTo(gzipSink); - gzipSink.close(); - } - }; - } -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/JSON.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/JSON.java deleted file mode 100644 index 9630f790..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/JSON.java +++ /dev/null @@ -1,403 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.internal.bind.util.ISO8601Utils; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.google.gson.JsonElement; -import io.gsonfire.GsonFireBuilder; -import io.gsonfire.TypeSelector; - -import okio.ByteString; - -import java.io.IOException; -import java.io.StringReader; -import java.lang.reflect.Type; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.ParsePosition; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.Date; -import java.util.Locale; -import java.util.Map; -import java.util.HashMap; - -/* - * A JSON utility class - * - * NOTE: in the future, this class may be converted to static, which may break - * backward-compatibility - */ -public class JSON { - private static Gson gson; - private static boolean isLenientOnJson = false; - private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); - private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); - - @SuppressWarnings("unchecked") - public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder() - ; - GsonBuilder builder = fireBuilder.createGsonBuilder(); - return builder; - } - - private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { - JsonElement element = readElement.getAsJsonObject().get(discriminatorField); - if (null == element) { - throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); - } - return element.getAsString(); - } - - /** - * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. - * - * @param classByDiscriminatorValue The map of discriminator values to Java classes. - * @param discriminatorValue The value of the OpenAPI discriminator in the input data. - * @return The Java class that implements the OpenAPI schema - */ - private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { - Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); - if (null == clazz) { - throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); - } - return clazz; - } - - static { - GsonBuilder gsonBuilder = createGson(); - gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); - gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); - gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); - gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); - gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); - gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ChatRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ChatResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ErrorResponse.CustomTypeAdapterFactory()); - gson = gsonBuilder.create(); - } - - /** - * Get Gson. - * - * @return Gson - */ - public static Gson getGson() { - return gson; - } - - /** - * Set Gson. - * - * @param gson Gson - */ - public static void setGson(Gson gson) { - JSON.gson = gson; - } - - public static void setLenientOnJson(boolean lenientOnJson) { - isLenientOnJson = lenientOnJson; - } - - /** - * Serialize the given Java object into JSON string. - * - * @param obj Object - * @return String representation of the JSON - */ - public static String serialize(Object obj) { - return gson.toJson(obj); - } - - /** - * Deserialize the given JSON string to Java object. - * - * @param Type - * @param body The JSON string - * @param returnType The type to deserialize into - * @return The deserialized Java object - */ - @SuppressWarnings("unchecked") - public static T deserialize(String body, Type returnType) { - try { - if (isLenientOnJson) { - JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) - jsonReader.setLenient(true); - return gson.fromJson(jsonReader, returnType); - } else { - return gson.fromJson(body, returnType); - } - } catch (JsonParseException e) { - // Fallback processing when failed to parse JSON form response body: - // return the response body string directly for the String return type; - if (returnType.equals(String.class)) { - return (T) body; - } else { - throw (e); - } - } - } - - /** - * Gson TypeAdapter for Byte Array type - */ - public static class ByteArrayAdapter extends TypeAdapter { - - @Override - public void write(JsonWriter out, byte[] value) throws IOException { - if (value == null) { - out.nullValue(); - } else { - out.value(ByteString.of(value).base64()); - } - } - - @Override - public byte[] read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String bytesAsBase64 = in.nextString(); - ByteString byteString = ByteString.decodeBase64(bytesAsBase64); - return byteString.toByteArray(); - } - } - } - - /** - * Gson TypeAdapter for JSR310 OffsetDateTime type - */ - public static class OffsetDateTimeTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public OffsetDateTimeTypeAdapter() { - this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); - } - - public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, OffsetDateTime date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public OffsetDateTime read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - if (date.endsWith("+0000")) { - date = date.substring(0, date.length()-5) + "Z"; - } - return OffsetDateTime.parse(date, formatter); - } - } - } - - /** - * Gson TypeAdapter for JSR310 LocalDate type - */ - public static class LocalDateTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public LocalDateTypeAdapter() { - this(DateTimeFormatter.ISO_LOCAL_DATE); - } - - public LocalDateTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, LocalDate date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public LocalDate read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return LocalDate.parse(date, formatter); - } - } - } - - public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - offsetDateTimeTypeAdapter.setFormat(dateFormat); - } - - public static void setLocalDateFormat(DateTimeFormatter dateFormat) { - localDateTypeAdapter.setFormat(dateFormat); - } - - /** - * Gson TypeAdapter for java.sql.Date type - * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used - * (more efficient than SimpleDateFormat). - */ - public static class SqlDateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public SqlDateTypeAdapter() {} - - public SqlDateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, java.sql.Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = date.toString(); - } - out.value(value); - } - } - - @Override - public java.sql.Date read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return new java.sql.Date(dateFormat.parse(date).getTime()); - } - return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } - } - - /** - * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, ISO8601Utils will be used. - */ - public static class DateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public DateTypeAdapter() {} - - public DateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = ISO8601Utils.format(date, true); - } - out.value(value); - } - } - - @Override - public Date read(JsonReader in) throws IOException { - try { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return dateFormat.parse(date); - } - return ISO8601Utils.parse(date, new ParsePosition(0)); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } catch (IllegalArgumentException e) { - throw new JsonParseException(e); - } - } - } - - public static void setDateFormat(DateFormat dateFormat) { - dateTypeAdapter.setFormat(dateFormat); - } - - public static void setSqlDateFormat(DateFormat dateFormat) { - sqlDateTypeAdapter.setFormat(dateFormat); - } -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/Pair.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/Pair.java deleted file mode 100644 index 44ae7b43..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/Pair.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class Pair { - private String name = ""; - private String value = ""; - - public Pair (String name, String value) { - setName(name); - setValue(value); - } - - private void setName(String name) { - if (!isValidString(name)) { - return; - } - - this.name = name; - } - - private void setValue(String value) { - if (!isValidString(value)) { - return; - } - - this.value = value; - } - - public String getName() { - return this.name; - } - - public String getValue() { - return this.value; - } - - private boolean isValidString(String arg) { - if (arg == null) { - return false; - } - - return true; - } -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java deleted file mode 100644 index 0875f209..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -import okhttp3.MediaType; -import okhttp3.RequestBody; - -import java.io.IOException; - -import okio.Buffer; -import okio.BufferedSink; -import okio.ForwardingSink; -import okio.Okio; -import okio.Sink; - -public class ProgressRequestBody extends RequestBody { - - private final RequestBody requestBody; - - private final ApiCallback callback; - - public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { - this.requestBody = requestBody; - this.callback = callback; - } - - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() throws IOException { - return requestBody.contentLength(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - BufferedSink bufferedSink = Okio.buffer(sink(sink)); - requestBody.writeTo(bufferedSink); - bufferedSink.flush(); - } - - private Sink sink(Sink sink) { - return new ForwardingSink(sink) { - - long bytesWritten = 0L; - long contentLength = 0L; - - @Override - public void write(Buffer source, long byteCount) throws IOException { - super.write(source, byteCount); - if (contentLength == 0) { - contentLength = contentLength(); - } - - bytesWritten += byteCount; - callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); - } - }; - } -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java deleted file mode 100644 index 45b35a33..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -import okhttp3.MediaType; -import okhttp3.ResponseBody; - -import java.io.IOException; - -import okio.Buffer; -import okio.BufferedSource; -import okio.ForwardingSource; -import okio.Okio; -import okio.Source; - -public class ProgressResponseBody extends ResponseBody { - - private final ResponseBody responseBody; - private final ApiCallback callback; - private BufferedSource bufferedSource; - - public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { - this.responseBody = responseBody; - this.callback = callback; - } - - @Override - public MediaType contentType() { - return responseBody.contentType(); - } - - @Override - public long contentLength() { - return responseBody.contentLength(); - } - - @Override - public BufferedSource source() { - if (bufferedSource == null) { - bufferedSource = Okio.buffer(source(responseBody.source())); - } - return bufferedSource; - } - - private Source source(Source source) { - return new ForwardingSource(source) { - long totalBytesRead = 0L; - - @Override - public long read(Buffer sink, long byteCount) throws IOException { - long bytesRead = super.read(sink, byteCount); - // read() returns the number of bytes read, or -1 if this source is exhausted. - totalBytesRead += bytesRead != -1 ? bytesRead : 0; - callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); - return bytesRead; - } - }; - } -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java deleted file mode 100644 index 7dae208c..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.openapitools.client; - -import java.util.Map; - -/** - * Representing a Server configuration. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class ServerConfiguration { - public String URL; - public String description; - public Map variables; - - /** - * @param URL A URL to the target host. - * @param description A description of the host designated by the URL. - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ - public ServerConfiguration(String URL, String description, Map variables) { - this.URL = URL; - this.description = description; - this.variables = variables; - } - - /** - * Format URL template using given variables. - * - * @param variables A map between a variable name and its value. - * @return Formatted URL. - */ - public String URL(Map variables) { - String url = this.URL; - - // go through variables and replace placeholders - for (Map.Entry variable: this.variables.entrySet()) { - String name = variable.getKey(); - ServerVariable serverVariable = variable.getValue(); - String value = serverVariable.defaultValue; - - if (variables != null && variables.containsKey(name)) { - value = variables.get(name); - if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { - throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); - } - } - url = url.replace("{" + name + "}", value); - } - return url; - } - - /** - * Format URL template using default server variables. - * - * @return Formatted URL. - */ - public String URL() { - return URL(null); - } -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ServerVariable.java deleted file mode 100644 index 46efd869..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/ServerVariable.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client; - -import java.util.HashSet; - -/** - * Representing a Server Variable for server URL template substitution. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class ServerVariable { - public String description; - public String defaultValue; - public HashSet enumValues = null; - - /** - * @param description A description for the server variable. - * @param defaultValue The default value to use for substitution. - * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. - */ - public ServerVariable(String description, String defaultValue, HashSet enumValues) { - this.description = description; - this.defaultValue = defaultValue; - this.enumValues = enumValues; - } -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/StringUtil.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/StringUtil.java deleted file mode 100644 index efc1e4bd..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/StringUtil.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -import java.util.Collection; -import java.util.Iterator; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class StringUtil { - /** - * Check if the given array contains the given value (with case-insensitive comparison). - * - * @param array The array - * @param value The value to search - * @return true if the array contains the value - */ - public static boolean containsIgnoreCase(String[] array, String value) { - for (String str : array) { - if (value == null && str == null) { - return true; - } - if (value != null && value.equalsIgnoreCase(str)) { - return true; - } - } - return false; - } - - /** - * Join an array of strings with the given separator. - *

- * Note: This might be replaced by utility method from commons-lang or guava someday - * if one of those libraries is added as dependency. - *

- * - * @param array The array of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(String[] array, String separator) { - int len = array.length; - if (len == 0) { - return ""; - } - - StringBuilder out = new StringBuilder(); - out.append(array[0]); - for (int i = 1; i < len; i++) { - out.append(separator).append(array[i]); - } - return out.toString(); - } - - /** - * Join a list of strings with the given separator. - * - * @param list The list of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(Collection list, String separator) { - Iterator iterator = list.iterator(); - StringBuilder out = new StringBuilder(); - if (iterator.hasNext()) { - out.append(iterator.next()); - } - while (iterator.hasNext()) { - out.append(separator).append(iterator.next()); - } - return out.toString(); - } -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java deleted file mode 100644 index 4bf0a527..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.api; - -import org.openapitools.client.ApiCallback; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Configuration; -import org.openapitools.client.Pair; -import org.openapitools.client.ProgressRequestBody; -import org.openapitools.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import org.openapitools.client.model.ChatRequest; -import org.openapitools.client.model.ChatResponse; -import org.openapitools.client.model.ErrorResponse; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class DefaultApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public DefaultApi() { - this(Configuration.getDefaultApiClient()); - } - - public DefaultApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for chatWithLLM - * @param chatRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Successful response from LLM -
500 Internal Server Error -
- */ - public okhttp3.Call chatWithLLMCall(ChatRequest chatRequest, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = chatRequest; - - // create path and map variables - String localVarPath = "/chat"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call chatWithLLMValidateBeforeCall(ChatRequest chatRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'chatRequest' is set - if (chatRequest == null) { - throw new ApiException("Missing the required parameter 'chatRequest' when calling chatWithLLM(Async)"); - } - - return chatWithLLMCall(chatRequest, _callback); - - } - - /** - * Chat with LLM - * - * @param chatRequest (required) - * @return ChatResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Successful response from LLM -
500 Internal Server Error -
- */ - public ChatResponse chatWithLLM(ChatRequest chatRequest) throws ApiException { - ApiResponse localVarResp = chatWithLLMWithHttpInfo(chatRequest); - return localVarResp.getData(); - } - - /** - * Chat with LLM - * - * @param chatRequest (required) - * @return ApiResponse<ChatResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Successful response from LLM -
500 Internal Server Error -
- */ - public ApiResponse chatWithLLMWithHttpInfo(ChatRequest chatRequest) throws ApiException { - okhttp3.Call localVarCall = chatWithLLMValidateBeforeCall(chatRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Chat with LLM (asynchronously) - * - * @param chatRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Successful response from LLM -
500 Internal Server Error -
- */ - public okhttp3.Call chatWithLLMAsync(ChatRequest chatRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = chatWithLLMValidateBeforeCall(chatRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java deleted file mode 100644 index c187f03a..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.auth; - -import org.openapitools.client.ApiException; -import org.openapitools.client.Pair; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class ApiKeyAuth implements Authentication { - private final String location; - private final String paramName; - - private String apiKey; - private String apiKeyPrefix; - - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } - - public String getLocation() { - return location; - } - - public String getParamName() { - return paramName; - } - - public String getApiKey() { - return apiKey; - } - - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - public String getApiKeyPrefix() { - return apiKeyPrefix; - } - - public void setApiKeyPrefix(String apiKeyPrefix) { - this.apiKeyPrefix = apiKeyPrefix; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (apiKey == null) { - return; - } - String value; - if (apiKeyPrefix != null) { - value = apiKeyPrefix + " " + apiKey; - } else { - value = apiKey; - } - if ("query".equals(location)) { - queryParams.add(new Pair(paramName, value)); - } else if ("header".equals(location)) { - headerParams.put(paramName, value); - } else if ("cookie".equals(location)) { - cookieParams.put(paramName, value); - } - } -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/Authentication.java deleted file mode 100644 index 0a0c173f..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/Authentication.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.auth; - -import org.openapitools.client.Pair; -import org.openapitools.client.ApiException; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -public interface Authentication { - /** - * Apply authentication settings to header and query params. - * - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - * @param payload HTTP request body - * @param method HTTP method - * @param uri URI - * @throws ApiException if failed to update the parameters - */ - void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java deleted file mode 100644 index 4e184b88..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.auth; - -import org.openapitools.client.Pair; -import org.openapitools.client.ApiException; - -import okhttp3.Credentials; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -public class HttpBasicAuth implements Authentication { - private String username; - private String password; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (username == null && password == null) { - return; - } - headerParams.put("Authorization", Credentials.basic( - username == null ? "" : username, - password == null ? "" : password)); - } -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java deleted file mode 100644 index 9d87659b..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.auth; - -import org.openapitools.client.ApiException; -import org.openapitools.client.Pair; - -import java.net.URI; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.function.Supplier; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class HttpBearerAuth implements Authentication { - private final String scheme; - private Supplier tokenSupplier; - - public HttpBearerAuth(String scheme) { - this.scheme = scheme; - } - - /** - * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @return The bearer token - */ - public String getBearerToken() { - return tokenSupplier.get(); - } - - /** - * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @param bearerToken The bearer token to send in the Authorization header - */ - public void setBearerToken(String bearerToken) { - this.tokenSupplier = () -> bearerToken; - } - - /** - * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. - * - * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header - */ - public void setBearerToken(Supplier tokenSupplier) { - this.tokenSupplier = tokenSupplier; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); - if (bearerToken == null) { - return; - } - - headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); - } - - private static String upperCaseBearer(String scheme) { - return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; - } -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java deleted file mode 100644 index d376479d..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import org.openapitools.client.ApiException; -import java.util.Objects; -import java.lang.reflect.Type; -import java.util.Map; - -/** - * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public abstract class AbstractOpenApiSchema { - - // store the actual instance of the schema/object - private Object instance; - - // is nullable - private Boolean isNullable; - - // schema type (e.g. oneOf, anyOf) - private final String schemaType; - - public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { - this.schemaType = schemaType; - this.isNullable = isNullable; - } - - /** - * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object - * - * @return an instance of the actual schema/object - */ - public abstract Map> getSchemas(); - - /** - * Get the actual instance - * - * @return an instance of the actual schema/object - */ - //@JsonValue - public Object getActualInstance() {return instance;} - - /** - * Set the actual instance - * - * @param instance the actual instance of the schema/object - */ - public void setActualInstance(Object instance) {this.instance = instance;} - - /** - * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well - * - * @return an instance of the actual schema/object - */ - public Object getActualInstanceRecursively() { - return getActualInstanceRecursively(this); - } - - private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { - if (object.getActualInstance() == null) { - return null; - } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { - return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); - } else { - return object.getActualInstance(); - } - } - - /** - * Get the schema type (e.g. anyOf, oneOf) - * - * @return the schema type - */ - public String getSchemaType() { - return schemaType; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ").append(getClass()).append(" {\n"); - sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); - sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); - sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; - return Objects.equals(this.instance, a.instance) && - Objects.equals(this.isNullable, a.isNullable) && - Objects.equals(this.schemaType, a.schemaType); - } - - @Override - public int hashCode() { - return Objects.hash(instance, isNullable, schemaType); - } - - /** - * Is nullable - * - * @return true if it's nullable - */ - public Boolean isNullable() { - if (Boolean.TRUE.equals(isNullable)) { - return Boolean.TRUE; - } else { - return Boolean.FALSE; - } - } - - - -} diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ChatRequest.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ChatRequest.java deleted file mode 100644 index fb2581a1..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ChatRequest.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * ChatRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class ChatRequest { - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public ChatRequest() { - } - - public ChatRequest message(String message) { - this.message = message; - return this; - } - - /** - * The message to be sent to the LLM - * @return message - */ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ChatRequest chatRequest = (ChatRequest) o; - return Objects.equals(this.message, chatRequest.message); - } - - @Override - public int hashCode() { - return Objects.hash(message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ChatRequest {\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("message"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("message"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ChatRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ChatRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ChatRequest is not found in the empty JSON string", ChatRequest.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ChatRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ChatRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ChatRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ChatRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ChatRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ChatRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ChatRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ChatRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ChatRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of ChatRequest - * @throws IOException if the JSON string is invalid with respect to ChatRequest - */ - public static ChatRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ChatRequest.class); - } - - /** - * Convert an instance of ChatRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ChatResponse.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ChatResponse.java deleted file mode 100644 index 37c7c518..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ChatResponse.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * ChatResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class ChatResponse { - public static final String SERIALIZED_NAME_RESPONSE = "response"; - @SerializedName(SERIALIZED_NAME_RESPONSE) - private String response; - - public ChatResponse() { - } - - public ChatResponse response(String response) { - this.response = response; - return this; - } - - /** - * The response generated by the LLM - * @return response - */ - @javax.annotation.Nonnull - public String getResponse() { - return response; - } - - public void setResponse(String response) { - this.response = response; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ChatResponse chatResponse = (ChatResponse) o; - return Objects.equals(this.response, chatResponse.response); - } - - @Override - public int hashCode() { - return Objects.hash(response); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ChatResponse {\n"); - sb.append(" response: ").append(toIndentedString(response)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("response"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("response"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ChatResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ChatResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ChatResponse is not found in the empty JSON string", ChatResponse.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ChatResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ChatResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ChatResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("response").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("response").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ChatResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ChatResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ChatResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ChatResponse value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ChatResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ChatResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of ChatResponse - * @throws IOException if the JSON string is invalid with respect to ChatResponse - */ - public static ChatResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ChatResponse.class); - } - - /** - * Convert an instance of ChatResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ErrorResponse.java b/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ErrorResponse.java deleted file mode 100644 index 89d4ae55..00000000 --- a/server/intelligence-service/java-client/src/main/java/org/openapitools/client/model/ErrorResponse.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * ErrorResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-30T23:43:50.516482+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class ErrorResponse { - public static final String SERIALIZED_NAME_DETAIL = "detail"; - @SerializedName(SERIALIZED_NAME_DETAIL) - private String detail; - - public ErrorResponse() { - } - - public ErrorResponse detail(String detail) { - this.detail = detail; - return this; - } - - /** - * Error message in case of failure - * @return detail - */ - @javax.annotation.Nullable - public String getDetail() { - return detail; - } - - public void setDetail(String detail) { - this.detail = detail; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ErrorResponse errorResponse = (ErrorResponse) o; - return Objects.equals(this.detail, errorResponse.detail); - } - - @Override - public int hashCode() { - return Objects.hash(detail); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ErrorResponse {\n"); - sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("detail"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ErrorResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ErrorResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorResponse is not found in the empty JSON string", ErrorResponse.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ErrorResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("detail") != null && !jsonObj.get("detail").isJsonNull()) && !jsonObj.get("detail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `detail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("detail").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ErrorResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ErrorResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ErrorResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ErrorResponse value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ErrorResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ErrorResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of ErrorResponse - * @throws IOException if the JSON string is invalid with respect to ErrorResponse - */ - public static ErrorResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ErrorResponse.class); - } - - /** - * Convert an instance of ErrorResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/server/intelligence-service/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/server/intelligence-service/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java deleted file mode 100644 index cdf75c51..00000000 --- a/server/intelligence-service/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.api; - -import org.openapitools.client.ApiException; -import org.openapitools.client.model.ChatRequest; -import org.openapitools.client.model.ChatResponse; -import org.openapitools.client.model.ErrorResponse; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for DefaultApi - */ -@Disabled -public class DefaultApiTest { - - private final DefaultApi api = new DefaultApi(); - - /** - * Chat with LLM - * - * @throws ApiException if the Api call fails - */ - @Test - public void chatWithLLMTest() throws ApiException { - ChatRequest chatRequest = null; - ChatResponse response = api.chatWithLLM(chatRequest); - // TODO: test validations - } - -} diff --git a/server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ChatRequestTest.java b/server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ChatRequestTest.java deleted file mode 100644 index 6ca278c2..00000000 --- a/server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ChatRequestTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ChatRequest - */ -public class ChatRequestTest { - private final ChatRequest model = new ChatRequest(); - - /** - * Model tests for ChatRequest - */ - @Test - public void testChatRequest() { - // TODO: test ChatRequest - } - - /** - * Test the property 'message' - */ - @Test - public void messageTest() { - // TODO: test message - } - -} diff --git a/server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ChatResponseTest.java b/server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ChatResponseTest.java deleted file mode 100644 index e1f003d8..00000000 --- a/server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ChatResponseTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ChatResponse - */ -public class ChatResponseTest { - private final ChatResponse model = new ChatResponse(); - - /** - * Model tests for ChatResponse - */ - @Test - public void testChatResponse() { - // TODO: test ChatResponse - } - - /** - * Test the property 'response' - */ - @Test - public void responseTest() { - // TODO: test response - } - -} diff --git a/server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ErrorResponseTest.java b/server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ErrorResponseTest.java deleted file mode 100644 index db51c938..00000000 --- a/server/intelligence-service/java-client/src/test/java/org/openapitools/client/model/ErrorResponseTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Hephaestus API - * API documentation for the Hephaestus intelligence service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ErrorResponse - */ -public class ErrorResponseTest { - private final ErrorResponse model = new ErrorResponse(); - - /** - * Model tests for ErrorResponse - */ - @Test - public void testErrorResponse() { - // TODO: test ErrorResponse - } - - /** - * Test the property 'detail' - */ - @Test - public void detailTest() { - // TODO: test detail - } - -} From b2a9513b5c0bcf6374aa293fb06c6f34e63b6f19 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Mon, 14 Oct 2024 11:30:13 +0200 Subject: [PATCH 28/67] Add java client gen as a plugin --- package.json | 6 +- server/application-server/pom.xml | 490 +++++++++++++++++------------- 2 files changed, 286 insertions(+), 210 deletions(-) diff --git a/package.json b/package.json index 72eb1a1e..00f27a41 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,12 @@ "webapp/*" ], "scripts": { - "generate:api:clean": "rimraf webapp/src/app/core/modules/openapi", + "generate:api:clean": "rimraf webapp/src/app/core/modules/openapi && rimraf server/application-server/intelligence-api", "generate:api:application-server-specs": "cd server/application-server && mvn verify -DskipTests=true && node ../../scripts/clean-openapi-specs.js", "generate:api:application-server-client": "npx openapi-generator-cli generate -i server/application-server/openapi.yaml -g typescript-angular -o webapp/src/app/core/modules/openapi --additional-properties fileNaming=kebab-case,withInterfaces=true --generate-alias-as-model", - "generate:api": "npm run generate:api:application-server-specs && npm run generate:api:clean && npm run generate:api:application-server-client", + "generate:api": "npm run generate:api:application-server-specs && npm run generate:api:intelligence-service-specs && npm run generate:api:clean && npm run generate:api:application-server-client && npm run generate:api:intelligence-service-client", "generate:api:intelligence-service-specs": "python -m server.intelligence-service.app.generate_openapi_yaml", - "generate:api:intelligence-service-client": "npx @openapitools/openapi-generator-cli generate -i server/intelligence-service/openapi.yaml -g java -o server/intelligence-service/java-client" + "generate:api:intelligence-service-client": "cd server/application-server && mvn clean generate-sources" }, "devDependencies": { "@openapitools/openapi-generator-cli": "2.13.5", diff --git a/server/application-server/pom.xml b/server/application-server/pom.xml index d13c8cac..59d62f40 100644 --- a/server/application-server/pom.xml +++ b/server/application-server/pom.xml @@ -1,213 +1,289 @@ - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 3.3.3 - - - - de.tum.in.www1 - hephaestus - 0.0.1-SNAPSHOT - Hephaestus - AI-driven learning for better software development - - - - - - - - - - - - - - - 21 - local,dev - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot - spring-boot-starter-oauth2-client - - - org.springframework.boot - spring-boot-starter-oauth2-resource-server - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-web - - - org.springdoc - springdoc-openapi-starter-webmvc-ui - 2.6.0 - - - org.liquibase - liquibase-core - - - org.springframework.boot - spring-boot-starter-logging - - - org.springframework.boot - spring-boot-devtools - runtime - true - - - org.springframework.boot - spring-boot-docker-compose - runtime - true - - - org.postgresql - postgresql - runtime - - - org.projectlombok - lombok - true - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.security - spring-security-test - test - - - io.zonky.test - embedded-database-spring-test - 2.5.1 - test - - - com.github.therapi - therapi-runtime-javadoc - 0.15.0 - - - org.springframework.modulith - spring-modulith-starter-core - - - org.springframework.modulith - spring-modulith-starter-test - test - - - org.kohsuke - github-api - 1.324 - - - io.hypersistence - hypersistence-utils-hibernate-63 - 3.8.2 - - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.3.3 + + + + de.tum.in.www1 + hephaestus + 0.0.1-SNAPSHOT + Hephaestus + AI-driven learning for better software development + + + + + + + + + + + + + + + 21 + local,dev + + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-oauth2-client + + + org.springframework.boot + spring-boot-starter-oauth2-resource-server + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-web + + + org.springdoc + springdoc-openapi-starter-webmvc-ui + 2.6.0 + + + org.liquibase + liquibase-core + + + org.springframework.boot + spring-boot-starter-logging + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + org.springframework.boot + spring-boot-docker-compose + runtime + true + + + org.postgresql + postgresql + runtime + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.security + spring-security-test + test + + + io.zonky.test + embedded-database-spring-test + 2.5.1 + test + + + com.github.therapi + therapi-runtime-javadoc + 0.15.0 + + + org.springframework.modulith + spring-modulith-starter-core + + + org.springframework.modulith + spring-modulith-starter-test + test + + + org.kohsuke + github-api + 1.324 + + + io.hypersistence + hypersistence-utils-hibernate-63 + 3.8.2 + + + org.openapitools + openapi-generator-maven-plugin + 6.6.0 + + + org.openapitools + openapi-generator + 6.6.0 + - - - - org.springframework.modulith - spring-modulith-bom - 1.2.2 - import - pom - - - + + com.squareup.okhttp3 + okhttp + + + com.squareup.okhttp3 + logging-interceptor + + + com.google.code.gson + gson + + + io.gsonfire + gson-fire + 1.8.5 + + + jakarta.ws.rs + jakarta.ws.rs-api + + + jakarta.annotation + jakarta.annotation-api + + + org.openapitools + jackson-databind-nullable + 0.2.6 + + + org.glassfish.jersey.core + jersey-client + + + org.hibernate.validator + hibernate-validator + + - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - com.github.therapi - therapi-runtime-javadoc-scribe - 0.15.0 - - - org.projectlombok - lombok - ${lombok.version} - - - - - - org.springframework.boot - spring-boot-maven-plugin - - ${app.profiles} - -Dspring.application.admin.enabled=true - - - org.projectlombok - lombok - - - 500 - 100 - - - - - start - stop - - - - - - org.springdoc - springdoc-openapi-maven-plugin - 1.4 - - - integration-test - - generate - - - - - http://localhost:8080/v3/api-docs.yaml - openapi.yaml - . - - - - + + + + org.springframework.modulith + spring-modulith-bom + 1.2.2 + import + pom + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + com.github.therapi + therapi-runtime-javadoc-scribe + 0.15.0 + + + org.projectlombok + lombok + ${lombok.version} + + + + + + org.springframework.boot + spring-boot-maven-plugin + + ${app.profiles} + -Dspring.application.admin.enabled=true + + + org.projectlombok + lombok + + + 500 + 100 + + + + + start + stop + + + + + + org.springdoc + springdoc-openapi-maven-plugin + 1.4 + + + integration-test + + generate + + + + + http://localhost:8080/v3/api-docs.yaml + openapi.yaml + . + + + + org.openapitools + openapi-generator-maven-plugin + 6.6.0 + + + + generate + + + ${project.basedir}/../intelligence-service/openapi.yaml + java + resttemplate + de.tum.in.www1.hephaestus.intelligenceapi.api + de.tum.in.www1.hephaestus.intelligenceapi.model + de.tum.in.www1.hephaestus.intelligenceapi + + true + true + true + + false + false + de.tum.in.www1.hephaestus.intelligenceapi + + + + + + \ No newline at end of file From be9df1c698bb8a8103d9c34286251f1d4f73efba Mon Sep 17 00:00:00 2001 From: milenasrb Date: Wed, 23 Oct 2024 13:46:49 +0200 Subject: [PATCH 29/67] Add shx --- package-lock.json | 147 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 146 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index ec6d7178..8d9b6b00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,8 @@ ], "devDependencies": { "@openapitools/openapi-generator-cli": "2.13.5", - "rimraf": "6.0.1" + "rimraf": "6.0.1", + "shx": "^0.3.4" } }, "node_modules/@babel/runtime": { @@ -917,6 +918,16 @@ "dev": true, "license": "ISC" }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -966,6 +977,19 @@ "node": ">=8" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/https-proxy-agent": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", @@ -1060,6 +1084,32 @@ "node": ">=12.0.0" } }, + "node_modules/interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-core-module": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -1222,6 +1272,16 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/minipass": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", @@ -1354,6 +1414,13 @@ "node": ">=8" } }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, "node_modules/path-scurry": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", @@ -1400,6 +1467,18 @@ "node": ">= 6" } }, + "node_modules/rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", + "dev": true, + "dependencies": { + "resolve": "^1.1.6" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/reflect-metadata": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", @@ -1424,6 +1503,24 @@ "node": ">=0.10.0" } }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -1579,6 +1676,41 @@ "node": ">=8" } }, + "node_modules/shelljs": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + }, + "bin": { + "shjs": "bin/shjs" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/shx": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.4.tgz", + "integrity": "sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.3", + "shelljs": "^0.8.5" + }, + "bin": { + "shx": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -1673,6 +1805,19 @@ "node": ">=8" } }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", From edfae58f901798fa4d219bf9e5ff1be16bf30dde Mon Sep 17 00:00:00 2001 From: milenasrb Date: Wed, 23 Oct 2024 13:48:25 +0200 Subject: [PATCH 30/67] Add tmp for java client generation --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f62e12af..0e199488 100644 --- a/.gitignore +++ b/.gitignore @@ -167,4 +167,7 @@ cython_debug/ node_modules/ -application-local.yml \ No newline at end of file +application-local.yml + +# Java-Client creation temporary +tmp \ No newline at end of file From b181b79b3307525bbc4a63052e3d8ac887d9c9ef Mon Sep 17 00:00:00 2001 From: milenasrb Date: Wed, 23 Oct 2024 13:48:40 +0200 Subject: [PATCH 31/67] Delete open-api get plugin --- server/application-server/pom.xml | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/server/application-server/pom.xml b/server/application-server/pom.xml index 59d62f40..2ce4dead 100644 --- a/server/application-server/pom.xml +++ b/server/application-server/pom.xml @@ -256,34 +256,6 @@ . - - org.openapitools - openapi-generator-maven-plugin - 6.6.0 - - - - generate - - - ${project.basedir}/../intelligence-service/openapi.yaml - java - resttemplate - de.tum.in.www1.hephaestus.intelligenceapi.api - de.tum.in.www1.hephaestus.intelligenceapi.model - de.tum.in.www1.hephaestus.intelligenceapi - - true - true - true - - false - false - de.tum.in.www1.hephaestus.intelligenceapi - - - - \ No newline at end of file From 2a9211929d2752d729b18f5327f4f4df1e602b0b Mon Sep 17 00:00:00 2001 From: milenasrb Date: Wed, 23 Oct 2024 13:49:01 +0200 Subject: [PATCH 32/67] Restructure file --- package.json | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 00f27a41..4d59587a 100644 --- a/package.json +++ b/package.json @@ -4,15 +4,20 @@ "webapp/*" ], "scripts": { - "generate:api:clean": "rimraf webapp/src/app/core/modules/openapi && rimraf server/application-server/intelligence-api", + "generate:api:application-server:clean": "rimraf webapp/src/app/core/modules/openapi", + "generate:api:intelligence-service:clean": "rimraf server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi", + "generate:api:clean": "npm run generate:api:intelligence-service:clean && npm run generate:api:application-server:clean", "generate:api:application-server-specs": "cd server/application-server && mvn verify -DskipTests=true && node ../../scripts/clean-openapi-specs.js", - "generate:api:application-server-client": "npx openapi-generator-cli generate -i server/application-server/openapi.yaml -g typescript-angular -o webapp/src/app/core/modules/openapi --additional-properties fileNaming=kebab-case,withInterfaces=true --generate-alias-as-model", - "generate:api": "npm run generate:api:application-server-specs && npm run generate:api:intelligence-service-specs && npm run generate:api:clean && npm run generate:api:application-server-client && npm run generate:api:intelligence-service-client", "generate:api:intelligence-service-specs": "python -m server.intelligence-service.app.generate_openapi_yaml", - "generate:api:intelligence-service-client": "cd server/application-server && mvn clean generate-sources" + "generate:api:specs": "npm run generate:api:application-server-specs && npm run generate:api:intelligence-service-specs", + "generate:api:application-server-client": "npx openapi-generator-cli generate -i server/application-server/openapi.yaml -g typescript-angular -o webapp/src/app/core/modules/openapi --additional-properties fileNaming=kebab-case,withInterfaces=true --generate-alias-as-model", + "generate:api:intelligence-service-client": "openapi-generator-cli generate -i server/intelligence-service/openapi.yaml -g java --library resttemplate --api-package de.tum.in.www1.hephaestus.intelligenceapi.api --model-package de.tum.in.www1.hephaestus.intelligenceapi.model --invoker-package de.tum.in.www1.hephaestus.intelligenceapi --additional-properties useJakartaEe=true,performBeanValidation=true,generateClientAsBean=true --package-name de.tum.in.www1.hephaestus.intelligenceapi -o tmp/java-client && shx cp -r tmp/java-client/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi server/application-server/src/main/java/de/tum/in/www1/hephaestus && rimraf tmp", + "generate:api:clients": "npm run generate:api:application-server-client && npm run generate:api:intelligence-service-client", + "generate:api": "npm run generate:api:clean && npm run generate:api:specs && npm run generate:api:clients" }, "devDependencies": { "@openapitools/openapi-generator-cli": "2.13.5", - "rimraf": "6.0.1" + "rimraf": "6.0.1", + "shx": "^0.3.4" } } From ad557768985e65da445a1cb0299d57452ad59b94 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Wed, 23 Oct 2024 13:49:20 +0200 Subject: [PATCH 33/67] Delete unused code --- .../src/app/core/modules/openapi/.gitignore | 4 - .../modules/openapi/.openapi-generator-ignore | 23 -- .../modules/openapi/.openapi-generator/FILES | 33 --- .../openapi/.openapi-generator/VERSION | 1 - webapp/src/app/core/modules/openapi/README.md | 226 ------------------ .../app/core/modules/openapi/api.module.ts | 30 --- .../core/modules/openapi/api/admin.service.ts | 155 ------------ .../openapi/api/admin.serviceInterface.ts | 32 --- .../src/app/core/modules/openapi/api/api.ts | 13 - .../openapi/api/leaderboard.service.ts | 170 ------------- .../api/leaderboard.serviceInterface.ts | 35 --- .../openapi/api/pull-request.service.ts | 224 ----------------- .../api/pull-request.serviceInterface.ts | 41 ---- .../core/modules/openapi/api/user.service.ts | 226 ------------------ .../openapi/api/user.serviceInterface.ts | 42 ---- .../app/core/modules/openapi/configuration.ts | 166 ------------- .../src/app/core/modules/openapi/encoder.ts | 20 -- .../src/app/core/modules/openapi/git_push.sh | 57 ----- webapp/src/app/core/modules/openapi/index.ts | 6 - .../openapi/model/issue-comment-dto.ts | 24 -- .../modules/openapi/model/issue-comment.ts | 24 -- .../openapi/model/leaderboard-entry.ts | 35 --- .../app/core/modules/openapi/model/models.ts | 13 - .../modules/openapi/model/pull-request-dto.ts | 37 --- .../openapi/model/pull-request-label.ts | 18 -- .../model/pull-request-review-comment.ts | 25 -- .../openapi/model/pull-request-review-dto.ts | 31 --- .../openapi/model/pull-request-review.ts | 37 --- .../modules/openapi/model/pull-request.ts | 49 ---- .../modules/openapi/model/repository-dto.ts | 20 -- .../core/modules/openapi/model/repository.ts | 36 --- .../core/modules/openapi/model/user-dto.ts | 25 -- .../app/core/modules/openapi/model/user.ts | 56 ----- webapp/src/app/core/modules/openapi/param.ts | 69 ------ .../src/app/core/modules/openapi/variables.ts | 9 - 35 files changed, 2012 deletions(-) delete mode 100644 webapp/src/app/core/modules/openapi/.gitignore delete mode 100644 webapp/src/app/core/modules/openapi/.openapi-generator-ignore delete mode 100644 webapp/src/app/core/modules/openapi/.openapi-generator/FILES delete mode 100644 webapp/src/app/core/modules/openapi/.openapi-generator/VERSION delete mode 100644 webapp/src/app/core/modules/openapi/README.md delete mode 100644 webapp/src/app/core/modules/openapi/api.module.ts delete mode 100644 webapp/src/app/core/modules/openapi/api/admin.service.ts delete mode 100644 webapp/src/app/core/modules/openapi/api/admin.serviceInterface.ts delete mode 100644 webapp/src/app/core/modules/openapi/api/api.ts delete mode 100644 webapp/src/app/core/modules/openapi/api/leaderboard.service.ts delete mode 100644 webapp/src/app/core/modules/openapi/api/leaderboard.serviceInterface.ts delete mode 100644 webapp/src/app/core/modules/openapi/api/pull-request.service.ts delete mode 100644 webapp/src/app/core/modules/openapi/api/pull-request.serviceInterface.ts delete mode 100644 webapp/src/app/core/modules/openapi/api/user.service.ts delete mode 100644 webapp/src/app/core/modules/openapi/api/user.serviceInterface.ts delete mode 100644 webapp/src/app/core/modules/openapi/configuration.ts delete mode 100644 webapp/src/app/core/modules/openapi/encoder.ts delete mode 100644 webapp/src/app/core/modules/openapi/git_push.sh delete mode 100644 webapp/src/app/core/modules/openapi/index.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/issue-comment-dto.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/issue-comment.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/leaderboard-entry.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/models.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/pull-request-dto.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/pull-request-label.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/pull-request-review-comment.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/pull-request-review-dto.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/pull-request-review.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/pull-request.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/repository-dto.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/repository.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/user-dto.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/user.ts delete mode 100644 webapp/src/app/core/modules/openapi/param.ts delete mode 100644 webapp/src/app/core/modules/openapi/variables.ts diff --git a/webapp/src/app/core/modules/openapi/.gitignore b/webapp/src/app/core/modules/openapi/.gitignore deleted file mode 100644 index 149b5765..00000000 --- a/webapp/src/app/core/modules/openapi/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -wwwroot/*.js -node_modules -typings -dist diff --git a/webapp/src/app/core/modules/openapi/.openapi-generator-ignore b/webapp/src/app/core/modules/openapi/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/webapp/src/app/core/modules/openapi/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/webapp/src/app/core/modules/openapi/.openapi-generator/FILES b/webapp/src/app/core/modules/openapi/.openapi-generator/FILES deleted file mode 100644 index f148186c..00000000 --- a/webapp/src/app/core/modules/openapi/.openapi-generator/FILES +++ /dev/null @@ -1,33 +0,0 @@ -.gitignore -.openapi-generator-ignore -README.md -api.module.ts -api/admin.service.ts -api/admin.serviceInterface.ts -api/api.ts -api/leaderboard.service.ts -api/leaderboard.serviceInterface.ts -api/pull-request.service.ts -api/pull-request.serviceInterface.ts -api/user.service.ts -api/user.serviceInterface.ts -configuration.ts -encoder.ts -git_push.sh -index.ts -model/issue-comment-dto.ts -model/issue-comment.ts -model/leaderboard-entry.ts -model/models.ts -model/pull-request-dto.ts -model/pull-request-label.ts -model/pull-request-review-comment.ts -model/pull-request-review-dto.ts -model/pull-request-review.ts -model/pull-request.ts -model/repository-dto.ts -model/repository.ts -model/user-dto.ts -model/user.ts -param.ts -variables.ts diff --git a/webapp/src/app/core/modules/openapi/.openapi-generator/VERSION b/webapp/src/app/core/modules/openapi/.openapi-generator/VERSION deleted file mode 100644 index 1985849f..00000000 --- a/webapp/src/app/core/modules/openapi/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.7.0 diff --git a/webapp/src/app/core/modules/openapi/README.md b/webapp/src/app/core/modules/openapi/README.md deleted file mode 100644 index de16f95a..00000000 --- a/webapp/src/app/core/modules/openapi/README.md +++ /dev/null @@ -1,226 +0,0 @@ -## @ - -### Building - -To install the required dependencies and to build the typescript sources run: -``` -npm install -npm run build -``` - -### publishing - -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) - -### consuming - -Navigate to the folder of your consuming project and run one of next commands. - -_published:_ - -``` -npm install @ --save -``` - -_without publishing (not recommended):_ - -``` -npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save -``` - -_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ - -_using `npm link`:_ - -In PATH_TO_GENERATED_PACKAGE/dist: -``` -npm link -``` - -In your project: -``` -npm link -``` - -__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. -Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround. -Published packages are not effected by this issue. - - -#### General usage - -In your Angular project: - - -``` -// without configuring providers -import { ApiModule } from ''; -import { HttpClientModule } from '@angular/common/http'; - -@NgModule({ - imports: [ - ApiModule, - // make sure to import the HttpClientModule in the AppModule only, - // see https://github.com/angular/angular/issues/20575 - HttpClientModule - ], - declarations: [ AppComponent ], - providers: [], - bootstrap: [ AppComponent ] -}) -export class AppModule {} -``` - -``` -// configuring providers -import { ApiModule, Configuration, ConfigurationParameters } from ''; - -export function apiConfigFactory (): Configuration { - const params: ConfigurationParameters = { - // set configuration parameters here. - } - return new Configuration(params); -} - -@NgModule({ - imports: [ ApiModule.forRoot(apiConfigFactory) ], - declarations: [ AppComponent ], - providers: [], - bootstrap: [ AppComponent ] -}) -export class AppModule {} -``` - -``` -// configuring providers with an authentication service that manages your access tokens -import { ApiModule, Configuration } from ''; - -@NgModule({ - imports: [ ApiModule ], - declarations: [ AppComponent ], - providers: [ - { - provide: Configuration, - useFactory: (authService: AuthService) => new Configuration( - { - basePath: environment.apiUrl, - accessToken: authService.getAccessToken.bind(authService) - } - ), - deps: [AuthService], - multi: false - } - ], - bootstrap: [ AppComponent ] -}) -export class AppModule {} -``` - -``` -import { DefaultApi } from ''; - -export class AppComponent { - constructor(private apiGateway: DefaultApi) { } -} -``` - -Note: The ApiModule is restricted to being instantiated once app wide. -This is to ensure that all services are treated as singletons. - -#### Using multiple OpenAPI files / APIs / ApiModules -In order to use multiple `ApiModules` generated from different OpenAPI files, -you can create an alias name when importing the modules -in order to avoid naming conflicts: -``` -import { ApiModule } from 'my-api-path'; -import { ApiModule as OtherApiModule } from 'my-other-api-path'; -import { HttpClientModule } from '@angular/common/http'; - -@NgModule({ - imports: [ - ApiModule, - OtherApiModule, - // make sure to import the HttpClientModule in the AppModule only, - // see https://github.com/angular/angular/issues/20575 - HttpClientModule - ] -}) -export class AppModule { - -} -``` - - -### Set service base path -If different than the generated base path, during app bootstrap, you can provide the base path to your service. - -``` -import { BASE_PATH } from ''; - -bootstrap(AppComponent, [ - { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, -]); -``` -or - -``` -import { BASE_PATH } from ''; - -@NgModule({ - imports: [], - declarations: [ AppComponent ], - providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], - bootstrap: [ AppComponent ] -}) -export class AppModule {} -``` - - -#### Using @angular/cli -First extend your `src/environments/*.ts` files by adding the corresponding base path: - -``` -export const environment = { - production: false, - API_BASE_PATH: 'http://127.0.0.1:8080' -}; -``` - -In the src/app/app.module.ts: -``` -import { BASE_PATH } from ''; -import { environment } from '../environments/environment'; - -@NgModule({ - declarations: [ - AppComponent - ], - imports: [ ], - providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], - bootstrap: [ AppComponent ] -}) -export class AppModule { } -``` - -### Customizing path parameter encoding - -Without further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple' -and Dates for format 'date-time' are encoded correctly. - -Other styles (e.g. "matrix") are not that easy to encode -and thus are best delegated to other libraries (e.g.: [@honoluluhenk/http-param-expander]). - -To implement your own parameter encoding (or call another library), -pass an arrow-function or method-reference to the `encodeParam` property of the Configuration-object -(see [General Usage](#general-usage) above). - -Example value for use in your Configuration-Provider: -```typescript -new Configuration({ - encodeParam: (param: Param) => myFancyParamEncoder(param), -}) -``` - -[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations -[style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values -[@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander diff --git a/webapp/src/app/core/modules/openapi/api.module.ts b/webapp/src/app/core/modules/openapi/api.module.ts deleted file mode 100644 index 58d341fb..00000000 --- a/webapp/src/app/core/modules/openapi/api.module.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; -import { Configuration } from './configuration'; -import { HttpClient } from '@angular/common/http'; - - -@NgModule({ - imports: [], - declarations: [], - exports: [], - providers: [] -}) -export class ApiModule { - public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { - return { - ngModule: ApiModule, - providers: [ { provide: Configuration, useFactory: configurationFactory } ] - }; - } - - constructor( @Optional() @SkipSelf() parentModule: ApiModule, - @Optional() http: HttpClient) { - if (parentModule) { - throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); - } - if (!http) { - throw new Error('You need to import the HttpClientModule in your AppModule! \n' + - 'See also https://github.com/angular/angular/issues/20575'); - } - } -} diff --git a/webapp/src/app/core/modules/openapi/api/admin.service.ts b/webapp/src/app/core/modules/openapi/api/admin.service.ts deleted file mode 100644 index 6ba0eceb..00000000 --- a/webapp/src/app/core/modules/openapi/api/admin.service.ts +++ /dev/null @@ -1,155 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -/* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; - - -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { - AdminServiceInterface -} from './admin.serviceInterface'; - - - -@Injectable({ - providedIn: 'root' -}) -export class AdminService implements AdminServiceInterface { - - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; - } - - /** - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public admin(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public admin(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public admin(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public admin(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/admin`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - -} diff --git a/webapp/src/app/core/modules/openapi/api/admin.serviceInterface.ts b/webapp/src/app/core/modules/openapi/api/admin.serviceInterface.ts deleted file mode 100644 index 1dcc07cd..00000000 --- a/webapp/src/app/core/modules/openapi/api/admin.serviceInterface.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { HttpHeaders } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - - - -import { Configuration } from '../configuration'; - - - -export interface AdminServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * - * - */ - admin(extraHttpRequestParams?: any): Observable; - -} diff --git a/webapp/src/app/core/modules/openapi/api/api.ts b/webapp/src/app/core/modules/openapi/api/api.ts deleted file mode 100644 index 30528fda..00000000 --- a/webapp/src/app/core/modules/openapi/api/api.ts +++ /dev/null @@ -1,13 +0,0 @@ -export * from './admin.service'; -import { AdminService } from './admin.service'; -export * from './admin.serviceInterface'; -export * from './leaderboard.service'; -import { LeaderboardService } from './leaderboard.service'; -export * from './leaderboard.serviceInterface'; -export * from './pull-request.service'; -import { PullRequestService } from './pull-request.service'; -export * from './pull-request.serviceInterface'; -export * from './user.service'; -import { UserService } from './user.service'; -export * from './user.serviceInterface'; -export const APIS = [AdminService, LeaderboardService, PullRequestService, UserService]; diff --git a/webapp/src/app/core/modules/openapi/api/leaderboard.service.ts b/webapp/src/app/core/modules/openapi/api/leaderboard.service.ts deleted file mode 100644 index 34a2c7cd..00000000 --- a/webapp/src/app/core/modules/openapi/api/leaderboard.service.ts +++ /dev/null @@ -1,170 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -/* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; - -// @ts-ignore -import { LeaderboardEntry } from '../model/leaderboard-entry'; - -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { - LeaderboardServiceInterface -} from './leaderboard.serviceInterface'; - - - -@Injectable({ - providedIn: 'root' -}) -export class LeaderboardService implements LeaderboardServiceInterface { - - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; - } - - /** - * @param after - * @param before - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getLeaderboard(after?: string, before?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getLeaderboard(after?: string, before?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getLeaderboard(after?: string, before?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getLeaderboard(after?: string, before?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (after !== undefined && after !== null) { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - after, 'after'); - } - if (before !== undefined && before !== null) { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - before, 'before'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/leaderboard`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - -} diff --git a/webapp/src/app/core/modules/openapi/api/leaderboard.serviceInterface.ts b/webapp/src/app/core/modules/openapi/api/leaderboard.serviceInterface.ts deleted file mode 100644 index 19a131c7..00000000 --- a/webapp/src/app/core/modules/openapi/api/leaderboard.serviceInterface.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { HttpHeaders } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { LeaderboardEntry } from '../model/models'; - - -import { Configuration } from '../configuration'; - - - -export interface LeaderboardServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * - * - * @param after - * @param before - */ - getLeaderboard(after?: string, before?: string, extraHttpRequestParams?: any): Observable>; - -} diff --git a/webapp/src/app/core/modules/openapi/api/pull-request.service.ts b/webapp/src/app/core/modules/openapi/api/pull-request.service.ts deleted file mode 100644 index 5511e994..00000000 --- a/webapp/src/app/core/modules/openapi/api/pull-request.service.ts +++ /dev/null @@ -1,224 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -/* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; - -// @ts-ignore -import { PullRequest } from '../model/pull-request'; - -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { - PullRequestServiceInterface -} from './pull-request.serviceInterface'; - - - -@Injectable({ - providedIn: 'root' -}) -export class PullRequestService implements PullRequestServiceInterface { - - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; - } - - /** - * @param id - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPullRequest(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPullRequest(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPullRequest(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPullRequest(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getPullRequest.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/pullrequest/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * @param login - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPullRequestsByAuthor(login: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPullRequestsByAuthor(login: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getPullRequestsByAuthor(login: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getPullRequestsByAuthor(login: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (login === null || login === undefined) { - throw new Error('Required parameter login was null or undefined when calling getPullRequestsByAuthor.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/pullrequest/author/${this.configuration.encodeParam({name: "login", value: login, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - -} diff --git a/webapp/src/app/core/modules/openapi/api/pull-request.serviceInterface.ts b/webapp/src/app/core/modules/openapi/api/pull-request.serviceInterface.ts deleted file mode 100644 index 66d5615b..00000000 --- a/webapp/src/app/core/modules/openapi/api/pull-request.serviceInterface.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { HttpHeaders } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { PullRequest } from '../model/models'; - - -import { Configuration } from '../configuration'; - - - -export interface PullRequestServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * - * - * @param id - */ - getPullRequest(id: number, extraHttpRequestParams?: any): Observable; - - /** - * - * - * @param login - */ - getPullRequestsByAuthor(login: string, extraHttpRequestParams?: any): Observable>; - -} diff --git a/webapp/src/app/core/modules/openapi/api/user.service.ts b/webapp/src/app/core/modules/openapi/api/user.service.ts deleted file mode 100644 index 2e8ba927..00000000 --- a/webapp/src/app/core/modules/openapi/api/user.service.ts +++ /dev/null @@ -1,226 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -/* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; - -// @ts-ignore -import { User } from '../model/user'; -// @ts-ignore -import { UserDTO } from '../model/user-dto'; - -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { - UserServiceInterface -} from './user.serviceInterface'; - - - -@Injectable({ - providedIn: 'root' -}) -export class UserService implements UserServiceInterface { - - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; - } - - /** - * @param login - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getFullUser(login: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getFullUser(login: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getFullUser(login: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getFullUser(login: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (login === null || login === undefined) { - throw new Error('Required parameter login was null or undefined when calling getFullUser.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/user/${this.configuration.encodeParam({name: "login", value: login, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/full`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * @param login - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getUser(login: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getUser(login: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getUser(login: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getUser(login: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (login === null || login === undefined) { - throw new Error('Required parameter login was null or undefined when calling getUser.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/user/${this.configuration.encodeParam({name: "login", value: login, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - -} diff --git a/webapp/src/app/core/modules/openapi/api/user.serviceInterface.ts b/webapp/src/app/core/modules/openapi/api/user.serviceInterface.ts deleted file mode 100644 index 65217329..00000000 --- a/webapp/src/app/core/modules/openapi/api/user.serviceInterface.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { HttpHeaders } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { User } from '../model/models'; -import { UserDTO } from '../model/models'; - - -import { Configuration } from '../configuration'; - - - -export interface UserServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * - * - * @param login - */ - getFullUser(login: string, extraHttpRequestParams?: any): Observable; - - /** - * - * - * @param login - */ - getUser(login: string, extraHttpRequestParams?: any): Observable; - -} diff --git a/webapp/src/app/core/modules/openapi/configuration.ts b/webapp/src/app/core/modules/openapi/configuration.ts deleted file mode 100644 index 526b454f..00000000 --- a/webapp/src/app/core/modules/openapi/configuration.ts +++ /dev/null @@ -1,166 +0,0 @@ -import { HttpParameterCodec } from '@angular/common/http'; -import { Param } from './param'; - -export interface ConfigurationParameters { - /** - * @deprecated Since 5.0. Use credentials instead - */ - apiKeys?: {[ key: string ]: string}; - username?: string; - password?: string; - /** - * @deprecated Since 5.0. Use credentials instead - */ - accessToken?: string | (() => string); - basePath?: string; - withCredentials?: boolean; - /** - * Takes care of encoding query- and form-parameters. - */ - encoder?: HttpParameterCodec; - /** - * Override the default method for encoding path parameters in various - * styles. - *

- * See {@link README.md} for more details - *

- */ - encodeParam?: (param: Param) => string; - /** - * The keys are the names in the securitySchemes section of the OpenAPI - * document. They should map to the value used for authentication - * minus any standard prefixes such as 'Basic' or 'Bearer'. - */ - credentials?: {[ key: string ]: string | (() => string | undefined)}; -} - -export class Configuration { - /** - * @deprecated Since 5.0. Use credentials instead - */ - apiKeys?: {[ key: string ]: string}; - username?: string; - password?: string; - /** - * @deprecated Since 5.0. Use credentials instead - */ - accessToken?: string | (() => string); - basePath?: string; - withCredentials?: boolean; - /** - * Takes care of encoding query- and form-parameters. - */ - encoder?: HttpParameterCodec; - /** - * Encoding of various path parameter - * styles. - *

- * See {@link README.md} for more details - *

- */ - encodeParam: (param: Param) => string; - /** - * The keys are the names in the securitySchemes section of the OpenAPI - * document. They should map to the value used for authentication - * minus any standard prefixes such as 'Basic' or 'Bearer'. - */ - credentials: {[ key: string ]: string | (() => string | undefined)}; - - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; - } - else { - this.encodeParam = param => this.defaultEncodeParam(param); - } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; - } - else { - this.credentials = {}; - } - } - - /** - * Select the correct content-type to use for a request. - * Uses {@link Configuration#isJsonMime} to determine the correct content-type. - * If no content type is found return the first found type if the contentTypes is not empty - * @param contentTypes - the array of content types that are available for selection - * @returns the selected content-type or undefined if no selection could be made. - */ - public selectHeaderContentType (contentTypes: string[]): string | undefined { - if (contentTypes.length === 0) { - return undefined; - } - - const type = contentTypes.find((x: string) => this.isJsonMime(x)); - if (type === undefined) { - return contentTypes[0]; - } - return type; - } - - /** - * Select the correct accept content-type to use for a request. - * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. - * If no content type is found return the first found type if the contentTypes is not empty - * @param accepts - the array of content types that are available for selection. - * @returns the selected content-type or undefined if no selection could be made. - */ - public selectHeaderAccept(accepts: string[]): string | undefined { - if (accepts.length === 0) { - return undefined; - } - - const type = accepts.find((x: string) => this.isJsonMime(x)); - if (type === undefined) { - return accepts[0]; - } - return type; - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } - - public lookupCredential(key: string): string | undefined { - const value = this.credentials[key]; - return typeof value === 'function' - ? value() - : value; - } - - private defaultEncodeParam(param: Param): string { - // This implementation exists as fallback for missing configuration - // and for backwards compatibility to older typescript-angular generator versions. - // It only works for the 'simple' parameter style. - // Date-handling only works for the 'date-time' format. - // All other styles and Date-formats are probably handled incorrectly. - // - // But: if that's all you need (i.e.: the most common use-case): no need for customization! - - const value = param.dataFormat === 'date-time' && param.value instanceof Date - ? (param.value as Date).toISOString() - : param.value; - - return encodeURIComponent(String(value)); - } -} diff --git a/webapp/src/app/core/modules/openapi/encoder.ts b/webapp/src/app/core/modules/openapi/encoder.ts deleted file mode 100644 index 138c4d5c..00000000 --- a/webapp/src/app/core/modules/openapi/encoder.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { HttpParameterCodec } from '@angular/common/http'; - -/** - * Custom HttpParameterCodec - * Workaround for https://github.com/angular/angular/issues/18261 - */ -export class CustomHttpParameterCodec implements HttpParameterCodec { - encodeKey(k: string): string { - return encodeURIComponent(k); - } - encodeValue(v: string): string { - return encodeURIComponent(v); - } - decodeKey(k: string): string { - return decodeURIComponent(k); - } - decodeValue(v: string): string { - return decodeURIComponent(v); - } -} diff --git a/webapp/src/app/core/modules/openapi/git_push.sh b/webapp/src/app/core/modules/openapi/git_push.sh deleted file mode 100644 index f53a75d4..00000000 --- a/webapp/src/app/core/modules/openapi/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/webapp/src/app/core/modules/openapi/index.ts b/webapp/src/app/core/modules/openapi/index.ts deleted file mode 100644 index 104dd3d2..00000000 --- a/webapp/src/app/core/modules/openapi/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './api/api'; -export * from './model/models'; -export * from './variables'; -export * from './configuration'; -export * from './api.module'; -export * from './param'; diff --git a/webapp/src/app/core/modules/openapi/model/issue-comment-dto.ts b/webapp/src/app/core/modules/openapi/model/issue-comment-dto.ts deleted file mode 100644 index b1f01fb9..00000000 --- a/webapp/src/app/core/modules/openapi/model/issue-comment-dto.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { PullRequestDTO } from './pull-request-dto'; -import { UserDTO } from './user-dto'; - - -export interface IssueCommentDTO { - id?: number; - body?: string; - createdAt?: string; - updatedAt?: string; - author?: UserDTO; - pullRequest?: PullRequestDTO; -} - diff --git a/webapp/src/app/core/modules/openapi/model/issue-comment.ts b/webapp/src/app/core/modules/openapi/model/issue-comment.ts deleted file mode 100644 index 2bdafa3b..00000000 --- a/webapp/src/app/core/modules/openapi/model/issue-comment.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { User } from './user'; -import { PullRequest } from './pull-request'; - - -export interface IssueComment { - id?: number; - createdAt?: string; - updatedAt?: string; - body?: string; - author?: User; - pullRequest?: PullRequest; -} - diff --git a/webapp/src/app/core/modules/openapi/model/leaderboard-entry.ts b/webapp/src/app/core/modules/openapi/model/leaderboard-entry.ts deleted file mode 100644 index e65a9c77..00000000 --- a/webapp/src/app/core/modules/openapi/model/leaderboard-entry.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { PullRequestReviewDTO } from './pull-request-review-dto'; - - -export interface LeaderboardEntry { - githubName?: string; - avatarUrl?: string; - name?: string; - type?: LeaderboardEntry.TypeEnum; - score?: number; - rank?: number; - numberOfReviewedPRs?: number; - changesRequested?: Array; - approvals?: Array; - comments?: Array; -} -export namespace LeaderboardEntry { - export type TypeEnum = 'USER' | 'BOT'; - export const TypeEnum = { - User: 'USER' as TypeEnum, - Bot: 'BOT' as TypeEnum - }; -} - - diff --git a/webapp/src/app/core/modules/openapi/model/models.ts b/webapp/src/app/core/modules/openapi/model/models.ts deleted file mode 100644 index ae9140b7..00000000 --- a/webapp/src/app/core/modules/openapi/model/models.ts +++ /dev/null @@ -1,13 +0,0 @@ -export * from './issue-comment'; -export * from './issue-comment-dto'; -export * from './leaderboard-entry'; -export * from './pull-request'; -export * from './pull-request-dto'; -export * from './pull-request-label'; -export * from './pull-request-review'; -export * from './pull-request-review-comment'; -export * from './pull-request-review-dto'; -export * from './repository'; -export * from './repository-dto'; -export * from './user'; -export * from './user-dto'; diff --git a/webapp/src/app/core/modules/openapi/model/pull-request-dto.ts b/webapp/src/app/core/modules/openapi/model/pull-request-dto.ts deleted file mode 100644 index 4a1064f1..00000000 --- a/webapp/src/app/core/modules/openapi/model/pull-request-dto.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { UserDTO } from './user-dto'; -import { IssueCommentDTO } from './issue-comment-dto'; -import { RepositoryDTO } from './repository-dto'; - - -export interface PullRequestDTO { - id?: number; - title?: string; - url?: string; - state?: PullRequestDTO.StateEnum; - createdAt?: string; - updatedAt?: string; - mergedAt?: string; - author?: UserDTO; - comments?: Set; - repository?: RepositoryDTO; -} -export namespace PullRequestDTO { - export type StateEnum = 'CLOSED' | 'OPEN'; - export const StateEnum = { - Closed: 'CLOSED' as StateEnum, - Open: 'OPEN' as StateEnum - }; -} - - diff --git a/webapp/src/app/core/modules/openapi/model/pull-request-label.ts b/webapp/src/app/core/modules/openapi/model/pull-request-label.ts deleted file mode 100644 index 9e0750c2..00000000 --- a/webapp/src/app/core/modules/openapi/model/pull-request-label.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export interface PullRequestLabel { - name?: string; - color?: string; -} - diff --git a/webapp/src/app/core/modules/openapi/model/pull-request-review-comment.ts b/webapp/src/app/core/modules/openapi/model/pull-request-review-comment.ts deleted file mode 100644 index 1781825d..00000000 --- a/webapp/src/app/core/modules/openapi/model/pull-request-review-comment.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { PullRequestReview } from './pull-request-review'; -import { User } from './user'; - - -export interface PullRequestReviewComment { - id?: number; - createdAt?: string; - updatedAt?: string; - body?: string; - author?: User; - review?: PullRequestReview; - commit: string; -} - diff --git a/webapp/src/app/core/modules/openapi/model/pull-request-review-dto.ts b/webapp/src/app/core/modules/openapi/model/pull-request-review-dto.ts deleted file mode 100644 index b4947f88..00000000 --- a/webapp/src/app/core/modules/openapi/model/pull-request-review-dto.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export interface PullRequestReviewDTO { - id?: number; - createdAt?: string; - updatedAt?: string; - submittedAt?: string; - state?: PullRequestReviewDTO.StateEnum; -} -export namespace PullRequestReviewDTO { - export type StateEnum = 'COMMENTED' | 'APPROVED' | 'CHANGES_REQUESTED' | 'DISMISSED'; - export const StateEnum = { - Commented: 'COMMENTED' as StateEnum, - Approved: 'APPROVED' as StateEnum, - ChangesRequested: 'CHANGES_REQUESTED' as StateEnum, - Dismissed: 'DISMISSED' as StateEnum - }; -} - - diff --git a/webapp/src/app/core/modules/openapi/model/pull-request-review.ts b/webapp/src/app/core/modules/openapi/model/pull-request-review.ts deleted file mode 100644 index 52c37e3b..00000000 --- a/webapp/src/app/core/modules/openapi/model/pull-request-review.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { PullRequestReviewComment } from './pull-request-review-comment'; -import { User } from './user'; -import { PullRequest } from './pull-request'; - - -export interface PullRequestReview { - id?: number; - createdAt?: string; - updatedAt?: string; - author?: User; - state: PullRequestReview.StateEnum; - submittedAt?: string; - comments?: Set; - pullRequest?: PullRequest; -} -export namespace PullRequestReview { - export type StateEnum = 'COMMENTED' | 'APPROVED' | 'CHANGES_REQUESTED' | 'DISMISSED'; - export const StateEnum = { - Commented: 'COMMENTED' as StateEnum, - Approved: 'APPROVED' as StateEnum, - ChangesRequested: 'CHANGES_REQUESTED' as StateEnum, - Dismissed: 'DISMISSED' as StateEnum - }; -} - - diff --git a/webapp/src/app/core/modules/openapi/model/pull-request.ts b/webapp/src/app/core/modules/openapi/model/pull-request.ts deleted file mode 100644 index 98c19061..00000000 --- a/webapp/src/app/core/modules/openapi/model/pull-request.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { Repository } from './repository'; -import { PullRequestLabel } from './pull-request-label'; -import { PullRequestReview } from './pull-request-review'; -import { User } from './user'; -import { IssueComment } from './issue-comment'; - - -export interface PullRequest { - id?: number; - createdAt?: string; - updatedAt?: string; - number?: number; - title: string; - url: string; - /** - * State of the PullRequest. Does not include the state of the merge. - */ - state: PullRequest.StateEnum; - additions?: number; - deletions?: number; - commits?: number; - changedFiles?: number; - mergedAt?: string; - author?: User; - comments?: Set; - reviews?: Set; - repository?: Repository; - pullRequestLabels?: Set; -} -export namespace PullRequest { - export type StateEnum = 'CLOSED' | 'OPEN'; - export const StateEnum = { - Closed: 'CLOSED' as StateEnum, - Open: 'OPEN' as StateEnum - }; -} - - diff --git a/webapp/src/app/core/modules/openapi/model/repository-dto.ts b/webapp/src/app/core/modules/openapi/model/repository-dto.ts deleted file mode 100644 index bb31547f..00000000 --- a/webapp/src/app/core/modules/openapi/model/repository-dto.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export interface RepositoryDTO { - name?: string; - nameWithOwner?: string; - description?: string; - url?: string; -} - diff --git a/webapp/src/app/core/modules/openapi/model/repository.ts b/webapp/src/app/core/modules/openapi/model/repository.ts deleted file mode 100644 index 3c7f9428..00000000 --- a/webapp/src/app/core/modules/openapi/model/repository.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { PullRequest } from './pull-request'; - - -export interface Repository { - id?: number; - createdAt?: string; - updatedAt?: string; - name: string; - nameWithOwner: string; - description?: string; - defaultBranch: string; - visibility: Repository.VisibilityEnum; - url: string; - homepage?: string; - pullRequests?: Set; -} -export namespace Repository { - export type VisibilityEnum = 'PUBLIC' | 'PRIVATE'; - export const VisibilityEnum = { - Public: 'PUBLIC' as VisibilityEnum, - Private: 'PRIVATE' as VisibilityEnum - }; -} - - diff --git a/webapp/src/app/core/modules/openapi/model/user-dto.ts b/webapp/src/app/core/modules/openapi/model/user-dto.ts deleted file mode 100644 index aaaae01b..00000000 --- a/webapp/src/app/core/modules/openapi/model/user-dto.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { PullRequestDTO } from './pull-request-dto'; -import { IssueCommentDTO } from './issue-comment-dto'; - - -export interface UserDTO { - id?: number; - login?: string; - email?: string; - name?: string; - url?: string; - pullRequests?: Set; - comments?: Set; -} - diff --git a/webapp/src/app/core/modules/openapi/model/user.ts b/webapp/src/app/core/modules/openapi/model/user.ts deleted file mode 100644 index 8e8311bd..00000000 --- a/webapp/src/app/core/modules/openapi/model/user.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { PullRequestReviewComment } from './pull-request-review-comment'; -import { PullRequestReview } from './pull-request-review'; -import { PullRequest } from './pull-request'; -import { IssueComment } from './issue-comment'; - - -export interface User { - id?: number; - createdAt?: string; - updatedAt?: string; - /** - * Unique login identifier for a user. - */ - login: string; - email?: string; - /** - * Display name of the user. - */ - name?: string; - /** - * Unique URL to the user\'s profile. Not the website a user can set in their profile. - */ - url: string; - /** - * URL to the user\'s avatar. If unavailable, a fallback can be generated from the login, e.g. on Github: https://github.com/{login}.png - */ - avatarUrl?: string; - /** - * Type of the user. Used to distinguish between users and bots. - */ - type: User.TypeEnum; - pullRequests?: Set; - issueComments?: Set; - reviewComments?: Set; - reviews?: Set; -} -export namespace User { - export type TypeEnum = 'USER' | 'BOT'; - export const TypeEnum = { - User: 'USER' as TypeEnum, - Bot: 'BOT' as TypeEnum - }; -} - - diff --git a/webapp/src/app/core/modules/openapi/param.ts b/webapp/src/app/core/modules/openapi/param.ts deleted file mode 100644 index 78a2d20a..00000000 --- a/webapp/src/app/core/modules/openapi/param.ts +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Standard parameter styles defined by OpenAPI spec - */ -export type StandardParamStyle = - | 'matrix' - | 'label' - | 'form' - | 'simple' - | 'spaceDelimited' - | 'pipeDelimited' - | 'deepObject' - ; - -/** - * The OpenAPI standard {@link StandardParamStyle}s may be extended by custom styles by the user. - */ -export type ParamStyle = StandardParamStyle | string; - -/** - * Standard parameter locations defined by OpenAPI spec - */ -export type ParamLocation = 'query' | 'header' | 'path' | 'cookie'; - -/** - * Standard types as defined in OpenAPI Specification: Data Types - */ -export type StandardDataType = - | "integer" - | "number" - | "boolean" - | "string" - | "object" - | "array" - ; - -/** - * Standard {@link DataType}s plus your own types/classes. - */ -export type DataType = StandardDataType | string; - -/** - * Standard formats as defined in OpenAPI Specification: Data Types - */ -export type StandardDataFormat = - | "int32" - | "int64" - | "float" - | "double" - | "byte" - | "binary" - | "date" - | "date-time" - | "password" - ; - -export type DataFormat = StandardDataFormat | string; - -/** - * The parameter to encode. - */ -export interface Param { - name: string; - value: unknown; - in: ParamLocation; - style: ParamStyle, - explode: boolean; - dataType: DataType; - dataFormat: DataFormat | undefined; -} diff --git a/webapp/src/app/core/modules/openapi/variables.ts b/webapp/src/app/core/modules/openapi/variables.ts deleted file mode 100644 index 6fe58549..00000000 --- a/webapp/src/app/core/modules/openapi/variables.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { InjectionToken } from '@angular/core'; - -export const BASE_PATH = new InjectionToken('basePath'); -export const COLLECTION_FORMATS = { - 'csv': ',', - 'tsv': ' ', - 'ssv': ' ', - 'pipes': '|' -} From 40b566ea69314100b8b5ddabb7211c271e31dc82 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Fri, 25 Oct 2024 13:07:17 +0200 Subject: [PATCH 34/67] Add generated docs --- package.json | 4 +- .../hephaestus/intelligenceapi/ApiClient.java | 803 ++++++++++++++++++ .../hephaestus/intelligenceapi/BaseApi.java | 74 ++ .../BeanValidationException.java | 27 + .../intelligenceapi/JavaTimeFormatter.java | 64 ++ .../intelligenceapi/RFC3339DateFormat.java | 58 ++ .../intelligenceapi/ServerConfiguration.java | 59 ++ .../intelligenceapi/ServerVariable.java | 24 + .../intelligenceapi/api/DefaultApi.java | 119 +++ .../intelligenceapi/auth/ApiKeyAuth.java | 62 ++ .../intelligenceapi/auth/Authentication.java | 14 + .../intelligenceapi/auth/HttpBasicAuth.java | 38 + .../intelligenceapi/auth/HttpBearerAuth.java | 56 ++ .../intelligenceapi/model/ChatRequest.java | 104 +++ .../intelligenceapi/model/ChatResponse.java | 104 +++ .../model/HTTPValidationError.java | 116 +++ .../model/ValidationError.java | 178 ++++ .../model/ValidationErrorLocInner.java | 70 ++ 18 files changed, 1972 insertions(+), 2 deletions(-) create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BeanValidationException.java create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/Authentication.java create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java diff --git a/package.json b/package.json index 4d59587a..c6187466 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ "generate:api:specs": "npm run generate:api:application-server-specs && npm run generate:api:intelligence-service-specs", "generate:api:application-server-client": "npx openapi-generator-cli generate -i server/application-server/openapi.yaml -g typescript-angular -o webapp/src/app/core/modules/openapi --additional-properties fileNaming=kebab-case,withInterfaces=true --generate-alias-as-model", "generate:api:intelligence-service-client": "openapi-generator-cli generate -i server/intelligence-service/openapi.yaml -g java --library resttemplate --api-package de.tum.in.www1.hephaestus.intelligenceapi.api --model-package de.tum.in.www1.hephaestus.intelligenceapi.model --invoker-package de.tum.in.www1.hephaestus.intelligenceapi --additional-properties useJakartaEe=true,performBeanValidation=true,generateClientAsBean=true --package-name de.tum.in.www1.hephaestus.intelligenceapi -o tmp/java-client && shx cp -r tmp/java-client/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi server/application-server/src/main/java/de/tum/in/www1/hephaestus && rimraf tmp", - "generate:api:clients": "npm run generate:api:application-server-client && npm run generate:api:intelligence-service-client", - "generate:api": "npm run generate:api:clean && npm run generate:api:specs && npm run generate:api:clients" + "generate:api:clients": "npm run generate:api:intelligence-service-client && npm run generate:api:application-server-client", + "generate:api": "npm run generate:api:clean && npm run generate:api:intelligence-service-specs && npm run generate:api:intelligence-service-client && npm run generate:api:application-server-specs && npm run generate:api:application-server-client" }, "devDependencies": { "@openapitools/openapi-generator-cli": "2.13.5", diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java new file mode 100644 index 00000000..390ef49f --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java @@ -0,0 +1,803 @@ +package de.tum.in.www1.hephaestus.intelligenceapi; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpRequest; +import org.springframework.http.HttpStatus; +import org.springframework.http.InvalidMediaTypeException; +import org.springframework.http.MediaType; +import org.springframework.http.RequestEntity; +import org.springframework.http.RequestEntity.BodyBuilder; +import org.springframework.http.ResponseEntity; +import org.springframework.http.client.BufferingClientHttpRequestFactory; +import org.springframework.http.client.ClientHttpRequestExecution; +import org.springframework.http.client.ClientHttpRequestInterceptor; +import org.springframework.http.client.ClientHttpResponse; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.util.StringUtils; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.HttpServerErrorException; +import org.springframework.web.client.RestClientException; +import org.springframework.web.client.RestTemplate; +import org.springframework.web.util.UriComponentsBuilder; +import org.springframework.web.util.DefaultUriBuilderFactory; +import org.openapitools.jackson.nullable.JsonNullableModule; + + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.text.DateFormat; +import java.text.ParseException; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TimeZone; +import java.util.function.Supplier; +import java.time.OffsetDateTime; + +import de.tum.in.www1.hephaestus.intelligenceapi.auth.Authentication; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@Component("de.tum.in.www1.hephaestus.intelligenceapi.ApiClient") +public class ApiClient extends JavaTimeFormatter { + public enum CollectionFormat { + CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); + + private final String separator; + + private CollectionFormat(String separator) { + this.separator = separator; + } + + private String collectionToString(Collection collection) { + return StringUtils.collectionToDelimitedString(collection, separator); + } + } + + private boolean debugging = false; + + private HttpHeaders defaultHeaders = new HttpHeaders(); + private MultiValueMap defaultCookies = new LinkedMultiValueMap(); + + private int maxAttemptsForRetry = 1; + + private long waitTimeMillis = 10; + + private String basePath = "http://localhost"; + + private RestTemplate restTemplate; + + private Map authentications; + + private DateFormat dateFormat; + + public ApiClient() { + this.restTemplate = buildRestTemplate(); + init(); + } + + @Autowired + public ApiClient(RestTemplate restTemplate) { + this.restTemplate = restTemplate; + init(); + } + + protected void init() { + // Use RFC3339 format for date and datetime. + // See http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14 + this.dateFormat = new RFC3339DateFormat(); + + // Use UTC as the default time zone. + this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + + // Set default User-Agent. + setUserAgent("Java-SDK"); + + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap(); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Get the current base path + * + * @return String the base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set the base path, which should include the host + * + * @param basePath the base path + * @return ApiClient this client + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get the max attempts for retry + * + * @return int the max attempts + */ + public int getMaxAttemptsForRetry() { + return maxAttemptsForRetry; + } + + /** + * Set the max attempts for retry + * + * @param maxAttemptsForRetry the max attempts for retry + * @return ApiClient this client + */ + public ApiClient setMaxAttemptsForRetry(int maxAttemptsForRetry) { + this.maxAttemptsForRetry = maxAttemptsForRetry; + return this; + } + + /** + * Get the wait time in milliseconds + * + * @return long wait time in milliseconds + */ + public long getWaitTimeMillis() { + return waitTimeMillis; + } + + /** + * Set the wait time in milliseconds + * + * @param waitTimeMillis the wait time in milliseconds + * @return ApiClient this client + */ + public ApiClient setWaitTimeMillis(long waitTimeMillis) { + this.waitTimeMillis = waitTimeMillis; + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map the currently configured authentication types + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + + + + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent the user agent string + * @return ApiClient this client + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param name The header's name + * @param value The header's value + * @return ApiClient this client + */ + public ApiClient addDefaultHeader(String name, String value) { + if (defaultHeaders.containsKey(name)) { + defaultHeaders.remove(name); + } + defaultHeaders.add(name, value); + return this; + } + + /** + * Add a default cookie. + * + * @param name The cookie's name + * @param value The cookie's value + * @return ApiClient this client + */ + public ApiClient addDefaultCookie(String name, String value) { + if (defaultCookies.containsKey(name)) { + defaultCookies.remove(name); + } + defaultCookies.add(name, value); + return this; + } + + public void setDebugging(boolean debugging) { + List currentInterceptors = this.restTemplate.getInterceptors(); + if (debugging) { + if (currentInterceptors == null) { + currentInterceptors = new ArrayList(); + } + ClientHttpRequestInterceptor interceptor = new ApiClientHttpRequestInterceptor(); + currentInterceptors.add(interceptor); + this.restTemplate.setInterceptors(currentInterceptors); + } else { + if (currentInterceptors != null && !currentInterceptors.isEmpty()) { + Iterator iter = currentInterceptors.iterator(); + while (iter.hasNext()) { + ClientHttpRequestInterceptor interceptor = iter.next(); + if (interceptor instanceof ApiClientHttpRequestInterceptor) { + iter.remove(); + } + } + this.restTemplate.setInterceptors(currentInterceptors); + } + } + this.debugging = debugging; + } + + /** + * Check that whether debugging is enabled for this API client. + * @return boolean true if this client is enabled for debugging, false otherwise + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Get the date format used to parse/format date parameters. + * @return DateFormat format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Set the date format used to parse/format date parameters. + * @param dateFormat Date format + * @return API client + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + return this; + } + + /** + * Parse the given string into Date object. + * + * @param str the string to parse + * @return the Date parsed from the string + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + * + * @param date the date to format + * @return the formatted date as string + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Format the given parameter object into string. + * + * @param param the object to convert + * @return String the parameter represented as a String + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate( (Date) param); + } else if (param instanceof OffsetDateTime) { + return formatOffsetDateTime((OffsetDateTime) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param values The values of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { + // create the value based on the collection format + if (CollectionFormat.MULTI.equals(collectionFormat)) { + // not valid for path params + return parameterToString(values); + } + + // collectionFormat is assumed to be "csv" by default + if (collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + return collectionFormat.collectionToString(values); + } + + /** + * Converts a parameter to a {@link MultiValueMap} for use in REST requests + * + * @param collectionFormat The format to convert to + * @param name The name of the parameter + * @param value The parameter's value + * @return a Map containing the String value(s) of the input parameter + */ + public MultiValueMap parameterToMultiValueMap(CollectionFormat collectionFormat, String name, Object value) { + final MultiValueMap params = new LinkedMultiValueMap(); + + if (name == null || name.isEmpty() || value == null) { + return params; + } + + if (collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + if (value instanceof Map) { + @SuppressWarnings("unchecked") + final Map valuesMap = (Map) value; + for (final Entry entry : valuesMap.entrySet()) { + params.add(entry.getKey(), parameterToString(entry.getValue())); + } + return params; + } + + Collection valueCollection = null; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(name, parameterToString(value)); + return params; + } + + if (valueCollection.isEmpty()) { + return params; + } + + if (collectionFormat.equals(CollectionFormat.MULTI)) { + for (Object item : valueCollection) { + params.add(name, parameterToString(item)); + } + return params; + } + + List values = new ArrayList(); + for (Object o : valueCollection) { + values.add(parameterToString(o)); + } + params.add(name, collectionFormat.collectionToString(values)); + + return params; + } + + /** + * Check if the given {@code String} is a JSON MIME. + * + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(String mediaType) { + // "* / *" is default to JSON + if ("*/*".equals(mediaType)) { + return true; + } + + try { + return isJsonMime(MediaType.parseMediaType(mediaType)); + } catch (InvalidMediaTypeException e) { + } + return false; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(MediaType mediaType) { + return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*\\+json[;]?\\s*$")); + } + + /** + * Check if the given {@code String} is a Problem JSON MIME (RFC-7807). + * + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents Problem JSON, false otherwise + */ + public boolean isProblemJsonMime(String mediaType) { + return "application/problem+json".equalsIgnoreCase(mediaType); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return List The list of MediaTypes to use for the Accept header + */ + public List selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + MediaType mediaType = MediaType.parseMediaType(accept); + if (isJsonMime(mediaType) && !isProblemJsonMime(accept)) { + return Collections.singletonList(mediaType); + } + } + return MediaType.parseMediaTypes(StringUtils.arrayToCommaDelimitedString(accepts)); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return MediaType The Content-Type header to use. If the given array is empty, JSON will be used. + */ + public MediaType selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return MediaType.APPLICATION_JSON; + } + for (String contentType : contentTypes) { + MediaType mediaType = MediaType.parseMediaType(contentType); + if (isJsonMime(mediaType)) { + return mediaType; + } + } + return MediaType.parseMediaType(contentTypes[0]); + } + + /** + * Select the body to use for the request + * + * @param obj the body object + * @param formParams the form parameters + * @param contentType the content type of the request + * @return Object the selected body + */ + protected Object selectBody(Object obj, MultiValueMap formParams, MediaType contentType) { + boolean isForm = MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType) || MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(contentType); + return isForm ? formParams : obj; + } + + /** + * Expand path template with variables + * + * @param pathTemplate path template with placeholders + * @param variables variables to replace + * @return path with placeholders replaced by variables + */ + public String expandPath(String pathTemplate, Map variables) { + return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString(); + } + + /** + * Include queryParams in uriParams taking into account the paramName + * + * @param queryParams The query parameters + * @param uriParams The path parameters + * return templatized query string + */ + public String generateQueryUri(MultiValueMap queryParams, Map uriParams) { + StringBuilder queryBuilder = new StringBuilder(); + queryParams.forEach((name, values) -> { + try { + final String encodedName = URLEncoder.encode(name.toString(), "UTF-8"); + if (CollectionUtils.isEmpty(values)) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(encodedName); + } else { + int valueItemCounter = 0; + for (Object value : values) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(encodedName); + if (value != null) { + String templatizedKey = encodedName + valueItemCounter++; + uriParams.put(templatizedKey, value.toString()); + queryBuilder.append('=').append("{").append(templatizedKey).append("}"); + } + } + } + } catch (UnsupportedEncodingException e) { + + } + }); + return queryBuilder.toString(); + + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param the return type to use + * @param path The sub-path of the HTTP URL + * @param method The request method + * @param pathParams The path parameters + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @return ResponseEntity<T> The response of the chosen type + */ + public ResponseEntity invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { + updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + + Map uriParams = new HashMap<>(); + uriParams.putAll(pathParams); + + String finalUri = path; + + if (queryParams != null && !queryParams.isEmpty()) { + //Include queryParams in uriParams taking into account the paramName + String queryUri = generateQueryUri(queryParams, uriParams); + //Append to finalUri the templatized query string like "?param1={param1Value}&....... + finalUri += "?" + queryUri; + } + String expandedPath = this.expandPath(finalUri, uriParams); + final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(expandedPath); + + URI uri; + try { + uri = new URI(builder.build().toUriString()); + } catch (URISyntaxException ex) { + throw new RestClientException("Could not build URL: " + builder.toUriString(), ex); + } + + final BodyBuilder requestBuilder = RequestEntity.method(method, UriComponentsBuilder.fromHttpUrl(basePath).toUriString() + finalUri, uriParams); + if (accept != null) { + requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); + } + if (contentType != null) { + requestBuilder.contentType(contentType); + } + + addHeadersToRequest(headerParams, requestBuilder); + addHeadersToRequest(defaultHeaders, requestBuilder); + addCookiesToRequest(cookieParams, requestBuilder); + addCookiesToRequest(defaultCookies, requestBuilder); + + RequestEntity requestEntity = requestBuilder.body(selectBody(body, formParams, contentType)); + + ResponseEntity responseEntity = null; + int attempts = 0; + while (attempts < maxAttemptsForRetry) { + try { + responseEntity = restTemplate.exchange(requestEntity, returnType); + break; + } catch (HttpServerErrorException | HttpClientErrorException ex) { + if (ex instanceof HttpServerErrorException + || ((HttpClientErrorException) ex) + .getStatusCode() + .equals(HttpStatus.TOO_MANY_REQUESTS)) { + attempts++; + if (attempts < maxAttemptsForRetry) { + try { + Thread.sleep(waitTimeMillis); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + } else { + throw ex; + } + } else { + throw ex; + } + } + } + + if (responseEntity == null) { + throw new RestClientException("ResponseEntity is null"); + } + + if (responseEntity.getStatusCode().is2xxSuccessful()) { + return responseEntity; + } else { + // The error handler built into the RestTemplate should handle 400 and 500 series errors. + throw new RestClientException("API returned " + responseEntity.getStatusCode() + " and it wasn't handled by the RestTemplate error handler"); + } + } + + /** + * Add headers to the request that is being built + * @param headers The headers to add + * @param requestBuilder The current request + */ + protected void addHeadersToRequest(HttpHeaders headers, BodyBuilder requestBuilder) { + for (Entry> entry : headers.entrySet()) { + List values = entry.getValue(); + for (String value : values) { + if (value != null) { + requestBuilder.header(entry.getKey(), value); + } + } + } + } + + /** + * Add cookies to the request that is being built + * + * @param cookies The cookies to add + * @param requestBuilder The current request + */ + protected void addCookiesToRequest(MultiValueMap cookies, BodyBuilder requestBuilder) { + if (!cookies.isEmpty()) { + requestBuilder.header("Cookie", buildCookieHeader(cookies)); + } + } + + /** + * Build cookie header. Keeps a single value per cookie (as per + * RFC6265 section 5.3). + * + * @param cookies map all cookies + * @return header string for cookies. + */ + private String buildCookieHeader(MultiValueMap cookies) { + final StringBuilder cookieValue = new StringBuilder(); + String delimiter = ""; + for (final Map.Entry> entry : cookies.entrySet()) { + final String value = entry.getValue().get(entry.getValue().size() - 1); + cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), value)); + delimiter = "; "; + } + return cookieValue.toString(); + } + + /** + * Build the RestTemplate used to make HTTP requests. + * @return RestTemplate + */ + protected RestTemplate buildRestTemplate() { + RestTemplate restTemplate = new RestTemplate(); + // This allows us to read the response more than once - Necessary for debugging. + restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(restTemplate.getRequestFactory())); + + // disable default URL encoding + DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(); + uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.VALUES_ONLY); + restTemplate.setUriTemplateHandler(uriBuilderFactory); + return restTemplate; + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams The query parameters + * @param headerParams The header parameters + */ + protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RestClientException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams); + } + } + + private class ApiClientHttpRequestInterceptor implements ClientHttpRequestInterceptor { + private final Log log = LogFactory.getLog(ApiClientHttpRequestInterceptor.class); + + @Override + public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException { + logRequest(request, body); + ClientHttpResponse response = execution.execute(request, body); + logResponse(response); + return response; + } + + private void logRequest(HttpRequest request, byte[] body) throws UnsupportedEncodingException { + log.info("URI: " + request.getURI()); + log.info("HTTP Method: " + request.getMethod()); + log.info("HTTP Headers: " + headersToString(request.getHeaders())); + log.info("Request Body: " + new String(body, StandardCharsets.UTF_8)); + } + + private void logResponse(ClientHttpResponse response) throws IOException { + log.info("HTTP Status Code: " + response.getStatusCode().value()); + log.info("Status Text: " + response.getStatusText()); + log.info("HTTP Headers: " + headersToString(response.getHeaders())); + log.info("Response Body: " + bodyToString(response.getBody())); + } + + private String headersToString(HttpHeaders headers) { + if(headers == null || headers.isEmpty()) { + return ""; + } + StringBuilder builder = new StringBuilder(); + for (Entry> entry : headers.entrySet()) { + builder.append(entry.getKey()).append("=["); + for (String value : entry.getValue()) { + builder.append(value).append(","); + } + builder.setLength(builder.length() - 1); // Get rid of trailing comma + builder.append("],"); + } + builder.setLength(builder.length() - 1); // Get rid of trailing comma + return builder.toString(); + } + + private String bodyToString(InputStream body) throws IOException { + StringBuilder builder = new StringBuilder(); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(body, StandardCharsets.UTF_8)); + String line = bufferedReader.readLine(); + while (line != null) { + builder.append(line).append(System.lineSeparator()); + line = bufferedReader.readLine(); + } + bufferedReader.close(); + return builder.toString(); + } + } +} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java new file mode 100644 index 00000000..f8ad7408 --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java @@ -0,0 +1,74 @@ +package de.tum.in.www1.hephaestus.intelligenceapi; + +import org.springframework.web.client.RestClientException; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public abstract class BaseApi { + + protected ApiClient apiClient; + + public BaseApi() { + this(new ApiClient()); + } + + public BaseApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @return ResponseEntity<Void> + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity invokeAPI(String url, HttpMethod method) throws RestClientException { + return invokeAPI(url, method, null, new ParameterizedTypeReference() {}); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @return ResponseEntity<Void> + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity invokeAPI(String url, HttpMethod method, Object request) throws RestClientException { + return invokeAPI(url, method, request, new ParameterizedTypeReference() {}); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param returnType The return type. + * @return ResponseEntity in the specified type. + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity invokeAPI(String url, HttpMethod method, ParameterizedTypeReference returnType) throws RestClientException { + return invokeAPI(url, method, null, returnType); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @param returnType The return type. + * @return ResponseEntity in the specified type. + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public abstract ResponseEntity invokeAPI(String url, HttpMethod method, Object request, ParameterizedTypeReference returnType) throws RestClientException; +} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BeanValidationException.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BeanValidationException.java new file mode 100644 index 00000000..279ceb8f --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BeanValidationException.java @@ -0,0 +1,27 @@ +package de.tum.in.www1.hephaestus.intelligenceapi; + +import java.util.Set; + +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ValidationException; + +public class BeanValidationException extends ValidationException { + /** + * + */ + private static final long serialVersionUID = -5294733947409491364L; + Set> violations; + + public BeanValidationException(Set> violations) { + this.violations = violations; + } + + public Set> getViolations() { + return violations; + } + + public void setViolations(Set> violations) { + this.violations = violations; + } + +} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java new file mode 100644 index 00000000..1e919b7a --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java @@ -0,0 +1,64 @@ +/* + * Hephaestus Intelligence Service API + * API documentation for the Hephaestus Intelligence Service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package de.tum.in.www1.hephaestus.intelligenceapi; + +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; + +/** + * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. + * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class JavaTimeFormatter { + + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } + + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } + + /** + * Parse the given string into {@code OffsetDateTime} object. + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); + } + } + /** + * Format the given {@code OffsetDateTime} object into string. + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java new file mode 100644 index 00000000..498266d2 --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java @@ -0,0 +1,58 @@ +/* + * Hephaestus Intelligence Service API + * API documentation for the Hephaestus Intelligence Service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package de.tum.in.www1.hephaestus.intelligenceapi; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java new file mode 100644 index 00000000..2b80d5e1 --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java @@ -0,0 +1,59 @@ +package de.tum.in.www1.hephaestus.intelligenceapi; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java new file mode 100644 index 00000000..3f65131b --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java @@ -0,0 +1,24 @@ +package de.tum.in.www1.hephaestus.intelligenceapi; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java new file mode 100644 index 00000000..2d647737 --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java @@ -0,0 +1,119 @@ +package de.tum.in.www1.hephaestus.intelligenceapi.api; + +import de.tum.in.www1.hephaestus.intelligenceapi.ApiClient; +import de.tum.in.www1.hephaestus.intelligenceapi.BaseApi; + +import de.tum.in.www1.hephaestus.intelligenceapi.model.ChatRequest; +import de.tum.in.www1.hephaestus.intelligenceapi.model.ChatResponse; +import de.tum.in.www1.hephaestus.intelligenceapi.model.HTTPValidationError; + +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.client.RestClientException; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@Component("de.tum.in.www1.hephaestus.intelligenceapi.api.DefaultApi") +public class DefaultApi extends BaseApi { + + public DefaultApi() { + super(new ApiClient()); + } + + @Autowired + public DefaultApi(ApiClient apiClient) { + super(apiClient); + } + + /** + * Chat with LLM + * + *

200 - Successful Response + *

422 - Validation Error + * @param chatRequest (required) + * @return ChatResponse + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ChatResponse chatChatPost(ChatRequest chatRequest) throws RestClientException { + return chatChatPostWithHttpInfo(chatRequest).getBody(); + } + + /** + * Chat with LLM + * + *

200 - Successful Response + *

422 - Validation Error + * @param chatRequest (required) + * @return ResponseEntity<ChatResponse> + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity chatChatPostWithHttpInfo(ChatRequest chatRequest) throws RestClientException { + Object localVarPostBody = chatRequest; + + // verify the required parameter 'chatRequest' is set + if (chatRequest == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'chatRequest' when calling chatChatPost"); + } + + + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/chat", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); + } + + @Override + public ResponseEntity invokeAPI(String url, HttpMethod method, Object request, ParameterizedTypeReference returnType) throws RestClientException { + String localVarPath = url.replace(apiClient.getBasePath(), ""); + Object localVarPostBody = request; + + final Map uriVariables = new HashMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI(localVarPath, method, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, returnType); + } +} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java new file mode 100644 index 00000000..e4fab268 --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java @@ -0,0 +1,62 @@ +package de.tum.in.www1.hephaestus.intelligenceapi.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if (location.equals("query")) { + queryParams.add(paramName, value); + } else if (location.equals("header")) { + headerParams.add(paramName, value); + } else if (location.equals("cookie")) { + cookieParams.add(paramName, value); + } + } +} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/Authentication.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/Authentication.java new file mode 100644 index 00000000..6887e338 --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/Authentication.java @@ -0,0 +1,14 @@ +package de.tum.in.www1.hephaestus.intelligenceapi.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +public interface Authentication { + /** + * Apply authentication settings to header and / or query parameters. + * @param queryParams The query parameters for the request + * @param headerParams The header parameters for the request + * @param cookieParams The cookie parameters for the request + */ + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams); +} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java new file mode 100644 index 00000000..6c79db20 --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java @@ -0,0 +1,38 @@ +package de.tum.in.www1.hephaestus.intelligenceapi.auth; + +import java.nio.charset.StandardCharsets; +import java.util.Base64; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } +} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java new file mode 100644 index 00000000..66f366f1 --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java @@ -0,0 +1,56 @@ +package de.tum.in.www1.hephaestus.intelligenceapi.auth; + +import java.util.Optional; +import java.util.function.Supplier; +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + headerParams.add(HttpHeaders.AUTHORIZATION, (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java new file mode 100644 index 00000000..98fbeb11 --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java @@ -0,0 +1,104 @@ +/* + * Hephaestus Intelligence Service API + * API documentation for the Hephaestus Intelligence Service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package de.tum.in.www1.hephaestus.intelligenceapi.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.hibernate.validator.constraints.*; + +/** + * ChatRequest + */ +@JsonPropertyOrder({ + ChatRequest.JSON_PROPERTY_MESSAGE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class ChatRequest { + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public ChatRequest() { + } + + public ChatRequest message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChatRequest chatRequest = (ChatRequest) o; + return Objects.equals(this.message, chatRequest.message); + } + + @Override + public int hashCode() { + return Objects.hash(message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChatRequest {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java new file mode 100644 index 00000000..bc3e79a4 --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java @@ -0,0 +1,104 @@ +/* + * Hephaestus Intelligence Service API + * API documentation for the Hephaestus Intelligence Service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package de.tum.in.www1.hephaestus.intelligenceapi.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.hibernate.validator.constraints.*; + +/** + * ChatResponse + */ +@JsonPropertyOrder({ + ChatResponse.JSON_PROPERTY_RESPONSE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class ChatResponse { + public static final String JSON_PROPERTY_RESPONSE = "response"; + private String response; + + public ChatResponse() { + } + + public ChatResponse response(String response) { + + this.response = response; + return this; + } + + /** + * Get response + * @return response + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getResponse() { + return response; + } + + + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setResponse(String response) { + this.response = response; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChatResponse chatResponse = (ChatResponse) o; + return Objects.equals(this.response, chatResponse.response); + } + + @Override + public int hashCode() { + return Objects.hash(response); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChatResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java new file mode 100644 index 00000000..36050f13 --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java @@ -0,0 +1,116 @@ +/* + * Hephaestus Intelligence Service API + * API documentation for the Hephaestus Intelligence Service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package de.tum.in.www1.hephaestus.intelligenceapi.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import de.tum.in.www1.hephaestus.intelligenceapi.model.ValidationError; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.hibernate.validator.constraints.*; + +/** + * HTTPValidationError + */ +@JsonPropertyOrder({ + HTTPValidationError.JSON_PROPERTY_DETAIL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class HTTPValidationError { + public static final String JSON_PROPERTY_DETAIL = "detail"; + private List detail = new ArrayList<>(); + + public HTTPValidationError() { + } + + public HTTPValidationError detail(List detail) { + + this.detail = detail; + return this; + } + + public HTTPValidationError addDetailItem(ValidationError detailItem) { + if (this.detail == null) { + this.detail = new ArrayList<>(); + } + this.detail.add(detailItem); + return this; + } + + /** + * Get detail + * @return detail + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDetail() { + return detail; + } + + + @JsonProperty(JSON_PROPERTY_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDetail(List detail) { + this.detail = detail; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HTTPValidationError htTPValidationError = (HTTPValidationError) o; + return Objects.equals(this.detail, htTPValidationError.detail); + } + + @Override + public int hashCode() { + return Objects.hash(detail); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HTTPValidationError {\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java new file mode 100644 index 00000000..152b5a9b --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java @@ -0,0 +1,178 @@ +/* + * Hephaestus Intelligence Service API + * API documentation for the Hephaestus Intelligence Service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package de.tum.in.www1.hephaestus.intelligenceapi.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import de.tum.in.www1.hephaestus.intelligenceapi.model.ValidationErrorLocInner; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.hibernate.validator.constraints.*; + +/** + * ValidationError + */ +@JsonPropertyOrder({ + ValidationError.JSON_PROPERTY_LOC, + ValidationError.JSON_PROPERTY_MSG, + ValidationError.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class ValidationError { + public static final String JSON_PROPERTY_LOC = "loc"; + private List loc = new ArrayList<>(); + + public static final String JSON_PROPERTY_MSG = "msg"; + private String msg; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public ValidationError() { + } + + public ValidationError loc(List loc) { + + this.loc = loc; + return this; + } + + public ValidationError addLocItem(ValidationErrorLocInner locItem) { + if (this.loc == null) { + this.loc = new ArrayList<>(); + } + this.loc.add(locItem); + return this; + } + + /** + * Get loc + * @return loc + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LOC) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getLoc() { + return loc; + } + + + @JsonProperty(JSON_PROPERTY_LOC) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLoc(List loc) { + this.loc = loc; + } + + public ValidationError msg(String msg) { + + this.msg = msg; + return this; + } + + /** + * Get msg + * @return msg + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MSG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getMsg() { + return msg; + } + + + @JsonProperty(JSON_PROPERTY_MSG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMsg(String msg) { + this.msg = msg; + } + + public ValidationError type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ValidationError validationError = (ValidationError) o; + return Objects.equals(this.loc, validationError.loc) && + Objects.equals(this.msg, validationError.msg) && + Objects.equals(this.type, validationError.type); + } + + @Override + public int hashCode() { + return Objects.hash(loc, msg, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ValidationError {\n"); + sb.append(" loc: ").append(toIndentedString(loc)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java new file mode 100644 index 00000000..6ff48cf0 --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java @@ -0,0 +1,70 @@ +/* + * Hephaestus Intelligence Service API + * API documentation for the Hephaestus Intelligence Service. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package de.tum.in.www1.hephaestus.intelligenceapi.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.hibernate.validator.constraints.*; + +/** + * ValidationErrorLocInner + */ +@JsonPropertyOrder({ +}) +@JsonTypeName("ValidationError_loc_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +public class ValidationErrorLocInner { + public ValidationErrorLocInner() { + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ValidationErrorLocInner {\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + From 4693f32d0c26440563d633c83266a5dc7db096ba Mon Sep 17 00:00:00 2001 From: milenasrb Date: Fri, 25 Oct 2024 14:43:50 +0200 Subject: [PATCH 35/67] Fix maven app start error --- .../IntelligenceApiClientConfig.java | 14 ++ .../de/tum/in/www1/hephaestus/WebConfig.java | 7 + .../hephaestus/intelligenceapi/ApiClient.java | 2 +- .../hephaestus/intelligenceapi/BaseApi.java | 2 +- .../intelligenceapi/JavaTimeFormatter.java | 2 +- .../intelligenceapi/RFC3339DateFormat.java | 2 +- .../intelligenceapi/ServerConfiguration.java | 2 +- .../intelligenceapi/ServerVariable.java | 2 +- .../intelligenceapi/api/DefaultApi.java | 2 +- .../intelligenceapi/auth/ApiKeyAuth.java | 2 +- .../intelligenceapi/auth/HttpBasicAuth.java | 2 +- .../intelligenceapi/auth/HttpBearerAuth.java | 2 +- .../intelligenceapi/model/ChatRequest.java | 2 +- .../intelligenceapi/model/ChatResponse.java | 2 +- .../model/HTTPValidationError.java | 2 +- .../model/ValidationError.java | 2 +- .../model/ValidationErrorLocInner.java | 2 +- .../src/app/core/modules/openapi/.gitignore | 4 + .../modules/openapi/.openapi-generator-ignore | 23 ++ .../modules/openapi/.openapi-generator/FILES | 32 +++ .../openapi/.openapi-generator/VERSION | 1 + webapp/src/app/core/modules/openapi/README.md | 226 ++++++++++++++++++ .../app/core/modules/openapi/api.module.ts | 30 +++ .../core/modules/openapi/api/admin.service.ts | 155 ++++++++++++ .../openapi/api/admin.serviceInterface.ts | 32 +++ .../src/app/core/modules/openapi/api/api.ts | 13 + .../openapi/api/leaderboard.service.ts | 170 +++++++++++++ .../api/leaderboard.serviceInterface.ts | 35 +++ .../openapi/api/pull-request.service.ts | 224 +++++++++++++++++ .../api/pull-request.serviceInterface.ts | 41 ++++ .../core/modules/openapi/api/user.service.ts | 226 ++++++++++++++++++ .../openapi/api/user.serviceInterface.ts | 42 ++++ .../app/core/modules/openapi/configuration.ts | 166 +++++++++++++ .../src/app/core/modules/openapi/encoder.ts | 20 ++ .../src/app/core/modules/openapi/git_push.sh | 57 +++++ webapp/src/app/core/modules/openapi/index.ts | 6 + .../openapi/model/issue-comment-dto.ts | 24 ++ .../modules/openapi/model/issue-comment.ts | 24 ++ .../openapi/model/leaderboard-entry.ts | 35 +++ .../app/core/modules/openapi/model/models.ts | 13 + .../modules/openapi/model/pull-request-dto.ts | 37 +++ .../openapi/model/pull-request-label.ts | 18 ++ .../model/pull-request-review-comment.ts | 25 ++ .../openapi/model/pull-request-review-dto.ts | 31 +++ .../openapi/model/pull-request-review.ts | 37 +++ .../modules/openapi/model/pull-request.ts | 49 ++++ .../modules/openapi/model/repository-dto.ts | 20 ++ .../core/modules/openapi/model/repository.ts | 36 +++ .../core/modules/openapi/model/user-dto.ts | 25 ++ .../app/core/modules/openapi/model/user.ts | 56 +++++ webapp/src/app/core/modules/openapi/param.ts | 69 ++++++ .../src/app/core/modules/openapi/variables.ts | 9 + 52 files changed, 2047 insertions(+), 15 deletions(-) create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/IntelligenceApiClientConfig.java create mode 100644 webapp/src/app/core/modules/openapi/.gitignore create mode 100644 webapp/src/app/core/modules/openapi/.openapi-generator-ignore create mode 100644 webapp/src/app/core/modules/openapi/.openapi-generator/FILES create mode 100644 webapp/src/app/core/modules/openapi/.openapi-generator/VERSION create mode 100644 webapp/src/app/core/modules/openapi/README.md create mode 100644 webapp/src/app/core/modules/openapi/api.module.ts create mode 100644 webapp/src/app/core/modules/openapi/api/admin.service.ts create mode 100644 webapp/src/app/core/modules/openapi/api/admin.serviceInterface.ts create mode 100644 webapp/src/app/core/modules/openapi/api/api.ts create mode 100644 webapp/src/app/core/modules/openapi/api/leaderboard.service.ts create mode 100644 webapp/src/app/core/modules/openapi/api/leaderboard.serviceInterface.ts create mode 100644 webapp/src/app/core/modules/openapi/api/pull-request.service.ts create mode 100644 webapp/src/app/core/modules/openapi/api/pull-request.serviceInterface.ts create mode 100644 webapp/src/app/core/modules/openapi/api/user.service.ts create mode 100644 webapp/src/app/core/modules/openapi/api/user.serviceInterface.ts create mode 100644 webapp/src/app/core/modules/openapi/configuration.ts create mode 100644 webapp/src/app/core/modules/openapi/encoder.ts create mode 100644 webapp/src/app/core/modules/openapi/git_push.sh create mode 100644 webapp/src/app/core/modules/openapi/index.ts create mode 100644 webapp/src/app/core/modules/openapi/model/issue-comment-dto.ts create mode 100644 webapp/src/app/core/modules/openapi/model/issue-comment.ts create mode 100644 webapp/src/app/core/modules/openapi/model/leaderboard-entry.ts create mode 100644 webapp/src/app/core/modules/openapi/model/models.ts create mode 100644 webapp/src/app/core/modules/openapi/model/pull-request-dto.ts create mode 100644 webapp/src/app/core/modules/openapi/model/pull-request-label.ts create mode 100644 webapp/src/app/core/modules/openapi/model/pull-request-review-comment.ts create mode 100644 webapp/src/app/core/modules/openapi/model/pull-request-review-dto.ts create mode 100644 webapp/src/app/core/modules/openapi/model/pull-request-review.ts create mode 100644 webapp/src/app/core/modules/openapi/model/pull-request.ts create mode 100644 webapp/src/app/core/modules/openapi/model/repository-dto.ts create mode 100644 webapp/src/app/core/modules/openapi/model/repository.ts create mode 100644 webapp/src/app/core/modules/openapi/model/user-dto.ts create mode 100644 webapp/src/app/core/modules/openapi/model/user.ts create mode 100644 webapp/src/app/core/modules/openapi/param.ts create mode 100644 webapp/src/app/core/modules/openapi/variables.ts diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/IntelligenceApiClientConfig.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/IntelligenceApiClientConfig.java new file mode 100644 index 00000000..575a64ac --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/IntelligenceApiClientConfig.java @@ -0,0 +1,14 @@ +package de.tum.in.www1.hephaestus; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; + +import de.tum.in.www1.hephaestus.intelligenceapi.ApiClient; + +@Configuration +public class IntelligenceApiClientConfig { + @Autowired + public IntelligenceApiClientConfig(ApiClient apiClient) { + apiClient.setBasePath("http://localhost"); + } +} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/WebConfig.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/WebConfig.java index 6afaac48..c54247eb 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/WebConfig.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/WebConfig.java @@ -1,8 +1,10 @@ package de.tum.in.www1.hephaestus; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.format.FormatterRegistry; import org.springframework.lang.NonNull; +import org.springframework.web.client.RestTemplate; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import de.tum.in.www1.hephaestus.codereview.comment.IssueCommentConverter; @@ -24,4 +26,9 @@ public void addFormatters(@NonNull FormatterRegistry registry) { registry.addConverter(new IssueCommentConverter()); registry.addConverter(new PullRequestReviewCommentConverter()); } + + @Bean + public RestTemplate restTemplate() { + return new RestTemplate(); + } } \ No newline at end of file diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java index 390ef49f..27004f2e 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java @@ -58,7 +58,7 @@ import de.tum.in.www1.hephaestus.intelligenceapi.auth.Authentication; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") @Component("de.tum.in.www1.hephaestus.intelligenceapi.ApiClient") public class ApiClient extends JavaTimeFormatter { public enum CollectionFormat { diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java index f8ad7408..c1456c82 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java @@ -5,7 +5,7 @@ import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public abstract class BaseApi { protected ApiClient apiClient; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java index 1e919b7a..e0dfa2d1 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java @@ -20,7 +20,7 @@ * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class JavaTimeFormatter { private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java index 498266d2..9139a6dc 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java @@ -22,7 +22,7 @@ import java.util.GregorianCalendar; import java.util.TimeZone; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class RFC3339DateFormat extends DateFormat { private static final long serialVersionUID = 1L; private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java index 2b80d5e1..c93e929f 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java @@ -5,7 +5,7 @@ /** * Representing a Server configuration. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ServerConfiguration { public String URL; public String description; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java index 3f65131b..6e41015d 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java @@ -5,7 +5,7 @@ /** * Representing a Server Variable for server URL template substitution. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ServerVariable { public String description; public String defaultValue; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java index 2d647737..c66c0fc6 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java @@ -28,7 +28,7 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") @Component("de.tum.in.www1.hephaestus.intelligenceapi.api.DefaultApi") public class DefaultApi extends BaseApi { diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java index e4fab268..a62bd677 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java @@ -3,7 +3,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java index 6c79db20..2ce61084 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java @@ -6,7 +6,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class HttpBasicAuth implements Authentication { private String username; private String password; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java index 66f366f1..b4514660 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java @@ -5,7 +5,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class HttpBearerAuth implements Authentication { private final String scheme; private Supplier tokenSupplier; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java index 98fbeb11..2400e5dd 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java @@ -30,7 +30,7 @@ @JsonPropertyOrder({ ChatRequest.JSON_PROPERTY_MESSAGE }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ChatRequest { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java index bc3e79a4..6932898f 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java @@ -30,7 +30,7 @@ @JsonPropertyOrder({ ChatResponse.JSON_PROPERTY_RESPONSE }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ChatResponse { public static final String JSON_PROPERTY_RESPONSE = "response"; private String response; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java index 36050f13..dae309b1 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java @@ -34,7 +34,7 @@ @JsonPropertyOrder({ HTTPValidationError.JSON_PROPERTY_DETAIL }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class HTTPValidationError { public static final String JSON_PROPERTY_DETAIL = "detail"; private List detail = new ArrayList<>(); diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java index 152b5a9b..71aa404a 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java @@ -36,7 +36,7 @@ ValidationError.JSON_PROPERTY_MSG, ValidationError.JSON_PROPERTY_TYPE }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ValidationError { public static final String JSON_PROPERTY_LOC = "loc"; private List loc = new ArrayList<>(); diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java index 6ff48cf0..778cf6ae 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java @@ -26,7 +26,7 @@ @JsonPropertyOrder({ }) @JsonTypeName("ValidationError_loc_inner") -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:05:04.950342+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ValidationErrorLocInner { public ValidationErrorLocInner() { } diff --git a/webapp/src/app/core/modules/openapi/.gitignore b/webapp/src/app/core/modules/openapi/.gitignore new file mode 100644 index 00000000..149b5765 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/webapp/src/app/core/modules/openapi/.openapi-generator-ignore b/webapp/src/app/core/modules/openapi/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/webapp/src/app/core/modules/openapi/.openapi-generator/FILES b/webapp/src/app/core/modules/openapi/.openapi-generator/FILES new file mode 100644 index 00000000..f61052d2 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/.openapi-generator/FILES @@ -0,0 +1,32 @@ +.gitignore +README.md +api.module.ts +api/admin.service.ts +api/admin.serviceInterface.ts +api/api.ts +api/leaderboard.service.ts +api/leaderboard.serviceInterface.ts +api/pull-request.service.ts +api/pull-request.serviceInterface.ts +api/user.service.ts +api/user.serviceInterface.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/issue-comment-dto.ts +model/issue-comment.ts +model/leaderboard-entry.ts +model/models.ts +model/pull-request-dto.ts +model/pull-request-label.ts +model/pull-request-review-comment.ts +model/pull-request-review-dto.ts +model/pull-request-review.ts +model/pull-request.ts +model/repository-dto.ts +model/repository.ts +model/user-dto.ts +model/user.ts +param.ts +variables.ts diff --git a/webapp/src/app/core/modules/openapi/.openapi-generator/VERSION b/webapp/src/app/core/modules/openapi/.openapi-generator/VERSION new file mode 100644 index 00000000..1985849f --- /dev/null +++ b/webapp/src/app/core/modules/openapi/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.7.0 diff --git a/webapp/src/app/core/modules/openapi/README.md b/webapp/src/app/core/modules/openapi/README.md new file mode 100644 index 00000000..de16f95a --- /dev/null +++ b/webapp/src/app/core/modules/openapi/README.md @@ -0,0 +1,226 @@ +## @ + +### Building + +To install the required dependencies and to build the typescript sources run: +``` +npm install +npm run build +``` + +### publishing + +First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) + +### consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +``` +npm install @ --save +``` + +_without publishing (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save +``` + +_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: +``` +npm link +``` + +In your project: +``` +npm link +``` + +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround. +Published packages are not effected by this issue. + + +#### General usage + +In your Angular project: + + +``` +// without configuring providers +import { ApiModule } from ''; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from ''; + +export function apiConfigFactory (): Configuration { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@NgModule({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers with an authentication service that manages your access tokens +import { ApiModule, Configuration } from ''; + +@NgModule({ + imports: [ ApiModule ], + declarations: [ AppComponent ], + providers: [ + { + provide: Configuration, + useFactory: (authService: AuthService) => new Configuration( + { + basePath: environment.apiUrl, + accessToken: authService.getAccessToken.bind(authService) + } + ), + deps: [AuthService], + multi: false + } + ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +import { DefaultApi } from ''; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule is restricted to being instantiated once app wide. +This is to ensure that all services are treated as singletons. + +#### Using multiple OpenAPI files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from ''; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from ''; + +@NgModule({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + + +#### Using @angular/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: +``` +import { BASE_PATH } from ''; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], + bootstrap: [ AppComponent ] +}) +export class AppModule { } +``` + +### Customizing path parameter encoding + +Without further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple' +and Dates for format 'date-time' are encoded correctly. + +Other styles (e.g. "matrix") are not that easy to encode +and thus are best delegated to other libraries (e.g.: [@honoluluhenk/http-param-expander]). + +To implement your own parameter encoding (or call another library), +pass an arrow-function or method-reference to the `encodeParam` property of the Configuration-object +(see [General Usage](#general-usage) above). + +Example value for use in your Configuration-Provider: +```typescript +new Configuration({ + encodeParam: (param: Param) => myFancyParamEncoder(param), +}) +``` + +[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations +[style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values +[@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander diff --git a/webapp/src/app/core/modules/openapi/api.module.ts b/webapp/src/app/core/modules/openapi/api.module.ts new file mode 100644 index 00000000..58d341fb --- /dev/null +++ b/webapp/src/app/core/modules/openapi/api.module.ts @@ -0,0 +1,30 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/webapp/src/app/core/modules/openapi/api/admin.service.ts b/webapp/src/app/core/modules/openapi/api/admin.service.ts new file mode 100644 index 00000000..6ba0eceb --- /dev/null +++ b/webapp/src/app/core/modules/openapi/api/admin.service.ts @@ -0,0 +1,155 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { + AdminServiceInterface +} from './admin.serviceInterface'; + + + +@Injectable({ + providedIn: 'root' +}) +export class AdminService implements AdminServiceInterface { + + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public admin(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public admin(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public admin(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public admin(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/admin`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + +} diff --git a/webapp/src/app/core/modules/openapi/api/admin.serviceInterface.ts b/webapp/src/app/core/modules/openapi/api/admin.serviceInterface.ts new file mode 100644 index 00000000..1dcc07cd --- /dev/null +++ b/webapp/src/app/core/modules/openapi/api/admin.serviceInterface.ts @@ -0,0 +1,32 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { HttpHeaders } from '@angular/common/http'; + +import { Observable } from 'rxjs'; + + + +import { Configuration } from '../configuration'; + + + +export interface AdminServiceInterface { + defaultHeaders: HttpHeaders; + configuration: Configuration; + + /** + * + * + */ + admin(extraHttpRequestParams?: any): Observable; + +} diff --git a/webapp/src/app/core/modules/openapi/api/api.ts b/webapp/src/app/core/modules/openapi/api/api.ts new file mode 100644 index 00000000..30528fda --- /dev/null +++ b/webapp/src/app/core/modules/openapi/api/api.ts @@ -0,0 +1,13 @@ +export * from './admin.service'; +import { AdminService } from './admin.service'; +export * from './admin.serviceInterface'; +export * from './leaderboard.service'; +import { LeaderboardService } from './leaderboard.service'; +export * from './leaderboard.serviceInterface'; +export * from './pull-request.service'; +import { PullRequestService } from './pull-request.service'; +export * from './pull-request.serviceInterface'; +export * from './user.service'; +import { UserService } from './user.service'; +export * from './user.serviceInterface'; +export const APIS = [AdminService, LeaderboardService, PullRequestService, UserService]; diff --git a/webapp/src/app/core/modules/openapi/api/leaderboard.service.ts b/webapp/src/app/core/modules/openapi/api/leaderboard.service.ts new file mode 100644 index 00000000..34a2c7cd --- /dev/null +++ b/webapp/src/app/core/modules/openapi/api/leaderboard.service.ts @@ -0,0 +1,170 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { LeaderboardEntry } from '../model/leaderboard-entry'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { + LeaderboardServiceInterface +} from './leaderboard.serviceInterface'; + + + +@Injectable({ + providedIn: 'root' +}) +export class LeaderboardService implements LeaderboardServiceInterface { + + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * @param after + * @param before + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getLeaderboard(after?: string, before?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getLeaderboard(after?: string, before?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getLeaderboard(after?: string, before?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getLeaderboard(after?: string, before?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (after !== undefined && after !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + after, 'after'); + } + if (before !== undefined && before !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + before, 'before'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/leaderboard`; + return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + +} diff --git a/webapp/src/app/core/modules/openapi/api/leaderboard.serviceInterface.ts b/webapp/src/app/core/modules/openapi/api/leaderboard.serviceInterface.ts new file mode 100644 index 00000000..19a131c7 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/api/leaderboard.serviceInterface.ts @@ -0,0 +1,35 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { HttpHeaders } from '@angular/common/http'; + +import { Observable } from 'rxjs'; + +import { LeaderboardEntry } from '../model/models'; + + +import { Configuration } from '../configuration'; + + + +export interface LeaderboardServiceInterface { + defaultHeaders: HttpHeaders; + configuration: Configuration; + + /** + * + * + * @param after + * @param before + */ + getLeaderboard(after?: string, before?: string, extraHttpRequestParams?: any): Observable>; + +} diff --git a/webapp/src/app/core/modules/openapi/api/pull-request.service.ts b/webapp/src/app/core/modules/openapi/api/pull-request.service.ts new file mode 100644 index 00000000..5511e994 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/api/pull-request.service.ts @@ -0,0 +1,224 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { PullRequest } from '../model/pull-request'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { + PullRequestServiceInterface +} from './pull-request.serviceInterface'; + + + +@Injectable({ + providedIn: 'root' +}) +export class PullRequestService implements PullRequestServiceInterface { + + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPullRequest(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getPullRequest(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPullRequest(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPullRequest(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getPullRequest.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pullrequest/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * @param login + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPullRequestsByAuthor(login: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPullRequestsByAuthor(login: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getPullRequestsByAuthor(login: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getPullRequestsByAuthor(login: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (login === null || login === undefined) { + throw new Error('Required parameter login was null or undefined when calling getPullRequestsByAuthor.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pullrequest/author/${this.configuration.encodeParam({name: "login", value: login, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + +} diff --git a/webapp/src/app/core/modules/openapi/api/pull-request.serviceInterface.ts b/webapp/src/app/core/modules/openapi/api/pull-request.serviceInterface.ts new file mode 100644 index 00000000..66d5615b --- /dev/null +++ b/webapp/src/app/core/modules/openapi/api/pull-request.serviceInterface.ts @@ -0,0 +1,41 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { HttpHeaders } from '@angular/common/http'; + +import { Observable } from 'rxjs'; + +import { PullRequest } from '../model/models'; + + +import { Configuration } from '../configuration'; + + + +export interface PullRequestServiceInterface { + defaultHeaders: HttpHeaders; + configuration: Configuration; + + /** + * + * + * @param id + */ + getPullRequest(id: number, extraHttpRequestParams?: any): Observable; + + /** + * + * + * @param login + */ + getPullRequestsByAuthor(login: string, extraHttpRequestParams?: any): Observable>; + +} diff --git a/webapp/src/app/core/modules/openapi/api/user.service.ts b/webapp/src/app/core/modules/openapi/api/user.service.ts new file mode 100644 index 00000000..2e8ba927 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/api/user.service.ts @@ -0,0 +1,226 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { User } from '../model/user'; +// @ts-ignore +import { UserDTO } from '../model/user-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { + UserServiceInterface +} from './user.serviceInterface'; + + + +@Injectable({ + providedIn: 'root' +}) +export class UserService implements UserServiceInterface { + + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * @param login + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getFullUser(login: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getFullUser(login: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getFullUser(login: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getFullUser(login: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (login === null || login === undefined) { + throw new Error('Required parameter login was null or undefined when calling getFullUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/${this.configuration.encodeParam({name: "login", value: login, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/full`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * @param login + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getUser(login: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getUser(login: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getUser(login: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getUser(login: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (login === null || login === undefined) { + throw new Error('Required parameter login was null or undefined when calling getUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/${this.configuration.encodeParam({name: "login", value: login, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + +} diff --git a/webapp/src/app/core/modules/openapi/api/user.serviceInterface.ts b/webapp/src/app/core/modules/openapi/api/user.serviceInterface.ts new file mode 100644 index 00000000..65217329 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/api/user.serviceInterface.ts @@ -0,0 +1,42 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { HttpHeaders } from '@angular/common/http'; + +import { Observable } from 'rxjs'; + +import { User } from '../model/models'; +import { UserDTO } from '../model/models'; + + +import { Configuration } from '../configuration'; + + + +export interface UserServiceInterface { + defaultHeaders: HttpHeaders; + configuration: Configuration; + + /** + * + * + * @param login + */ + getFullUser(login: string, extraHttpRequestParams?: any): Observable; + + /** + * + * + * @param login + */ + getUser(login: string, extraHttpRequestParams?: any): Observable; + +} diff --git a/webapp/src/app/core/modules/openapi/configuration.ts b/webapp/src/app/core/modules/openapi/configuration.ts new file mode 100644 index 00000000..526b454f --- /dev/null +++ b/webapp/src/app/core/modules/openapi/configuration.ts @@ -0,0 +1,166 @@ +import { HttpParameterCodec } from '@angular/common/http'; +import { Param } from './param'; + +export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Override the default method for encoding path parameters in various + * styles. + *

+ * See {@link README.md} for more details + *

+ */ + encodeParam?: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; +} + +export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Encoding of various path parameter + * styles. + *

+ * See {@link README.md} for more details + *

+ */ + encodeParam: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + this.encoder = configurationParameters.encoder; + if (configurationParameters.encodeParam) { + this.encodeParam = configurationParameters.encodeParam; + } + else { + this.encodeParam = param => this.defaultEncodeParam(param); + } + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } + + private defaultEncodeParam(param: Param): string { + // This implementation exists as fallback for missing configuration + // and for backwards compatibility to older typescript-angular generator versions. + // It only works for the 'simple' parameter style. + // Date-handling only works for the 'date-time' format. + // All other styles and Date-formats are probably handled incorrectly. + // + // But: if that's all you need (i.e.: the most common use-case): no need for customization! + + const value = param.dataFormat === 'date-time' && param.value instanceof Date + ? (param.value as Date).toISOString() + : param.value; + + return encodeURIComponent(String(value)); + } +} diff --git a/webapp/src/app/core/modules/openapi/encoder.ts b/webapp/src/app/core/modules/openapi/encoder.ts new file mode 100644 index 00000000..138c4d5c --- /dev/null +++ b/webapp/src/app/core/modules/openapi/encoder.ts @@ -0,0 +1,20 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ +export class CustomHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } +} diff --git a/webapp/src/app/core/modules/openapi/git_push.sh b/webapp/src/app/core/modules/openapi/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/webapp/src/app/core/modules/openapi/index.ts b/webapp/src/app/core/modules/openapi/index.ts new file mode 100644 index 00000000..104dd3d2 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/index.ts @@ -0,0 +1,6 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; +export * from './param'; diff --git a/webapp/src/app/core/modules/openapi/model/issue-comment-dto.ts b/webapp/src/app/core/modules/openapi/model/issue-comment-dto.ts new file mode 100644 index 00000000..b1f01fb9 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/model/issue-comment-dto.ts @@ -0,0 +1,24 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { PullRequestDTO } from './pull-request-dto'; +import { UserDTO } from './user-dto'; + + +export interface IssueCommentDTO { + id?: number; + body?: string; + createdAt?: string; + updatedAt?: string; + author?: UserDTO; + pullRequest?: PullRequestDTO; +} + diff --git a/webapp/src/app/core/modules/openapi/model/issue-comment.ts b/webapp/src/app/core/modules/openapi/model/issue-comment.ts new file mode 100644 index 00000000..2bdafa3b --- /dev/null +++ b/webapp/src/app/core/modules/openapi/model/issue-comment.ts @@ -0,0 +1,24 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { User } from './user'; +import { PullRequest } from './pull-request'; + + +export interface IssueComment { + id?: number; + createdAt?: string; + updatedAt?: string; + body?: string; + author?: User; + pullRequest?: PullRequest; +} + diff --git a/webapp/src/app/core/modules/openapi/model/leaderboard-entry.ts b/webapp/src/app/core/modules/openapi/model/leaderboard-entry.ts new file mode 100644 index 00000000..e65a9c77 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/model/leaderboard-entry.ts @@ -0,0 +1,35 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { PullRequestReviewDTO } from './pull-request-review-dto'; + + +export interface LeaderboardEntry { + githubName?: string; + avatarUrl?: string; + name?: string; + type?: LeaderboardEntry.TypeEnum; + score?: number; + rank?: number; + numberOfReviewedPRs?: number; + changesRequested?: Array; + approvals?: Array; + comments?: Array; +} +export namespace LeaderboardEntry { + export type TypeEnum = 'USER' | 'BOT'; + export const TypeEnum = { + User: 'USER' as TypeEnum, + Bot: 'BOT' as TypeEnum + }; +} + + diff --git a/webapp/src/app/core/modules/openapi/model/models.ts b/webapp/src/app/core/modules/openapi/model/models.ts new file mode 100644 index 00000000..ae9140b7 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/model/models.ts @@ -0,0 +1,13 @@ +export * from './issue-comment'; +export * from './issue-comment-dto'; +export * from './leaderboard-entry'; +export * from './pull-request'; +export * from './pull-request-dto'; +export * from './pull-request-label'; +export * from './pull-request-review'; +export * from './pull-request-review-comment'; +export * from './pull-request-review-dto'; +export * from './repository'; +export * from './repository-dto'; +export * from './user'; +export * from './user-dto'; diff --git a/webapp/src/app/core/modules/openapi/model/pull-request-dto.ts b/webapp/src/app/core/modules/openapi/model/pull-request-dto.ts new file mode 100644 index 00000000..4a1064f1 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/model/pull-request-dto.ts @@ -0,0 +1,37 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { UserDTO } from './user-dto'; +import { IssueCommentDTO } from './issue-comment-dto'; +import { RepositoryDTO } from './repository-dto'; + + +export interface PullRequestDTO { + id?: number; + title?: string; + url?: string; + state?: PullRequestDTO.StateEnum; + createdAt?: string; + updatedAt?: string; + mergedAt?: string; + author?: UserDTO; + comments?: Set; + repository?: RepositoryDTO; +} +export namespace PullRequestDTO { + export type StateEnum = 'CLOSED' | 'OPEN'; + export const StateEnum = { + Closed: 'CLOSED' as StateEnum, + Open: 'OPEN' as StateEnum + }; +} + + diff --git a/webapp/src/app/core/modules/openapi/model/pull-request-label.ts b/webapp/src/app/core/modules/openapi/model/pull-request-label.ts new file mode 100644 index 00000000..9e0750c2 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/model/pull-request-label.ts @@ -0,0 +1,18 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface PullRequestLabel { + name?: string; + color?: string; +} + diff --git a/webapp/src/app/core/modules/openapi/model/pull-request-review-comment.ts b/webapp/src/app/core/modules/openapi/model/pull-request-review-comment.ts new file mode 100644 index 00000000..1781825d --- /dev/null +++ b/webapp/src/app/core/modules/openapi/model/pull-request-review-comment.ts @@ -0,0 +1,25 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { PullRequestReview } from './pull-request-review'; +import { User } from './user'; + + +export interface PullRequestReviewComment { + id?: number; + createdAt?: string; + updatedAt?: string; + body?: string; + author?: User; + review?: PullRequestReview; + commit: string; +} + diff --git a/webapp/src/app/core/modules/openapi/model/pull-request-review-dto.ts b/webapp/src/app/core/modules/openapi/model/pull-request-review-dto.ts new file mode 100644 index 00000000..b4947f88 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/model/pull-request-review-dto.ts @@ -0,0 +1,31 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface PullRequestReviewDTO { + id?: number; + createdAt?: string; + updatedAt?: string; + submittedAt?: string; + state?: PullRequestReviewDTO.StateEnum; +} +export namespace PullRequestReviewDTO { + export type StateEnum = 'COMMENTED' | 'APPROVED' | 'CHANGES_REQUESTED' | 'DISMISSED'; + export const StateEnum = { + Commented: 'COMMENTED' as StateEnum, + Approved: 'APPROVED' as StateEnum, + ChangesRequested: 'CHANGES_REQUESTED' as StateEnum, + Dismissed: 'DISMISSED' as StateEnum + }; +} + + diff --git a/webapp/src/app/core/modules/openapi/model/pull-request-review.ts b/webapp/src/app/core/modules/openapi/model/pull-request-review.ts new file mode 100644 index 00000000..52c37e3b --- /dev/null +++ b/webapp/src/app/core/modules/openapi/model/pull-request-review.ts @@ -0,0 +1,37 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { PullRequestReviewComment } from './pull-request-review-comment'; +import { User } from './user'; +import { PullRequest } from './pull-request'; + + +export interface PullRequestReview { + id?: number; + createdAt?: string; + updatedAt?: string; + author?: User; + state: PullRequestReview.StateEnum; + submittedAt?: string; + comments?: Set; + pullRequest?: PullRequest; +} +export namespace PullRequestReview { + export type StateEnum = 'COMMENTED' | 'APPROVED' | 'CHANGES_REQUESTED' | 'DISMISSED'; + export const StateEnum = { + Commented: 'COMMENTED' as StateEnum, + Approved: 'APPROVED' as StateEnum, + ChangesRequested: 'CHANGES_REQUESTED' as StateEnum, + Dismissed: 'DISMISSED' as StateEnum + }; +} + + diff --git a/webapp/src/app/core/modules/openapi/model/pull-request.ts b/webapp/src/app/core/modules/openapi/model/pull-request.ts new file mode 100644 index 00000000..98c19061 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/model/pull-request.ts @@ -0,0 +1,49 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Repository } from './repository'; +import { PullRequestLabel } from './pull-request-label'; +import { PullRequestReview } from './pull-request-review'; +import { User } from './user'; +import { IssueComment } from './issue-comment'; + + +export interface PullRequest { + id?: number; + createdAt?: string; + updatedAt?: string; + number?: number; + title: string; + url: string; + /** + * State of the PullRequest. Does not include the state of the merge. + */ + state: PullRequest.StateEnum; + additions?: number; + deletions?: number; + commits?: number; + changedFiles?: number; + mergedAt?: string; + author?: User; + comments?: Set; + reviews?: Set; + repository?: Repository; + pullRequestLabels?: Set; +} +export namespace PullRequest { + export type StateEnum = 'CLOSED' | 'OPEN'; + export const StateEnum = { + Closed: 'CLOSED' as StateEnum, + Open: 'OPEN' as StateEnum + }; +} + + diff --git a/webapp/src/app/core/modules/openapi/model/repository-dto.ts b/webapp/src/app/core/modules/openapi/model/repository-dto.ts new file mode 100644 index 00000000..bb31547f --- /dev/null +++ b/webapp/src/app/core/modules/openapi/model/repository-dto.ts @@ -0,0 +1,20 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface RepositoryDTO { + name?: string; + nameWithOwner?: string; + description?: string; + url?: string; +} + diff --git a/webapp/src/app/core/modules/openapi/model/repository.ts b/webapp/src/app/core/modules/openapi/model/repository.ts new file mode 100644 index 00000000..3c7f9428 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/model/repository.ts @@ -0,0 +1,36 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { PullRequest } from './pull-request'; + + +export interface Repository { + id?: number; + createdAt?: string; + updatedAt?: string; + name: string; + nameWithOwner: string; + description?: string; + defaultBranch: string; + visibility: Repository.VisibilityEnum; + url: string; + homepage?: string; + pullRequests?: Set; +} +export namespace Repository { + export type VisibilityEnum = 'PUBLIC' | 'PRIVATE'; + export const VisibilityEnum = { + Public: 'PUBLIC' as VisibilityEnum, + Private: 'PRIVATE' as VisibilityEnum + }; +} + + diff --git a/webapp/src/app/core/modules/openapi/model/user-dto.ts b/webapp/src/app/core/modules/openapi/model/user-dto.ts new file mode 100644 index 00000000..aaaae01b --- /dev/null +++ b/webapp/src/app/core/modules/openapi/model/user-dto.ts @@ -0,0 +1,25 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { PullRequestDTO } from './pull-request-dto'; +import { IssueCommentDTO } from './issue-comment-dto'; + + +export interface UserDTO { + id?: number; + login?: string; + email?: string; + name?: string; + url?: string; + pullRequests?: Set; + comments?: Set; +} + diff --git a/webapp/src/app/core/modules/openapi/model/user.ts b/webapp/src/app/core/modules/openapi/model/user.ts new file mode 100644 index 00000000..8e8311bd --- /dev/null +++ b/webapp/src/app/core/modules/openapi/model/user.ts @@ -0,0 +1,56 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { PullRequestReviewComment } from './pull-request-review-comment'; +import { PullRequestReview } from './pull-request-review'; +import { PullRequest } from './pull-request'; +import { IssueComment } from './issue-comment'; + + +export interface User { + id?: number; + createdAt?: string; + updatedAt?: string; + /** + * Unique login identifier for a user. + */ + login: string; + email?: string; + /** + * Display name of the user. + */ + name?: string; + /** + * Unique URL to the user\'s profile. Not the website a user can set in their profile. + */ + url: string; + /** + * URL to the user\'s avatar. If unavailable, a fallback can be generated from the login, e.g. on Github: https://github.com/{login}.png + */ + avatarUrl?: string; + /** + * Type of the user. Used to distinguish between users and bots. + */ + type: User.TypeEnum; + pullRequests?: Set; + issueComments?: Set; + reviewComments?: Set; + reviews?: Set; +} +export namespace User { + export type TypeEnum = 'USER' | 'BOT'; + export const TypeEnum = { + User: 'USER' as TypeEnum, + Bot: 'BOT' as TypeEnum + }; +} + + diff --git a/webapp/src/app/core/modules/openapi/param.ts b/webapp/src/app/core/modules/openapi/param.ts new file mode 100644 index 00000000..78a2d20a --- /dev/null +++ b/webapp/src/app/core/modules/openapi/param.ts @@ -0,0 +1,69 @@ +/** + * Standard parameter styles defined by OpenAPI spec + */ +export type StandardParamStyle = + | 'matrix' + | 'label' + | 'form' + | 'simple' + | 'spaceDelimited' + | 'pipeDelimited' + | 'deepObject' + ; + +/** + * The OpenAPI standard {@link StandardParamStyle}s may be extended by custom styles by the user. + */ +export type ParamStyle = StandardParamStyle | string; + +/** + * Standard parameter locations defined by OpenAPI spec + */ +export type ParamLocation = 'query' | 'header' | 'path' | 'cookie'; + +/** + * Standard types as defined in OpenAPI Specification: Data Types + */ +export type StandardDataType = + | "integer" + | "number" + | "boolean" + | "string" + | "object" + | "array" + ; + +/** + * Standard {@link DataType}s plus your own types/classes. + */ +export type DataType = StandardDataType | string; + +/** + * Standard formats as defined in OpenAPI Specification: Data Types + */ +export type StandardDataFormat = + | "int32" + | "int64" + | "float" + | "double" + | "byte" + | "binary" + | "date" + | "date-time" + | "password" + ; + +export type DataFormat = StandardDataFormat | string; + +/** + * The parameter to encode. + */ +export interface Param { + name: string; + value: unknown; + in: ParamLocation; + style: ParamStyle, + explode: boolean; + dataType: DataType; + dataFormat: DataFormat | undefined; +} diff --git a/webapp/src/app/core/modules/openapi/variables.ts b/webapp/src/app/core/modules/openapi/variables.ts new file mode 100644 index 00000000..6fe58549 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} From 475cd0143a63c894028f5ab26c0ec22c7faa4b44 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Fri, 25 Oct 2024 19:31:55 +0200 Subject: [PATCH 36/67] Add generate all --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index c6187466..8fe3a896 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "generate:api:application-server-client": "npx openapi-generator-cli generate -i server/application-server/openapi.yaml -g typescript-angular -o webapp/src/app/core/modules/openapi --additional-properties fileNaming=kebab-case,withInterfaces=true --generate-alias-as-model", "generate:api:intelligence-service-client": "openapi-generator-cli generate -i server/intelligence-service/openapi.yaml -g java --library resttemplate --api-package de.tum.in.www1.hephaestus.intelligenceapi.api --model-package de.tum.in.www1.hephaestus.intelligenceapi.model --invoker-package de.tum.in.www1.hephaestus.intelligenceapi --additional-properties useJakartaEe=true,performBeanValidation=true,generateClientAsBean=true --package-name de.tum.in.www1.hephaestus.intelligenceapi -o tmp/java-client && shx cp -r tmp/java-client/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi server/application-server/src/main/java/de/tum/in/www1/hephaestus && rimraf tmp", "generate:api:clients": "npm run generate:api:intelligence-service-client && npm run generate:api:application-server-client", - "generate:api": "npm run generate:api:clean && npm run generate:api:intelligence-service-specs && npm run generate:api:intelligence-service-client && npm run generate:api:application-server-specs && npm run generate:api:application-server-client" + "generate:api": "npm run generate:api:application-server-specs && npm run generate:api:clean && npm run generate:api:application-server-client", + "generate:api:all": "npm run generate:api:clean && npm run generate:api:intelligence-service-specs && npm run generate:api:intelligence-service-client && npm run generate:api:application-server-specs && npm run generate:api:application-server-client" }, "devDependencies": { "@openapitools/openapi-generator-cli": "2.13.5", From ebf90c2db3436b50f7104e6e542be861df2067ae Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 29 Oct 2024 19:32:19 +0100 Subject: [PATCH 37/67] Merge develop --- .gitignore | 2 + server/application-server/pom.xml | 388 +++++++++--------- .../modules/openapi/.openapi-generator/FILES | 1 + 3 files changed, 202 insertions(+), 189 deletions(-) diff --git a/.gitignore b/.gitignore index 8e241bf8..20602f4f 100644 --- a/.gitignore +++ b/.gitignore @@ -168,5 +168,7 @@ node_modules/ application-local.yml +server/application-server/postgres-data/ + # Java-Client creation temporary tmp \ No newline at end of file diff --git a/server/application-server/pom.xml b/server/application-server/pom.xml index 9f7f71ef..0780ab9d 100644 --- a/server/application-server/pom.xml +++ b/server/application-server/pom.xml @@ -1,118 +1,125 @@ - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 3.3.3 - - - - de.tum.in.www1 - hephaestus - 0.0.1-SNAPSHOT - Hephaestus - AI-driven learning for better software development - - - - - - - - - - - - - - - 21 - local,dev - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-data-jpa - - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.3.3 + + + + de.tum.in.www1 + hephaestus + 0.0.1-SNAPSHOT + Hephaestus + AI-driven learning for better software development + + + + + + + + + + + + + + + 21 + local,dev + + + + jitpack.io + https://jitpack.io + + + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-data-jpa + + org.springframework.boot spring-boot-starter-oauth2-client - - org.springframework.boot - spring-boot-starter-oauth2-resource-server - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-web - - - org.springdoc - springdoc-openapi-starter-webmvc-ui - 2.6.0 - - - org.liquibase - liquibase-core - - - org.springframework.boot - spring-boot-starter-logging - - - org.springframework.boot - spring-boot-devtools - runtime - true - - - org.springframework.boot - spring-boot-docker-compose - runtime - true - - - org.postgresql - postgresql - runtime - - - org.projectlombok - lombok - true - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.security - spring-security-test - test - - - io.zonky.test - embedded-database-spring-test - 2.5.1 - test - - - com.github.therapi - therapi-runtime-javadoc - 0.15.0 - - + + org.springframework.boot + spring-boot-starter-oauth2-resource-server + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-web + + + org.springdoc + springdoc-openapi-starter-webmvc-ui + 2.6.0 + + + org.liquibase + liquibase-core + + + org.springframework.boot + spring-boot-starter-logging + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + org.springframework.boot + spring-boot-docker-compose + runtime + true + + + org.postgresql + postgresql + runtime + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.security + spring-security-test + test + + + io.zonky.test + embedded-database-spring-test + 2.5.1 + test + + + com.github.therapi + therapi-runtime-javadoc + 0.15.0 + + org.springframework.modulith spring-modulith-starter-core @@ -121,17 +128,22 @@ spring-modulith-starter-test test - - org.kohsuke - github-api - 1.324 - - - io.hypersistence - hypersistence-utils-hibernate-63 - 3.8.2 - - + + com.github.FelixTJDietrich + github-api + 2.0.5 + + + io.hypersistence + hypersistence-utils-hibernate-63 + 3.8.2 + + + io.nats + jnats + 2.20.2 + + org.openapitools openapi-generator-maven-plugin 6.6.0 @@ -179,9 +191,8 @@ org.hibernate.validator hibernate-validator - - - + + org.springframework.modulith @@ -192,69 +203,68 @@ - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - com.github.therapi - therapi-runtime-javadoc-scribe - 0.15.0 - - - org.projectlombok - lombok - ${lombok.version} - - - - - - org.springframework.boot - spring-boot-maven-plugin - - ${app.profiles} - -Dspring.application.admin.enabled=true - - - org.projectlombok - lombok - - - 500 - 100 - - - - - start - stop - - - - - - org.springdoc - springdoc-openapi-maven-plugin - 1.4 - - - integration-test - - generate - - - - - http://localhost:8080/v3/api-docs.yaml - openapi.yaml - . - - - - + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + com.github.therapi + therapi-runtime-javadoc-scribe + 0.15.0 + + + org.projectlombok + lombok + ${lombok.version} + + + + + + org.springframework.boot + spring-boot-maven-plugin + + ${app.profiles} + -Dspring.application.admin.enabled=true + + + org.projectlombok + lombok + + + 1000 + 100 + + + + + start + stop + + + + + + org.springdoc + springdoc-openapi-maven-plugin + 1.4 + + + integration-test + + generate + + + + + http://localhost:8080/v3/api-docs.yaml + openapi.yaml + . + + + + \ No newline at end of file diff --git a/webapp/src/app/core/modules/openapi/.openapi-generator/FILES b/webapp/src/app/core/modules/openapi/.openapi-generator/FILES index a47f80f5..ef18ebb1 100644 --- a/webapp/src/app/core/modules/openapi/.openapi-generator/FILES +++ b/webapp/src/app/core/modules/openapi/.openapi-generator/FILES @@ -1,4 +1,5 @@ .gitignore +.openapi-generator-ignore README.md api.module.ts api/admin.service.ts From ddd12bebc5ecff419b191b4cd87c709f8df82db5 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 29 Oct 2024 19:33:05 +0100 Subject: [PATCH 38/67] Restructure and fix bugs --- package.json | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8fe3a896..0fe2b9ad 100644 --- a/package.json +++ b/package.json @@ -7,14 +7,19 @@ "generate:api:application-server:clean": "rimraf webapp/src/app/core/modules/openapi", "generate:api:intelligence-service:clean": "rimraf server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi", "generate:api:clean": "npm run generate:api:intelligence-service:clean && npm run generate:api:application-server:clean", + "generate:api:application-server-specs": "cd server/application-server && mvn verify -DskipTests=true && node ../../scripts/clean-openapi-specs.js", "generate:api:intelligence-service-specs": "python -m server.intelligence-service.app.generate_openapi_yaml", "generate:api:specs": "npm run generate:api:application-server-specs && npm run generate:api:intelligence-service-specs", + "generate:api:application-server-client": "npx openapi-generator-cli generate -i server/application-server/openapi.yaml -g typescript-angular -o webapp/src/app/core/modules/openapi --additional-properties fileNaming=kebab-case,withInterfaces=true --generate-alias-as-model", - "generate:api:intelligence-service-client": "openapi-generator-cli generate -i server/intelligence-service/openapi.yaml -g java --library resttemplate --api-package de.tum.in.www1.hephaestus.intelligenceapi.api --model-package de.tum.in.www1.hephaestus.intelligenceapi.model --invoker-package de.tum.in.www1.hephaestus.intelligenceapi --additional-properties useJakartaEe=true,performBeanValidation=true,generateClientAsBean=true --package-name de.tum.in.www1.hephaestus.intelligenceapi -o tmp/java-client && shx cp -r tmp/java-client/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi server/application-server/src/main/java/de/tum/in/www1/hephaestus && rimraf tmp", + "generate:api:intelligence-service-client": "npx openapi-generator-cli generate -i server/intelligence-service/openapi.yaml -g java --library resttemplate --api-package de.tum.in.www1.hephaestus.intelligenceapi.api --model-package de.tum.in.www1.hephaestus.intelligenceapi.model --invoker-package de.tum.in.www1.hephaestus.intelligenceapi --additional-properties useJakartaEe=true,performBeanValidation=true,generateClientAsBean=true --package-name de.tum.in.www1.hephaestus.intelligenceapi -o tmp/java-client && shx cp -r tmp/java-client/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi server/application-server/src/main/java/de/tum/in/www1/hephaestus && rimraf tmp", "generate:api:clients": "npm run generate:api:intelligence-service-client && npm run generate:api:application-server-client", - "generate:api": "npm run generate:api:application-server-specs && npm run generate:api:clean && npm run generate:api:application-server-client", - "generate:api:all": "npm run generate:api:clean && npm run generate:api:intelligence-service-specs && npm run generate:api:intelligence-service-client && npm run generate:api:application-server-specs && npm run generate:api:application-server-client" + + "generate:api:application-server": "npm run generate:api:application-server-specs && npm run generate:api:application-server:clean && npm run generate:api:application-server-client", + "generate:api:intelligence-service": "npm run generate:api:intelligence-service:clean && npm run generate:api:intelligence-service-specs && npm run generate:api:intelligence-service-client", + + "generate:api": "npm run generate:api:intelligence-service && npm run generate:api:application-server" }, "devDependencies": { "@openapitools/openapi-generator-cli": "2.13.5", From 0a3c1c404b5f1ff6d1317cceb5c207ea8d8c1826 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 29 Oct 2024 19:41:51 +0100 Subject: [PATCH 39/67] Add new GitHub workflow --- ...=> generate-application-server-client.yml} | 10 +-- .../generate-intelligence-service-client.yml | 87 +++++++++++++++++++ server/intelligence-service/app/model.py | 7 ++ 3 files changed, 99 insertions(+), 5 deletions(-) rename .github/workflows/{generate-api-client.yml => generate-application-server-client.yml} (88%) create mode 100644 .github/workflows/generate-intelligence-service-client.yml diff --git a/.github/workflows/generate-api-client.yml b/.github/workflows/generate-application-server-client.yml similarity index 88% rename from .github/workflows/generate-api-client.yml rename to .github/workflows/generate-application-server-client.yml index a285796e..545ddd0c 100644 --- a/.github/workflows/generate-api-client.yml +++ b/.github/workflows/generate-application-server-client.yml @@ -1,11 +1,11 @@ -name: OpenAPI +name: OpenAPI application server on: pull_request: types: [opened, synchronize, labeled, reopened] paths: - 'server/application-server/**' - - '.github/workflows/generate-api-client.yml' + - '.github/workflows/generate-application-server-client.yml' push: paths: - 'server/application-server/openapi.yaml' @@ -15,7 +15,7 @@ on: jobs: generate-api-client: - name: Verify API Specs and Client (add autocommit-openapi label to PR to auto-commit changes) + name: Verify API Specs and Client of the application server (add autocommit-openapi label to PR to auto-commit changes) runs-on: ubuntu-latest steps: @@ -40,8 +40,8 @@ jobs: - name: Install dependencies run: npm install - - name: Generate API client - run: npm run generate:api + - name: Generate API client for the application server + run: npm run generate:api:application-server - name: Check for changes in the API id: check_changes diff --git a/.github/workflows/generate-intelligence-service-client.yml b/.github/workflows/generate-intelligence-service-client.yml new file mode 100644 index 00000000..db4b378b --- /dev/null +++ b/.github/workflows/generate-intelligence-service-client.yml @@ -0,0 +1,87 @@ +name: OpenAPI intelligence service + +on: + pull_request: + types: [opened, synchronize, labeled, reopened] + paths: + - 'server/application-server/**' + - '.github/workflows/generate-intelligence-service-client.yml' + push: + paths: + - 'server/intelligence-service/openapi.yaml' + - 'server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/**' + branches: [develop] + workflow_dispatch: + +jobs: + generate-api-client: + name: Verify API Specs and Client of the intelligence service (add autocommit-openapi label to PR to auto-commit changes) + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. + fetch-depth: 0 + + - name: Set up Python 3.12 + uses: actions/setup-python@v2 + with: + python-version: 3.12 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + + - name: Install dependencies + run: npm install + + - name: Install Poetry + uses: snok/install-poetry@v1 + + - name: Install Python dependencies + working-directory: server/intelligence-service + run: poetry install --no-interaction + + - name: Generate API client for the intelligence service + run: npm run generate:api:intelligence-service + + - name: Check for changes in the API + id: check_changes + run: | + echo "Checking for changes in the API client directory..." + git add . + if git diff --cached --quiet; then + echo "No changes detected in the API client directory." + echo "NO_CHANGES_DETECTED=true" >> $GITHUB_ENV + else + echo "Changes detected in the API client directory." + echo "NO_CHANGES_DETECTED=false" >> $GITHUB_ENV + exit 1 + fi + + - name: Commit files + if: ${{ always() && contains(github.event.pull_request.labels.*.name, 'autocommit-openapi') }} + run: | + echo "Committing and pushing changes..." + git config --local user.name "github-actions[bot]" + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git commit -a -m "chore: update API specs and client" + + - name: Push changes + if: ${{ always() && contains(github.event.pull_request.labels.*.name, 'autocommit-openapi') }} + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GH_PAT }} + branch: ${{ github.event.pull_request.head.ref }} + + - name: Remove autocommit-openapi label + if: ${{ always() && contains(github.event.pull_request.labels.*.name, 'autocommit-openapi') }} + run: | + echo "Removing the autocommit-openapi label..." + curl --silent --fail-with-body -X DELETE -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels/autocommit-openapi diff --git a/server/intelligence-service/app/model.py b/server/intelligence-service/app/model.py index 12ef4930..7f5efaef 100644 --- a/server/intelligence-service/app/model.py +++ b/server/intelligence-service/app/model.py @@ -1,3 +1,4 @@ +import os from langchain.chat_models.base import BaseChatModel from langchain_openai import ChatOpenAI, AzureChatOpenAI @@ -5,6 +6,12 @@ model: BaseChatModel +if os.getenv("GITHUB_ACTIONS") == "true": + # mock model for testing environment + class MockChatModel(BaseChatModel): + def invoke(self, message: str): + return "Mock response" + if settings.is_openai_available: model = ChatOpenAI() elif settings.is_azure_openai_available: From 14fba4acc5daf77b52aac9f722319ccd21e4b08c Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 29 Oct 2024 19:43:51 +0100 Subject: [PATCH 40/67] Update generated docs --- .../de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java | 2 +- .../java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java | 2 +- .../in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java | 2 +- .../in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java | 2 +- .../in/www1/hephaestus/intelligenceapi/ServerConfiguration.java | 2 +- .../tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java | 2 +- .../tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java | 2 +- .../tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java | 2 +- .../in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java | 2 +- .../in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java | 2 +- .../in/www1/hephaestus/intelligenceapi/model/ChatRequest.java | 2 +- .../in/www1/hephaestus/intelligenceapi/model/ChatResponse.java | 2 +- .../hephaestus/intelligenceapi/model/HTTPValidationError.java | 2 +- .../www1/hephaestus/intelligenceapi/model/ValidationError.java | 2 +- .../intelligenceapi/model/ValidationErrorLocInner.java | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java index 27004f2e..12df2eed 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java @@ -58,7 +58,7 @@ import de.tum.in.www1.hephaestus.intelligenceapi.auth.Authentication; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") @Component("de.tum.in.www1.hephaestus.intelligenceapi.ApiClient") public class ApiClient extends JavaTimeFormatter { public enum CollectionFormat { diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java index c1456c82..933f532c 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java @@ -5,7 +5,7 @@ import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public abstract class BaseApi { protected ApiClient apiClient; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java index e0dfa2d1..81d88315 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java @@ -20,7 +20,7 @@ * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class JavaTimeFormatter { private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java index 9139a6dc..fec724b1 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java @@ -22,7 +22,7 @@ import java.util.GregorianCalendar; import java.util.TimeZone; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class RFC3339DateFormat extends DateFormat { private static final long serialVersionUID = 1L; private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java index c93e929f..0a77c4e8 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java @@ -5,7 +5,7 @@ /** * Representing a Server configuration. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ServerConfiguration { public String URL; public String description; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java index 6e41015d..fc330105 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java @@ -5,7 +5,7 @@ /** * Representing a Server Variable for server URL template substitution. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ServerVariable { public String description; public String defaultValue; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java index c66c0fc6..732b5972 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java @@ -28,7 +28,7 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") @Component("de.tum.in.www1.hephaestus.intelligenceapi.api.DefaultApi") public class DefaultApi extends BaseApi { diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java index a62bd677..a6182bab 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java @@ -3,7 +3,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java index 2ce61084..fd7992d5 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java @@ -6,7 +6,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class HttpBasicAuth implements Authentication { private String username; private String password; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java index b4514660..4d9c2cf6 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java @@ -5,7 +5,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class HttpBearerAuth implements Authentication { private final String scheme; private Supplier tokenSupplier; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java index 2400e5dd..fa9c89b1 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java @@ -30,7 +30,7 @@ @JsonPropertyOrder({ ChatRequest.JSON_PROPERTY_MESSAGE }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ChatRequest { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java index 6932898f..904528e8 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java @@ -30,7 +30,7 @@ @JsonPropertyOrder({ ChatResponse.JSON_PROPERTY_RESPONSE }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ChatResponse { public static final String JSON_PROPERTY_RESPONSE = "response"; private String response; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java index dae309b1..d1ded315 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java @@ -34,7 +34,7 @@ @JsonPropertyOrder({ HTTPValidationError.JSON_PROPERTY_DETAIL }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class HTTPValidationError { public static final String JSON_PROPERTY_DETAIL = "detail"; private List detail = new ArrayList<>(); diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java index 71aa404a..a81f87d2 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java @@ -36,7 +36,7 @@ ValidationError.JSON_PROPERTY_MSG, ValidationError.JSON_PROPERTY_TYPE }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ValidationError { public static final String JSON_PROPERTY_LOC = "loc"; private List loc = new ArrayList<>(); diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java index 778cf6ae..b4d5b259 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java @@ -26,7 +26,7 @@ @JsonPropertyOrder({ }) @JsonTypeName("ValidationError_loc_inner") -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-25T13:33:58.458948+02:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ValidationErrorLocInner { public ValidationErrorLocInner() { } From 591d1c991bc796273b205d97eff8eec7875abfc3 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 29 Oct 2024 19:55:22 +0100 Subject: [PATCH 41/67] Add Webconfig --- .../de/tum/in/www1/hephaestus/WebConfig.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/WebConfig.java diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/WebConfig.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/WebConfig.java new file mode 100644 index 00000000..ba4fc629 --- /dev/null +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/WebConfig.java @@ -0,0 +1,16 @@ +package de.tum.in.www1.hephaestus; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.client.RestTemplate; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + + +@Configuration +public class WebConfig implements WebMvcConfigurer { + + @Bean + public RestTemplate restTemplate() { + return new RestTemplate(); + } +} \ No newline at end of file From 52cbb0840a8ba20d7003dede3c97565fc38f2f44 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 29 Oct 2024 20:17:20 +0100 Subject: [PATCH 42/67] Update naming --- .../generate-application-server-client.yml | 2 +- .../generate-intelligence-service-client.yml | 24 ++++++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/generate-application-server-client.yml b/.github/workflows/generate-application-server-client.yml index 545ddd0c..d66d3f54 100644 --- a/.github/workflows/generate-application-server-client.yml +++ b/.github/workflows/generate-application-server-client.yml @@ -14,7 +14,7 @@ on: workflow_dispatch: jobs: - generate-api-client: + generate-application-server-client: name: Verify API Specs and Client of the application server (add autocommit-openapi label to PR to auto-commit changes) runs-on: ubuntu-latest diff --git a/.github/workflows/generate-intelligence-service-client.yml b/.github/workflows/generate-intelligence-service-client.yml index db4b378b..54f174de 100644 --- a/.github/workflows/generate-intelligence-service-client.yml +++ b/.github/workflows/generate-intelligence-service-client.yml @@ -14,7 +14,7 @@ on: workflow_dispatch: jobs: - generate-api-client: + generate-intelligence-service-client: name: Verify API Specs and Client of the intelligence service (add autocommit-openapi label to PR to auto-commit changes) runs-on: ubuntu-latest @@ -30,6 +30,9 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.12 + + - name: Install dependencies + run: npm install - name: Set up JDK 21 uses: actions/setup-java@v4 @@ -37,15 +40,24 @@ jobs: distribution: 'temurin' java-version: '21' - - name: Install dependencies - run: npm install - - - name: Install Poetry + - name: Install and configure Poetry uses: snok/install-poetry@v1 + with: + version: 1.1.13 + virtualenvs-create: true + virtualenvs-in-project: true + - name: Set up cache + uses: actions/cache@v2 + id: cached-poetry-dependencies + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} + - name: Install Python dependencies working-directory: server/intelligence-service - run: poetry install --no-interaction + run: poetry install + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - name: Generate API client for the intelligence service run: npm run generate:api:intelligence-service From a9581225809970ff00522580a0e3648f9b8e601d Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 29 Oct 2024 20:22:31 +0100 Subject: [PATCH 43/67] Fix poetry --- .../generate-intelligence-service-client.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/generate-intelligence-service-client.yml b/.github/workflows/generate-intelligence-service-client.yml index 54f174de..370b1820 100644 --- a/.github/workflows/generate-intelligence-service-client.yml +++ b/.github/workflows/generate-intelligence-service-client.yml @@ -41,23 +41,11 @@ jobs: java-version: '21' - name: Install and configure Poetry - uses: snok/install-poetry@v1 - with: - version: 1.1.13 - virtualenvs-create: true - virtualenvs-in-project: true + run: pipx install poetry - - name: Set up cache - uses: actions/cache@v2 - id: cached-poetry-dependencies - with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} - - name: Install Python dependencies working-directory: server/intelligence-service run: poetry install - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - name: Generate API client for the intelligence service run: npm run generate:api:intelligence-service From 08f2d207f427182b26b67d713fa5a5d7636882ad Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 29 Oct 2024 20:26:01 +0100 Subject: [PATCH 44/67] Fix poetry --- .../generate-intelligence-service-client.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate-intelligence-service-client.yml b/.github/workflows/generate-intelligence-service-client.yml index 370b1820..a6bbcc9b 100644 --- a/.github/workflows/generate-intelligence-service-client.yml +++ b/.github/workflows/generate-intelligence-service-client.yml @@ -40,12 +40,21 @@ jobs: distribution: 'temurin' java-version: '21' - - name: Install and configure Poetry - run: pipx install poetry + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + virtualenvs-path: .venv + installer-parallel: true - name: Install Python dependencies working-directory: server/intelligence-service - run: poetry install + run: poetry install --no-interaction --no-root + + - name: Install project + working-directory: server/intelligence-service + run: poetry install --no-interaction - name: Generate API client for the intelligence service run: npm run generate:api:intelligence-service From a75d1ba6cbfe03d16fccca5315d7a5c86237ea97 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 29 Oct 2024 20:32:41 +0100 Subject: [PATCH 45/67] Fix poetry for github workflows --- .github/workflows/generate-intelligence-service-client.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/generate-intelligence-service-client.yml b/.github/workflows/generate-intelligence-service-client.yml index a6bbcc9b..5dfd5f09 100644 --- a/.github/workflows/generate-intelligence-service-client.yml +++ b/.github/workflows/generate-intelligence-service-client.yml @@ -47,6 +47,13 @@ jobs: virtualenvs-in-project: true virtualenvs-path: .venv installer-parallel: true + + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v4 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - name: Install Python dependencies working-directory: server/intelligence-service From 42e43447af67e26de2bbda19a440436b7527a2b1 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 29 Oct 2024 20:35:06 +0100 Subject: [PATCH 46/67] Fix poetry for github workflows --- .github/workflows/generate-application-server-client.yml | 2 +- .github/workflows/generate-intelligence-service-client.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate-application-server-client.yml b/.github/workflows/generate-application-server-client.yml index d66d3f54..545ddd0c 100644 --- a/.github/workflows/generate-application-server-client.yml +++ b/.github/workflows/generate-application-server-client.yml @@ -14,7 +14,7 @@ on: workflow_dispatch: jobs: - generate-application-server-client: + generate-api-client: name: Verify API Specs and Client of the application server (add autocommit-openapi label to PR to auto-commit changes) runs-on: ubuntu-latest diff --git a/.github/workflows/generate-intelligence-service-client.yml b/.github/workflows/generate-intelligence-service-client.yml index 5dfd5f09..861cf5f1 100644 --- a/.github/workflows/generate-intelligence-service-client.yml +++ b/.github/workflows/generate-intelligence-service-client.yml @@ -14,7 +14,7 @@ on: workflow_dispatch: jobs: - generate-intelligence-service-client: + generate-api-client: name: Verify API Specs and Client of the intelligence service (add autocommit-openapi label to PR to auto-commit changes) runs-on: ubuntu-latest @@ -52,7 +52,7 @@ jobs: id: cached-poetry-dependencies uses: actions/cache@v4 with: - path: .venv + path: .venv key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - name: Install Python dependencies From 16c54207d6a84c50a8a959fba1041128f65c3d91 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 29 Oct 2024 20:39:32 +0100 Subject: [PATCH 47/67] Fix poetry for github workflows --- .../generate-intelligence-service-client.yml | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/generate-intelligence-service-client.yml b/.github/workflows/generate-intelligence-service-client.yml index 861cf5f1..6a7d2c35 100644 --- a/.github/workflows/generate-intelligence-service-client.yml +++ b/.github/workflows/generate-intelligence-service-client.yml @@ -23,14 +23,14 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.ref }} - persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. + persist-credentials: false fetch-depth: 0 - name: Set up Python 3.12 uses: actions/setup-python@v2 with: python-version: 3.12 - + - name: Install dependencies run: npm install @@ -39,33 +39,33 @@ jobs: with: distribution: 'temurin' java-version: '21' - - - name: Install Poetry - uses: snok/install-poetry@v1 - with: + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: virtualenvs-create: true virtualenvs-in-project: true virtualenvs-path: .venv installer-parallel: true - - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v4 - with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v4 + with: + path: .venv + key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} - name: Install Python dependencies working-directory: server/intelligence-service run: poetry install --no-interaction --no-root - + - name: Install project working-directory: server/intelligence-service run: poetry install --no-interaction - name: Generate API client for the intelligence service run: npm run generate:api:intelligence-service - + - name: Check for changes in the API id: check_changes run: | From 96e86876054123a6178a225639bdff514b22d010 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 29 Oct 2024 20:45:20 +0100 Subject: [PATCH 48/67] Fix poetry for github workflows --- .github/workflows/generate-intelligence-service-client.yml | 4 ++-- .../de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java | 2 +- .../de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java | 2 +- .../in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java | 2 +- .../in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java | 2 +- .../www1/hephaestus/intelligenceapi/ServerConfiguration.java | 2 +- .../in/www1/hephaestus/intelligenceapi/ServerVariable.java | 2 +- .../in/www1/hephaestus/intelligenceapi/api/DefaultApi.java | 2 +- .../in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java | 2 +- .../www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java | 2 +- .../www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java | 2 +- .../in/www1/hephaestus/intelligenceapi/model/ChatRequest.java | 2 +- .../www1/hephaestus/intelligenceapi/model/ChatResponse.java | 2 +- .../hephaestus/intelligenceapi/model/HTTPValidationError.java | 2 +- .../hephaestus/intelligenceapi/model/ValidationError.java | 2 +- .../intelligenceapi/model/ValidationErrorLocInner.java | 2 +- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/generate-intelligence-service-client.yml b/.github/workflows/generate-intelligence-service-client.yml index 6a7d2c35..4a2443c2 100644 --- a/.github/workflows/generate-intelligence-service-client.yml +++ b/.github/workflows/generate-intelligence-service-client.yml @@ -64,8 +64,8 @@ jobs: run: poetry install --no-interaction - name: Generate API client for the intelligence service - run: npm run generate:api:intelligence-service - + run: poetry run npm run generate:api:intelligence-service + - name: Check for changes in the API id: check_changes run: | diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java index 12df2eed..7b2f1071 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java @@ -58,7 +58,7 @@ import de.tum.in.www1.hephaestus.intelligenceapi.auth.Authentication; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") @Component("de.tum.in.www1.hephaestus.intelligenceapi.ApiClient") public class ApiClient extends JavaTimeFormatter { public enum CollectionFormat { diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java index 933f532c..abcb2ea6 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java @@ -5,7 +5,7 @@ import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public abstract class BaseApi { protected ApiClient apiClient; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java index 81d88315..f5be0b8b 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java @@ -20,7 +20,7 @@ * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class JavaTimeFormatter { private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java index fec724b1..51f04a3b 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java @@ -22,7 +22,7 @@ import java.util.GregorianCalendar; import java.util.TimeZone; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class RFC3339DateFormat extends DateFormat { private static final long serialVersionUID = 1L; private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java index 0a77c4e8..4fcb64c1 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java @@ -5,7 +5,7 @@ /** * Representing a Server configuration. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ServerConfiguration { public String URL; public String description; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java index fc330105..a08397e6 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java @@ -5,7 +5,7 @@ /** * Representing a Server Variable for server URL template substitution. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ServerVariable { public String description; public String defaultValue; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java index 732b5972..b4d47087 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java @@ -28,7 +28,7 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") @Component("de.tum.in.www1.hephaestus.intelligenceapi.api.DefaultApi") public class DefaultApi extends BaseApi { diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java index a6182bab..8380140e 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java @@ -3,7 +3,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java index fd7992d5..8029c112 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java @@ -6,7 +6,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class HttpBasicAuth implements Authentication { private String username; private String password; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java index 4d9c2cf6..bdf1f859 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java @@ -5,7 +5,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class HttpBearerAuth implements Authentication { private final String scheme; private Supplier tokenSupplier; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java index fa9c89b1..2086e0e1 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java @@ -30,7 +30,7 @@ @JsonPropertyOrder({ ChatRequest.JSON_PROPERTY_MESSAGE }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ChatRequest { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java index 904528e8..d21b03a3 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java @@ -30,7 +30,7 @@ @JsonPropertyOrder({ ChatResponse.JSON_PROPERTY_RESPONSE }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ChatResponse { public static final String JSON_PROPERTY_RESPONSE = "response"; private String response; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java index d1ded315..0f513858 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java @@ -34,7 +34,7 @@ @JsonPropertyOrder({ HTTPValidationError.JSON_PROPERTY_DETAIL }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class HTTPValidationError { public static final String JSON_PROPERTY_DETAIL = "detail"; private List detail = new ArrayList<>(); diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java index a81f87d2..b16bc3e7 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java @@ -36,7 +36,7 @@ ValidationError.JSON_PROPERTY_MSG, ValidationError.JSON_PROPERTY_TYPE }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ValidationError { public static final String JSON_PROPERTY_LOC = "loc"; private List loc = new ArrayList<>(); diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java index b4d5b259..0ec5c292 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java @@ -26,7 +26,7 @@ @JsonPropertyOrder({ }) @JsonTypeName("ValidationError_loc_inner") -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:30:44.172496+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") public class ValidationErrorLocInner { public ValidationErrorLocInner() { } From bde758f282ab6dd41151e7c449e97ba8898fece0 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 29 Oct 2024 20:47:31 +0100 Subject: [PATCH 49/67] Fix poetry for github workflows --- .github/workflows/generate-intelligence-service-client.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/generate-intelligence-service-client.yml b/.github/workflows/generate-intelligence-service-client.yml index 4a2443c2..5dd214e7 100644 --- a/.github/workflows/generate-intelligence-service-client.yml +++ b/.github/workflows/generate-intelligence-service-client.yml @@ -59,11 +59,8 @@ jobs: working-directory: server/intelligence-service run: poetry install --no-interaction --no-root - - name: Install project - working-directory: server/intelligence-service - run: poetry install --no-interaction - - name: Generate API client for the intelligence service + working-directory: server/intelligence-service run: poetry run npm run generate:api:intelligence-service - name: Check for changes in the API From af5ae9467eae0c16c1e69165591c134775d901c1 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 29 Oct 2024 20:50:32 +0100 Subject: [PATCH 50/67] Fix poetry for github workflows --- server/intelligence-service/app/model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/intelligence-service/app/model.py b/server/intelligence-service/app/model.py index 7f5efaef..93ba9432 100644 --- a/server/intelligence-service/app/model.py +++ b/server/intelligence-service/app/model.py @@ -11,8 +11,8 @@ class MockChatModel(BaseChatModel): def invoke(self, message: str): return "Mock response" - -if settings.is_openai_available: + model = MockChatModel() +elif settings.is_openai_available: model = ChatOpenAI() elif settings.is_azure_openai_available: model = AzureChatOpenAI() From e2e909798227927d3eb3275b770a4fb293cf9f26 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 29 Oct 2024 20:55:19 +0100 Subject: [PATCH 51/67] Fix MockChatModel bug --- server/intelligence-service/app/model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/intelligence-service/app/model.py b/server/intelligence-service/app/model.py index 93ba9432..ecacc241 100644 --- a/server/intelligence-service/app/model.py +++ b/server/intelligence-service/app/model.py @@ -7,11 +7,11 @@ model: BaseChatModel if os.getenv("GITHUB_ACTIONS") == "true": - # mock model for testing environment - class MockChatModel(BaseChatModel): + class MockChatModel(): def invoke(self, message: str): return "Mock response" model = MockChatModel() + elif settings.is_openai_available: model = ChatOpenAI() elif settings.is_azure_openai_available: From 4b4cfe01a9677d1decc12a756b683edd412024c2 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 29 Oct 2024 20:59:51 +0100 Subject: [PATCH 52/67] Delete autocommit from the workflow --- .../generate-intelligence-service-client.yml | 38 +------------------ 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/.github/workflows/generate-intelligence-service-client.yml b/.github/workflows/generate-intelligence-service-client.yml index 5dd214e7..6ee8dfa1 100644 --- a/.github/workflows/generate-intelligence-service-client.yml +++ b/.github/workflows/generate-intelligence-service-client.yml @@ -61,40 +61,4 @@ jobs: - name: Generate API client for the intelligence service working-directory: server/intelligence-service - run: poetry run npm run generate:api:intelligence-service - - - name: Check for changes in the API - id: check_changes - run: | - echo "Checking for changes in the API client directory..." - git add . - if git diff --cached --quiet; then - echo "No changes detected in the API client directory." - echo "NO_CHANGES_DETECTED=true" >> $GITHUB_ENV - else - echo "Changes detected in the API client directory." - echo "NO_CHANGES_DETECTED=false" >> $GITHUB_ENV - exit 1 - fi - - - name: Commit files - if: ${{ always() && contains(github.event.pull_request.labels.*.name, 'autocommit-openapi') }} - run: | - echo "Committing and pushing changes..." - git config --local user.name "github-actions[bot]" - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git commit -a -m "chore: update API specs and client" - - - name: Push changes - if: ${{ always() && contains(github.event.pull_request.labels.*.name, 'autocommit-openapi') }} - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GH_PAT }} - branch: ${{ github.event.pull_request.head.ref }} - - - name: Remove autocommit-openapi label - if: ${{ always() && contains(github.event.pull_request.labels.*.name, 'autocommit-openapi') }} - run: | - echo "Removing the autocommit-openapi label..." - curl --silent --fail-with-body -X DELETE -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels/autocommit-openapi + run: poetry run npm run generate:api:intelligence-service \ No newline at end of file From d76674f4eddfa6343657491ac7129cc8d08eba52 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Mon, 4 Nov 2024 21:01:14 +0100 Subject: [PATCH 53/67] Update and add langgraph --- server/intelligence-service/poetry.lock | 164 ++++++++++++++++++++++-- 1 file changed, 155 insertions(+), 9 deletions(-) diff --git a/server/intelligence-service/poetry.lock b/server/intelligence-service/poetry.lock index 71289747..29a5124f 100644 --- a/server/intelligence-service/poetry.lock +++ b/server/intelligence-service/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" @@ -673,6 +673,17 @@ http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] zstd = ["zstandard (>=0.18.0)"] +[[package]] +name = "httpx-sse" +version = "0.4.0" +description = "Consume Server-Sent Event (SSE) messages with HTTPX." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpx-sse-0.4.0.tar.gz", hash = "sha256:1e81a3a3070ce322add1d3529ed42eb5f70817f45ed6ec915ab753f961139721"}, + {file = "httpx_sse-0.4.0-py3-none-any.whl", hash = "sha256:f329af6eae57eaa2bdfd962b42524764af68075ea87370a2de920af5341e318f"}, +] + [[package]] name = "idna" version = "3.8" @@ -821,18 +832,18 @@ tenacity = ">=8.1.0,<8.4.0 || >8.4.0,<9.0.0" [[package]] name = "langchain-core" -version = "0.2.36" +version = "0.2.43" description = "Building applications with LLMs through composability" optional = false python-versions = "<4.0,>=3.8.1" files = [ - {file = "langchain_core-0.2.36-py3-none-any.whl", hash = "sha256:eabce6e7538cb9dc60db4bc1eb584bbb91a5e7e02a96d5b65b4a6ab151081b6d"}, - {file = "langchain_core-0.2.36.tar.gz", hash = "sha256:56f2367070e8afc43922bba1d046035a144b4e732a5474676403bd0eb33d85f2"}, + {file = "langchain_core-0.2.43-py3-none-any.whl", hash = "sha256:619601235113298ebf8252a349754b7c28d3cf7166c7c922da24944b78a9363a"}, + {file = "langchain_core-0.2.43.tar.gz", hash = "sha256:42c2ef6adedb911f4254068b6adc9eb4c4075f6c8cb3d83590d3539a815695f5"}, ] [package.dependencies] jsonpatch = ">=1.33,<2.0" -langsmith = ">=0.1.75,<0.2.0" +langsmith = ">=0.1.112,<0.2.0" packaging = ">=23.2,<25" pydantic = [ {version = ">=1,<3", markers = "python_full_version < \"3.12.4\""}, @@ -872,15 +883,62 @@ files = [ [package.dependencies] langchain-core = ">=0.2.10,<0.3.0" +[[package]] +name = "langgraph" +version = "0.2.44" +description = "Building stateful, multi-actor applications with LLMs" +optional = false +python-versions = "<4.0,>=3.9.0" +files = [ + {file = "langgraph-0.2.44-py3-none-any.whl", hash = "sha256:ac03af8950efcb2ebb898bce0800c8c9bad9180f7490a73d2eaecacab7a7920a"}, + {file = "langgraph-0.2.44.tar.gz", hash = "sha256:8ae179c3a77666b0a78b273d89d8f32a012282ad49298234426a4443d559aa62"}, +] + +[package.dependencies] +langchain-core = ">=0.2.43,<0.3.0 || >0.3.0,<0.3.1 || >0.3.1,<0.3.2 || >0.3.2,<0.3.3 || >0.3.3,<0.3.4 || >0.3.4,<0.3.5 || >0.3.5,<0.3.6 || >0.3.6,<0.3.7 || >0.3.7,<0.3.8 || >0.3.8,<0.3.9 || >0.3.9,<0.3.10 || >0.3.10,<0.3.11 || >0.3.11,<0.3.12 || >0.3.12,<0.3.13 || >0.3.13,<0.3.14 || >0.3.14,<0.4.0" +langgraph-checkpoint = ">=2.0.0,<3.0.0" +langgraph-sdk = ">=0.1.32,<0.2.0" + +[[package]] +name = "langgraph-checkpoint" +version = "2.0.2" +description = "Library with base interfaces for LangGraph checkpoint savers." +optional = false +python-versions = "<4.0.0,>=3.9.0" +files = [ + {file = "langgraph_checkpoint-2.0.2-py3-none-any.whl", hash = "sha256:6e5dfd90e1fc71b91ccff75939ada1114e5d7f824df5f24c62d39bed69039ee2"}, + {file = "langgraph_checkpoint-2.0.2.tar.gz", hash = "sha256:c1d033e4e4855f580fa56830327eb86513b64ab5be527245363498e76b19a0b9"}, +] + +[package.dependencies] +langchain-core = ">=0.2.38,<0.4" +msgpack = ">=1.1.0,<2.0.0" + +[[package]] +name = "langgraph-sdk" +version = "0.1.35" +description = "SDK for interacting with LangGraph API" +optional = false +python-versions = "<4.0.0,>=3.9.0" +files = [ + {file = "langgraph_sdk-0.1.35-py3-none-any.whl", hash = "sha256:b137c324fbce96afe39cc6a189c61fc042164068f0f6f02ac8de864d8ece6e05"}, + {file = "langgraph_sdk-0.1.35.tar.gz", hash = "sha256:414cfbc172b883446197763f3645d86bbc6a5b8ce9693c1df3fb6ce7d854a994"}, +] + +[package.dependencies] +httpx = ">=0.25.2" +httpx-sse = ">=0.4.0" +orjson = ">=3.10.1" + [[package]] name = "langsmith" -version = "0.1.107" +version = "0.1.139" description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." optional = false python-versions = "<4.0,>=3.8.1" files = [ - {file = "langsmith-0.1.107-py3-none-any.whl", hash = "sha256:ddd0c846980474e271a553e9c220122e32d1f2ce877cc87d39ecd86726b9e78c"}, - {file = "langsmith-0.1.107.tar.gz", hash = "sha256:f44de0a5f199381d0b518ecbe295d541c44ff33d13f18098ecc54a4547eccb3f"}, + {file = "langsmith-0.1.139-py3-none-any.whl", hash = "sha256:2a4a541bfbd0a9727255df28a60048c85bc8c4c6a276975923785c3fd82dc879"}, + {file = "langsmith-0.1.139.tar.gz", hash = "sha256:2f9e4d32fef3ad7ef42c8506448cce3a31ad6b78bb4f3310db04ddaa1e9d744d"}, ] [package.dependencies] @@ -891,6 +949,7 @@ pydantic = [ {version = ">=2.7.4,<3.0.0", markers = "python_full_version >= \"3.12.4\""}, ] requests = ">=2,<3" +requests-toolbelt = ">=1.0.0,<2.0.0" [[package]] name = "markdown-it-py" @@ -996,6 +1055,79 @@ files = [ {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, ] +[[package]] +name = "msgpack" +version = "1.1.0" +description = "MessagePack serializer" +optional = false +python-versions = ">=3.8" +files = [ + {file = "msgpack-1.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7ad442d527a7e358a469faf43fda45aaf4ac3249c8310a82f0ccff9164e5dccd"}, + {file = "msgpack-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:74bed8f63f8f14d75eec75cf3d04ad581da6b914001b474a5d3cd3372c8cc27d"}, + {file = "msgpack-1.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:914571a2a5b4e7606997e169f64ce53a8b1e06f2cf2c3a7273aa106236d43dd5"}, + {file = "msgpack-1.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c921af52214dcbb75e6bdf6a661b23c3e6417f00c603dd2070bccb5c3ef499f5"}, + {file = "msgpack-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d8ce0b22b890be5d252de90d0e0d119f363012027cf256185fc3d474c44b1b9e"}, + {file = "msgpack-1.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:73322a6cc57fcee3c0c57c4463d828e9428275fb85a27aa2aa1a92fdc42afd7b"}, + {file = "msgpack-1.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:e1f3c3d21f7cf67bcf2da8e494d30a75e4cf60041d98b3f79875afb5b96f3a3f"}, + {file = "msgpack-1.1.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:64fc9068d701233effd61b19efb1485587560b66fe57b3e50d29c5d78e7fef68"}, + {file = "msgpack-1.1.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:42f754515e0f683f9c79210a5d1cad631ec3d06cea5172214d2176a42e67e19b"}, + {file = "msgpack-1.1.0-cp310-cp310-win32.whl", hash = "sha256:3df7e6b05571b3814361e8464f9304c42d2196808e0119f55d0d3e62cd5ea044"}, + {file = "msgpack-1.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:685ec345eefc757a7c8af44a3032734a739f8c45d1b0ac45efc5d8977aa4720f"}, + {file = "msgpack-1.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3d364a55082fb2a7416f6c63ae383fbd903adb5a6cf78c5b96cc6316dc1cedc7"}, + {file = "msgpack-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:79ec007767b9b56860e0372085f8504db5d06bd6a327a335449508bbee9648fa"}, + {file = "msgpack-1.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6ad622bf7756d5a497d5b6836e7fc3752e2dd6f4c648e24b1803f6048596f701"}, + {file = "msgpack-1.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e59bca908d9ca0de3dc8684f21ebf9a690fe47b6be93236eb40b99af28b6ea6"}, + {file = "msgpack-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5e1da8f11a3dd397f0a32c76165cf0c4eb95b31013a94f6ecc0b280c05c91b59"}, + {file = "msgpack-1.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:452aff037287acb1d70a804ffd022b21fa2bb7c46bee884dbc864cc9024128a0"}, + {file = "msgpack-1.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8da4bf6d54ceed70e8861f833f83ce0814a2b72102e890cbdfe4b34764cdd66e"}, + {file = "msgpack-1.1.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:41c991beebf175faf352fb940bf2af9ad1fb77fd25f38d9142053914947cdbf6"}, + {file = "msgpack-1.1.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a52a1f3a5af7ba1c9ace055b659189f6c669cf3657095b50f9602af3a3ba0fe5"}, + {file = "msgpack-1.1.0-cp311-cp311-win32.whl", hash = "sha256:58638690ebd0a06427c5fe1a227bb6b8b9fdc2bd07701bec13c2335c82131a88"}, + {file = "msgpack-1.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:fd2906780f25c8ed5d7b323379f6138524ba793428db5d0e9d226d3fa6aa1788"}, + {file = "msgpack-1.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:d46cf9e3705ea9485687aa4001a76e44748b609d260af21c4ceea7f2212a501d"}, + {file = "msgpack-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:5dbad74103df937e1325cc4bfeaf57713be0b4f15e1c2da43ccdd836393e2ea2"}, + {file = "msgpack-1.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:58dfc47f8b102da61e8949708b3eafc3504509a5728f8b4ddef84bd9e16ad420"}, + {file = "msgpack-1.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4676e5be1b472909b2ee6356ff425ebedf5142427842aa06b4dfd5117d1ca8a2"}, + {file = "msgpack-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:17fb65dd0bec285907f68b15734a993ad3fc94332b5bb21b0435846228de1f39"}, + {file = "msgpack-1.1.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a51abd48c6d8ac89e0cfd4fe177c61481aca2d5e7ba42044fd218cfd8ea9899f"}, + {file = "msgpack-1.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2137773500afa5494a61b1208619e3871f75f27b03bcfca7b3a7023284140247"}, + {file = "msgpack-1.1.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:398b713459fea610861c8a7b62a6fec1882759f308ae0795b5413ff6a160cf3c"}, + {file = "msgpack-1.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:06f5fd2f6bb2a7914922d935d3b8bb4a7fff3a9a91cfce6d06c13bc42bec975b"}, + {file = "msgpack-1.1.0-cp312-cp312-win32.whl", hash = "sha256:ad33e8400e4ec17ba782f7b9cf868977d867ed784a1f5f2ab46e7ba53b6e1e1b"}, + {file = "msgpack-1.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:115a7af8ee9e8cddc10f87636767857e7e3717b7a2e97379dc2054712693e90f"}, + {file = "msgpack-1.1.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:071603e2f0771c45ad9bc65719291c568d4edf120b44eb36324dcb02a13bfddf"}, + {file = "msgpack-1.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0f92a83b84e7c0749e3f12821949d79485971f087604178026085f60ce109330"}, + {file = "msgpack-1.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:4a1964df7b81285d00a84da4e70cb1383f2e665e0f1f2a7027e683956d04b734"}, + {file = "msgpack-1.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:59caf6a4ed0d164055ccff8fe31eddc0ebc07cf7326a2aaa0dbf7a4001cd823e"}, + {file = "msgpack-1.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0907e1a7119b337971a689153665764adc34e89175f9a34793307d9def08e6ca"}, + {file = "msgpack-1.1.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:65553c9b6da8166e819a6aa90ad15288599b340f91d18f60b2061f402b9a4915"}, + {file = "msgpack-1.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:7a946a8992941fea80ed4beae6bff74ffd7ee129a90b4dd5cf9c476a30e9708d"}, + {file = "msgpack-1.1.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:4b51405e36e075193bc051315dbf29168d6141ae2500ba8cd80a522964e31434"}, + {file = "msgpack-1.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:b4c01941fd2ff87c2a934ee6055bda4ed353a7846b8d4f341c428109e9fcde8c"}, + {file = "msgpack-1.1.0-cp313-cp313-win32.whl", hash = "sha256:7c9a35ce2c2573bada929e0b7b3576de647b0defbd25f5139dcdaba0ae35a4cc"}, + {file = "msgpack-1.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:bce7d9e614a04d0883af0b3d4d501171fbfca038f12c77fa838d9f198147a23f"}, + {file = "msgpack-1.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c40ffa9a15d74e05ba1fe2681ea33b9caffd886675412612d93ab17b58ea2fec"}, + {file = "msgpack-1.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f1ba6136e650898082d9d5a5217d5906d1e138024f836ff48691784bbe1adf96"}, + {file = "msgpack-1.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e0856a2b7e8dcb874be44fea031d22e5b3a19121be92a1e098f46068a11b0870"}, + {file = "msgpack-1.1.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:471e27a5787a2e3f974ba023f9e265a8c7cfd373632247deb225617e3100a3c7"}, + {file = "msgpack-1.1.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:646afc8102935a388ffc3914b336d22d1c2d6209c773f3eb5dd4d6d3b6f8c1cb"}, + {file = "msgpack-1.1.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:13599f8829cfbe0158f6456374e9eea9f44eee08076291771d8ae93eda56607f"}, + {file = "msgpack-1.1.0-cp38-cp38-win32.whl", hash = "sha256:8a84efb768fb968381e525eeeb3d92857e4985aacc39f3c47ffd00eb4509315b"}, + {file = "msgpack-1.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:879a7b7b0ad82481c52d3c7eb99bf6f0645dbdec5134a4bddbd16f3506947feb"}, + {file = "msgpack-1.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:53258eeb7a80fc46f62fd59c876957a2d0e15e6449a9e71842b6d24419d88ca1"}, + {file = "msgpack-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7e7b853bbc44fb03fbdba34feb4bd414322180135e2cb5164f20ce1c9795ee48"}, + {file = "msgpack-1.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f3e9b4936df53b970513eac1758f3882c88658a220b58dcc1e39606dccaaf01c"}, + {file = "msgpack-1.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:46c34e99110762a76e3911fc923222472c9d681f1094096ac4102c18319e6468"}, + {file = "msgpack-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a706d1e74dd3dea05cb54580d9bd8b2880e9264856ce5068027eed09680aa74"}, + {file = "msgpack-1.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:534480ee5690ab3cbed89d4c8971a5c631b69a8c0883ecfea96c19118510c846"}, + {file = "msgpack-1.1.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:8cf9e8c3a2153934a23ac160cc4cba0ec035f6867c8013cc6077a79823370346"}, + {file = "msgpack-1.1.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:3180065ec2abbe13a4ad37688b61b99d7f9e012a535b930e0e683ad6bc30155b"}, + {file = "msgpack-1.1.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:c5a91481a3cc573ac8c0d9aace09345d989dc4a0202b7fcb312c88c26d4e71a8"}, + {file = "msgpack-1.1.0-cp39-cp39-win32.whl", hash = "sha256:f80bc7d47f76089633763f952e67f8214cb7b3ee6bfa489b3cb6a84cfac114cd"}, + {file = "msgpack-1.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:4d1b7ff2d6146e16e8bd665ac726a89c74163ef8cd39fa8c1087d4e52d3a2325"}, + {file = "msgpack-1.1.0.tar.gz", hash = "sha256:dd432ccc2c72b914e4cb77afce64aab761c1137cc698be3984eee260bcb2896e"}, +] + [[package]] name = "multidict" version = "6.0.5" @@ -1597,6 +1729,20 @@ urllib3 = ">=1.21.1,<3" socks = ["PySocks (>=1.5.6,!=1.5.7)"] use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] +[[package]] +name = "requests-toolbelt" +version = "1.0.0" +description = "A utility belt for advanced users of python-requests" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "requests-toolbelt-1.0.0.tar.gz", hash = "sha256:7681a0a3d047012b5bdc0ee37d7f8f07ebe76ab08caeccfc3921ce23c88d5bc6"}, + {file = "requests_toolbelt-1.0.0-py2.py3-none-any.whl", hash = "sha256:cccfdd665f0a24fcf4726e690f65639d272bb0637b9b92dfd91a5568ccf6bd06"}, +] + +[package.dependencies] +requests = ">=2.0.1,<3.0.0" + [[package]] name = "rich" version = "13.8.0" @@ -2238,4 +2384,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12" -content-hash = "6a90bb9155b6367f017f6991a4701f455c3b5204dc1134f93b742d09e8004469" +content-hash = "88da8ecbba6a460244747fa296276cf3fa32751ca6801a8ea730bf70fd776306" From d4d4b4fcb77da08853b9e57a9179e9489c464995 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Mon, 4 Nov 2024 21:01:45 +0100 Subject: [PATCH 54/67] Update congic --- server/intelligence-service/openapi.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/intelligence-service/openapi.yaml b/server/intelligence-service/openapi.yaml index 305d241e..3a096fb9 100644 --- a/server/intelligence-service/openapi.yaml +++ b/server/intelligence-service/openapi.yaml @@ -5,6 +5,11 @@ components: message: title: Message type: string + thread_id: + anyOf: + - type: string + - type: 'null' + title: Thread Id required: - message title: ChatRequest @@ -14,6 +19,11 @@ components: response: title: Response type: string + thread_id: + anyOf: + - type: string + - type: 'null' + title: Thread Id required: - response title: ChatResponse From ef9ff361292878e23a062e1ef11b7060c7f11604 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Mon, 4 Nov 2024 21:02:12 +0100 Subject: [PATCH 55/67] Add memory and basic prompt integration --- server/intelligence-service/app/main.py | 34 +++++++-- server/intelligence-service/app/model.py | 92 +++++++++++++++++++++++- 2 files changed, 117 insertions(+), 9 deletions(-) diff --git a/server/intelligence-service/app/main.py b/server/intelligence-service/app/main.py index ac362b0c..9a82afb7 100644 --- a/server/intelligence-service/app/main.py +++ b/server/intelligence-service/app/main.py @@ -1,7 +1,7 @@ from fastapi import FastAPI, HTTPException from pydantic import BaseModel -from .model import model - +from .model import start_chat as start_chat_function, chat as chat_function +from typing import Dict, Optional app = FastAPI( title="Hephaestus Intelligence Service API", @@ -10,19 +10,39 @@ contact={"name": "Felix T.J. Dietrich", "email": "felixtj.dietrich@tum.de"}, ) +# Global dictionary to store conversation states +conversations: Dict[str, dict] = {} + class ChatRequest(BaseModel): message: str + thread_id: Optional[str] = None class ChatResponse(BaseModel): response: str + thread_id: Optional[str] = None @app.post("/chat", response_model=ChatResponse, summary="Chat with LLM") async def chat(request: ChatRequest): - try: - response = model.invoke(request.message) - return {"response": response.content} - except Exception as e: - raise HTTPException(status_code=500, detail=str(e)) + if request.thread_id is None: + # Start a new chat session + result = start_chat_function(request.message) + thread_id = result["thread_id"] + state = result["state"] + response_message = result["response"]["messages"][-1].content + conversations[thread_id] = state + return ChatResponse(thread_id=thread_id, response=response_message) + else: + thread_id = request.thread_id + # Check if the thread_id exists + if thread_id not in conversations: + raise HTTPException(status_code=404, detail="Thread ID not found") + state = conversations[thread_id] + user_input = request.message + result = chat_function(thread_id, user_input, state) + state = result["state"] + response_message = result["response"]["messages"][-1].content + conversations[thread_id] = state + return ChatResponse(response=response_message) diff --git a/server/intelligence-service/app/model.py b/server/intelligence-service/app/model.py index ecacc241..59fb8638 100644 --- a/server/intelligence-service/app/model.py +++ b/server/intelligence-service/app/model.py @@ -1,15 +1,27 @@ import os +from .config import settings +from random import randint +from typing import Sequence +from typing_extensions import Annotated, TypedDict + +from langchain_core.messages import trim_messages, BaseMessage, HumanMessage from langchain.chat_models.base import BaseChatModel from langchain_openai import ChatOpenAI, AzureChatOpenAI +from langchain_core.prompts import ChatPromptTemplate +from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder +from langgraph.checkpoint.memory import MemorySaver +from langgraph.graph import START, StateGraph +from langgraph.graph.message import add_messages -from .config import settings model: BaseChatModel if os.getenv("GITHUB_ACTIONS") == "true": - class MockChatModel(): + + class MockChatModel: def invoke(self, message: str): return "Mock response" + model = MockChatModel() elif settings.is_openai_available: @@ -18,3 +30,79 @@ def invoke(self, message: str): model = AzureChatOpenAI() else: raise EnvironmentError("No LLM available") + + +class State(TypedDict): + messages: Annotated[Sequence[BaseMessage], add_messages] + step: int + + +mentor_prompt = ChatPromptTemplate.from_messages( + [ + ( + "system", + "You are an AI mentor helping a students working on the software engineering projects." + + "You need to guide the student through the set of three questions regarding their work on the project during the last week (sprint)." + + "Steps are the indicator of your current task in the conversation with the student. Your current step is {step}. Just follow the instructions and focus on the current step." + + "If your step is 0: greet the student and ask about the overall progress on the project." + + "If your step is 1: ask the student about the challenges faced during the sprint reffering to what he saied about progress." + + "If your step is 2: ask about the plan for the next sprint." + + "If your step is >2: continue the conversation trying to assist the student.", + ), + MessagesPlaceholder(variable_name="messages"), + ] +) + +workflow = StateGraph(state_schema=State) +trimmer = trim_messages( + max_tokens=400, + strategy="last", + token_counter=model, + include_system=True, + allow_partial=False, + start_on="human", +) + + +def call_model(state: State): + chain = mentor_prompt | model + trimmed_messages = trimmer.invoke(state["messages"]) + response = chain.invoke({"messages": trimmed_messages, "step": state["step"]}) + return {"messages": [response]} + + +workflow.add_edge(START, "model") +workflow.add_node("model", call_model) + +memory = MemorySaver() +app = workflow.compile(checkpointer=memory) + + +def start_chat(input_message: str): + messages = [HumanMessage(input_message)] + state = State(messages=messages, step=0) + thread_id = "chat_" + str(randint(0, 9999)) + config = {"configurable": {"thread_id": thread_id}} + + output = app.invoke( + {"messages": state["messages"], "step": state["step"]}, + config, + ) + + state["messages"] += output.get("messages", []) + return {"thread_id": thread_id, "state": state, "response": output} + + +def chat(thread_id: str, input_message: str, state: State): + config = {"configurable": {"thread_id": thread_id}} + # append the new human message to the conversation + state["messages"] += [HumanMessage(input_message)] + state["step"] += 1 + + output = app.invoke( + {"messages": state["messages"], "step": state["step"]}, + config, + ) + + state["messages"] += output.get("messages", []) + return {"state": state, "response": output} From c3718e0473ad44b415433192b49b9a4b9bb82164 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Mon, 4 Nov 2024 21:02:30 +0100 Subject: [PATCH 56/67] Add langgraph --- server/intelligence-service/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/server/intelligence-service/pyproject.toml b/server/intelligence-service/pyproject.toml index 4c3174f6..331944bb 100644 --- a/server/intelligence-service/pyproject.toml +++ b/server/intelligence-service/pyproject.toml @@ -13,6 +13,7 @@ fastapi = {extras = ["standard"], version = "0.112.1"} pydantic-settings = "2.4.0" langchain = "0.2.15" langchain-openai = "0.1.23" +langgraph = "^0.2.44" [virtualenvs] create = true From ede2d738391b7e8e0f697c70c8ee5af43a741895 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Mon, 4 Nov 2024 22:37:17 +0100 Subject: [PATCH 57/67] Update specs --- .../intelligenceservice/api/DefaultApi.java | 4 +- .../model/ChatRequest.java | 60 ++++++++++++++++++- .../model/ChatResponse.java | 60 ++++++++++++++++++- server/intelligence-service/app/main.py | 2 +- server/intelligence-service/openapi.yaml | 12 +++- 5 files changed, 128 insertions(+), 10 deletions(-) diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice/api/DefaultApi.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice/api/DefaultApi.java index 0158bbd6..a7dc7925 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice/api/DefaultApi.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice/api/DefaultApi.java @@ -42,7 +42,7 @@ public DefaultApi(ApiClient apiClient) { } /** - * Get a response from an LLM to a chat message. + * Chat with LLM * *

200 - Successful Response *

422 - Validation Error @@ -55,7 +55,7 @@ public ChatResponse chatChatPost(ChatRequest chatRequest) throws RestClientExcep } /** - * Get a response from an LLM to a chat message. + * Chat with LLM * *

200 - Successful Response *

422 - Validation Error diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice/model/ChatRequest.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice/model/ChatRequest.java index 70234d22..2a35c7bd 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice/model/ChatRequest.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice/model/ChatRequest.java @@ -20,6 +20,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import org.hibernate.validator.constraints.*; @@ -28,13 +32,17 @@ * ChatRequest */ @JsonPropertyOrder({ - ChatRequest.JSON_PROPERTY_MESSAGE + ChatRequest.JSON_PROPERTY_MESSAGE, + ChatRequest.JSON_PROPERTY_THREAD_ID }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ChatRequest { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public static final String JSON_PROPERTY_THREAD_ID = "thread_id"; + private JsonNullable threadId = JsonNullable.undefined(); + public ChatRequest() { } @@ -63,6 +71,39 @@ public void setMessage(String message) { this.message = message; } + public ChatRequest threadId(String threadId) { + this.threadId = JsonNullable.of(threadId); + + return this; + } + + /** + * Get threadId + * @return threadId + */ + @jakarta.annotation.Nullable + @JsonIgnore + + public String getThreadId() { + return threadId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_THREAD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getThreadId_JsonNullable() { + return threadId; + } + + @JsonProperty(JSON_PROPERTY_THREAD_ID) + public void setThreadId_JsonNullable(JsonNullable threadId) { + this.threadId = threadId; + } + + public void setThreadId(String threadId) { + this.threadId = JsonNullable.of(threadId); + } + @Override public boolean equals(Object o) { if (this == o) { @@ -72,12 +113,24 @@ public boolean equals(Object o) { return false; } ChatRequest chatRequest = (ChatRequest) o; - return Objects.equals(this.message, chatRequest.message); + return Objects.equals(this.message, chatRequest.message) && + equalsNullable(this.threadId, chatRequest.threadId); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(message); + return Objects.hash(message, hashCodeNullable(threadId)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override @@ -85,6 +138,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ChatRequest {\n"); sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" threadId: ").append(toIndentedString(threadId)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice/model/ChatResponse.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice/model/ChatResponse.java index a601104d..5f615747 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice/model/ChatResponse.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice/model/ChatResponse.java @@ -20,6 +20,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import org.hibernate.validator.constraints.*; @@ -28,13 +32,17 @@ * ChatResponse */ @JsonPropertyOrder({ - ChatResponse.JSON_PROPERTY_RESPONSE + ChatResponse.JSON_PROPERTY_RESPONSE, + ChatResponse.JSON_PROPERTY_THREAD_ID }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ChatResponse { public static final String JSON_PROPERTY_RESPONSE = "response"; private String response; + public static final String JSON_PROPERTY_THREAD_ID = "thread_id"; + private JsonNullable threadId = JsonNullable.undefined(); + public ChatResponse() { } @@ -63,6 +71,39 @@ public void setResponse(String response) { this.response = response; } + public ChatResponse threadId(String threadId) { + this.threadId = JsonNullable.of(threadId); + + return this; + } + + /** + * Get threadId + * @return threadId + */ + @jakarta.annotation.Nullable + @JsonIgnore + + public String getThreadId() { + return threadId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_THREAD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getThreadId_JsonNullable() { + return threadId; + } + + @JsonProperty(JSON_PROPERTY_THREAD_ID) + public void setThreadId_JsonNullable(JsonNullable threadId) { + this.threadId = threadId; + } + + public void setThreadId(String threadId) { + this.threadId = JsonNullable.of(threadId); + } + @Override public boolean equals(Object o) { if (this == o) { @@ -72,12 +113,24 @@ public boolean equals(Object o) { return false; } ChatResponse chatResponse = (ChatResponse) o; - return Objects.equals(this.response, chatResponse.response); + return Objects.equals(this.response, chatResponse.response) && + equalsNullable(this.threadId, chatResponse.threadId); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(response); + return Objects.hash(response, hashCodeNullable(threadId)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override @@ -85,6 +138,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ChatResponse {\n"); sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" threadId: ").append(toIndentedString(threadId)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/server/intelligence-service/app/main.py b/server/intelligence-service/app/main.py index dc6cfe01..154303a0 100644 --- a/server/intelligence-service/app/main.py +++ b/server/intelligence-service/app/main.py @@ -24,7 +24,7 @@ class ChatResponse(BaseModel): thread_id: Optional[str] = None -@app.post("/chat", response_model=ChatResponse, summary="Chat with LLM") +@app.post("/chat", response_model=ChatResponse, summary="Start and continue a chat session with an LLM.") async def chat(request: ChatRequest): if request.thread_id is None: # Start a new chat session diff --git a/server/intelligence-service/openapi.yaml b/server/intelligence-service/openapi.yaml index f48cfc8a..3a096fb9 100644 --- a/server/intelligence-service/openapi.yaml +++ b/server/intelligence-service/openapi.yaml @@ -5,6 +5,11 @@ components: message: title: Message type: string + thread_id: + anyOf: + - type: string + - type: 'null' + title: Thread Id required: - message title: ChatRequest @@ -14,6 +19,11 @@ components: response: title: Response type: string + thread_id: + anyOf: + - type: string + - type: 'null' + title: Thread Id required: - response title: ChatResponse @@ -79,4 +89,4 @@ paths: schema: $ref: '#/components/schemas/HTTPValidationError' description: Validation Error - summary: Get a response from an LLM to a chat message. \ No newline at end of file + summary: Chat with LLM From 05c379810371709033e9e641f704eeb3b0e9f977 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Mon, 4 Nov 2024 22:51:42 +0100 Subject: [PATCH 58/67] Change chat description --- .../www1/hephaestus/intelligenceservice/api/DefaultApi.java | 4 ++-- server/intelligence-service/openapi.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice/api/DefaultApi.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice/api/DefaultApi.java index a7dc7925..946825f3 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice/api/DefaultApi.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice/api/DefaultApi.java @@ -42,7 +42,7 @@ public DefaultApi(ApiClient apiClient) { } /** - * Chat with LLM + * Start and continue a chat session with an LLM. * *

200 - Successful Response *

422 - Validation Error @@ -55,7 +55,7 @@ public ChatResponse chatChatPost(ChatRequest chatRequest) throws RestClientExcep } /** - * Chat with LLM + * Start and continue a chat session with an LLM. * *

200 - Successful Response *

422 - Validation Error diff --git a/server/intelligence-service/openapi.yaml b/server/intelligence-service/openapi.yaml index 3a096fb9..0f802b7e 100644 --- a/server/intelligence-service/openapi.yaml +++ b/server/intelligence-service/openapi.yaml @@ -89,4 +89,4 @@ paths: schema: $ref: '#/components/schemas/HTTPValidationError' description: Validation Error - summary: Chat with LLM + summary: Start and continue a chat session with an LLM. From 8c5a02ea54f50b9aa720bc3d6ead67cedf22011a Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 5 Nov 2024 10:23:05 +0100 Subject: [PATCH 59/67] Renamed intelligence api folder --- .../hephaestus/intelligenceapi/ApiClient.java | 803 ------------------ .../hephaestus/intelligenceapi/BaseApi.java | 74 -- .../BeanValidationException.java | 27 - .../intelligenceapi/JavaTimeFormatter.java | 64 -- .../intelligenceapi/RFC3339DateFormat.java | 58 -- .../intelligenceapi/ServerConfiguration.java | 59 -- .../intelligenceapi/ServerVariable.java | 24 - .../intelligenceapi/api/DefaultApi.java | 119 --- .../intelligenceapi/auth/ApiKeyAuth.java | 62 -- .../intelligenceapi/auth/Authentication.java | 14 - .../intelligenceapi/auth/HttpBasicAuth.java | 38 - .../intelligenceapi/auth/HttpBearerAuth.java | 56 -- .../intelligenceapi/model/ChatRequest.java | 104 --- .../intelligenceapi/model/ChatResponse.java | 104 --- .../model/HTTPValidationError.java | 116 --- .../model/ValidationError.java | 178 ---- .../model/ValidationErrorLocInner.java | 70 -- 17 files changed, 1970 deletions(-) delete mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java delete mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java delete mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BeanValidationException.java delete mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java delete mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java delete mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java delete mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java delete mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java delete mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java delete mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/Authentication.java delete mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java delete mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java delete mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java delete mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java delete mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java delete mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java delete mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java deleted file mode 100644 index 7b2f1071..00000000 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ApiClient.java +++ /dev/null @@ -1,803 +0,0 @@ -package de.tum.in.www1.hephaestus.intelligenceapi; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.ParameterizedTypeReference; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpRequest; -import org.springframework.http.HttpStatus; -import org.springframework.http.InvalidMediaTypeException; -import org.springframework.http.MediaType; -import org.springframework.http.RequestEntity; -import org.springframework.http.RequestEntity.BodyBuilder; -import org.springframework.http.ResponseEntity; -import org.springframework.http.client.BufferingClientHttpRequestFactory; -import org.springframework.http.client.ClientHttpRequestExecution; -import org.springframework.http.client.ClientHttpRequestInterceptor; -import org.springframework.http.client.ClientHttpResponse; -import org.springframework.stereotype.Component; -import org.springframework.util.CollectionUtils; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.util.StringUtils; -import org.springframework.web.client.HttpClientErrorException; -import org.springframework.web.client.HttpServerErrorException; -import org.springframework.web.client.RestClientException; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.util.UriComponentsBuilder; -import org.springframework.web.util.DefaultUriBuilderFactory; -import org.openapitools.jackson.nullable.JsonNullableModule; - - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.text.DateFormat; -import java.text.ParseException; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.TimeZone; -import java.util.function.Supplier; -import java.time.OffsetDateTime; - -import de.tum.in.www1.hephaestus.intelligenceapi.auth.Authentication; - -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -@Component("de.tum.in.www1.hephaestus.intelligenceapi.ApiClient") -public class ApiClient extends JavaTimeFormatter { - public enum CollectionFormat { - CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); - - private final String separator; - - private CollectionFormat(String separator) { - this.separator = separator; - } - - private String collectionToString(Collection collection) { - return StringUtils.collectionToDelimitedString(collection, separator); - } - } - - private boolean debugging = false; - - private HttpHeaders defaultHeaders = new HttpHeaders(); - private MultiValueMap defaultCookies = new LinkedMultiValueMap(); - - private int maxAttemptsForRetry = 1; - - private long waitTimeMillis = 10; - - private String basePath = "http://localhost"; - - private RestTemplate restTemplate; - - private Map authentications; - - private DateFormat dateFormat; - - public ApiClient() { - this.restTemplate = buildRestTemplate(); - init(); - } - - @Autowired - public ApiClient(RestTemplate restTemplate) { - this.restTemplate = restTemplate; - init(); - } - - protected void init() { - // Use RFC3339 format for date and datetime. - // See http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14 - this.dateFormat = new RFC3339DateFormat(); - - // Use UTC as the default time zone. - this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); - - // Set default User-Agent. - setUserAgent("Java-SDK"); - - // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - /** - * Get the current base path - * - * @return String the base path - */ - public String getBasePath() { - return basePath; - } - - /** - * Set the base path, which should include the host - * - * @param basePath the base path - * @return ApiClient this client - */ - public ApiClient setBasePath(String basePath) { - this.basePath = basePath; - return this; - } - - /** - * Get the max attempts for retry - * - * @return int the max attempts - */ - public int getMaxAttemptsForRetry() { - return maxAttemptsForRetry; - } - - /** - * Set the max attempts for retry - * - * @param maxAttemptsForRetry the max attempts for retry - * @return ApiClient this client - */ - public ApiClient setMaxAttemptsForRetry(int maxAttemptsForRetry) { - this.maxAttemptsForRetry = maxAttemptsForRetry; - return this; - } - - /** - * Get the wait time in milliseconds - * - * @return long wait time in milliseconds - */ - public long getWaitTimeMillis() { - return waitTimeMillis; - } - - /** - * Set the wait time in milliseconds - * - * @param waitTimeMillis the wait time in milliseconds - * @return ApiClient this client - */ - public ApiClient setWaitTimeMillis(long waitTimeMillis) { - this.waitTimeMillis = waitTimeMillis; - return this; - } - - /** - * Get authentications (key: authentication name, value: authentication). - * - * @return Map the currently configured authentication types - */ - public Map getAuthentications() { - return authentications; - } - - /** - * Get authentication for the given name. - * - * @param authName The authentication name - * @return The authentication, null if not found - */ - public Authentication getAuthentication(String authName) { - return authentications.get(authName); - } - - - - - - /** - * Set the User-Agent header's value (by adding to the default header map). - * - * @param userAgent the user agent string - * @return ApiClient this client - */ - public ApiClient setUserAgent(String userAgent) { - addDefaultHeader("User-Agent", userAgent); - return this; - } - - /** - * Add a default header. - * - * @param name The header's name - * @param value The header's value - * @return ApiClient this client - */ - public ApiClient addDefaultHeader(String name, String value) { - if (defaultHeaders.containsKey(name)) { - defaultHeaders.remove(name); - } - defaultHeaders.add(name, value); - return this; - } - - /** - * Add a default cookie. - * - * @param name The cookie's name - * @param value The cookie's value - * @return ApiClient this client - */ - public ApiClient addDefaultCookie(String name, String value) { - if (defaultCookies.containsKey(name)) { - defaultCookies.remove(name); - } - defaultCookies.add(name, value); - return this; - } - - public void setDebugging(boolean debugging) { - List currentInterceptors = this.restTemplate.getInterceptors(); - if (debugging) { - if (currentInterceptors == null) { - currentInterceptors = new ArrayList(); - } - ClientHttpRequestInterceptor interceptor = new ApiClientHttpRequestInterceptor(); - currentInterceptors.add(interceptor); - this.restTemplate.setInterceptors(currentInterceptors); - } else { - if (currentInterceptors != null && !currentInterceptors.isEmpty()) { - Iterator iter = currentInterceptors.iterator(); - while (iter.hasNext()) { - ClientHttpRequestInterceptor interceptor = iter.next(); - if (interceptor instanceof ApiClientHttpRequestInterceptor) { - iter.remove(); - } - } - this.restTemplate.setInterceptors(currentInterceptors); - } - } - this.debugging = debugging; - } - - /** - * Check that whether debugging is enabled for this API client. - * @return boolean true if this client is enabled for debugging, false otherwise - */ - public boolean isDebugging() { - return debugging; - } - - /** - * Get the date format used to parse/format date parameters. - * @return DateFormat format - */ - public DateFormat getDateFormat() { - return dateFormat; - } - - /** - * Set the date format used to parse/format date parameters. - * @param dateFormat Date format - * @return API client - */ - public ApiClient setDateFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - return this; - } - - /** - * Parse the given string into Date object. - * - * @param str the string to parse - * @return the Date parsed from the string - */ - public Date parseDate(String str) { - try { - return dateFormat.parse(str); - } catch (ParseException e) { - throw new RuntimeException(e); - } - } - - /** - * Format the given Date object into string. - * - * @param date the date to format - * @return the formatted date as string - */ - public String formatDate(Date date) { - return dateFormat.format(date); - } - - /** - * Format the given parameter object into string. - * - * @param param the object to convert - * @return String the parameter represented as a String - */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date) { - return formatDate( (Date) param); - } else if (param instanceof OffsetDateTime) { - return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for (Object o : (Collection) param) { - if (b.length() > 0) { - b.append(","); - } - b.append(String.valueOf(o)); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /** - * Formats the specified collection path parameter to a string value. - * - * @param collectionFormat The collection format of the parameter. - * @param values The values of the parameter. - * @return String representation of the parameter - */ - public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { - // create the value based on the collection format - if (CollectionFormat.MULTI.equals(collectionFormat)) { - // not valid for path params - return parameterToString(values); - } - - // collectionFormat is assumed to be "csv" by default - if (collectionFormat == null) { - collectionFormat = CollectionFormat.CSV; - } - - return collectionFormat.collectionToString(values); - } - - /** - * Converts a parameter to a {@link MultiValueMap} for use in REST requests - * - * @param collectionFormat The format to convert to - * @param name The name of the parameter - * @param value The parameter's value - * @return a Map containing the String value(s) of the input parameter - */ - public MultiValueMap parameterToMultiValueMap(CollectionFormat collectionFormat, String name, Object value) { - final MultiValueMap params = new LinkedMultiValueMap(); - - if (name == null || name.isEmpty() || value == null) { - return params; - } - - if (collectionFormat == null) { - collectionFormat = CollectionFormat.CSV; - } - - if (value instanceof Map) { - @SuppressWarnings("unchecked") - final Map valuesMap = (Map) value; - for (final Entry entry : valuesMap.entrySet()) { - params.add(entry.getKey(), parameterToString(entry.getValue())); - } - return params; - } - - Collection valueCollection = null; - if (value instanceof Collection) { - valueCollection = (Collection) value; - } else { - params.add(name, parameterToString(value)); - return params; - } - - if (valueCollection.isEmpty()) { - return params; - } - - if (collectionFormat.equals(CollectionFormat.MULTI)) { - for (Object item : valueCollection) { - params.add(name, parameterToString(item)); - } - return params; - } - - List values = new ArrayList(); - for (Object o : valueCollection) { - values.add(parameterToString(o)); - } - params.add(name, collectionFormat.collectionToString(values)); - - return params; - } - - /** - * Check if the given {@code String} is a JSON MIME. - * - * @param mediaType the input MediaType - * @return boolean true if the MediaType represents JSON, false otherwise - */ - public boolean isJsonMime(String mediaType) { - // "* / *" is default to JSON - if ("*/*".equals(mediaType)) { - return true; - } - - try { - return isJsonMime(MediaType.parseMediaType(mediaType)); - } catch (InvalidMediaTypeException e) { - } - return false; - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * - * @param mediaType the input MediaType - * @return boolean true if the MediaType represents JSON, false otherwise - */ - public boolean isJsonMime(MediaType mediaType) { - return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*\\+json[;]?\\s*$")); - } - - /** - * Check if the given {@code String} is a Problem JSON MIME (RFC-7807). - * - * @param mediaType the input MediaType - * @return boolean true if the MediaType represents Problem JSON, false otherwise - */ - public boolean isProblemJsonMime(String mediaType) { - return "application/problem+json".equalsIgnoreCase(mediaType); - } - - /** - * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) - * - * @param accepts The accepts array to select from - * @return List The list of MediaTypes to use for the Accept header - */ - public List selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { - return null; - } - for (String accept : accepts) { - MediaType mediaType = MediaType.parseMediaType(accept); - if (isJsonMime(mediaType) && !isProblemJsonMime(accept)) { - return Collections.singletonList(mediaType); - } - } - return MediaType.parseMediaTypes(StringUtils.arrayToCommaDelimitedString(accepts)); - } - - /** - * Select the Content-Type header's value from the given array: - * if JSON exists in the given array, use it; - * otherwise use the first one of the array. - * - * @param contentTypes The Content-Type array to select from - * @return MediaType The Content-Type header to use. If the given array is empty, JSON will be used. - */ - public MediaType selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { - return MediaType.APPLICATION_JSON; - } - for (String contentType : contentTypes) { - MediaType mediaType = MediaType.parseMediaType(contentType); - if (isJsonMime(mediaType)) { - return mediaType; - } - } - return MediaType.parseMediaType(contentTypes[0]); - } - - /** - * Select the body to use for the request - * - * @param obj the body object - * @param formParams the form parameters - * @param contentType the content type of the request - * @return Object the selected body - */ - protected Object selectBody(Object obj, MultiValueMap formParams, MediaType contentType) { - boolean isForm = MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType) || MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(contentType); - return isForm ? formParams : obj; - } - - /** - * Expand path template with variables - * - * @param pathTemplate path template with placeholders - * @param variables variables to replace - * @return path with placeholders replaced by variables - */ - public String expandPath(String pathTemplate, Map variables) { - return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString(); - } - - /** - * Include queryParams in uriParams taking into account the paramName - * - * @param queryParams The query parameters - * @param uriParams The path parameters - * return templatized query string - */ - public String generateQueryUri(MultiValueMap queryParams, Map uriParams) { - StringBuilder queryBuilder = new StringBuilder(); - queryParams.forEach((name, values) -> { - try { - final String encodedName = URLEncoder.encode(name.toString(), "UTF-8"); - if (CollectionUtils.isEmpty(values)) { - if (queryBuilder.length() != 0) { - queryBuilder.append('&'); - } - queryBuilder.append(encodedName); - } else { - int valueItemCounter = 0; - for (Object value : values) { - if (queryBuilder.length() != 0) { - queryBuilder.append('&'); - } - queryBuilder.append(encodedName); - if (value != null) { - String templatizedKey = encodedName + valueItemCounter++; - uriParams.put(templatizedKey, value.toString()); - queryBuilder.append('=').append("{").append(templatizedKey).append("}"); - } - } - } - } catch (UnsupportedEncodingException e) { - - } - }); - return queryBuilder.toString(); - - } - - /** - * Invoke API by sending HTTP request with the given options. - * - * @param the return type to use - * @param path The sub-path of the HTTP URL - * @param method The request method - * @param pathParams The path parameters - * @param queryParams The query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param accept The request's Accept header - * @param contentType The request's Content-Type header - * @param authNames The authentications to apply - * @param returnType The return type into which to deserialize the response - * @return ResponseEntity<T> The response of the chosen type - */ - public ResponseEntity invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { - updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); - - Map uriParams = new HashMap<>(); - uriParams.putAll(pathParams); - - String finalUri = path; - - if (queryParams != null && !queryParams.isEmpty()) { - //Include queryParams in uriParams taking into account the paramName - String queryUri = generateQueryUri(queryParams, uriParams); - //Append to finalUri the templatized query string like "?param1={param1Value}&....... - finalUri += "?" + queryUri; - } - String expandedPath = this.expandPath(finalUri, uriParams); - final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(expandedPath); - - URI uri; - try { - uri = new URI(builder.build().toUriString()); - } catch (URISyntaxException ex) { - throw new RestClientException("Could not build URL: " + builder.toUriString(), ex); - } - - final BodyBuilder requestBuilder = RequestEntity.method(method, UriComponentsBuilder.fromHttpUrl(basePath).toUriString() + finalUri, uriParams); - if (accept != null) { - requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); - } - if (contentType != null) { - requestBuilder.contentType(contentType); - } - - addHeadersToRequest(headerParams, requestBuilder); - addHeadersToRequest(defaultHeaders, requestBuilder); - addCookiesToRequest(cookieParams, requestBuilder); - addCookiesToRequest(defaultCookies, requestBuilder); - - RequestEntity requestEntity = requestBuilder.body(selectBody(body, formParams, contentType)); - - ResponseEntity responseEntity = null; - int attempts = 0; - while (attempts < maxAttemptsForRetry) { - try { - responseEntity = restTemplate.exchange(requestEntity, returnType); - break; - } catch (HttpServerErrorException | HttpClientErrorException ex) { - if (ex instanceof HttpServerErrorException - || ((HttpClientErrorException) ex) - .getStatusCode() - .equals(HttpStatus.TOO_MANY_REQUESTS)) { - attempts++; - if (attempts < maxAttemptsForRetry) { - try { - Thread.sleep(waitTimeMillis); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - } else { - throw ex; - } - } else { - throw ex; - } - } - } - - if (responseEntity == null) { - throw new RestClientException("ResponseEntity is null"); - } - - if (responseEntity.getStatusCode().is2xxSuccessful()) { - return responseEntity; - } else { - // The error handler built into the RestTemplate should handle 400 and 500 series errors. - throw new RestClientException("API returned " + responseEntity.getStatusCode() + " and it wasn't handled by the RestTemplate error handler"); - } - } - - /** - * Add headers to the request that is being built - * @param headers The headers to add - * @param requestBuilder The current request - */ - protected void addHeadersToRequest(HttpHeaders headers, BodyBuilder requestBuilder) { - for (Entry> entry : headers.entrySet()) { - List values = entry.getValue(); - for (String value : values) { - if (value != null) { - requestBuilder.header(entry.getKey(), value); - } - } - } - } - - /** - * Add cookies to the request that is being built - * - * @param cookies The cookies to add - * @param requestBuilder The current request - */ - protected void addCookiesToRequest(MultiValueMap cookies, BodyBuilder requestBuilder) { - if (!cookies.isEmpty()) { - requestBuilder.header("Cookie", buildCookieHeader(cookies)); - } - } - - /** - * Build cookie header. Keeps a single value per cookie (as per - * RFC6265 section 5.3). - * - * @param cookies map all cookies - * @return header string for cookies. - */ - private String buildCookieHeader(MultiValueMap cookies) { - final StringBuilder cookieValue = new StringBuilder(); - String delimiter = ""; - for (final Map.Entry> entry : cookies.entrySet()) { - final String value = entry.getValue().get(entry.getValue().size() - 1); - cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), value)); - delimiter = "; "; - } - return cookieValue.toString(); - } - - /** - * Build the RestTemplate used to make HTTP requests. - * @return RestTemplate - */ - protected RestTemplate buildRestTemplate() { - RestTemplate restTemplate = new RestTemplate(); - // This allows us to read the response more than once - Necessary for debugging. - restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(restTemplate.getRequestFactory())); - - // disable default URL encoding - DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(); - uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.VALUES_ONLY); - restTemplate.setUriTemplateHandler(uriBuilderFactory); - return restTemplate; - } - - /** - * Update query and header parameters based on authentication settings. - * - * @param authNames The authentications to apply - * @param queryParams The query parameters - * @param headerParams The header parameters - */ - protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { - for (String authName : authNames) { - Authentication auth = authentications.get(authName); - if (auth == null) { - throw new RestClientException("Authentication undefined: " + authName); - } - auth.applyToParams(queryParams, headerParams, cookieParams); - } - } - - private class ApiClientHttpRequestInterceptor implements ClientHttpRequestInterceptor { - private final Log log = LogFactory.getLog(ApiClientHttpRequestInterceptor.class); - - @Override - public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException { - logRequest(request, body); - ClientHttpResponse response = execution.execute(request, body); - logResponse(response); - return response; - } - - private void logRequest(HttpRequest request, byte[] body) throws UnsupportedEncodingException { - log.info("URI: " + request.getURI()); - log.info("HTTP Method: " + request.getMethod()); - log.info("HTTP Headers: " + headersToString(request.getHeaders())); - log.info("Request Body: " + new String(body, StandardCharsets.UTF_8)); - } - - private void logResponse(ClientHttpResponse response) throws IOException { - log.info("HTTP Status Code: " + response.getStatusCode().value()); - log.info("Status Text: " + response.getStatusText()); - log.info("HTTP Headers: " + headersToString(response.getHeaders())); - log.info("Response Body: " + bodyToString(response.getBody())); - } - - private String headersToString(HttpHeaders headers) { - if(headers == null || headers.isEmpty()) { - return ""; - } - StringBuilder builder = new StringBuilder(); - for (Entry> entry : headers.entrySet()) { - builder.append(entry.getKey()).append("=["); - for (String value : entry.getValue()) { - builder.append(value).append(","); - } - builder.setLength(builder.length() - 1); // Get rid of trailing comma - builder.append("],"); - } - builder.setLength(builder.length() - 1); // Get rid of trailing comma - return builder.toString(); - } - - private String bodyToString(InputStream body) throws IOException { - StringBuilder builder = new StringBuilder(); - BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(body, StandardCharsets.UTF_8)); - String line = bufferedReader.readLine(); - while (line != null) { - builder.append(line).append(System.lineSeparator()); - line = bufferedReader.readLine(); - } - bufferedReader.close(); - return builder.toString(); - } - } -} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java deleted file mode 100644 index abcb2ea6..00000000 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BaseApi.java +++ /dev/null @@ -1,74 +0,0 @@ -package de.tum.in.www1.hephaestus.intelligenceapi; - -import org.springframework.web.client.RestClientException; -import org.springframework.core.ParameterizedTypeReference; -import org.springframework.http.HttpMethod; -import org.springframework.http.ResponseEntity; - -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public abstract class BaseApi { - - protected ApiClient apiClient; - - public BaseApi() { - this(new ApiClient()); - } - - public BaseApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. - * @param url The URL for the request, either full URL or only the path. - * @param method The HTTP method for the request. - * @return ResponseEntity<Void> - * @throws RestClientException if an error occurs while attempting to invoke the API - */ - public ResponseEntity invokeAPI(String url, HttpMethod method) throws RestClientException { - return invokeAPI(url, method, null, new ParameterizedTypeReference() {}); - } - - /** - * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. - * @param url The URL for the request, either full URL or only the path. - * @param method The HTTP method for the request. - * @param request The request object. - * @return ResponseEntity<Void> - * @throws RestClientException if an error occurs while attempting to invoke the API - */ - public ResponseEntity invokeAPI(String url, HttpMethod method, Object request) throws RestClientException { - return invokeAPI(url, method, request, new ParameterizedTypeReference() {}); - } - - /** - * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. - * @param url The URL for the request, either full URL or only the path. - * @param method The HTTP method for the request. - * @param returnType The return type. - * @return ResponseEntity in the specified type. - * @throws RestClientException if an error occurs while attempting to invoke the API - */ - public ResponseEntity invokeAPI(String url, HttpMethod method, ParameterizedTypeReference returnType) throws RestClientException { - return invokeAPI(url, method, null, returnType); - } - - /** - * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. - * @param url The URL for the request, either full URL or only the path. - * @param method The HTTP method for the request. - * @param request The request object. - * @param returnType The return type. - * @return ResponseEntity in the specified type. - * @throws RestClientException if an error occurs while attempting to invoke the API - */ - public abstract ResponseEntity invokeAPI(String url, HttpMethod method, Object request, ParameterizedTypeReference returnType) throws RestClientException; -} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BeanValidationException.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BeanValidationException.java deleted file mode 100644 index 279ceb8f..00000000 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/BeanValidationException.java +++ /dev/null @@ -1,27 +0,0 @@ -package de.tum.in.www1.hephaestus.intelligenceapi; - -import java.util.Set; - -import jakarta.validation.ConstraintViolation; -import jakarta.validation.ValidationException; - -public class BeanValidationException extends ValidationException { - /** - * - */ - private static final long serialVersionUID = -5294733947409491364L; - Set> violations; - - public BeanValidationException(Set> violations) { - this.violations = violations; - } - - public Set> getViolations() { - return violations; - } - - public void setViolations(Set> violations) { - this.violations = violations; - } - -} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java deleted file mode 100644 index f5be0b8b..00000000 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/JavaTimeFormatter.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Hephaestus Intelligence Service API - * API documentation for the Hephaestus Intelligence Service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package de.tum.in.www1.hephaestus.intelligenceapi; - -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.time.format.DateTimeParseException; - -/** - * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. - * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class JavaTimeFormatter { - - private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - - /** - * Get the date format used to parse/format {@code OffsetDateTime} parameters. - * @return DateTimeFormatter - */ - public DateTimeFormatter getOffsetDateTimeFormatter() { - return offsetDateTimeFormatter; - } - - /** - * Set the date format used to parse/format {@code OffsetDateTime} parameters. - * @param offsetDateTimeFormatter {@code DateTimeFormatter} - */ - public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { - this.offsetDateTimeFormatter = offsetDateTimeFormatter; - } - - /** - * Parse the given string into {@code OffsetDateTime} object. - * @param str String - * @return {@code OffsetDateTime} - */ - public OffsetDateTime parseOffsetDateTime(String str) { - try { - return OffsetDateTime.parse(str, offsetDateTimeFormatter); - } catch (DateTimeParseException e) { - throw new RuntimeException(e); - } - } - /** - * Format the given {@code OffsetDateTime} object into string. - * @param offsetDateTime {@code OffsetDateTime} - * @return {@code OffsetDateTime} in string format - */ - public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { - return offsetDateTimeFormatter.format(offsetDateTime); - } -} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java deleted file mode 100644 index 51f04a3b..00000000 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/RFC3339DateFormat.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Hephaestus Intelligence Service API - * API documentation for the Hephaestus Intelligence Service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package de.tum.in.www1.hephaestus.intelligenceapi; - -import com.fasterxml.jackson.databind.util.StdDateFormat; - -import java.text.DateFormat; -import java.text.FieldPosition; -import java.text.ParsePosition; -import java.util.Date; -import java.text.DecimalFormat; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class RFC3339DateFormat extends DateFormat { - private static final long serialVersionUID = 1L; - private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); - - private final StdDateFormat fmt = new StdDateFormat() - .withTimeZone(TIMEZONE_Z) - .withColonInTimeZone(true); - - public RFC3339DateFormat() { - this.calendar = new GregorianCalendar(); - this.numberFormat = new DecimalFormat(); - } - - @Override - public Date parse(String source) { - return parse(source, new ParsePosition(0)); - } - - @Override - public Date parse(String source, ParsePosition pos) { - return fmt.parse(source, pos); - } - - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - return fmt.format(date, toAppendTo, fieldPosition); - } - - @Override - public Object clone() { - return super.clone(); - } -} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java deleted file mode 100644 index 4fcb64c1..00000000 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerConfiguration.java +++ /dev/null @@ -1,59 +0,0 @@ -package de.tum.in.www1.hephaestus.intelligenceapi; - -import java.util.Map; - -/** - * Representing a Server configuration. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class ServerConfiguration { - public String URL; - public String description; - public Map variables; - - /** - * @param URL A URL to the target host. - * @param description A description of the host designated by the URL. - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ - public ServerConfiguration(String URL, String description, Map variables) { - this.URL = URL; - this.description = description; - this.variables = variables; - } - - /** - * Format URL template using given variables. - * - * @param variables A map between a variable name and its value. - * @return Formatted URL. - */ - public String URL(Map variables) { - String url = this.URL; - - // go through variables and replace placeholders - for (Map.Entry variable: this.variables.entrySet()) { - String name = variable.getKey(); - ServerVariable serverVariable = variable.getValue(); - String value = serverVariable.defaultValue; - - if (variables != null && variables.containsKey(name)) { - value = variables.get(name); - if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { - throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); - } - } - url = url.replace("{" + name + "}", value); - } - return url; - } - - /** - * Format URL template using default server variables. - * - * @return Formatted URL. - */ - public String URL() { - return URL(null); - } -} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java deleted file mode 100644 index a08397e6..00000000 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/ServerVariable.java +++ /dev/null @@ -1,24 +0,0 @@ -package de.tum.in.www1.hephaestus.intelligenceapi; - -import java.util.HashSet; - -/** - * Representing a Server Variable for server URL template substitution. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class ServerVariable { - public String description; - public String defaultValue; - public HashSet enumValues = null; - - /** - * @param description A description for the server variable. - * @param defaultValue The default value to use for substitution. - * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. - */ - public ServerVariable(String description, String defaultValue, HashSet enumValues) { - this.description = description; - this.defaultValue = defaultValue; - this.enumValues = enumValues; - } -} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java deleted file mode 100644 index b4d47087..00000000 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/api/DefaultApi.java +++ /dev/null @@ -1,119 +0,0 @@ -package de.tum.in.www1.hephaestus.intelligenceapi.api; - -import de.tum.in.www1.hephaestus.intelligenceapi.ApiClient; -import de.tum.in.www1.hephaestus.intelligenceapi.BaseApi; - -import de.tum.in.www1.hephaestus.intelligenceapi.model.ChatRequest; -import de.tum.in.www1.hephaestus.intelligenceapi.model.ChatResponse; -import de.tum.in.www1.hephaestus.intelligenceapi.model.HTTPValidationError; - -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.stream.Collectors; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestClientException; -import org.springframework.web.client.HttpClientErrorException; -import org.springframework.core.ParameterizedTypeReference; -import org.springframework.core.io.FileSystemResource; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; - -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -@Component("de.tum.in.www1.hephaestus.intelligenceapi.api.DefaultApi") -public class DefaultApi extends BaseApi { - - public DefaultApi() { - super(new ApiClient()); - } - - @Autowired - public DefaultApi(ApiClient apiClient) { - super(apiClient); - } - - /** - * Chat with LLM - * - *

200 - Successful Response - *

422 - Validation Error - * @param chatRequest (required) - * @return ChatResponse - * @throws RestClientException if an error occurs while attempting to invoke the API - */ - public ChatResponse chatChatPost(ChatRequest chatRequest) throws RestClientException { - return chatChatPostWithHttpInfo(chatRequest).getBody(); - } - - /** - * Chat with LLM - * - *

200 - Successful Response - *

422 - Validation Error - * @param chatRequest (required) - * @return ResponseEntity<ChatResponse> - * @throws RestClientException if an error occurs while attempting to invoke the API - */ - public ResponseEntity chatChatPostWithHttpInfo(ChatRequest chatRequest) throws RestClientException { - Object localVarPostBody = chatRequest; - - // verify the required parameter 'chatRequest' is set - if (chatRequest == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'chatRequest' when calling chatChatPost"); - } - - - final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); - final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/chat", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); - } - - @Override - public ResponseEntity invokeAPI(String url, HttpMethod method, Object request, ParameterizedTypeReference returnType) throws RestClientException { - String localVarPath = url.replace(apiClient.getBasePath(), ""); - Object localVarPostBody = request; - - final Map uriVariables = new HashMap(); - final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); - final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI(localVarPath, method, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, returnType); - } -} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java deleted file mode 100644 index 8380140e..00000000 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/ApiKeyAuth.java +++ /dev/null @@ -1,62 +0,0 @@ -package de.tum.in.www1.hephaestus.intelligenceapi.auth; - -import org.springframework.http.HttpHeaders; -import org.springframework.util.MultiValueMap; - -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class ApiKeyAuth implements Authentication { - private final String location; - private final String paramName; - - private String apiKey; - private String apiKeyPrefix; - - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } - - public String getLocation() { - return location; - } - - public String getParamName() { - return paramName; - } - - public String getApiKey() { - return apiKey; - } - - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - public String getApiKeyPrefix() { - return apiKeyPrefix; - } - - public void setApiKeyPrefix(String apiKeyPrefix) { - this.apiKeyPrefix = apiKeyPrefix; - } - - @Override - public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { - if (apiKey == null) { - return; - } - String value; - if (apiKeyPrefix != null) { - value = apiKeyPrefix + " " + apiKey; - } else { - value = apiKey; - } - if (location.equals("query")) { - queryParams.add(paramName, value); - } else if (location.equals("header")) { - headerParams.add(paramName, value); - } else if (location.equals("cookie")) { - cookieParams.add(paramName, value); - } - } -} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/Authentication.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/Authentication.java deleted file mode 100644 index 6887e338..00000000 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/Authentication.java +++ /dev/null @@ -1,14 +0,0 @@ -package de.tum.in.www1.hephaestus.intelligenceapi.auth; - -import org.springframework.http.HttpHeaders; -import org.springframework.util.MultiValueMap; - -public interface Authentication { - /** - * Apply authentication settings to header and / or query parameters. - * @param queryParams The query parameters for the request - * @param headerParams The header parameters for the request - * @param cookieParams The cookie parameters for the request - */ - public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams); -} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java deleted file mode 100644 index 8029c112..00000000 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBasicAuth.java +++ /dev/null @@ -1,38 +0,0 @@ -package de.tum.in.www1.hephaestus.intelligenceapi.auth; - -import java.nio.charset.StandardCharsets; -import java.util.Base64; - -import org.springframework.http.HttpHeaders; -import org.springframework.util.MultiValueMap; - -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class HttpBasicAuth implements Authentication { - private String username; - private String password; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @Override - public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { - if (username == null && password == null) { - return; - } - String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); - } -} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java deleted file mode 100644 index bdf1f859..00000000 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/auth/HttpBearerAuth.java +++ /dev/null @@ -1,56 +0,0 @@ -package de.tum.in.www1.hephaestus.intelligenceapi.auth; - -import java.util.Optional; -import java.util.function.Supplier; -import org.springframework.http.HttpHeaders; -import org.springframework.util.MultiValueMap; - -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class HttpBearerAuth implements Authentication { - private final String scheme; - private Supplier tokenSupplier; - - public HttpBearerAuth(String scheme) { - this.scheme = scheme; - } - - /** - * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @return The bearer token - */ - public String getBearerToken() { - return tokenSupplier.get(); - } - - /** - * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @param bearerToken The bearer token to send in the Authorization header - */ - public void setBearerToken(String bearerToken) { - this.tokenSupplier = () -> bearerToken; - } - - /** - * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. - * - * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header - */ - public void setBearerToken(Supplier tokenSupplier) { - this.tokenSupplier = tokenSupplier; - } - - @Override - public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { - String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); - if (bearerToken == null) { - return; - } - headerParams.add(HttpHeaders.AUTHORIZATION, (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); - } - - private static String upperCaseBearer(String scheme) { - return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; - } -} diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java deleted file mode 100644 index 2086e0e1..00000000 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatRequest.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Hephaestus Intelligence Service API - * API documentation for the Hephaestus Intelligence Service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package de.tum.in.www1.hephaestus.intelligenceapi.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.hibernate.validator.constraints.*; - -/** - * ChatRequest - */ -@JsonPropertyOrder({ - ChatRequest.JSON_PROPERTY_MESSAGE -}) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class ChatRequest { - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; - - public ChatRequest() { - } - - public ChatRequest message(String message) { - - this.message = message; - return this; - } - - /** - * Get message - * @return message - */ - @jakarta.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getMessage() { - return message; - } - - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setMessage(String message) { - this.message = message; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ChatRequest chatRequest = (ChatRequest) o; - return Objects.equals(this.message, chatRequest.message); - } - - @Override - public int hashCode() { - return Objects.hash(message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ChatRequest {\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java deleted file mode 100644 index d21b03a3..00000000 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ChatResponse.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Hephaestus Intelligence Service API - * API documentation for the Hephaestus Intelligence Service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package de.tum.in.www1.hephaestus.intelligenceapi.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.hibernate.validator.constraints.*; - -/** - * ChatResponse - */ -@JsonPropertyOrder({ - ChatResponse.JSON_PROPERTY_RESPONSE -}) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class ChatResponse { - public static final String JSON_PROPERTY_RESPONSE = "response"; - private String response; - - public ChatResponse() { - } - - public ChatResponse response(String response) { - - this.response = response; - return this; - } - - /** - * Get response - * @return response - */ - @jakarta.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_RESPONSE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getResponse() { - return response; - } - - - @JsonProperty(JSON_PROPERTY_RESPONSE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setResponse(String response) { - this.response = response; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ChatResponse chatResponse = (ChatResponse) o; - return Objects.equals(this.response, chatResponse.response); - } - - @Override - public int hashCode() { - return Objects.hash(response); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ChatResponse {\n"); - sb.append(" response: ").append(toIndentedString(response)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java deleted file mode 100644 index 0f513858..00000000 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/HTTPValidationError.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Hephaestus Intelligence Service API - * API documentation for the Hephaestus Intelligence Service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package de.tum.in.www1.hephaestus.intelligenceapi.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import de.tum.in.www1.hephaestus.intelligenceapi.model.ValidationError; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.hibernate.validator.constraints.*; - -/** - * HTTPValidationError - */ -@JsonPropertyOrder({ - HTTPValidationError.JSON_PROPERTY_DETAIL -}) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class HTTPValidationError { - public static final String JSON_PROPERTY_DETAIL = "detail"; - private List detail = new ArrayList<>(); - - public HTTPValidationError() { - } - - public HTTPValidationError detail(List detail) { - - this.detail = detail; - return this; - } - - public HTTPValidationError addDetailItem(ValidationError detailItem) { - if (this.detail == null) { - this.detail = new ArrayList<>(); - } - this.detail.add(detailItem); - return this; - } - - /** - * Get detail - * @return detail - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DETAIL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getDetail() { - return detail; - } - - - @JsonProperty(JSON_PROPERTY_DETAIL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDetail(List detail) { - this.detail = detail; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HTTPValidationError htTPValidationError = (HTTPValidationError) o; - return Objects.equals(this.detail, htTPValidationError.detail); - } - - @Override - public int hashCode() { - return Objects.hash(detail); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HTTPValidationError {\n"); - sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java deleted file mode 100644 index b16bc3e7..00000000 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationError.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Hephaestus Intelligence Service API - * API documentation for the Hephaestus Intelligence Service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package de.tum.in.www1.hephaestus.intelligenceapi.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import de.tum.in.www1.hephaestus.intelligenceapi.model.ValidationErrorLocInner; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.hibernate.validator.constraints.*; - -/** - * ValidationError - */ -@JsonPropertyOrder({ - ValidationError.JSON_PROPERTY_LOC, - ValidationError.JSON_PROPERTY_MSG, - ValidationError.JSON_PROPERTY_TYPE -}) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class ValidationError { - public static final String JSON_PROPERTY_LOC = "loc"; - private List loc = new ArrayList<>(); - - public static final String JSON_PROPERTY_MSG = "msg"; - private String msg; - - public static final String JSON_PROPERTY_TYPE = "type"; - private String type; - - public ValidationError() { - } - - public ValidationError loc(List loc) { - - this.loc = loc; - return this; - } - - public ValidationError addLocItem(ValidationErrorLocInner locItem) { - if (this.loc == null) { - this.loc = new ArrayList<>(); - } - this.loc.add(locItem); - return this; - } - - /** - * Get loc - * @return loc - */ - @jakarta.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_LOC) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getLoc() { - return loc; - } - - - @JsonProperty(JSON_PROPERTY_LOC) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setLoc(List loc) { - this.loc = loc; - } - - public ValidationError msg(String msg) { - - this.msg = msg; - return this; - } - - /** - * Get msg - * @return msg - */ - @jakarta.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_MSG) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getMsg() { - return msg; - } - - - @JsonProperty(JSON_PROPERTY_MSG) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setMsg(String msg) { - this.msg = msg; - } - - public ValidationError type(String type) { - - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @jakarta.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ValidationError validationError = (ValidationError) o; - return Objects.equals(this.loc, validationError.loc) && - Objects.equals(this.msg, validationError.msg) && - Objects.equals(this.type, validationError.type); - } - - @Override - public int hashCode() { - return Objects.hash(loc, msg, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ValidationError {\n"); - sb.append(" loc: ").append(toIndentedString(loc)).append("\n"); - sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java deleted file mode 100644 index 0ec5c292..00000000 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceapi/model/ValidationErrorLocInner.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Hephaestus Intelligence Service API - * API documentation for the Hephaestus Intelligence Service. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package de.tum.in.www1.hephaestus.intelligenceapi.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.hibernate.validator.constraints.*; - -/** - * ValidationErrorLocInner - */ -@JsonPropertyOrder({ -}) -@JsonTypeName("ValidationError_loc_inner") -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-29T19:53:57.523401+01:00[Europe/Berlin]", comments = "Generator version: 7.7.0") -public class ValidationErrorLocInner { - public ValidationErrorLocInner() { - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ValidationErrorLocInner {\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - From e4f6f2e4aecf8cb7ce0de0f5734f82202954fdd1 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 5 Nov 2024 14:09:27 +0100 Subject: [PATCH 60/67] Run black --- server/intelligence-service/app/config.py | 7 +++++-- server/intelligence-service/app/main.py | 8 ++++++-- server/intelligence-service/app/model.py | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/server/intelligence-service/app/config.py b/server/intelligence-service/app/config.py index 5383e680..006ea3a5 100644 --- a/server/intelligence-service/app/config.py +++ b/server/intelligence-service/app/config.py @@ -19,8 +19,11 @@ def is_openai_available(self): @property def is_azure_openai_available(self): - return bool(self.AZURE_OPENAI_API_KEY) and bool(self.AZURE_OPENAI_ENDPOINT) and bool( - self.AZURE_OPENAI_API_VERSION) + return ( + bool(self.AZURE_OPENAI_API_KEY) + and bool(self.AZURE_OPENAI_ENDPOINT) + and bool(self.AZURE_OPENAI_API_VERSION) + ) settings = Settings() diff --git a/server/intelligence-service/app/main.py b/server/intelligence-service/app/main.py index 154303a0..986a4cdb 100644 --- a/server/intelligence-service/app/main.py +++ b/server/intelligence-service/app/main.py @@ -24,7 +24,11 @@ class ChatResponse(BaseModel): thread_id: Optional[str] = None -@app.post("/chat", response_model=ChatResponse, summary="Start and continue a chat session with an LLM.") +@app.post( + "/chat", + response_model=ChatResponse, + summary="Start and continue a chat session with an LLM.", +) async def chat(request: ChatRequest): if request.thread_id is None: # Start a new chat session @@ -45,4 +49,4 @@ async def chat(request: ChatRequest): state = result["state"] response_message = result["response"]["messages"][-1].content conversations[thread_id] = state - return ChatResponse(response=response_message) \ No newline at end of file + return ChatResponse(response=response_message) diff --git a/server/intelligence-service/app/model.py b/server/intelligence-service/app/model.py index cd7686c4..59fb8638 100644 --- a/server/intelligence-service/app/model.py +++ b/server/intelligence-service/app/model.py @@ -105,4 +105,4 @@ def chat(thread_id: str, input_message: str, state: State): ) state["messages"] += output.get("messages", []) - return {"state": state, "response": output} \ No newline at end of file + return {"state": state, "response": output} From 2dc27b581fee5b7d194dee386de0ee80381b6f80 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 5 Nov 2024 14:29:34 +0100 Subject: [PATCH 61/67] Delete unused code --- .../hephaestus/IntelligenceApiClientConfig.java | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 server/application-server/src/main/java/de/tum/in/www1/hephaestus/IntelligenceApiClientConfig.java diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/IntelligenceApiClientConfig.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/IntelligenceApiClientConfig.java deleted file mode 100644 index 575a64ac..00000000 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/IntelligenceApiClientConfig.java +++ /dev/null @@ -1,14 +0,0 @@ -package de.tum.in.www1.hephaestus; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Configuration; - -import de.tum.in.www1.hephaestus.intelligenceapi.ApiClient; - -@Configuration -public class IntelligenceApiClientConfig { - @Autowired - public IntelligenceApiClientConfig(ApiClient apiClient) { - apiClient.setBasePath("http://localhost"); - } -} From 78a575050b6ab60ba221f4de83d061b7978314c7 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 5 Nov 2024 14:32:11 +0100 Subject: [PATCH 62/67] Add poetry lock update --- .github/workflows/generate-intelligence-service-client.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-intelligence-service-client.yml b/.github/workflows/generate-intelligence-service-client.yml index 7030e8ef..88b05152 100644 --- a/.github/workflows/generate-intelligence-service-client.yml +++ b/.github/workflows/generate-intelligence-service-client.yml @@ -57,7 +57,7 @@ jobs: - name: Install Python dependencies working-directory: server/intelligence-service - run: poetry install --no-interaction --no-root + run: poetry lock --no-update && poetry install --no-interaction --no-root - name: Generate API client for the application server working-directory: server/intelligence-service From 1e3dbe053e2797bb42b2a3d94052c81cf7834aef Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 5 Nov 2024 14:38:15 +0100 Subject: [PATCH 63/67] Change langgraph version --- server/intelligence-service/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/intelligence-service/pyproject.toml b/server/intelligence-service/pyproject.toml index 5f04ec7e..e343c4dd 100644 --- a/server/intelligence-service/pyproject.toml +++ b/server/intelligence-service/pyproject.toml @@ -13,7 +13,7 @@ fastapi = {extras = ["standard"], version = "0.112.1"} pydantic-settings = "2.4.0" langchain = "0.2.15" langchain-openai = "0.1.23" -langgraph = "^0.2.44" +langgraph = "0.2.44" [tool.poetry.group.dev.dependencies] black = "24.10.0" From 00f42ac1e27e53294d8694bdf5337cd0dd5037a0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 5 Nov 2024 14:00:00 +0000 Subject: [PATCH 64/67] chore: update API specs and client --- package-lock.json | 4058 +++++++++++------------ server/intelligence-service/poetry.lock | 135 +- 2 files changed, 2162 insertions(+), 2031 deletions(-) diff --git a/package-lock.json b/package-lock.json index 23ea9a38..e679a04e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,2033 +1,2033 @@ { - "name": "hephaestus", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "hephaestus", - "workspaces": [ - "webapp/*" - ], - "devDependencies": { - "@openapitools/openapi-generator-cli": "2.13.5", - "rimraf": "6.0.1", - "shx": "0.3.4" - } - }, - "node_modules/@babel/runtime": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.4.tgz", - "integrity": "sha512-DSgLeL/FNcpXuzav5wfYvHCGvynXkJbn3Zvc3823AEe9nPwW9IK4UoCSS5yGymmQzN0pCPvivtgS6/8U2kkm1w==", - "dev": true, - "license": "MIT", - "dependencies": { - "regenerator-runtime": "^0.14.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@isaacs/cliui/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/@lukeed/csprng": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz", - "integrity": "sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/@nestjs/axios": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.0.2.tgz", - "integrity": "sha512-Z6GuOUdNQjP7FX+OuV2Ybyamse+/e0BFdTWBX5JxpBDKA+YkdLynDgG6HTF04zy6e9zPa19UX0WA2VDoehwhXQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "@nestjs/common": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0", - "axios": "^1.3.1", - "rxjs": "^6.0.0 || ^7.0.0" - } - }, - "node_modules/@nestjs/common": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.3.0.tgz", - "integrity": "sha512-DGv34UHsZBxCM3H5QGE2XE/+oLJzz5+714JQjBhjD9VccFlQs3LRxo/epso4l7nJIiNlZkPyIUC8WzfU/5RTsQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "iterare": "1.2.1", - "tslib": "2.6.2", - "uid": "2.0.2" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/nest" - }, - "peerDependencies": { - "class-transformer": "*", - "class-validator": "*", - "reflect-metadata": "^0.1.12", - "rxjs": "^7.1.0" - }, - "peerDependenciesMeta": { - "class-transformer": { - "optional": true - }, - "class-validator": { - "optional": true - } - } - }, - "node_modules/@nestjs/core": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.3.0.tgz", - "integrity": "sha512-N06P5ncknW/Pm8bj964WvLIZn2gNhHliCBoAO1LeBvNImYkecqKcrmLbY49Fa1rmMfEM3MuBHeDys3edeuYAOA==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "@nuxtjs/opencollective": "0.3.2", - "fast-safe-stringify": "2.1.1", - "iterare": "1.2.1", - "path-to-regexp": "3.2.0", - "tslib": "2.6.2", - "uid": "2.0.2" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/nest" - }, - "peerDependencies": { - "@nestjs/common": "^10.0.0", - "@nestjs/microservices": "^10.0.0", - "@nestjs/platform-express": "^10.0.0", - "@nestjs/websockets": "^10.0.0", - "reflect-metadata": "^0.1.12", - "rxjs": "^7.1.0" - }, - "peerDependenciesMeta": { - "@nestjs/microservices": { - "optional": true - }, - "@nestjs/platform-express": { - "optional": true - }, - "@nestjs/websockets": { - "optional": true - } - } - }, - "node_modules/@nuxtjs/opencollective": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz", - "integrity": "sha512-um0xL3fO7Mf4fDxcqx9KryrB7zgRM5JSlvGN5AGkP6JLM5XEKyjeAiPbNxdXVXQ16isuAhYpvP88NgL2BGd6aA==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0", - "consola": "^2.15.0", - "node-fetch": "^2.6.1" - }, - "bin": { - "opencollective": "bin/opencollective.js" - }, - "engines": { - "node": ">=8.0.0", - "npm": ">=5.0.0" - } - }, - "node_modules/@openapitools/openapi-generator-cli": { - "version": "2.13.5", - "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.13.5.tgz", - "integrity": "sha512-9VgeKOTiiatKSwZDKKB3C86cW8tN9eDcFohotD4eisdK38UQswk/4Ysoq9KChRCbymjoMp6AIDHPtK1DQ2fTgw==", - "dev": true, - "hasInstallScript": true, - "license": "Apache-2.0", - "dependencies": { - "@nestjs/axios": "3.0.2", - "@nestjs/common": "10.3.0", - "@nestjs/core": "10.3.0", - "@nuxtjs/opencollective": "0.3.2", - "axios": "1.7.4", - "chalk": "4.1.2", - "commander": "8.3.0", - "compare-versions": "4.1.4", - "concurrently": "6.5.1", - "console.table": "0.10.0", - "fs-extra": "10.1.0", - "glob": "7.2.3", - "https-proxy-agent": "7.0.4", - "inquirer": "8.2.6", - "lodash": "4.17.21", - "reflect-metadata": "0.1.13", - "rxjs": "7.8.1", - "tslib": "2.6.2" - }, - "bin": { - "openapi-generator-cli": "main.js" - }, - "engines": { - "node": ">=10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/openapi_generator" - } - }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/agent-base": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", - "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "type-fest": "^0.21.3" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/axios": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz", - "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==", - "dev": true, - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true, - "license": "MIT" - }, - "node_modules/cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dev": true, - "license": "MIT", - "dependencies": { - "restore-cursor": "^3.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cli-spinners": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", - "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-width": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", - "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">= 10" - } - }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/cliui/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "license": "MIT", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/commander": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", - "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 12" - } - }, - "node_modules/compare-versions": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-4.1.4.tgz", - "integrity": "sha512-FemMreK9xNyL8gQevsdRMrvO4lFCkQP7qbuktn1q8ndcNk1+0mz7lgE7b/sNvbhVgY4w6tMN1FDp6aADjqw2rw==", - "dev": true, - "license": "MIT" - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "license": "MIT" - }, - "node_modules/concurrently": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-6.5.1.tgz", - "integrity": "sha512-FlSwNpGjWQfRwPLXvJ/OgysbBxPkWpiVjy1042b0U7on7S7qwwMIILRj7WTN1mTgqa582bG6NFuScOoh6Zgdag==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0", - "date-fns": "^2.16.1", - "lodash": "^4.17.21", - "rxjs": "^6.6.3", - "spawn-command": "^0.0.2-1", - "supports-color": "^8.1.0", - "tree-kill": "^1.2.2", - "yargs": "^16.2.0" - }, - "bin": { - "concurrently": "bin/concurrently.js" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/concurrently/node_modules/rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "tslib": "^1.9.0" - }, - "engines": { - "npm": ">=2.0.0" - } - }, - "node_modules/concurrently/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/concurrently/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true, - "license": "0BSD" - }, - "node_modules/consola": { - "version": "2.15.3", - "resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz", - "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==", - "dev": true, - "license": "MIT" - }, - "node_modules/console.table": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/console.table/-/console.table-0.10.0.tgz", - "integrity": "sha512-dPyZofqggxuvSf7WXvNjuRfnsOk1YazkVP8FdxH4tcH2c37wc79/Yl6Bhr7Lsu00KMgy2ql/qCMuNu8xctZM8g==", - "dev": true, - "license": "MIT", - "dependencies": { - "easy-table": "1.1.0" - }, - "engines": { - "node": "> 0.10" - } - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/date-fns": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", - "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.21.0" - }, - "engines": { - "node": ">=0.11" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/date-fns" - } - }, - "node_modules/debug": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/defaults": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", - "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "clone": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true, - "license": "MIT" - }, - "node_modules/easy-table": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/easy-table/-/easy-table-1.1.0.tgz", - "integrity": "sha512-oq33hWOSSnl2Hoh00tZWaIPi1ievrD9aFG82/IgjlycAnW9hHx5PkJiXpxPsgEE+H7BsbVQXFVFST8TEXS6/pA==", - "dev": true, - "license": "MIT", - "optionalDependencies": { - "wcwidth": ">=1.0.1" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "dev": true, - "license": "MIT", - "dependencies": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/fast-safe-stringify": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", - "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", - "dev": true, - "license": "MIT" - }, - "node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dev": true, - "license": "MIT", - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/follow-redirects": { - "version": "1.15.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", - "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "license": "MIT", - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/foreground-child": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", - "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", - "dev": true, - "license": "ISC", - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/foreground-child/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "license": "ISC" - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "license": "ISC", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/https-proxy-agent": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", - "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.0.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "BSD-3-Clause" - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dev": true, - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/inquirer": { - "version": "8.2.6", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", - "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.1", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.21", - "mute-stream": "0.0.8", - "ora": "^5.4.1", - "run-async": "^2.4.0", - "rxjs": "^7.5.5", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6", - "wrap-ansi": "^6.0.1" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/is-core-module": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", - "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-interactive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", - "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "license": "ISC" - }, - "node_modules/iterare": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/iterare/-/iterare-1.2.1.tgz", - "integrity": "sha512-RKYVTCjAnRthyJes037NX/IiqeidgN1xc3j1RjFfECFp28A1GVwK9nA+i0rJPaHqSZwygLzRnFlzUuHFoWWy+Q==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=6" - } - }, - "node_modules/jackspeak": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz", - "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true, - "license": "MIT" - }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lru-cache": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.0.tgz", - "integrity": "sha512-Qv32eSV1RSCfhY3fpPE2GNZ8jgM9X7rdAfemLWqTUxwiyIC4jJ6Sy0fZ8H+oLWevO6i4/bizg7c8d8i6bxrzbA==", - "dev": true, - "license": "ISC", - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true, - "license": "MIT" - }, - "node_modules/mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", - "dev": true, - "license": "ISC" - }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ora": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", - "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "bl": "^4.1.0", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-spinners": "^2.5.0", - "is-interactive": "^1.0.0", - "is-unicode-supported": "^0.1.0", - "log-symbols": "^4.1.0", - "strip-ansi": "^6.0.0", - "wcwidth": "^1.0.1" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/package-json-from-dist": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", - "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", - "dev": true, - "license": "BlueOak-1.0.0" - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true, - "license": "MIT" - }, - "node_modules/path-scurry": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", - "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/path-to-regexp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz", - "integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA==", - "dev": true, - "license": "MIT" - }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true, - "license": "MIT" - }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", - "dev": true, - "dependencies": { - "resolve": "^1.1.6" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/reflect-metadata": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", - "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/regenerator-runtime": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", - "dev": true, - "license": "MIT" - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, - "license": "MIT", - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/rimraf": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", - "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^11.0.0", - "package-json-from-dist": "^1.0.0" - }, - "bin": { - "rimraf": "dist/esm/bin.mjs" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/rimraf/node_modules/glob": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", - "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", - "dev": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^4.0.1", - "minimatch": "^10.0.0", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^2.0.0" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/minimatch": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", - "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/rxjs": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", - "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.1.0" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" + "name": "hephaestus", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "hephaestus", + "workspaces": [ + "webapp/*" + ], + "devDependencies": { + "@openapitools/openapi-generator-cli": "2.13.5", + "rimraf": "6.0.1", + "shx": "0.3.4" + } + }, + "node_modules/@babel/runtime": { + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.4.tgz", + "integrity": "sha512-DSgLeL/FNcpXuzav5wfYvHCGvynXkJbn3Zvc3823AEe9nPwW9IK4UoCSS5yGymmQzN0pCPvivtgS6/8U2kkm1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@lukeed/csprng": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz", + "integrity": "sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@nestjs/axios": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.0.2.tgz", + "integrity": "sha512-Z6GuOUdNQjP7FX+OuV2Ybyamse+/e0BFdTWBX5JxpBDKA+YkdLynDgG6HTF04zy6e9zPa19UX0WA2VDoehwhXQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@nestjs/common": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0", + "axios": "^1.3.1", + "rxjs": "^6.0.0 || ^7.0.0" + } + }, + "node_modules/@nestjs/common": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.3.0.tgz", + "integrity": "sha512-DGv34UHsZBxCM3H5QGE2XE/+oLJzz5+714JQjBhjD9VccFlQs3LRxo/epso4l7nJIiNlZkPyIUC8WzfU/5RTsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "iterare": "1.2.1", + "tslib": "2.6.2", + "uid": "2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "class-transformer": "*", + "class-validator": "*", + "reflect-metadata": "^0.1.12", + "rxjs": "^7.1.0" + }, + "peerDependenciesMeta": { + "class-transformer": { + "optional": true + }, + "class-validator": { + "optional": true + } + } + }, + "node_modules/@nestjs/core": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.3.0.tgz", + "integrity": "sha512-N06P5ncknW/Pm8bj964WvLIZn2gNhHliCBoAO1LeBvNImYkecqKcrmLbY49Fa1rmMfEM3MuBHeDys3edeuYAOA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@nuxtjs/opencollective": "0.3.2", + "fast-safe-stringify": "2.1.1", + "iterare": "1.2.1", + "path-to-regexp": "3.2.0", + "tslib": "2.6.2", + "uid": "2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "@nestjs/common": "^10.0.0", + "@nestjs/microservices": "^10.0.0", + "@nestjs/platform-express": "^10.0.0", + "@nestjs/websockets": "^10.0.0", + "reflect-metadata": "^0.1.12", + "rxjs": "^7.1.0" + }, + "peerDependenciesMeta": { + "@nestjs/microservices": { + "optional": true + }, + "@nestjs/platform-express": { + "optional": true + }, + "@nestjs/websockets": { + "optional": true + } + } + }, + "node_modules/@nuxtjs/opencollective": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz", + "integrity": "sha512-um0xL3fO7Mf4fDxcqx9KryrB7zgRM5JSlvGN5AGkP6JLM5XEKyjeAiPbNxdXVXQ16isuAhYpvP88NgL2BGd6aA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "consola": "^2.15.0", + "node-fetch": "^2.6.1" + }, + "bin": { + "opencollective": "bin/opencollective.js" + }, + "engines": { + "node": ">=8.0.0", + "npm": ">=5.0.0" + } + }, + "node_modules/@openapitools/openapi-generator-cli": { + "version": "2.13.5", + "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.13.5.tgz", + "integrity": "sha512-9VgeKOTiiatKSwZDKKB3C86cW8tN9eDcFohotD4eisdK38UQswk/4Ysoq9KChRCbymjoMp6AIDHPtK1DQ2fTgw==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@nestjs/axios": "3.0.2", + "@nestjs/common": "10.3.0", + "@nestjs/core": "10.3.0", + "@nuxtjs/opencollective": "0.3.2", + "axios": "1.7.4", + "chalk": "4.1.2", + "commander": "8.3.0", + "compare-versions": "4.1.4", + "concurrently": "6.5.1", + "console.table": "0.10.0", + "fs-extra": "10.1.0", + "glob": "7.2.3", + "https-proxy-agent": "7.0.4", + "inquirer": "8.2.6", + "lodash": "4.17.21", + "reflect-metadata": "0.1.13", + "rxjs": "7.8.1", + "tslib": "2.6.2" + }, + "bin": { + "openapi-generator-cli": "main.js" + }, + "engines": { + "node": ">=10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/openapi_generator" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz", + "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true, + "license": "MIT" + }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 10" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/compare-versions": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-4.1.4.tgz", + "integrity": "sha512-FemMreK9xNyL8gQevsdRMrvO4lFCkQP7qbuktn1q8ndcNk1+0mz7lgE7b/sNvbhVgY4w6tMN1FDp6aADjqw2rw==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/concurrently": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-6.5.1.tgz", + "integrity": "sha512-FlSwNpGjWQfRwPLXvJ/OgysbBxPkWpiVjy1042b0U7on7S7qwwMIILRj7WTN1mTgqa582bG6NFuScOoh6Zgdag==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "date-fns": "^2.16.1", + "lodash": "^4.17.21", + "rxjs": "^6.6.3", + "spawn-command": "^0.0.2-1", + "supports-color": "^8.1.0", + "tree-kill": "^1.2.2", + "yargs": "^16.2.0" + }, + "bin": { + "concurrently": "bin/concurrently.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/concurrently/node_modules/rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, + "node_modules/concurrently/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true, + "license": "0BSD" + }, + "node_modules/consola": { + "version": "2.15.3", + "resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz", + "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/console.table": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/console.table/-/console.table-0.10.0.tgz", + "integrity": "sha512-dPyZofqggxuvSf7WXvNjuRfnsOk1YazkVP8FdxH4tcH2c37wc79/Yl6Bhr7Lsu00KMgy2ql/qCMuNu8xctZM8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "easy-table": "1.1.0" + }, + "engines": { + "node": "> 0.10" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.21.0" + }, + "engines": { + "node": ">=0.11" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/date-fns" + } + }, + "node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/easy-table": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/easy-table/-/easy-table-1.1.0.tgz", + "integrity": "sha512-oq33hWOSSnl2Hoh00tZWaIPi1ievrD9aFG82/IgjlycAnW9hHx5PkJiXpxPsgEE+H7BsbVQXFVFST8TEXS6/pA==", + "dev": true, + "license": "MIT", + "optionalDependencies": { + "wcwidth": ">=1.0.1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "license": "MIT", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "dev": true, + "license": "MIT" + }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/inquirer": { + "version": "8.2.6", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", + "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^6.0.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-core-module": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/iterare": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/iterare/-/iterare-1.2.1.tgz", + "integrity": "sha512-RKYVTCjAnRthyJes037NX/IiqeidgN1xc3j1RjFfECFp28A1GVwK9nA+i0rJPaHqSZwygLzRnFlzUuHFoWWy+Q==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=6" + } + }, + "node_modules/jackspeak": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz", + "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lru-cache": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.0.tgz", + "integrity": "sha512-Qv32eSV1RSCfhY3fpPE2GNZ8jgM9X7rdAfemLWqTUxwiyIC4jJ6Sy0fZ8H+oLWevO6i4/bizg7c8d8i6bxrzbA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true, + "license": "ISC" + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", + "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-scurry": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", + "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-to-regexp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz", + "integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA==", + "dev": true, + "license": "MIT" + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true, + "license": "MIT" + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", + "dev": true, + "dependencies": { + "resolve": "^1.1.6" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/reflect-metadata": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "dev": true, + "license": "MIT" + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/rimraf": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", + "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^11.0.0", + "package-json-from-dist": "^1.0.0" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", + "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/shelljs": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + }, + "bin": { + "shjs": "bin/shjs" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/shx": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.4.tgz", + "integrity": "sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.3", + "shelljs": "^0.8.5" + }, + "bin": { + "shx": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/spawn-command": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2.tgz", + "integrity": "sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ==", + "dev": true + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true, + "license": "MIT" + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true, + "license": "0BSD" + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/uid": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz", + "integrity": "sha512-u3xV3X7uzvi5b1MncmZo3i2Aw222Zk1keqLA1YkHldREkAhAqi65wuPfe7lHx8H/Wzy+8CE7S7uS3jekIM5s8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@lukeed/csprng": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dev": true, + "license": "MIT", + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } } - ], - "license": "MIT" - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true, - "license": "MIT" - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/shelljs": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", - "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - }, - "bin": { - "shjs": "bin/shjs" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/shx": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.4.tgz", - "integrity": "sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==", - "dev": true, - "license": "MIT", - "dependencies": { - "minimist": "^1.2.3", - "shelljs": "^0.8.5" - }, - "bin": { - "shx": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/spawn-command": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2.tgz", - "integrity": "sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ==", - "dev": true - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true, - "license": "MIT" - }, - "node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "license": "MIT", - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true, - "license": "MIT" - }, - "node_modules/tree-kill": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", - "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", - "dev": true, - "license": "MIT", - "bin": { - "tree-kill": "cli.js" - } - }, - "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true, - "license": "0BSD" - }, - "node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/uid": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz", - "integrity": "sha512-u3xV3X7uzvi5b1MncmZo3i2Aw222Zk1keqLA1YkHldREkAhAqi65wuPfe7lHx8H/Wzy+8CE7S7uS3jekIM5s8g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@lukeed/csprng": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true, - "license": "MIT" - }, - "node_modules/wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", - "dev": true, - "license": "MIT", - "dependencies": { - "defaults": "^1.0.3" - } - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true, - "license": "BSD-2-Clause" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dev": true, - "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } } - } } diff --git a/server/intelligence-service/poetry.lock b/server/intelligence-service/poetry.lock index 49b95b64..9d3e654f 100644 --- a/server/intelligence-service/poetry.lock +++ b/server/intelligence-service/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" @@ -769,6 +769,17 @@ http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] zstd = ["zstandard (>=0.18.0)"] +[[package]] +name = "httpx-sse" +version = "0.4.0" +description = "Consume Server-Sent Event (SSE) messages with HTTPX." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpx-sse-0.4.0.tar.gz", hash = "sha256:1e81a3a3070ce322add1d3529ed42eb5f70817f45ed6ec915ab753f961139721"}, + {file = "httpx_sse-0.4.0-py3-none-any.whl", hash = "sha256:f329af6eae57eaa2bdfd962b42524764af68075ea87370a2de920af5341e318f"}, +] + [[package]] name = "idna" version = "3.10" @@ -983,6 +994,53 @@ files = [ [package.dependencies] langchain-core = ">=0.2.38,<0.3.0" +[[package]] +name = "langgraph" +version = "0.2.44" +description = "Building stateful, multi-actor applications with LLMs" +optional = false +python-versions = "<4.0,>=3.9.0" +files = [ + {file = "langgraph-0.2.44-py3-none-any.whl", hash = "sha256:ac03af8950efcb2ebb898bce0800c8c9bad9180f7490a73d2eaecacab7a7920a"}, + {file = "langgraph-0.2.44.tar.gz", hash = "sha256:8ae179c3a77666b0a78b273d89d8f32a012282ad49298234426a4443d559aa62"}, +] + +[package.dependencies] +langchain-core = ">=0.2.43,<0.3.0 || >0.3.0,<0.3.1 || >0.3.1,<0.3.2 || >0.3.2,<0.3.3 || >0.3.3,<0.3.4 || >0.3.4,<0.3.5 || >0.3.5,<0.3.6 || >0.3.6,<0.3.7 || >0.3.7,<0.3.8 || >0.3.8,<0.3.9 || >0.3.9,<0.3.10 || >0.3.10,<0.3.11 || >0.3.11,<0.3.12 || >0.3.12,<0.3.13 || >0.3.13,<0.3.14 || >0.3.14,<0.4.0" +langgraph-checkpoint = ">=2.0.0,<3.0.0" +langgraph-sdk = ">=0.1.32,<0.2.0" + +[[package]] +name = "langgraph-checkpoint" +version = "2.0.2" +description = "Library with base interfaces for LangGraph checkpoint savers." +optional = false +python-versions = "<4.0.0,>=3.9.0" +files = [ + {file = "langgraph_checkpoint-2.0.2-py3-none-any.whl", hash = "sha256:6e5dfd90e1fc71b91ccff75939ada1114e5d7f824df5f24c62d39bed69039ee2"}, + {file = "langgraph_checkpoint-2.0.2.tar.gz", hash = "sha256:c1d033e4e4855f580fa56830327eb86513b64ab5be527245363498e76b19a0b9"}, +] + +[package.dependencies] +langchain-core = ">=0.2.38,<0.4" +msgpack = ">=1.1.0,<2.0.0" + +[[package]] +name = "langgraph-sdk" +version = "0.1.35" +description = "SDK for interacting with LangGraph API" +optional = false +python-versions = "<4.0.0,>=3.9.0" +files = [ + {file = "langgraph_sdk-0.1.35-py3-none-any.whl", hash = "sha256:b137c324fbce96afe39cc6a189c61fc042164068f0f6f02ac8de864d8ece6e05"}, + {file = "langgraph_sdk-0.1.35.tar.gz", hash = "sha256:414cfbc172b883446197763f3645d86bbc6a5b8ce9693c1df3fb6ce7d854a994"}, +] + +[package.dependencies] +httpx = ">=0.25.2" +httpx-sse = ">=0.4.0" +orjson = ">=3.10.1" + [[package]] name = "langsmith" version = "0.1.139" @@ -1109,6 +1167,79 @@ files = [ {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, ] +[[package]] +name = "msgpack" +version = "1.1.0" +description = "MessagePack serializer" +optional = false +python-versions = ">=3.8" +files = [ + {file = "msgpack-1.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7ad442d527a7e358a469faf43fda45aaf4ac3249c8310a82f0ccff9164e5dccd"}, + {file = "msgpack-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:74bed8f63f8f14d75eec75cf3d04ad581da6b914001b474a5d3cd3372c8cc27d"}, + {file = "msgpack-1.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:914571a2a5b4e7606997e169f64ce53a8b1e06f2cf2c3a7273aa106236d43dd5"}, + {file = "msgpack-1.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c921af52214dcbb75e6bdf6a661b23c3e6417f00c603dd2070bccb5c3ef499f5"}, + {file = "msgpack-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d8ce0b22b890be5d252de90d0e0d119f363012027cf256185fc3d474c44b1b9e"}, + {file = "msgpack-1.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:73322a6cc57fcee3c0c57c4463d828e9428275fb85a27aa2aa1a92fdc42afd7b"}, + {file = "msgpack-1.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:e1f3c3d21f7cf67bcf2da8e494d30a75e4cf60041d98b3f79875afb5b96f3a3f"}, + {file = "msgpack-1.1.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:64fc9068d701233effd61b19efb1485587560b66fe57b3e50d29c5d78e7fef68"}, + {file = "msgpack-1.1.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:42f754515e0f683f9c79210a5d1cad631ec3d06cea5172214d2176a42e67e19b"}, + {file = "msgpack-1.1.0-cp310-cp310-win32.whl", hash = "sha256:3df7e6b05571b3814361e8464f9304c42d2196808e0119f55d0d3e62cd5ea044"}, + {file = "msgpack-1.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:685ec345eefc757a7c8af44a3032734a739f8c45d1b0ac45efc5d8977aa4720f"}, + {file = "msgpack-1.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3d364a55082fb2a7416f6c63ae383fbd903adb5a6cf78c5b96cc6316dc1cedc7"}, + {file = "msgpack-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:79ec007767b9b56860e0372085f8504db5d06bd6a327a335449508bbee9648fa"}, + {file = "msgpack-1.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6ad622bf7756d5a497d5b6836e7fc3752e2dd6f4c648e24b1803f6048596f701"}, + {file = "msgpack-1.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e59bca908d9ca0de3dc8684f21ebf9a690fe47b6be93236eb40b99af28b6ea6"}, + {file = "msgpack-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5e1da8f11a3dd397f0a32c76165cf0c4eb95b31013a94f6ecc0b280c05c91b59"}, + {file = "msgpack-1.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:452aff037287acb1d70a804ffd022b21fa2bb7c46bee884dbc864cc9024128a0"}, + {file = "msgpack-1.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8da4bf6d54ceed70e8861f833f83ce0814a2b72102e890cbdfe4b34764cdd66e"}, + {file = "msgpack-1.1.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:41c991beebf175faf352fb940bf2af9ad1fb77fd25f38d9142053914947cdbf6"}, + {file = "msgpack-1.1.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a52a1f3a5af7ba1c9ace055b659189f6c669cf3657095b50f9602af3a3ba0fe5"}, + {file = "msgpack-1.1.0-cp311-cp311-win32.whl", hash = "sha256:58638690ebd0a06427c5fe1a227bb6b8b9fdc2bd07701bec13c2335c82131a88"}, + {file = "msgpack-1.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:fd2906780f25c8ed5d7b323379f6138524ba793428db5d0e9d226d3fa6aa1788"}, + {file = "msgpack-1.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:d46cf9e3705ea9485687aa4001a76e44748b609d260af21c4ceea7f2212a501d"}, + {file = "msgpack-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:5dbad74103df937e1325cc4bfeaf57713be0b4f15e1c2da43ccdd836393e2ea2"}, + {file = "msgpack-1.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:58dfc47f8b102da61e8949708b3eafc3504509a5728f8b4ddef84bd9e16ad420"}, + {file = "msgpack-1.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4676e5be1b472909b2ee6356ff425ebedf5142427842aa06b4dfd5117d1ca8a2"}, + {file = "msgpack-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:17fb65dd0bec285907f68b15734a993ad3fc94332b5bb21b0435846228de1f39"}, + {file = "msgpack-1.1.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a51abd48c6d8ac89e0cfd4fe177c61481aca2d5e7ba42044fd218cfd8ea9899f"}, + {file = "msgpack-1.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2137773500afa5494a61b1208619e3871f75f27b03bcfca7b3a7023284140247"}, + {file = "msgpack-1.1.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:398b713459fea610861c8a7b62a6fec1882759f308ae0795b5413ff6a160cf3c"}, + {file = "msgpack-1.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:06f5fd2f6bb2a7914922d935d3b8bb4a7fff3a9a91cfce6d06c13bc42bec975b"}, + {file = "msgpack-1.1.0-cp312-cp312-win32.whl", hash = "sha256:ad33e8400e4ec17ba782f7b9cf868977d867ed784a1f5f2ab46e7ba53b6e1e1b"}, + {file = "msgpack-1.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:115a7af8ee9e8cddc10f87636767857e7e3717b7a2e97379dc2054712693e90f"}, + {file = "msgpack-1.1.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:071603e2f0771c45ad9bc65719291c568d4edf120b44eb36324dcb02a13bfddf"}, + {file = "msgpack-1.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0f92a83b84e7c0749e3f12821949d79485971f087604178026085f60ce109330"}, + {file = "msgpack-1.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:4a1964df7b81285d00a84da4e70cb1383f2e665e0f1f2a7027e683956d04b734"}, + {file = "msgpack-1.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:59caf6a4ed0d164055ccff8fe31eddc0ebc07cf7326a2aaa0dbf7a4001cd823e"}, + {file = "msgpack-1.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0907e1a7119b337971a689153665764adc34e89175f9a34793307d9def08e6ca"}, + {file = "msgpack-1.1.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:65553c9b6da8166e819a6aa90ad15288599b340f91d18f60b2061f402b9a4915"}, + {file = "msgpack-1.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:7a946a8992941fea80ed4beae6bff74ffd7ee129a90b4dd5cf9c476a30e9708d"}, + {file = "msgpack-1.1.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:4b51405e36e075193bc051315dbf29168d6141ae2500ba8cd80a522964e31434"}, + {file = "msgpack-1.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:b4c01941fd2ff87c2a934ee6055bda4ed353a7846b8d4f341c428109e9fcde8c"}, + {file = "msgpack-1.1.0-cp313-cp313-win32.whl", hash = "sha256:7c9a35ce2c2573bada929e0b7b3576de647b0defbd25f5139dcdaba0ae35a4cc"}, + {file = "msgpack-1.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:bce7d9e614a04d0883af0b3d4d501171fbfca038f12c77fa838d9f198147a23f"}, + {file = "msgpack-1.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c40ffa9a15d74e05ba1fe2681ea33b9caffd886675412612d93ab17b58ea2fec"}, + {file = "msgpack-1.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f1ba6136e650898082d9d5a5217d5906d1e138024f836ff48691784bbe1adf96"}, + {file = "msgpack-1.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e0856a2b7e8dcb874be44fea031d22e5b3a19121be92a1e098f46068a11b0870"}, + {file = "msgpack-1.1.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:471e27a5787a2e3f974ba023f9e265a8c7cfd373632247deb225617e3100a3c7"}, + {file = "msgpack-1.1.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:646afc8102935a388ffc3914b336d22d1c2d6209c773f3eb5dd4d6d3b6f8c1cb"}, + {file = "msgpack-1.1.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:13599f8829cfbe0158f6456374e9eea9f44eee08076291771d8ae93eda56607f"}, + {file = "msgpack-1.1.0-cp38-cp38-win32.whl", hash = "sha256:8a84efb768fb968381e525eeeb3d92857e4985aacc39f3c47ffd00eb4509315b"}, + {file = "msgpack-1.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:879a7b7b0ad82481c52d3c7eb99bf6f0645dbdec5134a4bddbd16f3506947feb"}, + {file = "msgpack-1.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:53258eeb7a80fc46f62fd59c876957a2d0e15e6449a9e71842b6d24419d88ca1"}, + {file = "msgpack-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7e7b853bbc44fb03fbdba34feb4bd414322180135e2cb5164f20ce1c9795ee48"}, + {file = "msgpack-1.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f3e9b4936df53b970513eac1758f3882c88658a220b58dcc1e39606dccaaf01c"}, + {file = "msgpack-1.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:46c34e99110762a76e3911fc923222472c9d681f1094096ac4102c18319e6468"}, + {file = "msgpack-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a706d1e74dd3dea05cb54580d9bd8b2880e9264856ce5068027eed09680aa74"}, + {file = "msgpack-1.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:534480ee5690ab3cbed89d4c8971a5c631b69a8c0883ecfea96c19118510c846"}, + {file = "msgpack-1.1.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:8cf9e8c3a2153934a23ac160cc4cba0ec035f6867c8013cc6077a79823370346"}, + {file = "msgpack-1.1.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:3180065ec2abbe13a4ad37688b61b99d7f9e012a535b930e0e683ad6bc30155b"}, + {file = "msgpack-1.1.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:c5a91481a3cc573ac8c0d9aace09345d989dc4a0202b7fcb312c88c26d4e71a8"}, + {file = "msgpack-1.1.0-cp39-cp39-win32.whl", hash = "sha256:f80bc7d47f76089633763f952e67f8214cb7b3ee6bfa489b3cb6a84cfac114cd"}, + {file = "msgpack-1.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:4d1b7ff2d6146e16e8bd665ac726a89c74163ef8cd39fa8c1087d4e52d3a2325"}, + {file = "msgpack-1.1.0.tar.gz", hash = "sha256:dd432ccc2c72b914e4cb77afce64aab761c1137cc698be3984eee260bcb2896e"}, +] + [[package]] name = "multidict" version = "6.1.0" @@ -2529,4 +2660,4 @@ propcache = ">=0.2.0" [metadata] lock-version = "2.0" python-versions = "^3.12" -content-hash = "4d8bfd77fe7d93844ac01046e3b8699f59ce1184ad9e424ea60662b6b62a4115" \ No newline at end of file +content-hash = "7f7ca24dc8c94926e9d096d40d4fd244fe8adba33fae95d87b625ecdd40ec6dd" From 4563fc0c61c1e4d39e4c6bb8727d7d73f7dc5245 Mon Sep 17 00:00:00 2001 From: milenasrb Date: Tue, 5 Nov 2024 16:08:28 +0100 Subject: [PATCH 65/67] Fix the path --- .github/workflows/intelligence-service-qa.yml | 9 ++++++++- server/intelligence-service/app/model.py | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/intelligence-service-qa.yml b/.github/workflows/intelligence-service-qa.yml index a64f40d0..0ed2fcaa 100644 --- a/.github/workflows/intelligence-service-qa.yml +++ b/.github/workflows/intelligence-service-qa.yml @@ -1,6 +1,13 @@ name: Intelligence Service QA -on: [pull_request] +on: + pull_request: + paths: + - "server/intelligence-service/**" + push: + paths: + - "server/intelligence-service/**" + branches: [develop] jobs: lint: diff --git a/server/intelligence-service/app/model.py b/server/intelligence-service/app/model.py index 59fb8638..626ac360 100644 --- a/server/intelligence-service/app/model.py +++ b/server/intelligence-service/app/model.py @@ -60,7 +60,7 @@ class State(TypedDict): token_counter=model, include_system=True, allow_partial=False, - start_on="human", + start_on="human", ) From 71e6311424ac698e3115a2a8106815a484622ddd Mon Sep 17 00:00:00 2001 From: "Felix T.J. Dietrich" Date: Sun, 10 Nov 2024 16:57:55 +0100 Subject: [PATCH 66/67] add format scripts --- package.json | 6 ++++-- server/intelligence-service/app/model.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 59110344..e32cd3d8 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,10 @@ "generate:api:application-server": "npm run generate:api:application-server-specs && npm run generate:api:application-server:clean && npm run generate:api:application-server-client", "generate:api:intelligence-service": "npm run generate:api:intelligence-service:clean && npm run generate:api:intelligence-service-specs && npm run generate:api:intelligence-service-client", "generate:api": "npm run generate:api:intelligence-service && npm run generate:api:application-server", - "prettier:java:check": "prettier --check server/application-server/src/**/*.java", - "prettier:java:write": "prettier --write server/application-server/src/**/*.java", + "format:java:check": "prettier --check server/application-server/src/**/*.java", + "format:java:write": "prettier --write server/application-server/src/**/*.java", + "format:python:check": "cd server/intelligence-service/ && poetry run black --check .", + "format:python:write": "cd server/intelligence-service/ && poetry run black .", "db:changelog:diff": "cd server/application-server && docker compose up -d postgres && mvn liquibase:diff && docker compose down postgres" }, "devDependencies": { diff --git a/server/intelligence-service/app/model.py b/server/intelligence-service/app/model.py index 626ac360..59fb8638 100644 --- a/server/intelligence-service/app/model.py +++ b/server/intelligence-service/app/model.py @@ -60,7 +60,7 @@ class State(TypedDict): token_counter=model, include_system=True, allow_partial=False, - start_on="human", + start_on="human", ) From c96431449b07cf263a308ed7e1d054bc143447db Mon Sep 17 00:00:00 2001 From: "Felix T.J. Dietrich" Date: Sun, 10 Nov 2024 16:58:42 +0100 Subject: [PATCH 67/67] fix workflow step name --- .github/workflows/intelligence-service-qa.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/intelligence-service-qa.yml b/.github/workflows/intelligence-service-qa.yml index 0ed2fcaa..a73cabfd 100644 --- a/.github/workflows/intelligence-service-qa.yml +++ b/.github/workflows/intelligence-service-qa.yml @@ -11,6 +11,7 @@ on: jobs: lint: + name: Code Quality Checks runs-on: ubuntu-latest steps: - uses: actions/checkout@v4