diff --git a/README.md b/README.md index f479403..fcce906 100644 --- a/README.md +++ b/README.md @@ -620,7 +620,7 @@ python -m pytest tests/ For issues, questions, or contributions: - [TrustCafé Website](https://trustcafe.io) -- [Forgejo Repository](https://git.jezzahehn.com/KrustyPlanet/trustcafe-api-wrapper) +- [GitLab Repository](https://gitlab.com/trustcafe/trustcafe-api-wrapper) - Contact the WikiTribune team ## Version History diff --git a/docs/API_REFERENCE.md b/docs/API_REFERENCE.md index 15c3bc1..3430824 100644 --- a/docs/API_REFERENCE.md +++ b/docs/API_REFERENCE.md @@ -340,21 +340,39 @@ Manage follow relationships. ### follow.follow() -Follows a user. +Follow or unfollow a user or subwiki. ```python -result = API.run_job('follow.follow', username) +result = API.run_job('follow.follow', payload) ``` **Parameters:** -- `username` (str): The username to follow +- `payload` (dict): Follow payload containing: + - `isFollowing` (bool): `true` to follow, `false` to unfollow + - `parent` (dict): Object with `pk` and `sk` for the target + - `followType` (str): Entity type (`'userprofile'` or `'subwiki'`) + - `parentSlug` (str): Slug of the user or subwiki + - `preferences` (dict, optional): Notification preferences -**Returns:** dict - Follow status +**Returns:** dict - Follow relationship data **Example:** ```python -followed = API.run_job('follow.follow', "another-user") -print(f"Follow status: {followed}") +# Follow a user +followed = API.run_job('follow.follow', { + "isFollowing": true, + "parent": { + "pk": "userprofile#philosopher-jon", + "sk": "userprofile#philosopher-jon" + }, + "followType": "userprofile", + "parentSlug": "philosopher-jon", + "preferences": { + "notification": true, + "emailNew": false, + "emailDigest": true + } +}) ``` --- @@ -591,38 +609,47 @@ Manage branches (platform branches or sub-wikis). Get a specific branch. ```python -branch = API.run_job('branch.get', branch_name) +branch = API.run_job('branch.get', branch_slug) ``` **Parameters:** -- `branchName` (str): The branch identifier +- `branch_slug` (str): The branch/subwiki slug identifier **Returns:** dict - Branch data **Example:** ```python -branch = API.run_job('branch.get', "main") -print(branch.get('branchName')) +branch = API.run_job('branch.get', "music") +print(branch.get('slug')) ``` --- ### branch.listbyname() -List branches by name prefix. +List all branches with pagination. ```python -branches = API.run_job('branch.listbyname', prefix) +branches = API.run_job('branch.listbyname', lastEvaluatedKey) ``` **Parameters:** -- `prefix` (str): String prefix for branch names +- `lastEvaluatedKey` (dict, optional): Pagination key for next page -**Returns:** dict - List of matching branches +**Returns:** dict - List of branches + +**Note:** Despite the name, this does not filter by branch name. It lists all branches. **Example:** ```python -music_branches = API.run_job('branch.listbyname', "music") +# Get first page of branches +branches = API.run_job('branch.listbyname') +for branch in branches.get('Items', []): + print(branch.get('slug')) + +# Get next page +if 'LastEvaluatedKey' in branches: + next_page = API.run_job('branch.listbyname', branches['LastEvaluatedKey']) ``` --- @@ -639,7 +666,8 @@ Get the café-wide feed. feed = API.run_job('feed.cafefeed') ``` -**Parameters:** None +**Parameters:** +- `lastEvaluatedKey` (dict, optional): Pagination key **Returns:** dict - Café feed content @@ -651,21 +679,22 @@ print(f"Feed items: {len(cafefeed.get('Items', []))}") --- -### feed.following() +### feed.followingfeed() Get feed for users you follow. ```python -feed = API.run_job('feed.following') +feed = API.run_job('feed.followingfeed') ``` -**Parameters:** None +**Parameters:** +- `lastEvaluatedKey` (dict, optional): Pagination key **Returns:** dict - Following feed content **Example:** ```python -following_feed = API.run_job('feed.following') +following_feed = API.run_job('feed.followingfeed') print(f"Following feed items: {len(following_feed.get('Items', []))}") ``` diff --git a/docs/INDEX.md b/docs/INDEX.md index 9c35c4a..98354b8 100644 --- a/docs/INDEX.md +++ b/docs/INDEX.md @@ -118,7 +118,7 @@ If you can't find the answer you're looking for: 1. **Check the FAQs section** - Common questions and answers 2. **Review the Troubleshooting guide** - For specific error handling 3. **Contact WikiTribune team** - Via company channels -4. **File an issue on Forgejo** - [Repository Issues](https://git.jezzahehn.com/KrustyPlanet/trustcafe-api-wrapper/issues) +4. **File an issue on GitLab** - [Repository Issues](https://gitlab.com/trustcafe/trustcafe-api-wrapper/-/issues) --- diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md index d6193af..523127f 100644 --- a/docs/TROUBLESHOOTING.md +++ b/docs/TROUBLESHOOTING.md @@ -729,8 +729,8 @@ requests_log.propagate = True If you've tried all of the above and still have issues: -1. **Check the Code**: Review the latest version on Forgejo - - [Forgejo Repository](https://git.jezzahehn.com/KrustyPlanet/trustcafe-api-wrapper) +1. **Check the Code**: Review the latest version on GitLab + - [GitLab Repository](https://gitlab.com/trustcafe/trustcafe-api-wrapper) 2. **Check TrustCafé Status**: Verify services are up - [Production](https://trustcafe.io)