Skip to content
Snippets Groups Projects
Commit 2a84e503 authored by syuilo's avatar syuilo
Browse files

Update type definitions

parent bc3b3bb1
No related branches found
No related tags found
No related merge requests found
import { import {
Ad, Announcement, Antenna, App, AuthSession, Channel, Clip, DateString, DetailedInstanceMetadata, DriveFile, DriveFolder, Following, FollowingFolloweePopulated, FollowingFollowerPopulated, FollowRequest, GalleryPost, InstanceMetadata, Ad, Announcement, Antenna, App, AuthSession, Channel, Clip, DateString, DetailedInstanceMetadata, DriveFile, DriveFolder, Following, FollowingFolloweePopulated, FollowingFollowerPopulated, FollowRequest, GalleryPost, Instance, InstanceMetadata,
LiteInstanceMetadata, LiteInstanceMetadata,
MeDetailed, MeDetailed,
Note, NoteFavorite, OriginType, Page, ServerInfo, Stats, User, UserDetailed, UserGroup, UserList, UserSorting Note, NoteFavorite, OriginType, Page, ServerInfo, Stats, User, UserDetailed, UserGroup, UserList, UserSorting
...@@ -251,17 +251,17 @@ export type Endpoints = { ...@@ -251,17 +251,17 @@ export type Endpoints = {
// drive // drive
'drive': { req: {}; res: { capacity: number; usage: number; }; }; 'drive': { req: {}; res: { capacity: number; usage: number; }; };
'drive/files': { req: TODO; res: TODO; }; 'drive/files': { req: { folderId?: DriveFolder['id'] | null; type?: DriveFile['type'] | null; limit?: number; sinceId?: DriveFile['id']; untilId?: DriveFile['id']; }; res: DriveFile[]; };
'drive/files/attached-notes': { req: TODO; res: TODO; }; 'drive/files/attached-notes': { req: TODO; res: TODO; };
'drive/files/check-existence': { req: TODO; res: TODO; }; 'drive/files/check-existence': { req: TODO; res: TODO; };
'drive/files/create': { req: TODO; res: TODO; }; 'drive/files/create': { req: TODO; res: TODO; };
'drive/files/delete': { req: { fileId: DriveFile['id']; }; res: null; }; 'drive/files/delete': { req: { fileId: DriveFile['id']; }; res: null; };
'drive/files/find-by-hash': { req: TODO; res: TODO; }; 'drive/files/find-by-hash': { req: TODO; res: TODO; };
'drive/files/find': { req: TODO; res: TODO; }; 'drive/files/find': { req: TODO; res: TODO; };
'drive/files/show': { req: TODO; res: TODO; }; 'drive/files/show': { req: { fileId?: DriveFile['id']; url?: string; }; res: DriveFile; };
'drive/files/update': { req: TODO; res: TODO; }; 'drive/files/update': { req: TODO; res: TODO; };
'drive/files/upload-from-url': { req: TODO; res: TODO; }; 'drive/files/upload-from-url': { req: TODO; res: TODO; };
'drive/folders': { req: TODO; res: TODO; }; 'drive/folders': { req: { folderId?: DriveFolder['id'] | null; limit?: number; sinceId?: DriveFile['id']; untilId?: DriveFile['id']; }; res: DriveFolder[]; };
'drive/folders/create': { req: TODO; res: TODO; }; 'drive/folders/create': { req: TODO; res: TODO; };
'drive/folders/delete': { req: { folderId: DriveFolder['id']; }; res: null; }; 'drive/folders/delete': { req: { folderId: DriveFolder['id']; }; res: null; };
'drive/folders/find': { req: TODO; res: TODO; }; 'drive/folders/find': { req: TODO; res: TODO; };
...@@ -276,13 +276,29 @@ export type Endpoints = { ...@@ -276,13 +276,29 @@ export type Endpoints = {
'endpoints': { req: {}; res: string[]; }; 'endpoints': { req: {}; res: string[]; };
// federation // federation
'federation/dns': { req: TODO; res: TODO; }; 'federation/dns': { req: { host: string; }; res: {
a: string[];
aaaa: string[];
cname: string[];
txt: string[];
}; };
'federation/followers': { req: { host: string; limit?: number; sinceId?: Following['id']; untilId?: Following['id']; }; res: FollowingFolloweePopulated[]; }; 'federation/followers': { req: { host: string; limit?: number; sinceId?: Following['id']; untilId?: Following['id']; }; res: FollowingFolloweePopulated[]; };
'federation/following': { req: { host: string; limit?: number; sinceId?: Following['id']; untilId?: Following['id']; }; res: FollowingFolloweePopulated[]; }; 'federation/following': { req: { host: string; limit?: number; sinceId?: Following['id']; untilId?: Following['id']; }; res: FollowingFolloweePopulated[]; };
'federation/instances': { req: TODO; res: TODO; }; 'federation/instances': { req: {
'federation/show-instance': { req: TODO; res: TODO; }; host?: string | null;
'federation/update-remote-user': { req: TODO; res: TODO; }; blocked?: boolean | null;
'federation/users': { req: TODO; res: TODO; }; notResponding?: boolean | null;
suspended?: boolean | null;
federating?: boolean | null;
subscribing?: boolean | null;
publishing?: boolean | null;
limit?: number;
offset?: number;
sort?: '+pubSub' | '-pubSub' | '+notes' | '-notes' | '+users' | '-users' | '+following' | '-following' | '+followers' | '-followers' | '+caughtAt' | '-caughtAt' | '+lastCommunicatedAt' | '-lastCommunicatedAt' | '+driveUsage' | '-driveUsage' | '+driveFiles' | '-driveFiles';
}; res: Instance[]; };
'federation/show-instance': { req: { host: string; }; res: Instance; };
'federation/update-remote-user': { req: { userId: User['id']; }; res: null; };
'federation/users': { req: { host: string; limit?: number; sinceId?: User['id']; untilId?: User['id']; }; res: UserDetailed[]; };
// following // following
'following/create': { req: { userId: User['id'] }; res: User; }; 'following/create': { req: { userId: User['id'] }; res: User; };
......
...@@ -338,5 +338,34 @@ export type FollowingFollowerPopulated = Following & { ...@@ -338,5 +338,34 @@ export type FollowingFollowerPopulated = Following & {
follower: UserDetailed; follower: UserDetailed;
}; };
export type Instance = {
id: ID;
caughtAt: DateString;
host: string;
usersCount: number;
notesCount: number;
followingCount: number;
followersCount: number;
driveUsage: number;
driveFiles: number;
latestRequestSentAt: DateString | null;
latestStatus: number | null;
latestRequestReceivedAt: DateString | null;
lastCommunicatedAt: DateString;
isNotResponding: boolean;
isSuspended: boolean;
softwareName: string | null;
softwareVersion: string | null;
openRegistrations: boolean | null;
name: string | null;
description: string | null;
maintainerName: string | null;
maintainerEmail: string | null;
iconUrl: string | null;
faviconUrl: string | null;
themeColor: string | null;
infoUpdatedAt: DateString | null;
};
export type UserSorting = '+follower' | '-follower' | '+createdAt' | '-createdAt' | '+updatedAt' | '-updatedAt'; export type UserSorting = '+follower' | '-follower' | '+createdAt' | '-createdAt' | '+updatedAt' | '-updatedAt';
export type OriginType = 'combined' | 'local' | 'remote'; export type OriginType = 'combined' | 'local' | 'remote';
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment