diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d11f3fc..c0817ade 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [0.0.22 - 2023-07-05] + +### Added + +- `heartbeat` endpoint support for AppEcosystemV2. + ## [0.0.21 - 2023-07-04] ### Added diff --git a/nc_py_api/__init__.py b/nc_py_api/__init__.py index cc901b8e..9f5eaa2a 100644 --- a/nc_py_api/__init__.py +++ b/nc_py_api/__init__.py @@ -5,6 +5,11 @@ from .constants import ApiScope, LogLvl from .exceptions import NextcloudException, check_error from .files import FsNodeInfo -from .integration_fastapi import nc_app, set_enabled_handler, set_scopes +from .integration_fastapi import ( + enable_heartbeat, + nc_app, + set_enabled_handler, + set_scopes, +) from .nextcloud import Nextcloud, NextcloudApp from .ui_files_actions_menu import UiActionFileInfo, UiFileActionHandlerInfo diff --git a/nc_py_api/_version.py b/nc_py_api/_version.py index cacb0b9f..e9829693 100644 --- a/nc_py_api/_version.py +++ b/nc_py_api/_version.py @@ -1,3 +1,3 @@ """ Version of nc_py_api""" -__version__ = "0.0.21" +__version__ = "0.0.22" diff --git a/nc_py_api/integration_fastapi.py b/nc_py_api/integration_fastapi.py index d1ae1090..b1383ebd 100644 --- a/nc_py_api/integration_fastapi.py +++ b/nc_py_api/integration_fastapi.py @@ -37,3 +37,9 @@ def enabled_handler( ): r = callback(enabled, nc) return JSONResponse(content={"error": r}, status_code=200) + + +def enable_heartbeat(fast_api_app: FastAPI): + @fast_api_app.get("/heartbeat") + def heartbeat_handler(): + return JSONResponse(content={"status": "ok"}, status_code=200)