[mastodon-client] Code cleanup

This commit is contained in:
Laura Hausmann 2023-09-28 20:08:17 +02:00
parent 72619198b9
commit cfc3db5c7c
No known key found for this signature in database
GPG Key ID: D044E84C5BE01605
5 changed files with 2 additions and 13 deletions

View File

@ -1,6 +1,4 @@
import { ILocalUser, User } from "@/models/entities/user.js"; import { ILocalUser } from "@/models/entities/user.js";
import config from "@/config/index.js";
import { IMentionedRemoteUsers } from "@/models/entities/note.js";
import { Notification } from "@/models/entities/notification.js"; import { Notification } from "@/models/entities/notification.js";
import { notificationTypes } from "@/types.js"; import { notificationTypes } from "@/types.js";
import { UserConverter } from "@/server/api/mastodon/converters/user.js"; import { UserConverter } from "@/server/api/mastodon/converters/user.js";

View File

@ -1,4 +1,4 @@
import { ILocalUser, User } from "@/models/entities/user.js"; import { User } from "@/models/entities/user.js";
import config from "@/config/index.js"; import config from "@/config/index.js";
import { DriveFiles, UserProfiles, Users } from "@/models/index.js"; import { DriveFiles, UserProfiles, Users } from "@/models/index.js";
import { EmojiConverter } from "@/server/api/mastodon/converters/emoji.js"; import { EmojiConverter } from "@/server/api/mastodon/converters/emoji.js";
@ -8,7 +8,6 @@ import { escapeMFM } from "@/server/api/mastodon/converters/mfm.js";
import mfm from "mfm-js"; import mfm from "mfm-js";
import { awaitAll } from "@/prelude/await-all.js"; import { awaitAll } from "@/prelude/await-all.js";
import { AccountCache, UserHelpers } from "@/server/api/mastodon/helpers/user.js"; import { AccountCache, UserHelpers } from "@/server/api/mastodon/helpers/user.js";
import { Note } from "@/models/entities/note.js";
type Field = { type Field = {
name: string; name: string;

View File

@ -1,6 +1,5 @@
import Router from "@koa/router"; import Router from "@koa/router";
import { convertId, IdType } from "../../index.js"; import { convertId, IdType } from "../../index.js";
import { getClient } from "../ApiMastodonCompatibleService.js";
import { convertTimelinesArgsId, limitToInt, normalizeUrlQuery } from "./timeline.js"; import { convertTimelinesArgsId, limitToInt, normalizeUrlQuery } from "./timeline.js";
import { convertNotification } from "../converters.js"; import { convertNotification } from "../converters.js";
import authenticate from "@/server/api/authenticate.js"; import authenticate from "@/server/api/authenticate.js";
@ -8,11 +7,6 @@ import { UserHelpers } from "@/server/api/mastodon/helpers/user.js";
import { NotificationHelpers } from "@/server/api/mastodon/helpers/notification.js"; import { NotificationHelpers } from "@/server/api/mastodon/helpers/notification.js";
import { NotificationConverter } from "@/server/api/mastodon/converters/notification.js"; import { NotificationConverter } from "@/server/api/mastodon/converters/notification.js";
function toLimitToInt(q: any) {
if (q.limit) if (typeof q.limit === "string") q.limit = parseInt(q.limit, 10);
return q;
}
export function apiNotificationsMastodon(router: Router): void { export function apiNotificationsMastodon(router: Router): void {
router.get("/v1/notifications", async (ctx) => { router.get("/v1/notifications", async (ctx) => {
try { try {

View File

@ -10,7 +10,6 @@ import { NoteConverter } from "@/server/api/mastodon/converters/note.js";
import { getNote } from "@/server/api/common/getters.js"; import { getNote } from "@/server/api/common/getters.js";
import authenticate from "@/server/api/authenticate.js"; import authenticate from "@/server/api/authenticate.js";
import { NoteHelpers } from "@/server/api/mastodon/helpers/note.js"; import { NoteHelpers } from "@/server/api/mastodon/helpers/note.js";
import { Note } from "@/models/entities/note.js";
import { UserHelpers } from "@/server/api/mastodon/helpers/user.js"; import { UserHelpers } from "@/server/api/mastodon/helpers/user.js";
function normalizeQuery(data: any) { function normalizeQuery(data: any) {

View File

@ -10,7 +10,6 @@ import {
import { convertId, IdType } from "../../index.js"; import { convertId, IdType } from "../../index.js";
import authenticate from "@/server/api/authenticate.js"; import authenticate from "@/server/api/authenticate.js";
import { TimelineHelpers } from "@/server/api/mastodon/helpers/timeline.js"; import { TimelineHelpers } from "@/server/api/mastodon/helpers/timeline.js";
import { NoteHelpers } from "@/server/api/mastodon/helpers/note.js";
import { NoteConverter } from "@/server/api/mastodon/converters/note.js"; import { NoteConverter } from "@/server/api/mastodon/converters/note.js";
import { UserHelpers } from "@/server/api/mastodon/helpers/user.js"; import { UserHelpers } from "@/server/api/mastodon/helpers/user.js";