summaryrefslogtreecommitdiff
path: root/src/endpoints.ts
blob: 7c0fe6b83697fb58599e2e5bf767e8c43bac079e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import { ID, InstanceMetadata, Note, OriginType, Page, ServerInfo, Stats, User, UserSorting } from './entities';

type TODO = Record<string, any>;

type ShowUserReq = { username: string; host?: string; } | { userId: ID; };

export type Endpoints = {
	// admin

	// announcements
	'announcements': { req: { limit?: number; withUnreads?: boolean; sinceId?: ID; untilId?: ID; }; res: TODO; };

	// antennas
	'antennas/create': { req: TODO; res: TODO; };

	// ap

	// app

	// auth

	// blocking

	// channnels

	// charts

	// clips

	// drive
	'drive': { req: null; res: { capacity: number; usage: number; }; };

	// federation

	// following

	// gallery

	// games

	// get-online-users-count

	// hashtags

	// i
	'i': { req: TODO; res: User; };

	// messaging

	// meta
	'meta': { req: { detail?: boolean; }; res: InstanceMetadata; };

	// miauth

	// mute

	// my

	// notes
	'notes': { req: { limit?: number; sinceId?: ID; untilId?: ID; }; res: Note[]; };
	'notes/create': { req: TODO; res: { createdNote: Note }; };
	'notes/delete': { req: { noteId: ID; }; res: null; };
	'notes/show': { req: { noteId: ID; }; res: Note; };

	// notifications

	// page-push
	'page-push': { req: { pageId: ID; event: string; var?: any; }; res: null; };

	// pages
	'pages/create': { req: TODO; res: Page; };
	'pages/delete': { req: { pageId: ID; }; res: null; };
	'pages/featured': { req: null; res: Page[]; };
	'pages/like': { req: { pageId: ID; }; res: null; };
	'pages/show': { req: { pageId?: ID; name?: string; username?: string; }; res: Page; };
	'pages/unlike': { req: { pageId: ID; }; res: null; };
	'pages/update': { req: TODO; res: null; };

	// ping

	// pinned-users

	// promo

	// request-reset-password

	// reset-password
	'reset-password': { req: { token: string; password: string; }; res: null; };

	// room

	// stats
	'stats': { req: null; res: Stats; };

	// server-info
	'server-info': { req: null; res: ServerInfo; };

	// sw

	// username

	// users
	'users': { req: { limit?: number; offset?: number; sort?: UserSorting; origin?: OriginType; }; res: User[]; };
	'users/show': { req: ShowUserReq; res: User; } | { req: { userIds: ID[]; }; res: User[]; };
};