refactor: 📝 Update all extension to remove now-useless fields

This commit is contained in:
Jesse Wierzbinski 2025-05-05 14:08:20 +02:00
parent 51c53824ad
commit d886b83e62
No known key found for this signature in database
27 changed files with 166 additions and 410 deletions

View file

@ -17,12 +17,13 @@ Having the authorization is defined as:
## Entity Definition
<Warning>
This entity is a [**Transient Entity**](/entities#transient-entities).
</Warning>
<Row>
<Col>
<Properties name="Delete">
<Property name="uri" type="null" required={false}>
This is a [**Transient Entity**](/entities#transient-entities) and does not have a URI.
</Property>
<Property name="author" type="URI | null" required={true} typeLink="/types#uri">
URI of the `User` who is deleting the entity. [Can be set to `null` to represent the instance](/entities/instance-metadata#the-null-author).
</Property>
@ -43,6 +44,7 @@ Having the authorization is defined as:
"id": "9b3212b8-529c-435a-8798-09ebbc17ca74",
"created_at": "2021-01-01T00:00:00.000Z",
"author": "6e0204a2-746c-4972-8602-c4f37fc63bbe",
"deleted_type": "Note",
"deleted": "02e1e3b2-cb1f-4e4a-b82e-98866bee5de7"
}
```

View file

@ -11,12 +11,13 @@ export const metadata = {
## Entity Definition
<Warning>
This entity is a [**Transient Entity**](/entities#transient-entities).
</Warning>
<Row>
<Col>
<Properties name="FollowAccept">
<Property name="uri" type="null" required={false}>
This is a [**Transient Entity**](/entities#transient-entities) and does not have a URI.
</Property>
<Property name="author" type="URI" required={true} typeLink="/types#uri">
URI of the `User` considered the 'followee', i.e. the user who is being followed.
</Property>

View file

@ -21,12 +21,13 @@ But it can also be used when Bob is already following Alice, in the case that:
## Entity Definition
<Warning>
This entity is a [**Transient Entity**](/entities#transient-entities).
</Warning>
<Row>
<Col>
<Properties name="FollowReject">
<Property name="uri" type="null" required={false}>
This is a [**Transient Entity**](/entities#transient-entities) and does not have a URI.
</Property>
<Property name="author" type="URI" required={true} typeLink="/types#uri">
URI of the `User` considered the 'followee', i.e. the user who is being followed.
</Property>

View file

@ -53,12 +53,13 @@ Once a follow relationship is established, the **followee**'s instance should se
## Entity Definition
<Warning>
This entity is a [**Transient Entity**](/entities#transient-entities).
</Warning>
<Row>
<Col>
<Properties name="Follow">
<Property name="uri" type="null" required={false}>
This is a [**Transient Entity**](/entities#transient-entities) and does not have a URI.
</Property>
<Property name="author" type="URI" required={true} typeLink="/types#uri">
URI of the `User` considered the 'follower'.
</Property>

View file

@ -9,7 +9,7 @@ Contains metadata about a Versia instance, such as capabilities and endpoints. {
## The `null` Author
On some entities that have an `author` field, the `author` can be `null` to represent the instance itself as the author (like ActivityPub's Server Actors). In this case, the instance's public key should be used to verify the entity. To know which instance's public key to use, the entity signature should be used.
On some entities that have an `author` field, the `author` can be `null` to represent the instance itself as the author (like ActivityPub's Server Actors).
Check the entity's documentation page to see if it supports this (it will be noted in the `author` field).
@ -21,9 +21,6 @@ Check the entity's documentation page to see if it supports this (it will be not
<Property name="id" type="null">
This entity does not have an ID.
</Property>
<Property name="uri" type="null">
This entity does not have a URI.
</Property>
<Property name="name" type="string" required={true}>
Friendly name of the instance, for humans.
</Property>
@ -60,9 +57,6 @@ Check the entity's documentation page to see if it supports this (it will be not
<Property name="host" type="string" required={true}>
Hostname of the instance. Includes the port if it is not the default (i.e. `443` for HTTPS).
</Property>
<Property name="shared_inbox" type="URI" required={false}>
URI to the instance's shared inbox, if supported.
</Property>
<Property name="public_key" type="PublicKey" required={true}>
Public key of the instance.
@ -76,20 +70,6 @@ Check the entity's documentation page to see if it supports this (it will be not
- `algorithm`: Algorithm used for the public key. Can only be `ed25519` for now.
- `key`: Instance public key, in [SPKI-encoded base64](/signatures#exporting-the-public-key).
</Property>
<Property name="moderators" type="URI" required={false}>
URI to [Collection](/structures/collection) of instance moderators.
<Note>
This is for human consumption (such as moderator contact), not for any kind of protocol authorization.
</Note>
</Property>
<Property name="admins" type="URI" required={false}>
URI to [Collection](/structures/collection) of instance administrators.
<Note>
This is for human consumption (such as admin contact), not for any kind of protocol authorization.
</Note>
</Property>
<Property name="logo" type="ContentFormat" required={false} typeLink="/structures/content-format">
Logo of the instance. Must be an image format (`image/*`).
</Property>
@ -144,4 +124,13 @@ Check the entity's documentation page to see if it supports this (it will be not
```
</Col>
</Row>
</Row>
### Collections
The following [Collections](/structures/collection) are available:
- `moderators`: [Collection](/structures/collection) of instance moderators ([Users](/entities/user)).
- `admins`: [Collection](/structures/collection) of instance administrators ([Users](/entities/user)).
These can be fetched using the [Federation API](/api/endpoints#entity-collections)

View file

@ -36,28 +36,6 @@ Notes represent a piece of content on a Versia instance. They can be posted by [
| "messaging"; // Like Discord, Element (Matrix), Signal
```
</Property>
<Property name="collections" type="NoteCollections" required={true}>
Collections related to the note. Must contain at least `replies` and `quotes`.
```typescript
type URI = string;
type NoteCollections = {
replies: URI;
quotes: URI;
// Same format as type on Extensions
[key: ExtensionsKey]: URI;
}
```
All URIs must resolve to either a [Collection](/structures/collection) or a [URI Collection](/structures/collection#uri-collection) of the appropriate entities. Extensions may add additional collections.
### Replies
All replies to this note (have this note as their `replies_to`). [URI Collection](/structures/collection#uri-collection) of [Note](/entities/note) entities.
### Quotes
All quotes of this note (have this note as their `quotes`). [URI Collection](/structures/collection#uri-collection) of [Note](/entities/note) entities.
</Property>
<Property name="content" type="ContentFormat" required={false} typeLink="/structures/content-format">
The content of the note. Must be text format (`text/html`, `text/markdown`, etc). Must not be remote.
</Property>
@ -178,3 +156,12 @@ Notes represent a piece of content on a Versia instance. They can be posted by [
</Col>
</Row>
### Collections
The following [Collections](/structures/collection) are available:
- `replies`: [URI Collection](/structures/collection#uri-collection) of [Note](/entities/note) entities that are replies to this note.
- `quotes`: [URI Collection](/structures/collection#uri-collection) of [Note](/entities/note) entities that quote this note.
These can be fetched using the [Federation API](/api/endpoints#entity-collections)

View file

@ -19,7 +19,12 @@ Any field in an entity not marked as `required` may be omitted or set to `null`.
<Properties name="Entity">
<Property name="id" type="string" required={true}>
Unique identifier for the entity. Must be unique within the instance. Can be any string. Max of 512 UTF-8 characters.
Unique identifier for the entity. Must be unique within the instance. Can be any string with the following character sets:
- `a-z`
- `A-Z`
- `0-9`
- `-`, `_`
</Property>
<Property name="type" type="string" required={true}>
Type of the entity. Custom types must follow [Extension Naming](/extensions#naming).
@ -31,13 +36,6 @@ Any field in an entity not marked as `required` may be omitted or set to `null`.
Handling of dates that are valid but obviously incorrect (e.g. in the future) is left to the Implementation's discretion.
</Note>
</Property>
<Property name="uri" type="URI" required={true} typeLink="/types#uri">
URI of the entity. Should be unique and resolve to the entity. Must be an absolute URI.
<Note>
[**Transient Entities**](/entities#transient-entities) do not require a URI.
</Note>
</Property>
<Property name="$schema" type="string" required={false}>
URL of any JSON Schema that the entity adheres to.
@ -86,7 +84,7 @@ Any field in an entity not marked as `required` may be omitted or set to `null`.
## Transient Entities
Some entities are transient, meaning they do not have a URI. These entities are used for actions that do not require a permanent record, such as deletions or migrations.
Some entities are transient, meaning they cannot be refetched using the [Federation API](/api/endpoints). These entities are used for actions that do not require a permanent record, such as deletions or migrations.
Implementations **must not** rely on other implementations to store transient entities in their database.
@ -95,5 +93,5 @@ Implementations **must not** rely on other implementations to store transient en
When serialized to a string, the JSON representation of an entity must follow the following rules:
- Keys must be sorted lexicographically.
- Must use UTF-8 encoding.
- Must be **signed** using the relevant [User](/entities/user)'s private key, or the [instance's private key](/entities/instance-metadata) if the entity is not associated with a particular user.
- Must be **signed** using the the [instance's private key](/entities/instance-metadata).
- Must use Unix-style `\n` line endings (LF).

View file

@ -26,12 +26,13 @@ Sometimes, [Users](/entities/user) want to unsubscribe from each other to stop s
## Entity Definition
<Warning>
This entity is a [**Transient Entity**](/entities#transient-entities).
</Warning>
<Row>
<Col>
<Properties name="Unfollow">
<Property name="uri" type="null" required={false}>
This is a [**Transient Entity**](/entities#transient-entities) and does not have a URI.
</Property>
<Property name="author" type="URI" required={true} typeLink="/types#uri">
URI of the `User` considered the 'follower', i.e. the user who is unsubscribing from the followee.
</Property>

View file

@ -70,64 +70,12 @@ Instance **must** be the host of the instance the user is on (hostname with opti
<Property name="header" type="ContentFormat" required={false} typeLink="/structures/content-format">
A header image for the user's profile. Also known as a cover photo or a banner. Must be an image format (`image/*`).
</Property>
<Property name="public_key" type="PublicKey" required={true}>
The user's public key. Must follow the [Versia Public Key](/signatures) format. `actor` may be a URI to another user's profile, in which case this key may allow the other user act on behalf of this user (see [delegation](/federation/delegation)).
- `algorithm`: Must be `ed25519` for now.
- `key`: The public key in [SPKI-encoded base64](/signatures#exporting-the-public-key). Must be the key associated with the `actor` URI.
- `actor`: URI to a user's profile, most often the user's own profile.
```typescript
type URI = string;
type PublicKey = {
actor: URI;
algorithm: string;
key: string;
}
```
</Property>
<Property name="manually_approves_followers" type="boolean" required={false}>
If `true`, the user must approve any new followers manually. If `false`, followers are automatically approved. This does not affect federation, and is meant to be used for clients to display correct UI. Defaults to `false`.
</Property>
<Property name="indexable" type="boolean" required={false}>
User consent to be indexed by search engines. If `false`, the user's profile should not be indexed. Defaults to `true`.
</Property>
<Property name="inbox" type="URI" required={true} typeLink="/types#uri">
The user's federation inbox. Refer to the [federation documentation](/federation).
Some instances may also have a shared inbox. Refer to [Instance Metadata](/entities/instance-metadata) for more information.
</Property>
<Property name="collections" type="UserCollections" required={true}>
Collections related to the user. Must contain at least `outbox`, `followers`, `following`, and `featured`.
```typescript
type URI = string;
type UserCollections = {
outbox: URI;
followers: URI;
following: URI;
featured: URI;
// Same format as type on Extensions
[key: ExtensionsKey]: URI;
}
```
All URIs must resolve to either a [Collection](/structures/collection) or a [URI Collection](/structures/collection#uri-collection) of the appropriate entities. Extensions may add additional collections.
### Outbox
The user's federation outbox. Refer to the [federation documentation](/federation). [Collection](/structures/collection) of [Note](/entities/note) entities.
### Followers
User's followers. [URI Collection](/structures/collection#uri-collection) of [User](/entities/user) entities.
### Following
Users that the user follows. [URI Collection](/structures/collection#uri-collection) of [User](/entities/user) entities.
### Featured
[Notes](/entities/note) that the user wants to feature (also known as "pin") on their profile. [Collection](/structures/collection) of [Note](/entities/note) entities. Only notes authored by the user can be featured.
</Property>
</Properties>
</Col>
@ -174,14 +122,20 @@ Instance **must** be the host of the instance the user is on (hostname with opti
"header": null,
"indexable": false,
"manually_approves_followers": false,
"public_key": {
"actor": "018ec082-0ae1-761c-b2c5-22275a611771",
"algorithm": "ed25519",
"key": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
},
"username": "aprl"
}
```
</Col>
</Row>
### Collections
The following [Collections](/structures/collection) are available:
- `outbox`: [Collection](/structures/collection) of notes authored by the user.
- `followers`: [URI Collection](/structures/collection#uri-collection) of users that follow the user.
- `following`: [URI Collection](/structures/collection#uri-collection) of users that the user follows.
- `featured`: [Collection](/structures/collection) of notes that the user wants to feature on their profile ("pinned" notes).
These can be fetched using the [Federation API](/api/endpoints#entity-collections)