提交
This commit is contained in:
+15
-3
@@ -20,17 +20,21 @@ import {
|
||||
authorizeFollowRequest,
|
||||
authorizePage,
|
||||
bookmarkStatus,
|
||||
bookmarksList,
|
||||
createApp,
|
||||
createStatus,
|
||||
customEmojis,
|
||||
deleteStatusEndpoint,
|
||||
favouriteStatus,
|
||||
favouritesList,
|
||||
filtersV1,
|
||||
followAccount,
|
||||
followRequestsList,
|
||||
getAccount,
|
||||
getRelationships,
|
||||
getStatusEndpoint,
|
||||
hashtagInfo,
|
||||
hashtagTimeline,
|
||||
homeTimeline,
|
||||
instance,
|
||||
instanceV2,
|
||||
@@ -38,6 +42,7 @@ import {
|
||||
notificationClear,
|
||||
notificationDismiss,
|
||||
notificationsList,
|
||||
pinStatus,
|
||||
publicTimeline,
|
||||
pushSubscription,
|
||||
reblogStatus,
|
||||
@@ -48,8 +53,10 @@ import {
|
||||
statusContext,
|
||||
token,
|
||||
trendsTags,
|
||||
unbookmarkStatus,
|
||||
unfavouriteStatus,
|
||||
unfollowAccount,
|
||||
unpinStatus,
|
||||
unreblogStatus,
|
||||
updateCredentials,
|
||||
updateMedia,
|
||||
@@ -122,12 +129,17 @@ async function route(request: Request, env: Env): Promise<Response> {
|
||||
if (method === "POST" && (m = path.match(/^\/api\/v1\/statuses\/([^/]+)\/reblog$/))) return reblogStatus(request, env, decodeURIComponent(m[1]));
|
||||
if (method === "POST" && (m = path.match(/^\/api\/v1\/statuses\/([^/]+)\/unreblog$/))) return unreblogStatus(request, env, decodeURIComponent(m[1]));
|
||||
if (method === "POST" && (m = path.match(/^\/api\/v1\/statuses\/([^/]+)\/bookmark$/))) return bookmarkStatus(request, env, decodeURIComponent(m[1]));
|
||||
if (method === "POST" && (m = path.match(/^\/api\/v1\/statuses\/([^/]+)\/unbookmark$/))) return bookmarkStatus(request, env, decodeURIComponent(m[1]));
|
||||
if (method === "POST" && (m = path.match(/^\/api\/v1\/statuses\/([^/]+)\/pin$/))) return bookmarkStatus(request, env, decodeURIComponent(m[1]));
|
||||
if (method === "POST" && (m = path.match(/^\/api\/v1\/statuses\/([^/]+)\/unpin$/))) return bookmarkStatus(request, env, decodeURIComponent(m[1]));
|
||||
if (method === "POST" && (m = path.match(/^\/api\/v1\/statuses\/([^/]+)\/unbookmark$/))) return unbookmarkStatus(request, env, decodeURIComponent(m[1]));
|
||||
if (method === "POST" && (m = path.match(/^\/api\/v1\/statuses\/([^/]+)\/pin$/))) return pinStatus(request, env, decodeURIComponent(m[1]));
|
||||
if (method === "POST" && (m = path.match(/^\/api\/v1\/statuses\/([^/]+)\/unpin$/))) return unpinStatus(request, env, decodeURIComponent(m[1]));
|
||||
|
||||
if (method === "GET" && path === "/api/v1/timelines/public") return publicTimeline(request, env);
|
||||
if (method === "GET" && path === "/api/v1/timelines/home") return homeTimeline(request, env);
|
||||
if (method === "GET" && (m = path.match(/^\/api\/v1\/timelines\/tag\/([^/]+)$/))) return hashtagTimeline(request, env, decodeURIComponent(m[1]));
|
||||
if (method === "GET" && (m = path.match(/^\/api\/v1\/tags\/([^/]+)$/))) return hashtagInfo(env, decodeURIComponent(m[1]));
|
||||
|
||||
if (method === "GET" && path === "/api/v1/bookmarks") return bookmarksList(request, env);
|
||||
if (method === "GET" && path === "/api/v1/favourites") return favouritesList(request, env);
|
||||
|
||||
if (method === "POST" && (path === "/api/v1/media" || path === "/api/v2/media")) return uploadMedia(request, env);
|
||||
if (method === "PUT" && (m = path.match(/^\/api\/v1\/media\/([^/]+)$/))) return updateMedia(request, env, decodeURIComponent(m[1]));
|
||||
|
||||
Reference in New Issue
Block a user