Sengi-Windows-MacOS-Linux/src/app/services/models/mastodon.interfaces.ts

301 lines
5.7 KiB
TypeScript
Raw Normal View History

import { PlatformLocation } from '@angular/common';
2018-09-08 05:17:19 +02:00
export interface AppData {
2019-02-24 01:47:39 +01:00
client_id: string;
client_secret: string;
id: string;
name: string;
redirect_uri: string;
website: string;
2018-09-08 05:17:19 +02:00
}
2018-03-17 05:30:43 +01:00
export interface TokenData {
2019-02-24 01:47:39 +01:00
access_token: string;
token_type: string;
scope: string;
created_at: number;
//TODO: Pleroma support this
me: string;
expires_in: number;
refresh_token: string;
2018-03-17 05:30:43 +01:00
}
export interface Account {
2019-02-24 01:47:39 +01:00
id: number;
username: string;
acct: string;
display_name: string;
2020-10-03 21:52:55 +02:00
locked: boolean;
2019-02-24 01:47:39 +01:00
created_at: string;
followers_count: number;
following_count: number;
statuses_count: number;
note: string;
url: string;
avatar: string;
avatar_static: string;
header: string;
header_static: string;
emojis: Emoji[];
2019-08-06 00:42:06 +02:00
moved: Account;
2019-02-24 01:47:39 +01:00
fields: Field[];
bot: boolean;
2019-03-11 05:31:56 +01:00
source: AccountInfo;
}
export interface AccountInfo {
privacy: string;
sensitive: boolean;
note: string;
fields: Field[];
2019-02-24 01:47:39 +01:00
}
export interface Emoji {
shortcode: string;
static_url: string;
url: string;
visible_in_picker: boolean;
}
export interface Field {
name: string;
value: string;
verified_at: string;
2018-03-17 05:30:43 +01:00
}
export interface Application {
2019-02-24 01:47:39 +01:00
name: string;
website: string;
2018-03-17 05:30:43 +01:00
}
export interface Attachment {
2019-02-24 01:47:39 +01:00
id: string;
2019-07-30 01:25:56 +02:00
type: 'image' | 'video' | 'gifv' | 'audio';
2019-02-24 01:47:39 +01:00
url: string;
remote_url: string;
preview_url: string;
text_url: string;
2019-03-10 19:36:22 +01:00
meta: any;
description: string;
2019-07-05 23:22:49 +02:00
pleroma: PleromaAttachment;
}
export interface PleromaAttachment {
mime_type: string;
2018-03-17 05:30:43 +01:00
}
export interface Card {
2019-02-24 01:47:39 +01:00
url: string;
title: string;
description: string;
image: string;
2019-05-02 11:26:38 +02:00
type: 'link' | 'photo' | 'video' | 'rich';
author_name: string;
author_url: string;
provider_name: string;
provider_url: string;
html: any;
width: number;
height: number;
2018-03-17 05:30:43 +01:00
}
export interface Context {
2019-02-24 01:47:39 +01:00
ancestors: Status[];
descendants: Status[];
2018-03-17 05:30:43 +01:00
}
export interface Error {
2019-02-24 01:47:39 +01:00
error: string;
2018-03-17 05:30:43 +01:00
}
2023-04-23 22:48:07 +02:00
2018-03-17 05:30:43 +01:00
export interface Instance {
2019-02-24 01:47:39 +01:00
title: string;
version: string;
2023-04-23 22:48:07 +02:00
description: string;
}
export interface Instancev1 extends Instance {
uri: string;
email: string;
2023-04-23 22:09:44 +02:00
urls: InstanceUrls;
contact_account: Account;
max_toot_chars: number;
2024-03-06 00:15:43 +01:00
configuration: Instancev2Configuration;
2018-03-17 05:30:43 +01:00
}
2023-04-23 22:48:07 +02:00
export interface Instancev2 extends Instance {
configuration: Instancev2Configuration
}
export interface Instancev2Configuration {
urls: Instancev2Urls;
statuses: Instancev2Statuses;
translation: Instancev2Translation;
2023-04-23 22:48:07 +02:00
}
2023-04-23 22:09:44 +02:00
export interface InstanceUrls {
streaming_api: string;
}
2023-04-23 22:48:07 +02:00
export interface Instancev2Urls {
streaming: string;
}
export interface Instancev2Statuses {
max_characters: number;
}
export interface Instancev2Translation {
enabled: boolean;
}
2018-03-17 05:30:43 +01:00
export interface Mention {
2019-02-24 01:47:39 +01:00
url: string;
username: string;
acct: string;
id: string;
2018-03-17 05:30:43 +01:00
}
export interface Notification {
2019-02-24 01:47:39 +01:00
id: string;
type: 'mention' | 'reblog' | 'favourite' | 'follow' | 'poll' | 'follow_request' | 'move' | 'update';
created_at: string;
2019-02-24 01:47:39 +01:00
account: Account;
status?: Status;
2020-12-22 05:12:47 +01:00
target?: Account; //for move Pleroma's notification
2018-03-17 05:30:43 +01:00
}
export interface Relationship {
2019-02-24 01:47:39 +01:00
id: number;
following: boolean;
followed_by: boolean;
blocked_by: boolean;
2019-02-24 01:47:39 +01:00
blocking: boolean;
2019-07-06 08:08:42 +02:00
domain_blocking: boolean;
2019-02-24 01:47:39 +01:00
muting: boolean;
2019-07-06 08:08:42 +02:00
muting_notifications: boolean;
2019-02-24 01:47:39 +01:00
requested: boolean;
2019-07-06 08:08:42 +02:00
showing_reblogs: boolean;
endorsed: boolean;
2018-03-17 05:30:43 +01:00
}
export interface Report {
2019-02-24 01:47:39 +01:00
id: string;
action_taken: boolean;
2018-03-17 05:30:43 +01:00
}
export interface Results {
2019-02-24 01:47:39 +01:00
accounts: Account[];
statuses: Status[];
hashtags: string[];
2018-03-17 05:30:43 +01:00
}
export interface Status {
2019-02-24 01:47:39 +01:00
id: string;
uri: string;
url: string;
account: Account;
in_reply_to_id: string;
2019-02-24 20:49:02 +01:00
in_reply_to_account_id: number;
2019-02-24 01:47:39 +01:00
reblog: Status;
content: string;
created_at: string;
2022-12-11 00:31:54 +01:00
edited_at: string;
2019-03-01 06:59:12 +01:00
reblogs_count: number;
replies_count: number;
2019-02-24 01:47:39 +01:00
favourites_count: string;
reblogged: boolean;
favourited: boolean;
sensitive: boolean;
spoiler_text: string;
2019-04-07 21:03:17 +02:00
visibility: 'public' | 'unlisted' | 'private' | 'direct';
2019-02-24 01:47:39 +01:00
media_attachments: Attachment[];
mentions: Mention[];
tags: Tag[];
application: Application;
2019-04-14 05:04:19 +02:00
emojis: Emoji[];
2019-02-24 01:47:39 +01:00
language: string;
pinned: boolean;
muted: boolean;
2020-03-13 00:54:52 +01:00
bookmarked: boolean;
2019-05-02 11:26:38 +02:00
card: Card;
poll: Poll;
2019-04-13 23:04:24 +02:00
pleroma: PleromaStatusInfo;
}
2019-08-03 02:56:52 +02:00
export interface Conversation {
id: string;
accounts: Account[];
last_status: Status;
unread: boolean;
}
2019-04-13 23:04:24 +02:00
export interface PleromaStatusInfo {
conversation_id: number;
local: boolean;
2018-03-17 05:30:43 +01:00
}
2019-04-13 23:04:24 +02:00
2019-05-19 02:44:36 +02:00
export interface List {
id: string;
title: string;
}
export interface Poll {
id: string;
expires_at: string;
expired: boolean;
multiple: boolean;
votes_count: number;
2021-03-12 05:09:12 +01:00
voters_count: number;
options: PollOption[];
voted: boolean;
}
export interface PollOption {
title: string;
votes_count: number;
2019-08-25 07:25:45 +02:00
}
export interface ScheduledStatus {
id: string;
scheduled_at: string;
params: StatusParams;
media_attachments: Attachment[];
}
export interface StatusParams {
text: string;
in_reply_to_id: string;
media_ids: string[];
sensitive: boolean;
spoiler_text: string;
visibility: 'public' | 'unlisted' | 'private' | 'direct';
scheduled_at: string;
application_id: string;
}
export interface TagHistory {
day: string;
uses: number;
accounts: number;
}
export interface Tag {
name: string;
url: string;
history: TagHistory[];
following: boolean;
2023-08-05 05:36:21 +02:00
}
export interface Translation {
content: string;
language: string;
detected_source_language: string;
provider: string;
spoiler_text: string;
2019-05-19 02:44:36 +02:00
}