Repository navigation
added support for list membership in client - #14495
Conversation
🟢 Tier S · Ready to merge
Adds Latest changes: The latest commit adds
Note @imtia33 does not have write access to this repository, so Hansi does not approve automatically. A maintainer can review and approve. 📂 Walkthrough · 7
Reviewed the commits since |
Query::groupByType() returns a ParsedQuery object since the utopia-php/database 8 upgrade, so array access on it fatals. Also sort the new import for Pint. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
What does this PR do?
Adds a new
account.listMemberships()endpoint (GET /v1/account/memberships) to the Account module.Motivation
While
users.listMemberships(userId)exists for Server/Admin SDKs with administrative access (users.read), client-side applications (Web, Mobile, Desktop) and SSR sessions acting on behalf of an authenticated user lacked an endpoint to answer:This PR enables currently authenticated users (via session or JWT) to retrieve their own team memberships directly.
Changes:
GET /v1/account/membershipsinsrc/Appwrite/Platform/Modules/Account/Http/Account/Memberships/XList.php.queries,search, andtotal.teamName,userName, anduserEmailmatching theResponse::MODEL_MEMBERSHIP_LISTmodel.accountwith[AuthType::SESSION, AuthType::JWT]auth types.account.listMembershipsinsrc/Appwrite/Platform/Modules/Account/Services/Http.php.app/config/sdks/parameters.lock.jsonfor client and server platforms.docs/references/account/list-memberships.md.tests/e2e/Services/Account/AccountCustomClientTest.php.Test Plan
E2E Tests:
Verified happy path and failure cases (401 unauthenticated, 400 invalid query attributes, 400 invalid cursor, total toggle, and search) with:
docker compose exec appwrite vendor/bin/phpunit --filter=testListAccountMemberships tests/e2e/Services/Account/AccountCustomClientTest.phpResult:
OK (1 test, 36 assertions)SDK Parameters Lock Unit Test:
Verified that method parameters and parameter order align with SDK generation standards:
docker compose exec appwrite vendor/bin/phpunit tests/unit/SDK/ParametersTest.phpResult:
OK (2 tests, 10072 assertions)Regression Sanity Check:
Verified that the existing server-side
users.listMembershipsendpoint continues to work without disruption:docker compose exec appwrite vendor/bin/phpunit --filter=testListUserMemberships tests/e2e/Services/UsersResult:
OK (1 test, 26 assertions)Related PRs and Issues
Checklist