docs: fix parameter mismatches and inaccurate documentation
- Fix update_post() wrapper documentation (post_id -> post_text/post_path/post_key) - Fix create_comment() wrapper documentation (added post_slug, post_key parameters) - Add missing wrapper docs for follow(), trust(), votecast(), react() - Fix reaction job parameters (parent_id -> parent_sk, corrected payload structure) - Fix trust job parameters (updated to match actual payload structure) - Fix vote job parameters (voteType -> vote, added parent structure) - Clearly mark Block and Mute jobs as NOT IMPLEMENTED - Fix GitLab URLs to Forgejo (git.jezzahehn.com) - Remove LLM-style language (comprehensive -> full/thorough) - Fix trust listbyusersinit parameter (username -> user_id)
This commit is contained in:
parent
fd1a1566e9
commit
e7cf4f1e09
6 changed files with 320 additions and 95 deletions
|
|
@ -365,25 +365,32 @@ Cast votes on posts/content.
|
|||
|
||||
### vote.votecast()
|
||||
|
||||
Casts a vote on a post.
|
||||
Casts a vote on a post or comment.
|
||||
|
||||
```python
|
||||
vote = API.run_job('vote.votecast', payload)
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
- `pk` (str): Object partition key
|
||||
- `sk` (str): Object sort key
|
||||
- `voteType` (str): Vote type - "up" or "down"
|
||||
- `parent` (dict): Object containing vote target info
|
||||
- `pk` (str): Object partition key
|
||||
- `sk` (str): Object sort key
|
||||
- `slug` (str): Object slug
|
||||
- `entity` (str): Entity type (e.g., "post", "comment")
|
||||
- `vote` (str): Vote type - "up" or "down"
|
||||
|
||||
**Returns:** dict - Vote status
|
||||
|
||||
**Example:**
|
||||
```python
|
||||
voted = API.run_job('vote.votecast', {
|
||||
"pk": "post-id",
|
||||
"sk": "post-id",
|
||||
"voteType": "up"
|
||||
"parent": {
|
||||
"pk": "post#abc123",
|
||||
"sk": "post#abc123",
|
||||
"slug": "my-post-slug",
|
||||
"entity": "post"
|
||||
},
|
||||
"vote": "up"
|
||||
})
|
||||
```
|
||||
|
||||
|
|
@ -402,20 +409,21 @@ reaction = API.run_job('reaction.reacttosomething', payload)
|
|||
```
|
||||
|
||||
**Parameters:**
|
||||
- `objectPK` (str): Object partition key
|
||||
- `objectSK` (str): Object sort key
|
||||
- `objectType` (str): Type of object ("post", "comment", etc.)
|
||||
- `reactionType` (str): Reaction type (depends on API)
|
||||
- `parent` (dict): Object containing `pk` and `sk` keys
|
||||
- `pk` (str): Object partition key
|
||||
- `sk` (str): Object sort key
|
||||
- `reaction` (str): Reaction type (e.g., "like", "heart", "fire")
|
||||
|
||||
**Returns:** dict - Reaction status
|
||||
|
||||
**Example:**
|
||||
```python
|
||||
reacted = API.run_job('reaction.reacttosomething', {
|
||||
"objectPK": "post-id",
|
||||
"objectSK": "post-id",
|
||||
"objectType": "post",
|
||||
"reactionType": "like"
|
||||
"parent": {
|
||||
"pk": "post-id",
|
||||
"sk": "post-id"
|
||||
},
|
||||
"reaction": "like"
|
||||
})
|
||||
```
|
||||
|
||||
|
|
@ -423,16 +431,21 @@ reacted = API.run_job('reaction.reacttosomething', {
|
|||
|
||||
### reaction.getbyparent()
|
||||
|
||||
Get reactions by parent object.
|
||||
Get a specific reaction by parent sort key.
|
||||
|
||||
```python
|
||||
reactions = API.run_job('reaction.getbyparent', parent_id)
|
||||
reactions = API.run_job('reaction.getbyparent', parent_sk)
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
- `objectId` (str): Parent object ID
|
||||
- `parent_sk` (str): Parent sort key (not full ID)
|
||||
|
||||
**Returns:** dict - List of reactions
|
||||
**Returns:** dict - Reaction data
|
||||
|
||||
**Example:**
|
||||
```python
|
||||
reaction = API.run_job('reaction.getbyparent', "post#my-post-slug")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -441,15 +454,19 @@ reactions = API.run_job('reaction.getbyparent', parent_id)
|
|||
List all reactions for a parent object.
|
||||
|
||||
```python
|
||||
reactions = API.run_job('reaction.listbyparent', parent_id)
|
||||
reactions = API.run_job('reaction.listbyparent', parent_sk)
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
- `parentPK` (str): Parent partition key
|
||||
- `parentSK` (str): Parent sort key
|
||||
- `parent_sk` (str): Parent sort key (not full ID)
|
||||
|
||||
**Returns:** dict - List of reactions
|
||||
|
||||
**Example:**
|
||||
```python
|
||||
reactions = API.run_job('reaction.listbyparent', "post#my-post-slug")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Notification Jobs
|
||||
|
|
@ -509,19 +526,21 @@ trust = API.run_job('trust.createorupdate', payload)
|
|||
```
|
||||
|
||||
**Parameters:**
|
||||
- `pk` (str): Trust identifier (partition key)
|
||||
- `sk` (str): Trust identifier (sort key)
|
||||
- `trustType` (str): Trust type ("positive", "negative", etc.)
|
||||
- Other optional fields
|
||||
- `parent` (dict): Object containing `pk` and `sk` for the userprofile
|
||||
- `parentSlug` (str): Slug of the userprofile
|
||||
- `trustLevel` (str): Trust level (e.g., "trusted", "neutral", "distrusted")
|
||||
|
||||
**Returns:** dict - Trust relationship status
|
||||
|
||||
**Example:**
|
||||
```python
|
||||
trust = API.run_job('trust.createorupdate', {
|
||||
"pk": "trust-id-123",
|
||||
"sk": "trust-id-123",
|
||||
"trustType": "positive"
|
||||
"parent": {
|
||||
"pk": "userprofile#philosopher-jon",
|
||||
"sk": "userprofile#philosopher-jon"
|
||||
},
|
||||
"parentSlug": "philosopher-jon",
|
||||
"trustLevel": "trusted"
|
||||
})
|
||||
```
|
||||
|
||||
|
|
@ -532,17 +551,18 @@ trust = API.run_job('trust.createorupdate', {
|
|||
Lists trust relationships initialized by a user.
|
||||
|
||||
```python
|
||||
trusts = API.run_job('trust.listbyusersinit', username)
|
||||
trusts = API.run_job('trust.listbyusersinit', user_id)
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
- `username` (str): The user whose trust relationships to list
|
||||
- `user_id` (str): The user ID (not username) whose trust relationships to list
|
||||
- `lastEvaluatedKey` (dict, optional): Pagination key
|
||||
|
||||
**Returns:** dict - List of trust relationships
|
||||
|
||||
**Example:**
|
||||
```python
|
||||
my_trusts = API.run_job('trust.listbyusersinit', "your-username")
|
||||
my_trusts = API.run_job('trust.listbyusersinit', "user-id-123")
|
||||
```
|
||||
|
||||
---
|
||||
|
|
@ -552,11 +572,11 @@ my_trusts = API.run_job('trust.listbyusersinit', "your-username")
|
|||
Lists trust relationships where a user was the target.
|
||||
|
||||
```python
|
||||
trusts = API.run_job('trust.listbyuserhas', username)
|
||||
trusts = API.run_job('trust.listbyuserhas', user_id)
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
- `username` (str): The user who was targeted
|
||||
- `user_id` (str): The user ID (not username) who was targeted
|
||||
|
||||
**Returns:** dict - List of trust relationships
|
||||
|
||||
|
|
@ -653,35 +673,21 @@ print(f"Following feed items: {len(following_feed.get('Items', []))}")
|
|||
|
||||
## Block Jobs
|
||||
|
||||
Block users or content.
|
||||
### ⚠️ NOT IMPLEMENTED
|
||||
|
||||
### block.[notimplemented]
|
||||
Block functionality is not yet implemented in this wrapper. The TrustCafé API may support blocking, but no job or wrapper functions exist yet.
|
||||
|
||||
Block functionality is defined in the backend but not yet implemented in the wrapper.
|
||||
|
||||
**Status:** TODO
|
||||
|
||||
**Implementation needed:**
|
||||
- Job function creation
|
||||
- Payload structure definition
|
||||
- Error handling
|
||||
**Status:** TODO - See development.md for details
|
||||
|
||||
---
|
||||
|
||||
## Mute Jobs
|
||||
|
||||
Mute users or content.
|
||||
### ⚠️ NOT IMPLEMENTED
|
||||
|
||||
### mute.[notimplemented]
|
||||
Mute functionality is not yet implemented in this wrapper. The TrustCafé API may support muting, but no job or wrapper functions exist yet.
|
||||
|
||||
Mute functionality is pending implementation.
|
||||
|
||||
**Status:** TODO
|
||||
|
||||
**Implementation needed:**
|
||||
- Job function creation
|
||||
- Payload structure definition
|
||||
- Error handling
|
||||
**Status:** TODO - See development.md for details
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue