mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
fix(api): 🚨 Use shorthand property syntax everywhere, remove useless template literals
This commit is contained in:
parent
6a810529bc
commit
59a3463c72
|
|
@ -72,7 +72,8 @@ const route = createRoute({
|
|||
.optional()
|
||||
.openapi({
|
||||
description: "Links to the next and previous pages",
|
||||
example: `<https://versia.social/api/v1/accounts/46be88d3-25b4-4edc-8be9-c28c4ac5ea95/followers?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/accounts/46be88d3-25b4-4edc-8be9-c28c4ac5ea95/followers?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"`,
|
||||
example:
|
||||
'<https://versia.social/api/v1/accounts/46be88d3-25b4-4edc-8be9-c28c4ac5ea95/followers?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/accounts/46be88d3-25b4-4edc-8be9-c28c4ac5ea95/followers?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"',
|
||||
externalDocs: {
|
||||
url: "https://docs.joinmastodon.org/api/guidelines/#pagination",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -72,7 +72,8 @@ const route = createRoute({
|
|||
.optional()
|
||||
.openapi({
|
||||
description: "Links to the next and previous pages",
|
||||
example: `<https://versia.social/api/v1/accounts/46be88d3-25b4-4edc-8be9-c28c4ac5ea95/following?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/accounts/46be88d3-25b4-4edc-8be9-c28c4ac5ea95/following?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"`,
|
||||
example:
|
||||
'<https://versia.social/api/v1/accounts/46be88d3-25b4-4edc-8be9-c28c4ac5ea95/following?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/accounts/46be88d3-25b4-4edc-8be9-c28c4ac5ea95/following?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"',
|
||||
externalDocs: {
|
||||
url: "https://docs.joinmastodon.org/api/guidelines/#pagination",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -61,13 +61,13 @@ const route = createRoute({
|
|||
body: {
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: schema,
|
||||
schema,
|
||||
},
|
||||
"multipart/form-data": {
|
||||
schema: schema,
|
||||
schema,
|
||||
},
|
||||
"application/x-www-form-urlencoded": {
|
||||
schema: schema,
|
||||
schema,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -347,9 +347,9 @@ export default apiRoute((app) =>
|
|||
}
|
||||
|
||||
await User.fromDataLocal({
|
||||
username: username,
|
||||
password: password,
|
||||
email: email,
|
||||
username,
|
||||
password,
|
||||
email,
|
||||
});
|
||||
|
||||
return context.text("", 200);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ export default apiRoute((app) =>
|
|||
name: client_name,
|
||||
redirectUri: redirect_uris.join("\n"),
|
||||
scopes: scopes.join(" "),
|
||||
website: website,
|
||||
website,
|
||||
clientId: randomString(32, "base64url"),
|
||||
secret: randomString(64, "base64url"),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ const route = createRoute({
|
|||
.optional()
|
||||
.openapi({
|
||||
description: "Links to the next and previous pages",
|
||||
example: `<https://versia.social/api/v1/blocks?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/blocks?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"`,
|
||||
example:
|
||||
'<https://versia.social/api/v1/blocks?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/blocks?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"',
|
||||
externalDocs: {
|
||||
url: "https://docs.joinmastodon.org/api/guidelines/#pagination",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -104,13 +104,13 @@ const routePatch = createRoute({
|
|||
body: {
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: schema,
|
||||
schema,
|
||||
},
|
||||
"application/x-www-form-urlencoded": {
|
||||
schema: schema,
|
||||
schema,
|
||||
},
|
||||
"multipart/form-data": {
|
||||
schema: schema,
|
||||
schema,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -53,13 +53,13 @@ const route = createRoute({
|
|||
body: {
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: schema,
|
||||
schema,
|
||||
},
|
||||
"multipart/form-data": {
|
||||
schema: schema,
|
||||
schema,
|
||||
},
|
||||
"application/x-www-form-urlencoded": {
|
||||
schema: schema,
|
||||
schema,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -56,7 +56,8 @@ const route = createRoute({
|
|||
.optional()
|
||||
.openapi({
|
||||
description: "Links to the next and previous pages",
|
||||
example: `<https://versia.social/api/v1/favourites?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/favourites?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"`,
|
||||
example:
|
||||
'<https://versia.social/api/v1/favourites?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/favourites?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"',
|
||||
externalDocs: {
|
||||
url: "https://docs.joinmastodon.org/api/guidelines/#pagination",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ const route = createRoute({
|
|||
.optional()
|
||||
.openapi({
|
||||
description: "Links to the next and previous pages",
|
||||
example: `<https://versia.social/api/v1/follow_requests?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/follow_requests?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"`,
|
||||
example:
|
||||
'<https://versia.social/api/v1/follow_requests?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/follow_requests?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"',
|
||||
externalDocs: {
|
||||
url: "https://docs.joinmastodon.org/api/guidelines/#pagination",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ const route = createRoute({
|
|||
.optional()
|
||||
.openapi({
|
||||
description: "Links to the next and previous pages",
|
||||
example: `<https://versia.social/api/v1/mutes?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/mutes?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"`,
|
||||
example:
|
||||
'<https://versia.social/api/v1/mutes?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/mutes?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"',
|
||||
externalDocs: {
|
||||
url: "https://docs.joinmastodon.org/api/guidelines/#pagination",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -70,7 +70,8 @@ const route = createRoute({
|
|||
.optional()
|
||||
.openapi({
|
||||
description: "Links to the next and previous pages",
|
||||
example: `<https://versia.social/api/v1/statuses/f048addc-49ca-4443-bdd8-a1b641ae8adc/favourited_by?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/statuses/f048addc-49ca-4443-bdd8-a1b641ae8adc/favourited_by?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"`,
|
||||
example:
|
||||
'<https://versia.social/api/v1/statuses/f048addc-49ca-4443-bdd8-a1b641ae8adc/favourited_by?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/statuses/f048addc-49ca-4443-bdd8-a1b641ae8adc/favourited_by?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"',
|
||||
externalDocs: {
|
||||
url: "https://docs.joinmastodon.org/api/guidelines/#pagination",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -180,13 +180,13 @@ const routePut = createRoute({
|
|||
body: {
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: schema,
|
||||
schema,
|
||||
},
|
||||
"application/x-www-form-urlencoded": {
|
||||
schema: schema,
|
||||
schema,
|
||||
},
|
||||
"multipart/form-data": {
|
||||
schema: schema,
|
||||
schema,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -70,7 +70,8 @@ const route = createRoute({
|
|||
.optional()
|
||||
.openapi({
|
||||
description: "Links to the next and previous pages",
|
||||
example: `<https://versia.social/api/v1/statuses/f048addc-49ca-4443-bdd8-a1b641ae8adc/reblogged_by?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/statuses/f048addc-49ca-4443-bdd8-a1b641ae8adc/reblogged_by?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"`,
|
||||
example:
|
||||
'<https://versia.social/api/v1/statuses/f048addc-49ca-4443-bdd8-a1b641ae8adc/reblogged_by?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/statuses/f048addc-49ca-4443-bdd8-a1b641ae8adc/reblogged_by?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"',
|
||||
externalDocs: {
|
||||
url: "https://docs.joinmastodon.org/api/guidelines/#pagination",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -121,13 +121,13 @@ const route = createRoute({
|
|||
body: {
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: schema,
|
||||
schema,
|
||||
},
|
||||
"application/x-www-form-urlencoded": {
|
||||
schema: schema,
|
||||
schema,
|
||||
},
|
||||
"multipart/form-data": {
|
||||
schema: schema,
|
||||
schema,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -61,7 +61,8 @@ const route = createRoute({
|
|||
.optional()
|
||||
.openapi({
|
||||
description: "Links to the next and previous pages",
|
||||
example: `<https://versia.social/api/v1/timelines/home?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/timelines/home?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"`,
|
||||
example:
|
||||
'<https://versia.social/api/v1/timelines/home?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/timelines/home?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"',
|
||||
externalDocs: {
|
||||
url: "https://docs.joinmastodon.org/api/guidelines/#pagination",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -81,7 +81,8 @@ const route = createRoute({
|
|||
.optional()
|
||||
.openapi({
|
||||
description: "Links to the next and previous pages",
|
||||
example: `<https://versia.social/api/v1/timelines/public?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/timelines/public?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"`,
|
||||
example:
|
||||
'<https://versia.social/api/v1/timelines/public?limit=2&max_id=359ae97f-78dd-43e7-8e13-1d8e1d7829b5>; rel="next", <https://versia.social/api/v1/timelines/public?limit=2&since_id=75e9f5a9-f455-48eb-8f60-435b4a088bc0>; rel="prev"',
|
||||
externalDocs: {
|
||||
url: "https://docs.joinmastodon.org/api/guidelines/#pagination",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ export default apiRoute((app) => {
|
|||
await db
|
||||
.insert(Filters)
|
||||
.values({
|
||||
title: title,
|
||||
title,
|
||||
context: ctx,
|
||||
filterAction: filter_action,
|
||||
expireAt: new Date(
|
||||
|
|
|
|||
Loading…
Reference in a new issue