diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 31e6a704..149a062e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -54,10 +54,10 @@ jobs: - name: BDD Integration tests if: ${{ false }} # disable for now - run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml run api behave + run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run api behave - name: Pytest Integration tests - run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml run --rm api pytest --integration + run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm api pytest --integration test-web: runs-on: ubuntu-latest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3a19d3a3..21ea3904 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: pass_filenames: false - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.6.0 hooks: - id: check-ast language_version: python3.10 @@ -20,9 +20,9 @@ repos: - id: check-toml - id: check-yaml - id: trailing-whitespace - exclude: ^.*\.(lock)$ + exclude: ^web/src/api/generated/|^.*\.(lock)$ - id: end-of-file-fixer - exclude: ^.*\.(lock)$ + exclude: ^web/src/api/generated/|^.*\.(lock)$ - id: mixed-line-ending exclude: ^.*\.(lock)$ - id: detect-private-key @@ -32,13 +32,13 @@ repos: stages: [commit-msg] - repo: https://github.com/compilerla/conventional-pre-commit - rev: v2.4.0 + rev: v3.4.0 hooks: - id: conventional-pre-commit stages: [commit-msg] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.7" + rev: "v0.6.3" hooks: - id: ruff name: Python lint @@ -50,10 +50,10 @@ repos: files: ^api/.*\.py$ - repo: https://github.com/biomejs/pre-commit - rev: v0.2.0 + rev: v0.4.0 hooks: - id: biome-check - additional_dependencies: [ "@biomejs/biome@1.8.0" ] + additional_dependencies: [ "@biomejs/biome@1.8.3" ] args: ["--config-path", "web"] @@ -92,6 +92,7 @@ repos: name: codespell description: Checks for common misspellings in text files. entry: codespell --toml=api/pyproject.toml + exclude: documentation/docs/changelog/changelog.md language: python types: [text] additional_dependencies: diff --git a/api/pyproject.toml b/api/pyproject.toml index 990bb6f2..f7ad6705 100644 --- a/api/pyproject.toml +++ b/api/pyproject.toml @@ -91,7 +91,13 @@ ignore = [ skip = "*.lock,*.cjs" ignore-words-list = "ignored-word" -[tool.pytest] -markers =[ +[tool.pytest.ini_options] +# Makes pytest CLI discover markers and conftest settings: +markers = [ + "unit: mark a test as unit test.", "integration: mark a test as integration test." ] +testpaths = [ + "src/tests/unit", + "src/tests/integration" +] diff --git a/api/src/app.py b/api/src/app.py index 1799ff35..aa5181ff 100644 --- a/api/src/app.py +++ b/api/src/app.py @@ -77,7 +77,7 @@ def run() -> None: port=5000, factory=True, reload=config.ENVIRONMENT == "local", - log_level=config.LOGGER_LEVEL.lower(), + log_level=config.log_level, ) diff --git a/api/src/authentication/models.py b/api/src/authentication/models.py index f5891c6e..e7e8f48e 100644 --- a/api/src/authentication/models.py +++ b/api/src/authentication/models.py @@ -15,19 +15,6 @@ def check_privilege(self, required_level: "AccessLevel") -> bool: return True return False - @classmethod - def __get_validators__(cls): # type:ignore - yield cls.validate - - @classmethod - def validate(cls, v: str) -> "AccessLevel": - if isinstance(v, cls): - return v - try: - return cls[v] - except KeyError: - raise ValueError("invalid AccessLevel enum value ") - @classmethod def __get_pydantic_json_schema__( cls, core_schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler diff --git a/api/src/common/exception_handlers.py b/api/src/common/exception_handlers.py index 3e875a33..963258c8 100644 --- a/api/src/common/exception_handlers.py +++ b/api/src/common/exception_handlers.py @@ -30,7 +30,7 @@ def add_exception_handlers(app: FastAPI) -> None: # Override built-in default handler app.add_exception_handler(RequestValidationError, validation_exception_handler) # type: ignore - app.add_exception_handler(HTTPStatusError, http_exception_handler) # type: ignore + app.add_exception_handler(HTTPStatusError, http_exception_handler) # Fallback exception handler for all unexpected exceptions app.add_exception_handler(Exception, fall_back_exception_handler) diff --git a/api/src/common/exceptions.py b/api/src/common/exceptions.py index 58787e38..94383e6d 100644 --- a/api/src/common/exceptions.py +++ b/api/src/common/exceptions.py @@ -44,7 +44,7 @@ def __init__( self.extra = extra self.severity = severity - def dict(self) -> dict[str, int | str | dict[str, Any] | None]: + def to_dict(self) -> dict[str, int | str | dict[str, Any] | None]: return { "status": self.status, "type": self.type, diff --git a/api/src/common/logger.py b/api/src/common/logger.py index c137a4d0..61ec1483 100644 --- a/api/src/common/logger.py +++ b/api/src/common/logger.py @@ -9,9 +9,9 @@ uvicorn_logger = logging.getLogger("uvicorn") logger = logging.getLogger("API") -logger.setLevel(config.LOGGER_LEVEL.upper()) +logger.setLevel(config.log_level.upper()) formatter = logging.Formatter("%(levelname)s:%(asctime)s %(message)s") channel = logging.StreamHandler() channel.setFormatter(formatter) -channel.setLevel(config.LOGGER_LEVEL.upper()) +channel.setLevel(config.log_level.upper()) logger.addHandler(channel) diff --git a/api/src/common/logger_level.py b/api/src/common/logger_level.py new file mode 100644 index 00000000..7a857d1b --- /dev/null +++ b/api/src/common/logger_level.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class LoggerLevel(Enum): + """Enum containing the different levels for logging.""" + + CRITICAL = "critical" + ERROR = "error" + WARNING = "warning" + INFO = "info" + DEBUG = "debug" + TRACE = "trace" diff --git a/api/src/common/responses.py b/api/src/common/responses.py index 23984e9e..9d17d1b4 100644 --- a/api/src/common/responses.py +++ b/api/src/common/responses.py @@ -10,19 +10,22 @@ ) responses: dict[int | str, dict[str, Any]] = { - 400: {"model": ErrorResponse, "content": {"application/json": {"example": BadRequestException().dict()}}}, + 400: {"model": ErrorResponse, "content": {"application/json": {"example": BadRequestException().to_dict()}}}, 401: { "model": ErrorResponse, "content": { "application/json": { "example": ErrorResponse( status=401, type="UnauthorizedException", message="Token validation failed" - ).dict() + ).model_dump() } }, }, - 403: {"model": ErrorResponse, "content": {"application/json": {"example": MissingPrivilegeException().dict()}}}, - 404: {"model": ErrorResponse, "content": {"application/json": {"example": NotFoundException().dict()}}}, - 422: {"model": ErrorResponse, "content": {"application/json": {"example": ValidationException().dict()}}}, - 500: {"model": ErrorResponse, "content": {"application/json": {"example": ApplicationException().dict()}}}, + 403: { + "model": ErrorResponse, + "content": {"application/json": {"example": MissingPrivilegeException().to_dict()}}, + }, + 404: {"model": ErrorResponse, "content": {"application/json": {"example": NotFoundException().to_dict()}}}, + 422: {"model": ErrorResponse, "content": {"application/json": {"example": ValidationException().to_dict()}}}, + 500: {"model": ErrorResponse, "content": {"application/json": {"example": ApplicationException().to_dict()}}}, } diff --git a/api/src/config.py b/api/src/config.py index 27382efa..d11f4910 100644 --- a/api/src/config.py +++ b/api/src/config.py @@ -2,6 +2,7 @@ from pydantic_settings import BaseSettings from authentication.models import User +from common.logger_level import LoggerLevel class Config(BaseSettings): @@ -9,7 +10,7 @@ class Config(BaseSettings): ENVIRONMENT: str = "local" # Logging - LOGGER_LEVEL: str = Field("INFO", validation_alias="LOGGING_LEVEL", to_lower=True) + LOGGER_LEVEL: LoggerLevel = Field(default=LoggerLevel.INFO) APPINSIGHTS_CONSTRING: str | None = None # Database @@ -36,6 +37,11 @@ class Config(BaseSettings): OAUTH_AUDIENCE: str = "" MICROSOFT_AUTH_PROVIDER: str = "login.microsoftonline.com" + @property + def log_level(self) -> str: + """Returns LOGGER_LEVEL as a (lower case) string.""" + return str(self.LOGGER_LEVEL.value).lower() + config = Config() diff --git a/api/src/features/todo/use_cases/add_todo.py b/api/src/features/todo/use_cases/add_todo.py index 846f8432..8d2758d9 100644 --- a/api/src/features/todo/use_cases/add_todo.py +++ b/api/src/features/todo/use_cases/add_todo.py @@ -11,13 +11,23 @@ class AddTodoRequest(BaseModel): title="The title of the item", max_length=300, min_length=1, - example="Read about clean architecture", + json_schema_extra={ + "examples": ["Read about clean architecture"], + }, ) class AddTodoResponse(BaseModel): - id: str = Field(example="vytxeTZskVKR7C7WgdSP3d") - title: str = Field(example="Read about clean architecture") + id: str = Field( + json_schema_extra={ + "examples": ["vytxeTZskVKR7C7WgdSP3d"], + } + ) + title: str = Field( + json_schema_extra={ + "examples": ["Read about clean architecture"], + } + ) is_completed: bool = False @staticmethod diff --git a/api/src/tests/conftest.py b/api/src/tests/conftest.py index e6e90b40..6e6bc6db 100644 --- a/api/src/tests/conftest.py +++ b/api/src/tests/conftest.py @@ -10,7 +10,7 @@ from app import create_app from authentication.authentication import auth_with_jwt -from config import config +from config import config as project_config from data_providers.clients.mongodb.mongo_database_client import MongoDatabaseClient from features.todo.repository.todo_repository import TodoRepository, get_todo_repository from tests.integration.mock_authentication import mock_auth_with_jwt @@ -28,7 +28,7 @@ def test_client(): @pytest.fixture(autouse=True) def disable_auth(): - config.AUTH_ENABLED = False + project_config.AUTH_ENABLED = False os.environ["AUTH_ENABLED"] = "False" @@ -50,8 +50,8 @@ def mock_request( method: str = "GET", server: str = "www.example.com", path: str = "/", - headers: dict = None, - body: str = None, + headers: dict | None = None, + body: bytes | None = None, ) -> Request: if headers is None: headers = {} @@ -76,10 +76,45 @@ async def request_body(): return request -def pytest_addoption(parser): - parser.addoption("--integration", action="store_true", help="run integration tests") +def pytest_configure(config: pytest.Config): + """Add markers to be recognised by pytest.""" + has_unit_option = config.getoption("unit", default=False) + has_integration_option = config.getoption("integration", default=False) + marker_expr = config.getoption("markexpr", default="") + if marker_expr != "" and (has_integration_option or has_unit_option): + pytest.exit("Invalid options: Cannot use --markexpr with --unit or --integration options", 4) -def pytest_runtest_setup(item): - if "integration" in item.keywords and not item.config.getoption("integration"): - pytest.skip("need --integration option to run") +def pytest_addoption(parser): + """Add option to pytest parser for running unit/integration tests.""" + parser.addoption("--unit", action="store_true", default=False, help="run unit tests") + parser.addoption("--integration", action="store_true", default=False, help="run integration tests") + + +def pytest_collection_modifyitems(config: pytest.Config, items: list[pytest.Item]): + """Add markers to tests based on folder structure.""" + unit_tests_directory = config.rootpath / "src/tests/unit" + integration_tests_directory = config.rootpath / "src/tests/integration" + for item in items: + if item.path.is_relative_to(unit_tests_directory): + item.add_marker("unit") + if item.path.is_relative_to(integration_tests_directory): + item.add_marker("integration") + + +def pytest_runtest_setup(item: pytest.Item): + """Skip tests based on options provided.""" + has_unit_option = item.config.getoption("unit", default=False) + has_integration_option = item.config.getoption("integration", default=False) + match (has_unit_option, has_integration_option): + case (False, True): + # skip unit tests + if "unit" in item.keywords: + pytest.skip("unit tests are skipped when explicitly running integration tests") + case (True, False): + # skip integration tests + if "integration" in item.keywords: + pytest.skip("integration tests are skipped when explicitly running unit tests") + case _: + # run all tests + return diff --git a/api/src/tests/integration/common/test_exception_handler.py b/api/src/tests/integration/common/test_exception_handler.py index 9acde276..c83cf711 100644 --- a/api/src/tests/integration/common/test_exception_handler.py +++ b/api/src/tests/integration/common/test_exception_handler.py @@ -1,9 +1,6 @@ -import pytest from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY from starlette.testclient import TestClient -pytestmark = pytest.mark.integration - def test_exception_handler_validation_error(test_app: TestClient): response = test_app.post("/todos", json={"title": 1}) diff --git a/api/src/tests/integration/features/health_check/test_health_check_feature.py b/api/src/tests/integration/features/health_check/test_health_check_feature.py index 9072c48d..b87745aa 100644 --- a/api/src/tests/integration/features/health_check/test_health_check_feature.py +++ b/api/src/tests/integration/features/health_check/test_health_check_feature.py @@ -1,9 +1,6 @@ -import pytest from starlette.status import HTTP_200_OK from starlette.testclient import TestClient -pytestmark = pytest.mark.integration - class TestTodo: def test_get(self, test_app: TestClient): diff --git a/api/src/tests/integration/features/todo/test_todo_feature.py b/api/src/tests/integration/features/todo/test_todo_feature.py index df4856cc..ef391c24 100644 --- a/api/src/tests/integration/features/todo/test_todo_feature.py +++ b/api/src/tests/integration/features/todo/test_todo_feature.py @@ -8,8 +8,6 @@ from data_providers.clients.client_interface import ClientInterface -pytestmark = pytest.mark.integration - class TestTodo: @pytest.fixture(autouse=True) diff --git a/api/src/tests/integration/features/whoami/test_whoami_feature.py b/api/src/tests/integration/features/whoami/test_whoami_feature.py index 9a8b5123..29233c80 100644 --- a/api/src/tests/integration/features/whoami/test_whoami_feature.py +++ b/api/src/tests/integration/features/whoami/test_whoami_feature.py @@ -1,4 +1,3 @@ -import pytest from starlette.status import HTTP_200_OK from starlette.testclient import TestClient @@ -6,8 +5,6 @@ from config import config from tests.integration.mock_authentication import get_mock_jwt_token -pytestmark = pytest.mark.integration - class TestWhoami: def test_whoami(self, test_app: TestClient): diff --git a/api/src/tests/unit/features/todo/use_cases/test_add_todo.py b/api/src/tests/unit/features/todo/use_cases/test_add_todo.py index 05ba5908..f2520e0d 100644 --- a/api/src/tests/unit/features/todo/use_cases/test_add_todo.py +++ b/api/src/tests/unit/features/todo/use_cases/test_add_todo.py @@ -1,5 +1,5 @@ import pytest -from pydantic.error_wrappers import ValidationError +from pydantic import ValidationError from features.todo.repository.todo_repository_interface import TodoRepositoryInterface from features.todo.use_cases.add_todo import AddTodoRequest, add_todo_use_case diff --git a/documentation/docs/about/running/03-starting-services.md b/documentation/docs/about/running/03-starting-services.md index f88e8205..52142282 100644 --- a/documentation/docs/about/running/03-starting-services.md +++ b/documentation/docs/about/running/03-starting-services.md @@ -3,7 +3,7 @@ You can start running: ```shell -docker-compose up +docker compose up ``` The web app will be served at [http://localhost](http://localhost) diff --git a/documentation/docs/contribute/01-how-to-start-contributing.md b/documentation/docs/contribute/01-how-to-start-contributing.md index 0ae63000..29a8d44d 100644 --- a/documentation/docs/contribute/01-how-to-start-contributing.md +++ b/documentation/docs/contribute/01-how-to-start-contributing.md @@ -33,8 +33,8 @@ git checkout -b feature/my-new-feature 5. Make the changes in the created branch. 6. Add and run tests for your changes (we only take pull requests with passing tests). ```shell -docker-compose run --rm api pytest -docker-compose run --rm web yarn test +docker compose run --rm api pytest +docker compose run --rm web yarn test ``` 7. Add the changed files ```shell diff --git a/documentation/docs/contribute/development-guide/03-testing.md b/documentation/docs/contribute/development-guide/03-testing.md index 5af764c2..5282be75 100644 --- a/documentation/docs/contribute/development-guide/03-testing.md +++ b/documentation/docs/contribute/development-guide/03-testing.md @@ -17,7 +17,7 @@ You will find unit tests under `src/tests/unit`. ```shell -docker-compose run --rm api pytest +docker compose run --rm api pytest ``` @@ -50,7 +50,7 @@ These tests depends on mongodb and that it's running. ```shell -docker-compose run --rm web yarn test +docker compose run --rm web yarn test ``` diff --git a/documentation/docs/contribute/development-guide/04-upgrading.md b/documentation/docs/contribute/development-guide/04-upgrading.md index fd1508f9..5d91c082 100644 --- a/documentation/docs/contribute/development-guide/04-upgrading.md +++ b/documentation/docs/contribute/development-guide/04-upgrading.md @@ -7,7 +7,7 @@ Remember to restart! Any changes you make to these files will only come into effect after you restart the server. If you run the application using containers, -you need to do `docker-compose build` and then `docker-compose up` to get the changes. +you need to do `docker compose build` and then `docker compose up` to get the changes. ::: diff --git a/web/biome.json b/web/biome.json index fadd6217..d5c1fcb7 100644 --- a/web/biome.json +++ b/web/biome.json @@ -1,7 +1,12 @@ { "$schema": "https://biomejs.dev/schemas/1.8.0/schema.json", "files": { - "ignore": ["documentation/*", "api/*", "web/src/api/generated"] + "ignore": [ + "documentation/*", + "api/*", + "web/src/api/generated", + ".release-please-manifest.json" + ] }, "javascript": { "formatter": { diff --git a/web/generate-api-typescript-client-pre-commit.sh b/web/generate-api-typescript-client-pre-commit.sh index 66d7cde2..e2dc8aef 100755 --- a/web/generate-api-typescript-client-pre-commit.sh +++ b/web/generate-api-typescript-client-pre-commit.sh @@ -3,6 +3,8 @@ set -eo PATTERN="api/src/features/*" PATTERN+="|api/src/entities/*" +PATTERN+="|api/src/common/*" +PATTERN+="|api/src/authentication/*" CHANGED_API_FILES=() while read; do diff --git a/web/src/api/generated/core/request.ts b/web/src/api/generated/core/request.ts index 1142d432..1dc6fef4 100644 --- a/web/src/api/generated/core/request.ts +++ b/web/src/api/generated/core/request.ts @@ -1,4 +1,4 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ @@ -145,10 +145,13 @@ export const resolve = async (options: ApiRequestOptions, resolver?: T | Reso }; export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions, formData?: FormData): Promise> => { - const token = await resolve(options, config.TOKEN); - const username = await resolve(options, config.USERNAME); - const password = await resolve(options, config.PASSWORD); - const additionalHeaders = await resolve(options, config.HEADERS); + const [token, username, password, additionalHeaders] = await Promise.all([ + resolve(options, config.TOKEN), + resolve(options, config.USERNAME), + resolve(options, config.PASSWORD), + resolve(options, config.HEADERS), + ]); + const formHeaders = typeof formData?.getHeaders === 'function' && formData?.getHeaders() || {} const headers = Object.entries({ @@ -172,7 +175,7 @@ export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptio headers['Authorization'] = `Basic ${credentials}`; } - if (options.body) { + if (options.body !== undefined) { if (options.mediaType) { headers['Content-Type'] = options.mediaType; } else if (isBlob(options.body)) { @@ -212,6 +215,7 @@ export const sendRequest = async ( data: body ?? formData, method: options.method, withCredentials: config.WITH_CREDENTIALS, + withXSRFToken: config.CREDENTIALS === 'include' ? config.WITH_CREDENTIALS : false, cancelToken: source.token, }; diff --git a/web/src/api/generated/index.ts b/web/src/api/generated/index.ts index 2b1a3e4d..a30fbd87 100644 --- a/web/src/api/generated/index.ts +++ b/web/src/api/generated/index.ts @@ -12,6 +12,7 @@ export type { AddTodoRequest } from './models/AddTodoRequest'; export type { AddTodoResponse } from './models/AddTodoResponse'; export type { DeleteTodoByIdResponse } from './models/DeleteTodoByIdResponse'; export type { ErrorResponse } from './models/ErrorResponse'; +export type { GetTodoAllResponse } from './models/GetTodoAllResponse'; export type { GetTodoByIdResponse } from './models/GetTodoByIdResponse'; export type { UpdateTodoRequest } from './models/UpdateTodoRequest'; export type { UpdateTodoResponse } from './models/UpdateTodoResponse'; diff --git a/web/src/api/generated/models/AddTodoRequest.ts b/web/src/api/generated/models/AddTodoRequest.ts index 6d2d4daa..dbe4b7af 100644 --- a/web/src/api/generated/models/AddTodoRequest.ts +++ b/web/src/api/generated/models/AddTodoRequest.ts @@ -6,3 +6,4 @@ export type AddTodoRequest = { title: string; }; + diff --git a/web/src/api/generated/models/AddTodoResponse.ts b/web/src/api/generated/models/AddTodoResponse.ts index 82863365..e1059771 100644 --- a/web/src/api/generated/models/AddTodoResponse.ts +++ b/web/src/api/generated/models/AddTodoResponse.ts @@ -8,3 +8,4 @@ export type AddTodoResponse = { title: string; is_completed: boolean; }; + diff --git a/web/src/api/generated/models/DeleteTodoByIdResponse.ts b/web/src/api/generated/models/DeleteTodoByIdResponse.ts index 3abeaf51..e2a8ce22 100644 --- a/web/src/api/generated/models/DeleteTodoByIdResponse.ts +++ b/web/src/api/generated/models/DeleteTodoByIdResponse.ts @@ -6,3 +6,4 @@ export type DeleteTodoByIdResponse = { success: boolean; }; + diff --git a/web/src/api/generated/models/ErrorResponse.ts b/web/src/api/generated/models/ErrorResponse.ts index 309e188c..7adcf7d0 100644 --- a/web/src/api/generated/models/ErrorResponse.ts +++ b/web/src/api/generated/models/ErrorResponse.ts @@ -10,3 +10,4 @@ export type ErrorResponse = { debug?: string; extra?: (Record | null); }; + diff --git a/web/src/api/generated/models/GetTodoAllResponse.ts b/web/src/api/generated/models/GetTodoAllResponse.ts new file mode 100644 index 00000000..0840c259 --- /dev/null +++ b/web/src/api/generated/models/GetTodoAllResponse.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type GetTodoAllResponse = { + id: string; + title: string; + is_completed: boolean; +}; + diff --git a/web/src/api/generated/models/GetTodoByIdResponse.ts b/web/src/api/generated/models/GetTodoByIdResponse.ts index 3c1b3e35..f1cd8bcb 100644 --- a/web/src/api/generated/models/GetTodoByIdResponse.ts +++ b/web/src/api/generated/models/GetTodoByIdResponse.ts @@ -8,3 +8,4 @@ export type GetTodoByIdResponse = { title: string; is_completed: boolean; }; + diff --git a/web/src/api/generated/models/UpdateTodoRequest.ts b/web/src/api/generated/models/UpdateTodoRequest.ts index a74763c6..f3e3c6cf 100644 --- a/web/src/api/generated/models/UpdateTodoRequest.ts +++ b/web/src/api/generated/models/UpdateTodoRequest.ts @@ -7,3 +7,4 @@ export type UpdateTodoRequest = { title?: string; is_completed: boolean; }; + diff --git a/web/src/api/generated/models/UpdateTodoResponse.ts b/web/src/api/generated/models/UpdateTodoResponse.ts index 03a633e3..8b203d0f 100644 --- a/web/src/api/generated/models/UpdateTodoResponse.ts +++ b/web/src/api/generated/models/UpdateTodoResponse.ts @@ -6,3 +6,4 @@ export type UpdateTodoResponse = { success: boolean; }; + diff --git a/web/src/api/generated/models/User.ts b/web/src/api/generated/models/User.ts index d10eae66..04f82ef0 100644 --- a/web/src/api/generated/models/User.ts +++ b/web/src/api/generated/models/User.ts @@ -12,3 +12,4 @@ export type User = { roles: Array; scope: AccessLevel; }; + diff --git a/web/src/api/generated/services/TodosService.ts b/web/src/api/generated/services/TodosService.ts index 3251773a..532f97e3 100644 --- a/web/src/api/generated/services/TodosService.ts +++ b/web/src/api/generated/services/TodosService.ts @@ -5,6 +5,7 @@ import type { AddTodoRequest } from '../models/AddTodoRequest'; import type { AddTodoResponse } from '../models/AddTodoResponse'; import type { DeleteTodoByIdResponse } from '../models/DeleteTodoByIdResponse'; +import type { GetTodoAllResponse } from '../models/GetTodoAllResponse'; import type { GetTodoByIdResponse } from '../models/GetTodoByIdResponse'; import type { UpdateTodoRequest } from '../models/UpdateTodoRequest'; import type { UpdateTodoResponse } from '../models/UpdateTodoResponse'; @@ -17,10 +18,10 @@ export class TodosService { /** * Get Todo All - * @returns any Successful Response + * @returns GetTodoAllResponse Successful Response * @throws ApiError */ - public static getAll(): CancelablePromise { + public static getAll(): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/todos',