mirror of
https://github.com/versia-pub/docs.git
synced 2026-03-13 02:49:16 +01:00
refactor: ♻️ Remove extension_type in favour of using the type field on entities
This commit is contained in:
parent
228ef3c98d
commit
596b42474f
9 changed files with 20 additions and 25 deletions
|
|
@ -19,7 +19,7 @@ Likes are a way for users to show appreciation for a note, like Twitter's "heart
|
|||
<Row>
|
||||
<Col>
|
||||
<Properties>
|
||||
<Property name="extension_type" type="string" required={true}>
|
||||
<Property name="type" type="string" required={true}>
|
||||
Must be `pub.versia:likes/Like`.
|
||||
</Property>
|
||||
<Property name="author" type="URI" required={true} typeLink="/types#uri">
|
||||
|
|
@ -36,8 +36,7 @@ Likes are a way for users to show appreciation for a note, like Twitter's "heart
|
|||
```jsonc {{ 'title': 'Example Like' }}
|
||||
{
|
||||
"id": "3e7e4750-afd4-4d99-a256-02f0710a0520",
|
||||
"type": "Extension",
|
||||
"extension_type": "pub.versia:likes/Like",
|
||||
"type": "pub.versia:likes/Like",
|
||||
"created_at": "2021-01-01T00:00:00.000Z",
|
||||
"author": "https://example.com/users/6e0204a2-746c-4972-8602-c4f37fc63bbe",
|
||||
"uri": "https://example.com/likes/3e7e4750-afd4-4d99-a256-02f0710a0520",
|
||||
|
|
@ -57,7 +56,7 @@ Dislikes are a way for users to show disapproval for a note, like YouTube's "dis
|
|||
<Row>
|
||||
<Col>
|
||||
<Properties>
|
||||
<Property name="extension_type" type="string" required={true}>
|
||||
<Property name="type" type="string" required={true}>
|
||||
Must be `pub.versia:likes/Dislike`.
|
||||
</Property>
|
||||
<Property name="author" type="URI" required={true} typeLink="/types#uri">
|
||||
|
|
@ -74,8 +73,7 @@ Dislikes are a way for users to show disapproval for a note, like YouTube's "dis
|
|||
```jsonc {{ 'title': 'Example Dislike' }}
|
||||
{
|
||||
"id": "3e7e4750-afd4-4d99-a256-02f0710a0520",
|
||||
"type": "Extension",
|
||||
"extension_type": "pub.versia:likes/Dislike",
|
||||
"type": "pub.versia:likes/Dislike",
|
||||
"created_at": "2021-01-01T00:00:00.000Z",
|
||||
"author": "https://example.com/users/6e0204a2-746c-4972-8602-c4f37fc63bbe",
|
||||
"uri": "https://example.com/dislikes/3e7e4750-afd4-4d99-a256-02f0710a0520",
|
||||
|
|
|
|||
|
|
@ -87,9 +87,6 @@ Extensions can be found in two places: an [Entity](/entities#entity-definition)'
|
|||
<Col>
|
||||
<Properties>
|
||||
<Property name="type" type="string" required={true}>
|
||||
The entity type. **Must** be `Extension`. The extension type is defined in the `extension_type` property.
|
||||
</Property>
|
||||
<Property name="extension_type" type="string" required={true}>
|
||||
The extension type. [Must follow naming conventions](#naming).
|
||||
</Property>
|
||||
<Property name="other">
|
||||
|
|
@ -103,8 +100,7 @@ Extensions can be found in two places: an [Entity](/entities#entity-definition)'
|
|||
|
||||
```jsonc {{ title: "Example Custom Entity" }}
|
||||
{
|
||||
"type": "Extension",
|
||||
"extension_type": "com.example:poll/Poll",
|
||||
"type": "com.example:poll/Poll",
|
||||
"id": "6f27bc77-58ee-4c9b-b804-8cc1c1182fa9",
|
||||
"uri": "https://example.com/actions/6f27bc77-58ee-4c9b-b804-8cc1c1182fa9",
|
||||
"author": "https://example.com/users/6e0204a2-746c-4972-8602-c4f37fc63bbe",
|
||||
|
|
|
|||
|
|
@ -95,6 +95,9 @@ If a vote is cast to a poll that is closed, the vote should be rejected with a `
|
|||
<Row>
|
||||
<Col>
|
||||
<Properties>
|
||||
<Property name="type" type="string" required="true">
|
||||
Must be `pub.versia:polls/Vote`.
|
||||
</Property>
|
||||
<Property name="author" type="URI" required="true" typeLink="/types#uri">
|
||||
URI to the user who cast the vote.
|
||||
</Property>
|
||||
|
|
@ -112,8 +115,7 @@ If a vote is cast to a poll that is closed, the vote should be rejected with a `
|
|||
```jsonc {{ title: "Example Vote" }}
|
||||
{
|
||||
"id": "6f27bc77-58ee-4c9b-b804-8cc1c1182fa9",
|
||||
"type": "Extension", // [!code focus:2]
|
||||
"extension_type": "pub.versia:polls/Vote",
|
||||
"type": "pub.versia:polls/Vote", // [!code focus]
|
||||
"uri": "https://example.com/actions/6f27bc77-58ee-4c9b-b804-8cc1c1182fa9",
|
||||
"created_at": "2021-01-01T00:00:00.000Z",
|
||||
"author": "https://example.com/users/6e0204a2-746c-4972-8602-c4f37fc63bbe", // [!code focus:3]
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ User reactions are (like every other entity) federated to all followers, and can
|
|||
<Row>
|
||||
<Col>
|
||||
<Properties>
|
||||
<Property name="extension_type" type="string" required>
|
||||
<Property name="type" type="string" required>
|
||||
Must be `pub.versia:reactions/Reaction`.
|
||||
</Property>
|
||||
<Property name="author" type="URI" required typeLink="/types#uri">
|
||||
|
|
@ -38,8 +38,7 @@ User reactions are (like every other entity) federated to all followers, and can
|
|||
```jsonc {{ title: "Example Entity" }}
|
||||
{
|
||||
"id": "6f27bc77-58ee-4c9b-b804-8cc1c1182fa9",
|
||||
"type": "Extension", // [!code focus:2]
|
||||
"extension_type": "pub.versia:reactions/Reaction",
|
||||
"type": "pub.versia:reactions/Reaction", // [!code focus]
|
||||
"uri": "https://example.com/actions/6f27bc77-58ee-4c9b-b804-8cc1c1182fa9",
|
||||
"created_at": "2021-01-01T00:00:00.000Z",
|
||||
"author": "https://example.com/users/6e0204a2-746c-4972-8602-c4f37fc63bbe", // [!code focus:3]
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ When a user shares a note, the note's original author **must** receive the entit
|
|||
<Row>
|
||||
<Col>
|
||||
<Properties>
|
||||
<Property name="extension_type" type="string" required={true}>
|
||||
<Property name="type" type="string" required={true}>
|
||||
Must be `pub.versia:share/Share`.
|
||||
</Property>
|
||||
<Property name="author" type="URI" required={true} typeLink="/types#uri">
|
||||
|
|
@ -35,8 +35,7 @@ When a user shares a note, the note's original author **must** receive the entit
|
|||
```jsonc {{ 'title': 'Example Share' }}
|
||||
{
|
||||
"id": "3e7e4750-afd4-4d99-a256-02f0710a0520",
|
||||
"type": "Extension",
|
||||
"extension_type": "pub.versia:share/Share",
|
||||
"type": "pub.versia:share/Share",
|
||||
"created_at": "2021-01-01T00:00:00.000Z",
|
||||
"author": "https://example.com/users/6e0204a2-746c-4972-8602-c4f37fc63bbe",
|
||||
"uri": "https://example.com/shares/3e7e4750-afd4-4d99-a256-02f0710a0520",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue