diff --git a/.github/workflows/analysis-coverage.yml b/.github/workflows/analysis-coverage.yml index 9d7f9338..8022f3f3 100644 --- a/.github/workflows/analysis-coverage.yml +++ b/.github/workflows/analysis-coverage.yml @@ -439,7 +439,7 @@ jobs: strategy: fail-fast: false matrix: - nextcloud: [ 'stable28', 'stable29', 'master' ] + nextcloud: [ 'stable28', 'stable29', 'stable30' ] timeout-minutes: 60 services: @@ -483,7 +483,6 @@ jobs: - name: Checkout Notes uses: actions/checkout@v4 - if: ${{ !startsWith(matrix.nextcloud, 'master') }} with: repository: nextcloud/notes ref: "main" @@ -491,7 +490,6 @@ jobs: - name: Checkout Files Locking uses: actions/checkout@v4 - if: ${{ !startsWith(matrix.nextcloud, 'master') }} with: repository: nextcloud/files_lock ref: ${{ matrix.nextcloud }} @@ -511,11 +509,9 @@ jobs: PHP_CLI_SERVER_WORKERS=2 php -S localhost:8080 & - name: Enable Files Locking - if: ${{ !startsWith(matrix.nextcloud, 'master') }} run: ./occ app:enable files_lock - name: Enable Notes - if: ${{ !startsWith(matrix.nextcloud, 'master') }} run: ./occ app:enable notes - name: Checkout NcPyApi @@ -528,7 +524,7 @@ jobs: run: python3 -m pip -v install ".[dev]" - name: Checkout AppAPI - if: ${{ matrix.nextcloud != 'master' }} + if: ${{ matrix.nextcloud != 'stable30' }} uses: actions/checkout@v4 with: path: apps/app_api @@ -536,11 +532,12 @@ jobs: ref: stable29 - name: Checkout AppAPI - if: ${{ matrix.nextcloud == 'master' }} + if: ${{ matrix.nextcloud == 'stable30' }} uses: actions/checkout@v4 with: path: apps/app_api repository: nextcloud/app_api + ref: stable30 - name: Install AppAPI run: | @@ -555,20 +552,12 @@ jobs: kill -15 $(cat /tmp/_install.pid) timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null - - name: Talk Branch Main - if: ${{ startsWith(matrix.nextcloud, 'master') }} - run: echo "TALK_BRANCH_NAME=main" >> $GITHUB_ENV - - - name: Talk Branch Other - if: ${{ !startsWith(matrix.nextcloud, 'master') }} - run: echo "TALK_BRANCH_NAME=${{ matrix.nextcloud }}" >> $GITHUB_ENV - - name: Checkout Talk uses: actions/checkout@v4 with: path: apps/spreed repository: nextcloud/spreed - ref: ${{ env.TALK_BRANCH_NAME }} + ref: ${{ matrix.nextcloud }} - name: Install Talk working-directory: apps/spreed @@ -627,7 +616,7 @@ jobs: strategy: fail-fast: false matrix: - nextcloud: [ 'stable28', 'stable29', 'master' ] + nextcloud: [ 'stable28', 'stable29', 'stable30' ] env: NC_dbname: nextcloud_abz DATABASE_PGSQL: 1 @@ -704,7 +693,7 @@ jobs: run: python3 -m pip -v install ".[dev]" - name: Checkout AppAPI - if: ${{ matrix.nextcloud != 'master' }} + if: ${{ matrix.nextcloud != 'stable30' }} uses: actions/checkout@v4 with: path: apps/app_api @@ -712,11 +701,12 @@ jobs: ref: stable29 - name: Checkout AppAPI - if: ${{ matrix.nextcloud == 'master' }} + if: ${{ matrix.nextcloud == 'stable30' }} uses: actions/checkout@v4 with: path: apps/app_api repository: nextcloud/app_api + ref: stable30 - name: Install AppAPI run: | @@ -731,20 +721,12 @@ jobs: kill -15 $(cat /tmp/_install.pid) timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null - - name: Talk Branch Main - if: ${{ startsWith(matrix.nextcloud, 'master') }} - run: echo "TALK_BRANCH_NAME=main" >> $GITHUB_ENV - - - name: Talk Branch Other - if: ${{ !startsWith(matrix.nextcloud, 'master') }} - run: echo "TALK_BRANCH_NAME=${{ matrix.nextcloud }}" >> $GITHUB_ENV - - name: Checkout Talk uses: actions/checkout@v4 with: path: apps/spreed repository: nextcloud/spreed - ref: ${{ env.TALK_BRANCH_NAME }} + ref: ${{ matrix.nextcloud }} - name: Install Talk working-directory: apps/spreed @@ -808,7 +790,7 @@ jobs: strategy: fail-fast: false matrix: - nextcloud: [ 'stable27', 'stable28', 'stable29', 'master' ] + nextcloud: [ 'stable27', 'stable28', 'stable29', 'stable30', 'master' ] env: NEXTCLOUD_URL: "http://localhost:8080/index.php" timeout-minutes: 60 @@ -884,28 +866,6 @@ jobs: working-directory: nc_py_api run: python3 -m pip -v install . pytest pytest-asyncio coverage pillow - - name: Talk Branch Main - if: ${{ startsWith(matrix.nextcloud, 'master') }} - run: echo "TALK_BRANCH_NAME=main" >> $GITHUB_ENV - - - name: Talk Branch Other - if: ${{ !startsWith(matrix.nextcloud, 'master') }} - run: echo "TALK_BRANCH_NAME=${{ matrix.nextcloud }}" >> $GITHUB_ENV - - - name: Checkout Talk - uses: actions/checkout@v4 - with: - path: apps/spreed - repository: nextcloud/spreed - ref: ${{ env.TALK_BRANCH_NAME }} - - - name: Install Talk - working-directory: apps/spreed - run: make dev-setup - - - name: Enable Talk - run: php occ app:enable spreed - - name: Generate coverage report working-directory: nc_py_api run: coverage run -m pytest && coverage xml -o coverage_sqlite_${{ matrix.nextcloud }}_client.xml diff --git a/AUTHORS b/AUTHORS index 27823323..451859a4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -6,6 +6,7 @@ answer newbie questions, and generally made NC-Py-API that much better: Alexander Piskun CooperGerman Tobias Tschech + Scott Williams A big THANK YOU goes to: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d40f3e3..588424e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. +## [0.18.0 - 2024-10-09] + +### Added + +- New `webhooks.unregister_all` method. #309 + +### Fixed + +- Files: `user` and `user_path` properties in `FSNode` when Nextcloud located in in sub-path. #297 Thanks to @vwbusguy +- `files.download_directory_as_zip` method now supports upcoming Nextcloud 31. #304 + ## [0.17.1 - 2024-09-06] ### Added diff --git a/nc_py_api/_version.py b/nc_py_api/_version.py index 749f78f5..abaed9bd 100644 --- a/nc_py_api/_version.py +++ b/nc_py_api/_version.py @@ -1,3 +1,3 @@ """Version of nc_py_api.""" -__version__ = "0.17.1" +__version__ = "0.18.0.dev0" diff --git a/nc_py_api/webhooks.py b/nc_py_api/webhooks.py index dd124e32..16bbf1c3 100644 --- a/nc_py_api/webhooks.py +++ b/nc_py_api/webhooks.py @@ -3,7 +3,7 @@ import dataclasses from ._misc import clear_from_params_empty # , require_capabilities -from ._session import AsyncNcSessionBasic, NcSessionBasic +from ._session import AppConfig, AsyncNcSessionBasic, NcSessionBasic @dataclasses.dataclass @@ -140,6 +140,13 @@ def update( def unregister(self, webhook_id: int) -> bool: return self._session.ocs("DELETE", f"{self._ep_base}/{webhook_id}") + def unregister_all(self, appid: str = "") -> int: + if not appid and isinstance(self._session.cfg, AppConfig): + appid = self._session.cfg.app_name + else: + raise ValueError("The `appid` parameter cannot be empty for non-ExApp use.") + return self._session.ocs("DELETE", f"{self._ep_base}/byappid/{appid}") + class _AsyncWebhooksAPI: """The class provides the async application management API on the Nextcloud server.""" @@ -208,3 +215,10 @@ async def update( async def unregister(self, webhook_id: int) -> bool: return await self._session.ocs("DELETE", f"{self._ep_base}/{webhook_id}") + + async def unregister_all(self, appid: str = "") -> int: + if not appid and isinstance(self._session.cfg, AppConfig): + appid = self._session.cfg.app_name + else: + raise ValueError("The `appid` parameter cannot be empty for non-ExApp use.") + return await self._session.ocs("DELETE", f"{self._ep_base}/byappid/{appid}")