Comment Object Documentation
The Comment object represents a user-generated comment within Replyke, including support for replies, mentions, upvotes, and optional media such as GIFs.
Properties
Property | Type | Description |
---|---|---|
id | string | Unique identifier for the comment (auto-generated by Sequelize). |
projectId | string | Identifier linking the comment to a specific project. |
userId | string | Identifier of the user who created the comment. |
entityId | string | Identifier of the entity the comment belongs to. |
parentId | string | null | Identifier of the parent comment if it’s a reply. |
content | string | null | The main text content of the comment. |
gif | IGif | null | Optional GIF attached to the comment. |
mentions | IMention[] | List of mentioned users in the comment. |
upvotes | string[] | List of user IDs who upvoted the comment. |
downvotes | string[] | List of user IDs who downvoted the comment. |
parentDeletedAt | Date | null | Timestamp indicating if the parent comment was deleted. |
createdAt | Date | Timestamp when the comment was created. |
updatedAt | Date | Timestamp when the comment was last updated. |
deletedAt | Date | null | Timestamp if the comment was deleted (null if active). |
Supporting Types
GIF Object (IGif
)
Property | Type | Description |
---|---|---|
altText | string | Alternative text for accessibility. |
gifPreviewUrl | string | URL to a preview version of the GIF. |
gifUrl | string | URL to the full-size GIF. |
id | string | Unique identifier for the GIF. |
url | string | Main URL for the GIF. |
aspectRatio | string | Aspect ratio of the GIF (e.g., “16:9”). |
Mention Object (IMention
)
Property | Type | Description |
---|---|---|
id | string | User ID of the mentioned user. |
username | string | Current username for easy lookup. |
Example Usage
Basic Comment
{
"id": "123456",
"projectId": "project-xyz",
"userId": "user-789",
"entityId": "entity-456",
"content": "This is a great post!",
"mentions": [{ "id": "user-555", "username": "johndoe" }],
"upvotes": ["user-100", "user-101"],
"downvotes": [],
"createdAt": "2024-02-14T12:34:56Z"
}
Comment with GIF
{
"id": "7891011",
"projectId": "project-abc",
"userId": "user-222",
"entityId": "entity-333",
"content": "This is hilarious!",
"gif": {
"altText": "Funny dancing cat",
"gifPreviewUrl": "https://example.com/preview.gif",
"gifUrl": "https://example.com/full.gif",
"id": "gif-999",
"url": "https://example.com/gif",
"aspectRatio": "4:3"
},
"mentions": [],
"upvotes": ["user-555"],
"downvotes": [],
"createdAt": "2024-02-14T13:45:00Z"
}
Integration Flexibility
The Comment object is designed to accommodate multiple use cases, including threaded discussions, reactions, and media-rich responses. Developers can extend the metadata and structure to fit specific project requirements.