1
0

add: Megalodon, initial mastodon api

This commit is contained in:
Mar0xy
2023-09-23 18:49:47 +02:00
parent 240d76a987
commit 2375d043d1
103 changed files with 9492 additions and 82 deletions
@@ -0,0 +1,6 @@
namespace MisskeyEntity {
export type GetAll = {
tutorial: number;
defaultNoteVisibility: "public" | "home" | "followers" | "specified";
};
}
@@ -0,0 +1,10 @@
namespace MisskeyEntity {
export type Announcement = {
id: string;
createdAt: string;
updatedAt: string;
text: string;
title: string;
isRead?: boolean;
};
}
@@ -0,0 +1,9 @@
namespace MisskeyEntity {
export type App = {
id: string;
name: string;
callbackUrl: string;
permission: Array<string>;
secret: string;
};
}
@@ -0,0 +1,10 @@
/// <reference path="userDetail.ts" />
namespace MisskeyEntity {
export type Blocking = {
id: string;
createdAt: string;
blockeeId: string;
blockee: UserDetail;
};
}
@@ -0,0 +1,7 @@
/// <reference path="note.ts" />
namespace MisskeyEntity {
export type CreatedNote = {
createdNote: Note;
};
}
@@ -0,0 +1,9 @@
namespace MisskeyEntity {
export type Emoji = {
name: string;
host: string | null;
url: string;
aliases: Array<string>;
category: string;
};
}
@@ -0,0 +1,10 @@
/// <reference path="note.ts" />
namespace MisskeyEntity {
export type Favorite = {
id: string;
createdAt: string;
noteId: string;
note: Note;
};
}
@@ -0,0 +1,7 @@
namespace MisskeyEntity {
export type Field = {
name: string;
value: string;
verified?: string;
};
}
@@ -0,0 +1,20 @@
namespace MisskeyEntity {
export type File = {
id: string;
createdAt: string;
name: string;
type: string;
md5: string;
size: number;
isSensitive: boolean;
properties: {
width: number;
height: number;
avgColor: string;
};
url: string;
thumbnailUrl: string;
comment: string;
blurhash: string;
};
}
@@ -0,0 +1,9 @@
/// <reference path="user.ts" />
namespace MisskeyEntity {
export type FollowRequest = {
id: string;
follower: User;
followee: User;
};
}
@@ -0,0 +1,11 @@
/// <reference path="userDetail.ts" />
namespace MisskeyEntity {
export type Follower = {
id: string;
createdAt: string;
followeeId: string;
followerId: string;
follower: UserDetail;
};
}
@@ -0,0 +1,11 @@
/// <reference path="userDetail.ts" />
namespace MisskeyEntity {
export type Following = {
id: string;
createdAt: string;
followeeId: string;
followerId: string;
followee: UserDetail;
};
}
@@ -0,0 +1,7 @@
namespace MisskeyEntity {
export type Hashtag = {
tag: string;
chart: Array<number>;
usersCount: number;
};
}
@@ -0,0 +1,8 @@
namespace MisskeyEntity {
export type List = {
id: string;
createdAt: string;
name: string;
userIds: Array<string>;
};
}
@@ -0,0 +1,18 @@
/// <reference path="emoji.ts" />
namespace MisskeyEntity {
export type Meta = {
maintainerName: string;
maintainerEmail: string;
name: string;
version: string;
uri: string;
description: string;
langs: Array<string>;
disableRegistration: boolean;
disableLocalTimeline: boolean;
bannerUrl: string;
maxNoteTextLength: 3000;
emojis: Array<Emoji>;
};
}
@@ -0,0 +1,10 @@
/// <reference path="userDetail.ts" />
namespace MisskeyEntity {
export type Mute = {
id: string;
createdAt: string;
muteeId: string;
mutee: UserDetail;
};
}
@@ -0,0 +1,32 @@
/// <reference path="user.ts" />
/// <reference path="emoji.ts" />
/// <reference path="file.ts" />
/// <reference path="poll.ts" />
namespace MisskeyEntity {
export type Note = {
id: string;
createdAt: string;
userId: string;
user: User;
text: string | null;
cw: string | null;
visibility: "public" | "home" | "followers" | "specified";
renoteCount: number;
repliesCount: number;
reactions: { [key: string]: number };
emojis: Array<Emoji>;
fileIds: Array<string>;
files: Array<File>;
replyId: string | null;
renoteId: string | null;
uri?: string;
reply?: Note;
renote?: Note;
viaMobile?: boolean;
tags?: Array<string>;
poll?: Poll;
mentions?: Array<string>;
myReaction?: string;
};
}
@@ -0,0 +1,17 @@
/// <reference path="user.ts" />
/// <reference path="note.ts" />
namespace MisskeyEntity {
export type Notification = {
id: string;
createdAt: string;
// https://github.com/syuilo/misskey/blob/056942391aee135eb6c77aaa63f6ed5741d701a6/src/models/entities/notification.ts#L50-L62
type: NotificationType;
userId: string;
user: User;
note?: Note;
reaction?: string;
};
export type NotificationType = string;
}
@@ -0,0 +1,13 @@
namespace MisskeyEntity {
export type Choice = {
text: string;
votes: number;
isVoted: boolean;
};
export type Poll = {
multiple: boolean;
expiresAt: string;
choices: Array<Choice>;
};
}
@@ -0,0 +1,11 @@
/// <reference path="user.ts" />
namespace MisskeyEntity {
export type Reaction = {
id: string;
createdAt: string;
user: User;
url?: string;
type: string;
};
}
@@ -0,0 +1,12 @@
namespace MisskeyEntity {
export type Relation = {
id: string;
isFollowing: boolean;
hasPendingFollowRequestFromYou: boolean;
hasPendingFollowRequestToYou: boolean;
isFollowed: boolean;
isBlocking: boolean;
isBlocked: boolean;
isMuted: boolean;
};
}
@@ -0,0 +1,6 @@
namespace MisskeyEntity {
export type Session = {
token: string;
url: string;
};
}
@@ -0,0 +1,7 @@
namespace MisskeyEntity {
export type State = {
isFavorited: boolean;
isMutedThread: boolean;
isWatching: boolean;
};
}
@@ -0,0 +1,9 @@
namespace MisskeyEntity {
export type Stats = {
notesCount: number;
originalNotesCount: number;
usersCount: number;
originalUsersCount: number;
instances: number;
};
}
@@ -0,0 +1,13 @@
/// <reference path="emoji.ts" />
namespace MisskeyEntity {
export type User = {
id: string;
name: string;
username: string;
host: string | null;
avatarUrl: string;
avatarColor: string;
emojis: Array<Emoji>;
};
}
@@ -0,0 +1,34 @@
/// <reference path="emoji.ts" />
/// <reference path="field.ts" />
/// <reference path="note.ts" />
namespace MisskeyEntity {
export type UserDetail = {
id: string;
name: string;
username: string;
host: string | null;
avatarUrl: string;
avatarColor: string;
isAdmin: boolean;
isModerator: boolean;
isBot: boolean;
isCat: boolean;
emojis: Array<Emoji>;
createdAt: string;
bannerUrl: string;
bannerColor: string;
isLocked: boolean;
isSilenced: boolean;
isSuspended: boolean;
description: string;
followersCount: number;
followingCount: number;
notesCount: number;
avatarId: string;
bannerId: string;
pinnedNoteIds?: Array<string>;
pinnedNotes?: Array<Note>;
fields: Array<Field>;
};
}
@@ -0,0 +1,36 @@
/// <reference path="emoji.ts" />
/// <reference path="field.ts" />
/// <reference path="note.ts" />
namespace MisskeyEntity {
export type UserDetailMe = {
id: string;
name: string;
username: string;
host: string | null;
avatarUrl: string;
avatarColor: string;
isAdmin: boolean;
isModerator: boolean;
isBot: boolean;
isCat: boolean;
emojis: Array<Emoji>;
createdAt: string;
bannerUrl: string;
bannerColor: string;
isLocked: boolean;
isSilenced: boolean;
isSuspended: boolean;
description: string;
followersCount: number;
followingCount: number;
notesCount: number;
avatarId: string;
bannerId: string;
pinnedNoteIds?: Array<string>;
pinnedNotes?: Array<Note>;
fields: Array<Field>;
alwaysMarkNsfw: boolean;
lang: string | null;
};
}
@@ -0,0 +1,8 @@
/// <reference path="user.ts" />
namespace MisskeyEntity {
export type UserKey = {
accessToken: string;
user: User;
};
}