2023-11-23 05:10:37 +01:00
|
|
|
import type { Emoji } from "./extensions/org.lysand/custom_emojis";
|
2023-11-04 04:34:31 +01:00
|
|
|
|
|
|
|
|
export interface LysandObjectType {
|
2024-04-07 07:30:49 +02:00
|
|
|
type: string;
|
|
|
|
|
id: string; // Either a UUID or some kind of time-based UUID-compatible system
|
|
|
|
|
uri: string; // URI to the note
|
|
|
|
|
created_at: string;
|
|
|
|
|
extensions?: {
|
|
|
|
|
// Should be in the format
|
|
|
|
|
// "organization:extension_name": value
|
|
|
|
|
// Example: "org.joinmastodon:spoiler_text": "This is a spoiler!"
|
|
|
|
|
"org.lysand:custom_emojis"?: {
|
|
|
|
|
emojis: Emoji[];
|
|
|
|
|
};
|
|
|
|
|
"org.lysand:reactions"?: {
|
|
|
|
|
reactions: string;
|
|
|
|
|
};
|
|
|
|
|
"org.lysand:polls"?: {
|
|
|
|
|
poll: {
|
|
|
|
|
options: ContentFormat[][];
|
|
|
|
|
votes: number[];
|
|
|
|
|
expires_at: string;
|
|
|
|
|
multiple_choice: boolean;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
[key: string]: Record<string, unknown> | undefined;
|
|
|
|
|
};
|
2023-11-04 04:34:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ActorPublicKeyData {
|
2024-04-07 07:30:49 +02:00
|
|
|
public_key: string;
|
|
|
|
|
actor: string;
|
2023-11-04 04:34:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface Collection<T> {
|
2024-04-07 07:30:49 +02:00
|
|
|
first: string;
|
|
|
|
|
last: string;
|
|
|
|
|
next?: string;
|
|
|
|
|
prev?: string;
|
|
|
|
|
items: T[];
|
2023-11-04 04:34:31 +01:00
|
|
|
}
|
|
|
|
|
|
2024-03-13 09:10:32 +01:00
|
|
|
export interface LysandUser extends LysandObjectType {
|
2024-04-07 07:30:49 +02:00
|
|
|
type: "User";
|
|
|
|
|
bio: ContentFormat[];
|
|
|
|
|
|
|
|
|
|
inbox: string;
|
|
|
|
|
outbox: string;
|
|
|
|
|
followers: string;
|
|
|
|
|
following: string;
|
|
|
|
|
liked: string;
|
|
|
|
|
disliked: string;
|
|
|
|
|
featured: string;
|
|
|
|
|
|
|
|
|
|
indexable: boolean;
|
|
|
|
|
fields?: {
|
|
|
|
|
key: ContentFormat[];
|
|
|
|
|
value: ContentFormat[];
|
|
|
|
|
}[];
|
|
|
|
|
display_name?: string;
|
|
|
|
|
public_key?: ActorPublicKeyData;
|
|
|
|
|
username: string;
|
|
|
|
|
avatar?: ContentFormat[];
|
|
|
|
|
header?: ContentFormat[];
|
2023-11-04 04:34:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface LysandPublication extends LysandObjectType {
|
2024-04-07 07:30:49 +02:00
|
|
|
type: "Note" | "Patch";
|
|
|
|
|
author: string;
|
|
|
|
|
contents: ContentFormat[];
|
|
|
|
|
mentions: string[];
|
|
|
|
|
replies_to: string[];
|
|
|
|
|
quotes: string[];
|
|
|
|
|
is_sensitive: boolean;
|
|
|
|
|
subject: string;
|
|
|
|
|
attachments: ContentFormat[][];
|
2023-11-04 04:34:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface LysandAction extends LysandObjectType {
|
2024-04-07 07:30:49 +02:00
|
|
|
type:
|
|
|
|
|
| "Like"
|
|
|
|
|
| "Dislike"
|
|
|
|
|
| "Follow"
|
|
|
|
|
| "FollowAccept"
|
|
|
|
|
| "FollowReject"
|
|
|
|
|
| "Announce"
|
|
|
|
|
| "Undo"
|
|
|
|
|
| "Extension";
|
|
|
|
|
author: string;
|
2023-11-04 04:34:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A Note is a publication on the network, such as a post or comment
|
|
|
|
|
*/
|
|
|
|
|
export interface Note extends LysandPublication {
|
2024-04-07 07:30:49 +02:00
|
|
|
type: "Note";
|
2023-11-04 04:34:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A Patch is an edit to a Note
|
|
|
|
|
*/
|
|
|
|
|
export interface Patch extends LysandPublication {
|
2024-04-07 07:30:49 +02:00
|
|
|
type: "Patch";
|
|
|
|
|
patched_id: string;
|
|
|
|
|
patched_at: string;
|
2023-11-04 04:34:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface Like extends LysandAction {
|
2024-04-07 07:30:49 +02:00
|
|
|
type: "Like";
|
|
|
|
|
object: string;
|
2023-11-04 04:34:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface Dislike extends LysandAction {
|
2024-04-07 07:30:49 +02:00
|
|
|
type: "Dislike";
|
|
|
|
|
object: string;
|
2023-11-04 04:34:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface Announce extends LysandAction {
|
2024-04-07 07:30:49 +02:00
|
|
|
type: "Announce";
|
|
|
|
|
object: string;
|
2023-11-04 04:34:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface Undo extends LysandAction {
|
2024-04-07 07:30:49 +02:00
|
|
|
type: "Undo";
|
|
|
|
|
object: string;
|
2023-11-04 04:34:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface Follow extends LysandAction {
|
2024-04-07 07:30:49 +02:00
|
|
|
type: "Follow";
|
|
|
|
|
followee: string;
|
2023-11-04 04:34:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface FollowAccept extends LysandAction {
|
2024-04-07 07:30:49 +02:00
|
|
|
type: "FollowAccept";
|
|
|
|
|
follower: string;
|
2023-11-04 04:34:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface FollowReject extends LysandAction {
|
2024-04-07 07:30:49 +02:00
|
|
|
type: "FollowReject";
|
|
|
|
|
follower: string;
|
2023-11-04 04:34:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ServerMetadata extends LysandObjectType {
|
2024-04-07 07:30:49 +02:00
|
|
|
type: "ServerMetadata";
|
|
|
|
|
name: string;
|
|
|
|
|
version?: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
website?: string;
|
|
|
|
|
moderators?: string[];
|
|
|
|
|
admins?: string[];
|
|
|
|
|
logo?: ContentFormat[];
|
|
|
|
|
banner?: ContentFormat[];
|
|
|
|
|
supported_extensions?: string[];
|
2023-11-04 04:34:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Content format is an array of objects that contain the content and the content type.
|
|
|
|
|
*/
|
|
|
|
|
export interface ContentFormat {
|
2024-04-07 07:30:49 +02:00
|
|
|
content: string;
|
|
|
|
|
content_type: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
size?: number;
|
|
|
|
|
hash?: {
|
|
|
|
|
md5?: string;
|
|
|
|
|
sha1?: string;
|
|
|
|
|
sha256?: string;
|
|
|
|
|
sha512?: string;
|
|
|
|
|
[key: string]: string | undefined;
|
|
|
|
|
};
|
|
|
|
|
blurhash?: string;
|
|
|
|
|
fps?: number;
|
|
|
|
|
width?: number;
|
|
|
|
|
height?: number;
|
|
|
|
|
duration?: number;
|
2023-11-04 04:34:31 +01:00
|
|
|
}
|