diff --git a/packages/backend/package.json b/packages/backend/package.json index 396cc963d..1923938b6 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -146,6 +146,8 @@ "@swc/core": "1.3.78", "@types/adm-zip": "^0.5.0", "@types/bcryptjs": "2.4.2", + "@types/color-convert": "^2.0.2", + "@types/content-disposition": "^0.5.7", "@types/escape-regexp": "0.0.1", "@types/fluent-ffmpeg": "2.1.21", "@types/js-yaml": "4.0.5", @@ -167,6 +169,8 @@ "@types/node-fetch": "3.0.3", "@types/nodemailer": "6.4.9", "@types/oauth": "0.9.1", + "@types/opencc-js": "^1.0.2", + "@types/pg": "^8.10.7", "@types/probe-image-size": "^7.2.0", "@types/pug": "2.0.6", "@types/punycode": "2.1.0", @@ -179,6 +183,7 @@ "@types/sanitize-html": "2.9.0", "@types/semver": "7.5.0", "@types/sinonjs__fake-timers": "8.1.2", + "@types/syslog-pro": "^1.0.2", "@types/tinycolor2": "1.4.3", "@types/tmp": "0.2.3", "@types/uuid": "9.0.2", diff --git a/packages/backend/src/boot/master.ts b/packages/backend/src/boot/master.ts index 4470cea9c..89f72227a 100644 --- a/packages/backend/src/boot/master.ts +++ b/packages/backend/src/boot/master.ts @@ -10,10 +10,9 @@ import semver from "semver"; import Logger from "@/services/logger.js"; import loadConfig from "@/config/load.js"; import type { Config } from "@/config/types.js"; -import { lessThan } from "@/prelude/array.js"; -import { envOption } from "../env.js"; +import { envOption } from "@/env.js"; import { showMachineInfo } from "@/misc/show-machine-info.js"; -import { db, initDb } from "../db/postgre.js"; +import { db, initDb } from "@/db/postgre.js"; const _filename = fileURLToPath(import.meta.url); const _dirname = dirname(_filename); diff --git a/packages/backend/src/boot/worker.ts b/packages/backend/src/boot/worker.ts index 236621b01..0acdcd97c 100644 --- a/packages/backend/src/boot/worker.ts +++ b/packages/backend/src/boot/worker.ts @@ -1,6 +1,5 @@ import cluster from "node:cluster"; -import { initDb } from "../db/postgre.js"; -import config from "@/config/index.js"; +import { initDb } from "@/db/postgre.js"; import os from "node:os"; /** diff --git a/packages/backend/src/daemons/queue-stats.ts b/packages/backend/src/daemons/queue-stats.ts index 381b52a91..c358518fa 100644 --- a/packages/backend/src/daemons/queue-stats.ts +++ b/packages/backend/src/daemons/queue-stats.ts @@ -1,5 +1,5 @@ import Xev from "xev"; -import { deliverQueue, inboxQueue } from "../queue/queues.js"; +import { deliverQueue, inboxQueue } from "@/queue/queues.js"; const ev = new Xev(); diff --git a/packages/backend/src/daemons/server-stats.ts b/packages/backend/src/daemons/server-stats.ts index 39d81ec91..dc7493381 100644 --- a/packages/backend/src/daemons/server-stats.ts +++ b/packages/backend/src/daemons/server-stats.ts @@ -2,7 +2,7 @@ import si from "systeminformation"; import Xev from "xev"; import * as osUtils from "os-utils"; import { fetchMeta } from "@/misc/fetch-meta.js"; -import meilisearch from "../db/meilisearch.js"; +import meilisearch from "@/db/meilisearch.js"; const ev = new Xev(); diff --git a/packages/backend/src/db/postgre.ts b/packages/backend/src/db/postgre.ts index 10ea5b15f..d68f919a7 100644 --- a/packages/backend/src/db/postgre.ts +++ b/packages/backend/src/db/postgre.ts @@ -74,9 +74,10 @@ import { UserIp } from "@/models/entities/user-ip.js"; import { NoteEdit } from "@/models/entities/note-edit.js"; import { entities as charts } from "@/services/chart/entities.js"; -import { envOption } from "../env.js"; import { dbLogger } from "./logger.js"; import { redisClient } from "./redis.js"; + +// TODO?: should we avoid importing things from built directory? import { nativeInitDatabase } from "native-utils/built/index.js"; const sqlLogger = dbLogger.createSubLogger("sql", "gray", false); diff --git a/packages/backend/src/misc/app-lock.ts b/packages/backend/src/misc/app-lock.ts index 198310c88..91d408ac5 100644 --- a/packages/backend/src/misc/app-lock.ts +++ b/packages/backend/src/misc/app-lock.ts @@ -1,4 +1,4 @@ -import { redisClient } from "../db/redis.js"; +import { redisClient } from "@/db/redis.js"; import { Mutex } from "redis-semaphore"; /** diff --git a/packages/backend/src/misc/captcha.ts b/packages/backend/src/misc/captcha.ts index 8ea4abedb..b3b3dca39 100644 --- a/packages/backend/src/misc/captcha.ts +++ b/packages/backend/src/misc/captcha.ts @@ -1,6 +1,6 @@ import fetch from "node-fetch"; import { URLSearchParams } from "node:url"; -import { getAgentByUrl } from "./fetch.js"; +import { getAgentByUrl } from "@/misc/fetch.js"; import config from "@/config/index.js"; export async function verifyRecaptcha(secret: string, response: string) { diff --git a/packages/backend/src/misc/check-hit-antenna.ts b/packages/backend/src/misc/check-hit-antenna.ts index 199b2d964..1f4f2f2fa 100644 --- a/packages/backend/src/misc/check-hit-antenna.ts +++ b/packages/backend/src/misc/check-hit-antenna.ts @@ -2,11 +2,11 @@ import type { Antenna } from "@/models/entities/antenna.js"; import type { Note } from "@/models/entities/note.js"; import type { User } from "@/models/entities/user.js"; import { Blockings, UserProfiles } from "@/models/index.js"; -import { getFullApAccount } from "./convert-host.js"; +import { getFullApAccount } from "@/misc/convert-host.js"; import * as Acct from "@/misc/acct.js"; -import type { Packed } from "./schema.js"; -import { Cache } from "./cache.js"; -import { getWordHardMute } from "./check-word-mute.js"; +import type { Packed } from "@/misc/schema.js"; +import { Cache } from "@/misc/cache.js"; +import { getWordHardMute } from "@/misc/check-word-mute.js"; const blockingCache = new Cache("blocking", 60 * 5); const mutedWordsCache = new Cache("mutedWords", 60 * 5); diff --git a/packages/backend/src/models/entities/note-thread-muting.ts b/packages/backend/src/models/entities/note-thread-muting.ts index 704b32850..7e5fad59a 100644 --- a/packages/backend/src/models/entities/note-thread-muting.ts +++ b/packages/backend/src/models/entities/note-thread-muting.ts @@ -7,7 +7,6 @@ import { ManyToOne, } from "typeorm"; import { User } from "./user.js"; -import { Note } from "./note.js"; import { id } from "../id.js"; @Entity() diff --git a/packages/backend/src/models/entities/user-ip.ts b/packages/backend/src/models/entities/user-ip.ts index c30e56b66..adef48e4c 100644 --- a/packages/backend/src/models/entities/user-ip.ts +++ b/packages/backend/src/models/entities/user-ip.ts @@ -1,14 +1,5 @@ -import { - PrimaryColumn, - Entity, - Index, - JoinColumn, - Column, - ManyToOne, - PrimaryGeneratedColumn, -} from "typeorm"; +import { Entity, Index, Column, PrimaryGeneratedColumn } from "typeorm"; import { id } from "../id.js"; -import { Note } from "./note.js"; import type { User } from "./user.js"; @Entity() diff --git a/packages/backend/src/models/index.ts b/packages/backend/src/models/index.ts index 8782d5740..c1f37cf6d 100644 --- a/packages/backend/src/models/index.ts +++ b/packages/backend/src/models/index.ts @@ -1,9 +1,7 @@ -import {} from "typeorm"; import { db } from "@/db/postgre.js"; import { Announcement } from "./entities/announcement.js"; import { AnnouncementRead } from "./entities/announcement-read.js"; -import { Instance } from "./entities/instance.js"; import { Poll } from "./entities/poll.js"; import { PollVote } from "./entities/poll-vote.js"; import { Meta } from "./entities/meta.js"; diff --git a/packages/backend/src/models/repositories/drive-file.ts b/packages/backend/src/models/repositories/drive-file.ts index 3918f7947..1b4f477d3 100644 --- a/packages/backend/src/models/repositories/drive-file.ts +++ b/packages/backend/src/models/repositories/drive-file.ts @@ -2,12 +2,10 @@ import { db } from "@/db/postgre.js"; import { DriveFile } from "@/models/entities/drive-file.js"; import type { User } from "@/models/entities/user.js"; import { toPuny } from "@/misc/convert-host.js"; -import { awaitAll, Promiseable } from "@/prelude/await-all.js"; +import { awaitAll } from "@/prelude/await-all.js"; import type { Packed } from "@/misc/schema.js"; import config from "@/config/index.js"; import { query, appendQuery } from "@/prelude/url.js"; -import { Meta } from "@/models/entities/meta.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; import { Users, DriveFolders } from "../index.js"; import { deepClone } from "@/misc/clone.js"; diff --git a/packages/backend/src/models/repositories/notification.ts b/packages/backend/src/models/repositories/notification.ts index 1538e67d8..90dfbd739 100644 --- a/packages/backend/src/models/repositories/notification.ts +++ b/packages/backend/src/models/repositories/notification.ts @@ -1,4 +1,4 @@ -import { In, Repository } from "typeorm"; +import { In } from "typeorm"; import { Notification } from "@/models/entities/notification.js"; import { awaitAll } from "@/prelude/await-all.js"; import type { Packed } from "@/misc/schema.js"; @@ -6,7 +6,6 @@ import type { Note } from "@/models/entities/note.js"; import type { NoteReaction } from "@/models/entities/note-reaction.js"; import type { User } from "@/models/entities/user.js"; import { aggregateNoteEmojis, prefetchEmojis } from "@/misc/populate-emojis.js"; -import { notificationTypes } from "@/types.js"; import { db } from "@/db/postgre.js"; import { Users, diff --git a/packages/backend/src/models/repositories/user.ts b/packages/backend/src/models/repositories/user.ts index e4284f935..be1dbc453 100644 --- a/packages/backend/src/models/repositories/user.ts +++ b/packages/backend/src/models/repositories/user.ts @@ -7,7 +7,6 @@ import type { Packed } from "@/misc/schema.js"; import type { Promiseable } from "@/prelude/await-all.js"; import { awaitAll } from "@/prelude/await-all.js"; import { populateEmojis } from "@/misc/populate-emojis.js"; -import { getAntennas } from "@/misc/antenna-cache.js"; import { USER_ACTIVE_THRESHOLD, USER_ONLINE_THRESHOLD } from "@/const.js"; import { Cache } from "@/misc/cache.js"; import { db } from "@/db/postgre.js"; diff --git a/packages/backend/src/queue/processors/background/index-all-notes.ts b/packages/backend/src/queue/processors/background/index-all-notes.ts index c0275b420..262724cbd 100644 --- a/packages/backend/src/queue/processors/background/index-all-notes.ts +++ b/packages/backend/src/queue/processors/background/index-all-notes.ts @@ -6,7 +6,7 @@ import { Notes } from "@/models/index.js"; import { MoreThan } from "typeorm"; import { index } from "@/services/note/create.js"; import { Note } from "@/models/entities/note.js"; -import meilisearch from "../../../db/meilisearch.js"; +import meilisearch from "@/db/meilisearch.js"; const logger = queueLogger.createSubLogger("index-all-notes"); diff --git a/packages/backend/src/queue/processors/db/export-custom-emojis.ts b/packages/backend/src/queue/processors/db/export-custom-emojis.ts index 7a19d0b60..86de43af4 100644 --- a/packages/backend/src/queue/processors/db/export-custom-emojis.ts +++ b/packages/backend/src/queue/processors/db/export-custom-emojis.ts @@ -1,14 +1,12 @@ import type Bull from "bull"; import * as fs from "node:fs"; -import { ulid } from "ulid"; import mime from "mime-types"; import archiver from "archiver"; import { queueLogger } from "../../logger.js"; import { addFile } from "@/services/drive/add-file.js"; import { format as dateFormat } from "date-fns"; import { Users, Emojis } from "@/models/index.js"; -import {} from "@/queue/types.js"; import { createTemp, createTempDir } from "@/misc/create-temp.js"; import { downloadUrl } from "@/misc/download-url.js"; import config from "@/config/index.js"; diff --git a/packages/backend/src/queue/processors/db/import-blocking.ts b/packages/backend/src/queue/processors/db/import-blocking.ts index 2fdf80a6e..290c9dbce 100644 --- a/packages/backend/src/queue/processors/db/import-blocking.ts +++ b/packages/backend/src/queue/processors/db/import-blocking.ts @@ -5,7 +5,7 @@ import * as Acct from "@/misc/acct.js"; import { resolveUser } from "@/remote/resolve-user.js"; import { downloadTextFile } from "@/misc/download-text-file.js"; import { isSelfHost, toPuny } from "@/misc/convert-host.js"; -import { Users, DriveFiles, Blockings } from "@/models/index.js"; +import { Users, DriveFiles } from "@/models/index.js"; import type { DbUserImportJobData } from "@/queue/types.js"; import block from "@/services/blocking/create.js"; import { IsNull } from "typeorm"; diff --git a/packages/backend/src/queue/processors/db/import-masto-post.ts b/packages/backend/src/queue/processors/db/import-masto-post.ts index 9b86a5903..c484ac0e1 100644 --- a/packages/backend/src/queue/processors/db/import-masto-post.ts +++ b/packages/backend/src/queue/processors/db/import-masto-post.ts @@ -5,7 +5,6 @@ import { queueLogger } from "../../logger.js"; import type Bull from "bull"; import { htmlToMfm } from "@/remote/activitypub/misc/html-to-mfm.js"; import { resolveNote } from "@/remote/activitypub/models/note.js"; -import { Note } from "@/models/entities/note.js"; import { uploadFromUrl } from "@/services/drive/upload-from-url.js"; import type { DriveFile } from "@/models/entities/drive-file.js"; import { Notes, NoteEdits } from "@/models/index.js"; diff --git a/packages/backend/src/queue/processors/ended-poll-notification.ts b/packages/backend/src/queue/processors/ended-poll-notification.ts index 3bf010a1b..f93b067b8 100644 --- a/packages/backend/src/queue/processors/ended-poll-notification.ts +++ b/packages/backend/src/queue/processors/ended-poll-notification.ts @@ -1,11 +1,12 @@ import type Bull from "bull"; import { Notes, PollVotes } from "@/models/index.js"; -import { queueLogger } from "../logger.js"; +// import { queueLogger } from "../logger.js"; import type { EndedPollNotificationJobData } from "@/queue/types.js"; import { createNotification } from "@/services/create-notification.js"; import { deliverQuestionUpdate } from "@/services/note/polls/update.js"; -const logger = queueLogger.createSubLogger("ended-poll-notification"); +// unused +// const logger = queueLogger.createSubLogger("ended-poll-notification"); export async function endedPollNotification( job: Bull.Job, diff --git a/packages/backend/src/queue/processors/system/verify-links.ts b/packages/backend/src/queue/processors/system/verify-links.ts index 3ddda9baf..4ee88c631 100644 --- a/packages/backend/src/queue/processors/system/verify-links.ts +++ b/packages/backend/src/queue/processors/system/verify-links.ts @@ -4,7 +4,6 @@ import { UserProfiles } from "@/models/index.js"; import { Not } from "typeorm"; import { queueLogger } from "../../logger.js"; import { verifyLink } from "@/services/fetch-rel-me.js"; -import config from "@/config/index.js"; const logger = queueLogger.createSubLogger("verify-links"); diff --git a/packages/backend/src/queue/processors/webhook-deliver.ts b/packages/backend/src/queue/processors/webhook-deliver.ts index 286b401ba..12c9a0549 100644 --- a/packages/backend/src/queue/processors/webhook-deliver.ts +++ b/packages/backend/src/queue/processors/webhook-deliver.ts @@ -1,4 +1,3 @@ -import { URL } from "node:url"; import type Bull from "bull"; import Logger from "@/services/logger.js"; import type { WebhookDeliverJobData } from "../types.js"; diff --git a/packages/backend/src/remote/activitypub/audience.ts b/packages/backend/src/remote/activitypub/audience.ts index 21b1b2e6a..9d840bc57 100644 --- a/packages/backend/src/remote/activitypub/audience.ts +++ b/packages/backend/src/remote/activitypub/audience.ts @@ -8,7 +8,6 @@ import type { CacheableRemoteUser, CacheableUser, } from "@/models/entities/user.js"; -import { User } from "@/models/entities/user.js"; type Visibility = "public" | "home" | "followers" | "specified"; diff --git a/packages/backend/src/remote/activitypub/kernel/read.ts b/packages/backend/src/remote/activitypub/kernel/read.ts index 7cc70976c..53fa7fe63 100644 --- a/packages/backend/src/remote/activitypub/kernel/read.ts +++ b/packages/backend/src/remote/activitypub/kernel/read.ts @@ -3,7 +3,7 @@ import type { IRead } from "../type.js"; import { getApId } from "../type.js"; import { isSelfHost, extractDbHost } from "@/misc/convert-host.js"; import { MessagingMessages } from "@/models/index.js"; -import { readUserMessagingMessage } from "../../../server/api/common/read-messaging-message.js"; +import { readUserMessagingMessage } from "@/server/api/common/read-messaging-message.js"; export const performReadActivity = async ( actor: CacheableRemoteUser, diff --git a/packages/backend/src/remote/activitypub/kernel/undo/accept.ts b/packages/backend/src/remote/activitypub/kernel/undo/accept.ts index 2cd05a77d..7cf457046 100644 --- a/packages/backend/src/remote/activitypub/kernel/undo/accept.ts +++ b/packages/backend/src/remote/activitypub/kernel/undo/accept.ts @@ -1,5 +1,4 @@ import unfollow from "@/services/following/delete.js"; -import cancelRequest from "@/services/following/requests/cancel.js"; import type { IAccept } from "../../type.js"; import type { CacheableRemoteUser } from "@/models/entities/user.js"; import { Followings } from "@/models/index.js"; diff --git a/packages/backend/src/remote/activitypub/misc/get-note-html.ts b/packages/backend/src/remote/activitypub/misc/get-note-html.ts index cb5294f73..7521d1213 100644 --- a/packages/backend/src/remote/activitypub/misc/get-note-html.ts +++ b/packages/backend/src/remote/activitypub/misc/get-note-html.ts @@ -1,6 +1,6 @@ import * as mfm from "mfm-js"; import type { Note } from "@/models/entities/note.js"; -import { toHtml } from "../../../mfm/to-html.js"; +import { toHtml } from "@/mfm/to-html.js"; export default function (note: Note) { if (!note.text) return ""; diff --git a/packages/backend/src/remote/activitypub/misc/html-to-mfm.ts b/packages/backend/src/remote/activitypub/misc/html-to-mfm.ts index 9d71a46a3..f18958f70 100644 --- a/packages/backend/src/remote/activitypub/misc/html-to-mfm.ts +++ b/packages/backend/src/remote/activitypub/misc/html-to-mfm.ts @@ -1,6 +1,6 @@ import type { IObject } from "../type.js"; import { extractApHashtagObjects } from "../models/tag.js"; -import { fromHtml } from "../../../mfm/from-html.js"; +import { fromHtml } from "@/mfm/from-html.js"; export function htmlToMfm(html: string, tag?: IObject | IObject[]) { const hashtagNames = extractApHashtagObjects(tag) diff --git a/packages/backend/src/remote/activitypub/models/image.ts b/packages/backend/src/remote/activitypub/models/image.ts index 67652d57d..2cf0c6c15 100644 --- a/packages/backend/src/remote/activitypub/models/image.ts +++ b/packages/backend/src/remote/activitypub/models/image.ts @@ -1,11 +1,10 @@ import { uploadFromUrl } from "@/services/drive/upload-from-url.js"; import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { IRemoteUser } from "@/models/entities/user.js"; import Resolver from "../resolver.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { apLogger } from "../logger.js"; import type { DriveFile } from "@/models/entities/drive-file.js"; -import { DriveFiles, Users } from "@/models/index.js"; +import { DriveFiles } from "@/models/index.js"; import { truncate } from "@/misc/truncate.js"; import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; diff --git a/packages/backend/src/remote/activitypub/models/mention.ts b/packages/backend/src/remote/activitypub/models/mention.ts index b888fa21a..e9f80bc43 100644 --- a/packages/backend/src/remote/activitypub/models/mention.ts +++ b/packages/backend/src/remote/activitypub/models/mention.ts @@ -1,7 +1,6 @@ import promiseLimit from "promise-limit"; import { toArray, unique } from "@/prelude/array.js"; import type { CacheableUser } from "@/models/entities/user.js"; -import { User } from "@/models/entities/user.js"; import type { IObject, IApMention } from "../type.js"; import { isMention } from "../type.js"; import Resolver from "../resolver.js"; diff --git a/packages/backend/src/remote/activitypub/models/note.ts b/packages/backend/src/remote/activitypub/models/note.ts index b2354bba6..d9eedb305 100644 --- a/packages/backend/src/remote/activitypub/models/note.ts +++ b/packages/backend/src/remote/activitypub/models/note.ts @@ -6,10 +6,7 @@ import post from "@/services/note/create.js"; import { extractMentionedUsers } from "@/services/note/create.js"; import { resolvePerson } from "./person.js"; import { resolveImage } from "./image.js"; -import type { - ILocalUser, - CacheableRemoteUser, -} from "@/models/entities/user.js"; +import type { CacheableRemoteUser } from "@/models/entities/user.js"; import { htmlToMfm } from "../misc/html-to-mfm.js"; import { extractApHashtags } from "./tag.js"; import { unique, toArray, toSingle } from "@/prelude/array.js"; @@ -52,7 +49,6 @@ import { In } from "typeorm"; import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; import { truncate } from "@/misc/truncate.js"; import { type Size, getEmojiSize } from "@/misc/emoji-meta.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; import { langmap } from "@/misc/langmap.js"; const logger = apLogger; diff --git a/packages/backend/src/remote/activitypub/models/person.ts b/packages/backend/src/remote/activitypub/models/person.ts index b13ee23e8..15083fa87 100644 --- a/packages/backend/src/remote/activitypub/models/person.ts +++ b/packages/backend/src/remote/activitypub/models/person.ts @@ -8,7 +8,6 @@ import { updateUsertags } from "@/services/update-hashtag.js"; import { Users, Instances, - DriveFiles, Followings, UserProfiles, UserPublickeys, @@ -33,8 +32,8 @@ import { publishInternalEvent } from "@/services/stream.js"; import { db } from "@/db/postgre.js"; import { apLogger } from "../logger.js"; import { htmlToMfm } from "../misc/html-to-mfm.js"; -import { fromHtml } from "../../../mfm/from-html.js"; -import type { IActor, IObject, IApPropertyValue } from "../type.js"; +import { fromHtml } from "@/mfm/from-html.js"; +import type { IActor, IObject } from "../type.js"; import { isCollectionOrOrderedCollection, isCollection, diff --git a/packages/backend/src/remote/activitypub/renderer/flag.ts b/packages/backend/src/remote/activitypub/renderer/flag.ts index f94d508e1..44da33f5c 100644 --- a/packages/backend/src/remote/activitypub/renderer/flag.ts +++ b/packages/backend/src/remote/activitypub/renderer/flag.ts @@ -1,8 +1,5 @@ import config from "@/config/index.js"; -import { IObject, IActivity } from "@/remote/activitypub/type.js"; import type { ILocalUser } from "@/models/entities/user.js"; -import { IRemoteUser } from "@/models/entities/user.js"; -import { getInstanceActor } from "@/services/instance-actor.js"; // to anonymise reporters, the reporting actor must be a system user // object has to be a uri or array of uris diff --git a/packages/backend/src/remote/activitypub/renderer/undo.ts b/packages/backend/src/remote/activitypub/renderer/undo.ts index 249d643b2..4394c4bf2 100644 --- a/packages/backend/src/remote/activitypub/renderer/undo.ts +++ b/packages/backend/src/remote/activitypub/renderer/undo.ts @@ -1,6 +1,5 @@ import config from "@/config/index.js"; import type { User } from "@/models/entities/user.js"; -import { ILocalUser } from "@/models/entities/user.js"; export default (object: any, user: { id: User["id"] }) => { if (object == null) return null; diff --git a/packages/backend/src/remote/activitypub/resolver.ts b/packages/backend/src/remote/activitypub/resolver.ts index 608ca3e93..c4bee109d 100644 --- a/packages/backend/src/remote/activitypub/resolver.ts +++ b/packages/backend/src/remote/activitypub/resolver.ts @@ -7,13 +7,7 @@ import { extractDbHost, isSelfHost } from "@/misc/convert-host.js"; import { signedGet } from "./request.js"; import type { IObject, ICollection, IOrderedCollection } from "./type.js"; import { isCollectionOrOrderedCollection, getApId } from "./type.js"; -import { - FollowRequests, - Notes, - NoteReactions, - Polls, - Users, -} from "@/models/index.js"; +import { Notes, NoteReactions, Polls, Users } from "@/models/index.js"; import { parseUri } from "./db-resolver.js"; import renderNote from "@/remote/activitypub/renderer/note.js"; import { renderLike } from "@/remote/activitypub/renderer/like.js"; diff --git a/packages/backend/src/server/activitypub.ts b/packages/backend/src/server/activitypub.ts index f9d5eb99c..337db5993 100644 --- a/packages/backend/src/server/activitypub.ts +++ b/packages/backend/src/server/activitypub.ts @@ -9,7 +9,7 @@ import renderKey from "@/remote/activitypub/renderer/key.js"; import { renderPerson } from "@/remote/activitypub/renderer/person.js"; import renderEmoji from "@/remote/activitypub/renderer/emoji.js"; import { inbox as processInbox } from "@/queue/index.js"; -import { isSelfHost, toPuny } from "@/misc/convert-host.js"; +import { isSelfHost } from "@/misc/convert-host.js"; import { Notes, Users, @@ -22,7 +22,6 @@ import { renderLike } from "@/remote/activitypub/renderer/like.js"; import { getUserKeypair } from "@/misc/keypair-store.js"; import { checkFetch, - hasSignature, getSignatureUser, } from "@/remote/activitypub/check-fetch.js"; import { getInstanceActor } from "@/services/instance-actor.js"; diff --git a/packages/backend/src/server/api/call.ts b/packages/backend/src/server/api/call.ts index 0a1027b83..2132edd0f 100644 --- a/packages/backend/src/server/api/call.ts +++ b/packages/backend/src/server/api/call.ts @@ -1,7 +1,6 @@ import { performance } from "perf_hooks"; import type Koa from "koa"; import type { CacheableLocalUser } from "@/models/entities/user.js"; -import { User } from "@/models/entities/user.js"; import type { AccessToken } from "@/models/entities/access-token.js"; import { getIpHash } from "@/misc/get-ip-hash.js"; import { limiter } from "./limiter.js"; @@ -10,7 +9,6 @@ import endpoints from "./endpoints.js"; import compatibility from "./compatibility.js"; import { ApiError } from "./error.js"; import { apiLogger } from "./logger.js"; -import type { AccessToken } from "@/models/entities/access-token.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; const accessDenied = { diff --git a/packages/backend/src/server/api/define.ts b/packages/backend/src/server/api/define.ts index ee0844185..946f86a63 100644 --- a/packages/backend/src/server/api/define.ts +++ b/packages/backend/src/server/api/define.ts @@ -1,7 +1,6 @@ import * as fs from "node:fs"; import Ajv from "ajv"; import type { CacheableLocalUser } from "@/models/entities/user.js"; -import { ILocalUser } from "@/models/entities/user.js"; import type { Schema, SchemaType } from "@/misc/schema.js"; import type { AccessToken } from "@/models/entities/access-token.js"; import type { IEndpointMeta } from "./endpoints.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts b/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts index 486143140..78034917f 100644 --- a/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts +++ b/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { AbuseUserReports } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/create.ts b/packages/backend/src/server/api/endpoints/admin/accounts/create.ts index 2e035d169..e5972173c 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/create.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; -import { signup } from "../../../common/signup.js"; +import { signup } from "@/server/api/common/signup.js"; import { IsNull } from "typeorm"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts b/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts index 3f7243ab5..423518083 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; import { doPostSuspend } from "@/services/suspend-user.js"; import { publishUserEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/hosted.ts b/packages/backend/src/server/api/endpoints/admin/accounts/hosted.ts index a7b6e95c2..601cd9500 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/hosted.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/hosted.ts @@ -2,7 +2,7 @@ import config from "@/config/index.js"; import { Meta } from "@/models/entities/meta.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; import { db } from "@/db/postgre.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/ad/create.ts b/packages/backend/src/server/api/endpoints/admin/ad/create.ts index db39f3eb2..bfe4d5446 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/create.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Ads } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/ad/delete.ts b/packages/backend/src/server/api/endpoints/admin/ad/delete.ts index ee6d314de..802eb5ef6 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/delete.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Ads } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/ad/list.ts b/packages/backend/src/server/api/endpoints/admin/ad/list.ts index 65944d31e..1f39e73e5 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/list.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Ads } from "@/models/index.js"; -import { makePaginationQuery } from "../../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/ad/update.ts b/packages/backend/src/server/api/endpoints/admin/ad/update.ts index 2c7038731..52f31a3ce 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/update.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Ads } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/create.ts b/packages/backend/src/server/api/endpoints/admin/announcements/create.ts index 754cc6c89..8af778486 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/create.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Announcements } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts b/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts index 5665b94a7..8b2326cda 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Announcements } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/list.ts b/packages/backend/src/server/api/endpoints/admin/announcements/list.ts index e96517c68..a13fabd60 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/list.ts @@ -1,7 +1,7 @@ import { Announcements, AnnouncementReads } from "@/models/index.js"; import type { Announcement } from "@/models/entities/announcement.js"; -import define from "../../../define.js"; -import { makePaginationQuery } from "../../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/update.ts b/packages/backend/src/server/api/endpoints/admin/announcements/update.ts index 616b94d69..03af41473 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/update.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Announcements } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/delete-2fa.ts b/packages/backend/src/server/api/endpoints/admin/delete-2fa.ts index 04f6abb82..1cf60d9c5 100644 --- a/packages/backend/src/server/api/endpoints/admin/delete-2fa.ts +++ b/packages/backend/src/server/api/endpoints/admin/delete-2fa.ts @@ -1,6 +1,6 @@ import { Users, UserProfiles } from "@/models/index.js"; import { publishMainStream } from "@/services/stream.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/delete-account.ts b/packages/backend/src/server/api/endpoints/admin/delete-account.ts index 9fd196888..1b6dc31a2 100644 --- a/packages/backend/src/server/api/endpoints/admin/delete-account.ts +++ b/packages/backend/src/server/api/endpoints/admin/delete-account.ts @@ -1,6 +1,6 @@ import { Users } from "@/models/index.js"; import { deleteAccount } from "@/services/delete-account.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts b/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts index 796900811..b52f60980 100644 --- a/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { deleteFile } from "@/services/drive/delete-file.js"; import { DriveFiles } from "@/models/index.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/delete-passkeys.ts b/packages/backend/src/server/api/endpoints/admin/delete-passkeys.ts index 3b5c59528..7a54f5d99 100644 --- a/packages/backend/src/server/api/endpoints/admin/delete-passkeys.ts +++ b/packages/backend/src/server/api/endpoints/admin/delete-passkeys.ts @@ -1,6 +1,6 @@ import { Users, UserProfiles, UserSecurityKeys } from "@/models/index.js"; import { publishMainStream } from "@/services/stream.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/drive-capacity-override.ts b/packages/backend/src/server/api/endpoints/admin/drive-capacity-override.ts index c8be34469..d4bb3045c 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive-capacity-override.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive-capacity-override.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/drive/clean-remote-files.ts b/packages/backend/src/server/api/endpoints/admin/drive/clean-remote-files.ts index 1b0c1260b..84c04793e 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/clean-remote-files.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/clean-remote-files.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { createCleanRemoteFilesJob } from "@/queue/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts b/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts index 04208f600..e56c027ff 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts @@ -1,5 +1,5 @@ import { IsNull } from "typeorm"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { deleteFile } from "@/services/drive/delete-file.js"; import { DriveFiles } from "@/models/index.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/drive/files.ts b/packages/backend/src/server/api/endpoints/admin/drive/files.ts index 5cb0aecd8..e068f1dc9 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/files.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/files.ts @@ -1,6 +1,6 @@ import { DriveFiles } from "@/models/index.js"; -import define from "../../../define.js"; -import { makePaginationQuery } from "../../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts b/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts index d65ec09fc..a080615e7 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts @@ -1,6 +1,6 @@ import { DriveFiles } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/add-aliases-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/add-aliases-bulk.ts index 1ea457adf..02b3877b8 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/add-aliases-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/add-aliases-bulk.ts @@ -1,7 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { In } from "typeorm"; -import { ApiError } from "../../../error.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/add.ts b/packages/backend/src/server/api/endpoints/admin/emoji/add.ts index 4366406ec..8d156e6f7 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/add.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/add.ts @@ -1,8 +1,8 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis, DriveFiles } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; import rndstr from "rndstr"; import { publishBroadcastStream } from "@/services/stream.js"; import { db } from "@/db/postgre.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts b/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts index c90e60633..29b1d8212 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts @@ -1,7 +1,7 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; import type { DriveFile } from "@/models/entities/drive-file.js"; import { uploadFromUrl } from "@/services/drive/upload-from-url.js"; import { publishBroadcastStream } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/delete-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/delete-bulk.ts index 585af231f..a5c4c8bcc 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/delete-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/delete-bulk.ts @@ -1,8 +1,7 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { In } from "typeorm"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; -import { ApiError } from "../../../error.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts b/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts index 761c7c377..726f90396 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts @@ -1,7 +1,7 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/import-zip.ts b/packages/backend/src/server/api/endpoints/admin/emoji/import-zip.ts index 9eba9dfd5..4b49e45dd 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/import-zip.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/import-zip.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { createImportCustomEmojisJob } from "@/queue/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts b/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts index 6252e7e92..c6246c48c 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts @@ -1,7 +1,7 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { toPuny } from "@/misc/convert-host.js"; -import { makePaginationQuery } from "../../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/list.ts b/packages/backend/src/server/api/endpoints/admin/emoji/list.ts index f8269588c..12de0b181 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/list.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { makePaginationQuery } from "../../../common/make-pagination-query.js"; import type { Emoji } from "@/models/entities/emoji.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/remove-aliases-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/remove-aliases-bulk.ts index 4e57fa3dd..49d31805f 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/remove-aliases-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/remove-aliases-bulk.ts @@ -1,7 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { In } from "typeorm"; -import { ApiError } from "../../../error.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/set-aliases-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/set-aliases-bulk.ts index 1197f6077..72d7fab80 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/set-aliases-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/set-aliases-bulk.ts @@ -1,7 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { In } from "typeorm"; -import { ApiError } from "../../../error.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/set-category-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/set-category-bulk.ts index 17881a445..89e68aa4c 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/set-category-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/set-category-bulk.ts @@ -1,7 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { In } from "typeorm"; -import { ApiError } from "../../../error.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/set-license-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/set-license-bulk.ts index c98ca03fa..e4500e02a 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/set-license-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/set-license-bulk.ts @@ -1,7 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { In } from "typeorm"; -import { ApiError } from "../../../error.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/update.ts b/packages/backend/src/server/api/endpoints/admin/emoji/update.ts index 9e2e85476..6fedf8620 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/update.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts b/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts index 534f226c2..d1a7fb695 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { deleteFile } from "@/services/drive/delete-file.js"; import { DriveFiles } from "@/models/index.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts b/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts index 9c7165593..bf71cd250 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Instances } from "@/models/index.js"; import { toPuny } from "@/misc/convert-host.js"; import { fetchInstanceMetadata } from "@/services/fetch-instance-metadata.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts b/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts index a1ccf11af..a2ce44bd5 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import deleteFollowing from "@/services/following/delete.js"; import { Followings, Users } from "@/models/index.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts b/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts index 016989b54..653d187c2 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Instances } from "@/models/index.js"; import { toPuny } from "@/misc/convert-host.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/get-index-stats.ts b/packages/backend/src/server/api/endpoints/admin/get-index-stats.ts index f39a369ec..98f1f024b 100644 --- a/packages/backend/src/server/api/endpoints/admin/get-index-stats.ts +++ b/packages/backend/src/server/api/endpoints/admin/get-index-stats.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts b/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts index 25d07f327..13c893f4b 100644 --- a/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts +++ b/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts @@ -1,5 +1,5 @@ import { db } from "@/db/postgre.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/admin/get-user-ips.ts b/packages/backend/src/server/api/endpoints/admin/get-user-ips.ts index da76ae624..1b394ebb8 100644 --- a/packages/backend/src/server/api/endpoints/admin/get-user-ips.ts +++ b/packages/backend/src/server/api/endpoints/admin/get-user-ips.ts @@ -1,5 +1,5 @@ import { UserIps } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/invite.ts b/packages/backend/src/server/api/endpoints/admin/invite.ts index b8bdb38b4..ebc523d41 100644 --- a/packages/backend/src/server/api/endpoints/admin/invite.ts +++ b/packages/backend/src/server/api/endpoints/admin/invite.ts @@ -1,5 +1,5 @@ import rndstr from "rndstr"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { RegistrationTickets } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index 2a0a7cfbb..37625a0c6 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -1,8 +1,7 @@ import config from "@/config/index.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { MAX_NOTE_TEXT_LENGTH, MAX_CAPTION_TEXT_LENGTH } from "@/const.js"; -import define from "../../define.js"; -import { Exp } from "@tensorflow/tfjs"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/admin/moderators/add.ts b/packages/backend/src/server/api/endpoints/admin/moderators/add.ts index 478f2661b..c8b53088c 100644 --- a/packages/backend/src/server/api/endpoints/admin/moderators/add.ts +++ b/packages/backend/src/server/api/endpoints/admin/moderators/add.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/moderators/remove.ts b/packages/backend/src/server/api/endpoints/admin/moderators/remove.ts index a43cc0cbe..e2af1ca37 100644 --- a/packages/backend/src/server/api/endpoints/admin/moderators/remove.ts +++ b/packages/backend/src/server/api/endpoints/admin/moderators/remove.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/promo/create.ts b/packages/backend/src/server/api/endpoints/admin/promo/create.ts index 00244a777..55038fc89 100644 --- a/packages/backend/src/server/api/endpoints/admin/promo/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/promo/create.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getNote } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getNote } from "@/server/api/common/getters.js"; import { PromoNotes } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/queue/clear.ts b/packages/backend/src/server/api/endpoints/admin/queue/clear.ts index 9b828bb24..9895f34b4 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/clear.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/clear.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { destroy } from "@/queue/index.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts b/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts index 15fdfb025..ea8c50569 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts @@ -1,6 +1,6 @@ import { deliverQueue } from "@/queue/queues.js"; import { URL } from "node:url"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts b/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts index 1890bd434..d4f44e307 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts @@ -1,5 +1,5 @@ import { URL } from "node:url"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { inboxQueue } from "@/queue/queues.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/queue/stats.ts b/packages/backend/src/server/api/endpoints/admin/queue/stats.ts index 4a437c3d1..f51c1e6d4 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/stats.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/stats.ts @@ -5,7 +5,7 @@ import { objectStorageQueue, backgroundQueue, } from "@/queue/queues.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/relays/add.ts b/packages/backend/src/server/api/endpoints/admin/relays/add.ts index bb56216a7..ac0084860 100644 --- a/packages/backend/src/server/api/endpoints/admin/relays/add.ts +++ b/packages/backend/src/server/api/endpoints/admin/relays/add.ts @@ -1,7 +1,7 @@ import { URL } from "node:url"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { addRelay } from "@/services/relay.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/relays/list.ts b/packages/backend/src/server/api/endpoints/admin/relays/list.ts index 4c294ba9b..5c3b7a922 100644 --- a/packages/backend/src/server/api/endpoints/admin/relays/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/relays/list.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { listRelay } from "@/services/relay.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/relays/remove.ts b/packages/backend/src/server/api/endpoints/admin/relays/remove.ts index 1b3d90628..19a9dfa39 100644 --- a/packages/backend/src/server/api/endpoints/admin/relays/remove.ts +++ b/packages/backend/src/server/api/endpoints/admin/relays/remove.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { removeRelay } from "@/services/relay.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/reset-password.ts b/packages/backend/src/server/api/endpoints/admin/reset-password.ts index cbe6735ce..5fbed130e 100644 --- a/packages/backend/src/server/api/endpoints/admin/reset-password.ts +++ b/packages/backend/src/server/api/endpoints/admin/reset-password.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; // import bcrypt from "bcryptjs"; import rndstr from "rndstr"; import { Users, UserProfiles } from "@/models/index.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts b/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts index c876a2198..a94687cf4 100644 --- a/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts +++ b/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { AbuseUserReports, Users } from "@/models/index.js"; import { getInstanceActor } from "@/services/instance-actor.js"; import { deliver } from "@/queue/index.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/search/index-all.ts b/packages/backend/src/server/api/endpoints/admin/search/index-all.ts index 135b48ecc..531428849 100644 --- a/packages/backend/src/server/api/endpoints/admin/search/index-all.ts +++ b/packages/backend/src/server/api/endpoints/admin/search/index-all.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { createIndexAllNotesJob } from "@/queue/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/send-email.ts b/packages/backend/src/server/api/endpoints/admin/send-email.ts index 1676f6890..1b43d90c8 100644 --- a/packages/backend/src/server/api/endpoints/admin/send-email.ts +++ b/packages/backend/src/server/api/endpoints/admin/send-email.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { sendEmail } from "@/services/send-email.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/send-mod-mail.ts b/packages/backend/src/server/api/endpoints/admin/send-mod-mail.ts index a36dca2f7..5dcbaf2e8 100644 --- a/packages/backend/src/server/api/endpoints/admin/send-mod-mail.ts +++ b/packages/backend/src/server/api/endpoints/admin/send-mod-mail.ts @@ -1,7 +1,7 @@ import sanitizeHtml from "sanitize-html"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Users, UserProfiles } from "@/models/index.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { sendEmail } from "@/services/send-email.js"; import { createNotification } from "@/services/create-notification.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/server-info.ts b/packages/backend/src/server/api/endpoints/admin/server-info.ts index 8998032cc..ff4691969 100644 --- a/packages/backend/src/server/api/endpoints/admin/server-info.ts +++ b/packages/backend/src/server/api/endpoints/admin/server-info.ts @@ -1,7 +1,7 @@ import * as os from "node:os"; import si from "systeminformation"; -import define from "../../define.js"; -import { redisClient } from "../../../../db/redis.js"; +import define from "@/server/api/define.js"; +import { redisClient } from "@/db/redis.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts b/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts index df7e8979c..adceda416 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { ModerationLogs } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/show-user.ts b/packages/backend/src/server/api/endpoints/admin/show-user.ts index cbc86a5c1..f3a74c313 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-user.ts @@ -1,5 +1,5 @@ import { Signins, UserProfiles, Users } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/show-users.ts b/packages/backend/src/server/api/endpoints/admin/show-users.ts index b777bd26d..1e6ebeda9 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-users.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-users.ts @@ -1,5 +1,5 @@ import { Users } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/silence-user.ts b/packages/backend/src/server/api/endpoints/admin/silence-user.ts index a61823297..8d9dcac68 100644 --- a/packages/backend/src/server/api/endpoints/admin/silence-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/silence-user.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/suspend-user.ts b/packages/backend/src/server/api/endpoints/admin/suspend-user.ts index 984bc0789..c6d6f47bc 100644 --- a/packages/backend/src/server/api/endpoints/admin/suspend-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/suspend-user.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import deleteFollowing from "@/services/following/delete.js"; import { Users, Followings, Notifications } from "@/models/index.js"; import type { User } from "@/models/entities/user.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts b/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts index 6a01b8e8d..6592bf443 100644 --- a/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts b/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts index e51d5851c..3289fb570 100644 --- a/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; import { doPostUnsuspend } from "@/services/unsuspend-user.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/update-meta.ts b/packages/backend/src/server/api/endpoints/admin/update-meta.ts index 00a472ed3..70b3d2709 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -1,7 +1,7 @@ import { Meta } from "@/models/entities/meta.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; import { db } from "@/db/postgre.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/update-user-note.ts b/packages/backend/src/server/api/endpoints/admin/update-user-note.ts index 04870d1c1..d1a4a6043 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-user-note.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-user-note.ts @@ -1,5 +1,5 @@ import { UserProfiles, Users } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/vacuum.ts b/packages/backend/src/server/api/endpoints/admin/vacuum.ts index 559b310e4..d5b086bb4 100644 --- a/packages/backend/src/server/api/endpoints/admin/vacuum.ts +++ b/packages/backend/src/server/api/endpoints/admin/vacuum.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; import { db } from "@/db/postgre.js"; diff --git a/packages/backend/src/server/api/endpoints/announcements.ts b/packages/backend/src/server/api/endpoints/announcements.ts index 1bab61ba2..504eb30e2 100644 --- a/packages/backend/src/server/api/endpoints/announcements.ts +++ b/packages/backend/src/server/api/endpoints/announcements.ts @@ -1,6 +1,6 @@ import { Announcements, AnnouncementReads } from "@/models/index.js"; -import define from "../define.js"; -import { makePaginationQuery } from "../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/antennas/create.ts b/packages/backend/src/server/api/endpoints/antennas/create.ts index ed1645012..46df3aa81 100644 --- a/packages/backend/src/server/api/endpoints/antennas/create.ts +++ b/packages/backend/src/server/api/endpoints/antennas/create.ts @@ -1,7 +1,7 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { genId } from "@/misc/gen-id.js"; import { Antennas, UserLists, UserGroupJoinings } from "@/models/index.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { publishInternalEvent } from "@/services/stream.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/antennas/delete.ts b/packages/backend/src/server/api/endpoints/antennas/delete.ts index a6cf79011..e5a372f19 100644 --- a/packages/backend/src/server/api/endpoints/antennas/delete.ts +++ b/packages/backend/src/server/api/endpoints/antennas/delete.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Antennas } from "@/models/index.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/antennas/list.ts b/packages/backend/src/server/api/endpoints/antennas/list.ts index 929b761d4..2726ecc8f 100644 --- a/packages/backend/src/server/api/endpoints/antennas/list.ts +++ b/packages/backend/src/server/api/endpoints/antennas/list.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Antennas } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/antennas/markread.ts b/packages/backend/src/server/api/endpoints/antennas/markread.ts index db8e683e4..bb5b5b77f 100644 --- a/packages/backend/src/server/api/endpoints/antennas/markread.ts +++ b/packages/backend/src/server/api/endpoints/antennas/markread.ts @@ -1,6 +1,5 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Antennas } from "@/models/index.js"; -import { FindOptionsWhere } from "typeorm"; export const meta = { tags: ["antennas", "account"], diff --git a/packages/backend/src/server/api/endpoints/antennas/notes.ts b/packages/backend/src/server/api/endpoints/antennas/notes.ts index 149f98ea9..1512cb928 100644 --- a/packages/backend/src/server/api/endpoints/antennas/notes.ts +++ b/packages/backend/src/server/api/endpoints/antennas/notes.ts @@ -1,13 +1,13 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import readNote from "@/services/note/read.js"; import { Antennas, Notes } from "@/models/index.js"; import { redisClient } from "@/db/redis.js"; -import { genId, getTimestamp } from "@/misc/gen-id.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { ApiError } from "../../error.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import { getTimestamp } from "@/misc/gen-id.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { ApiError } from "@/server/api/error.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; export const meta = { tags: ["antennas", "account", "notes"], diff --git a/packages/backend/src/server/api/endpoints/antennas/show.ts b/packages/backend/src/server/api/endpoints/antennas/show.ts index 350d73921..3700052f5 100644 --- a/packages/backend/src/server/api/endpoints/antennas/show.ts +++ b/packages/backend/src/server/api/endpoints/antennas/show.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Antennas } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/antennas/update.ts b/packages/backend/src/server/api/endpoints/antennas/update.ts index f491c0b63..9a71a8f9f 100644 --- a/packages/backend/src/server/api/endpoints/antennas/update.ts +++ b/packages/backend/src/server/api/endpoints/antennas/update.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Antennas, UserLists, UserGroupJoinings } from "@/models/index.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/ap/get.ts b/packages/backend/src/server/api/endpoints/ap/get.ts index f0db67a34..5159ce3b4 100644 --- a/packages/backend/src/server/api/endpoints/ap/get.ts +++ b/packages/backend/src/server/api/endpoints/ap/get.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import Resolver from "@/remote/activitypub/resolver.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/ap/show.ts b/packages/backend/src/server/api/endpoints/ap/show.ts index c25f0a801..50eb7e9c6 100644 --- a/packages/backend/src/server/api/endpoints/ap/show.ts +++ b/packages/backend/src/server/api/endpoints/ap/show.ts @@ -1,9 +1,9 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createPerson } from "@/remote/activitypub/models/person.js"; import { createNote } from "@/remote/activitypub/models/note.js"; import DbResolver from "@/remote/activitypub/db-resolver.js"; import Resolver from "@/remote/activitypub/resolver.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { extractDbHost } from "@/misc/convert-host.js"; import { Users, Notes } from "@/models/index.js"; import type { Note } from "@/models/entities/note.js"; diff --git a/packages/backend/src/server/api/endpoints/app/create.ts b/packages/backend/src/server/api/endpoints/app/create.ts index 013c5a10b..e32edf129 100644 --- a/packages/backend/src/server/api/endpoints/app/create.ts +++ b/packages/backend/src/server/api/endpoints/app/create.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Apps } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import { unique } from "@/prelude/array.js"; diff --git a/packages/backend/src/server/api/endpoints/app/show.ts b/packages/backend/src/server/api/endpoints/app/show.ts index 60949512e..d6f38428c 100644 --- a/packages/backend/src/server/api/endpoints/app/show.ts +++ b/packages/backend/src/server/api/endpoints/app/show.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Apps } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/auth/accept.ts b/packages/backend/src/server/api/endpoints/auth/accept.ts index 8e6ad6527..088de7863 100644 --- a/packages/backend/src/server/api/endpoints/auth/accept.ts +++ b/packages/backend/src/server/api/endpoints/auth/accept.ts @@ -1,6 +1,6 @@ import * as crypto from "node:crypto"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { AuthSessions, AccessTokens, Apps } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import { secureRndstr } from "@/misc/secure-rndstr.js"; diff --git a/packages/backend/src/server/api/endpoints/auth/session/generate.ts b/packages/backend/src/server/api/endpoints/auth/session/generate.ts index 1defb9400..bd1721104 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/generate.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/generate.ts @@ -1,7 +1,7 @@ import { v4 as uuid } from "uuid"; import config from "@/config/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Apps, AuthSessions } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; diff --git a/packages/backend/src/server/api/endpoints/auth/session/show.ts b/packages/backend/src/server/api/endpoints/auth/session/show.ts index 01a5fe5dc..70c6d54cd 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/show.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/show.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { AuthSessions } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/auth/session/userkey.ts b/packages/backend/src/server/api/endpoints/auth/session/userkey.ts index 0e97bf414..394681516 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/userkey.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/userkey.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Apps, AuthSessions, AccessTokens, Users } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/blocking/create.ts b/packages/backend/src/server/api/endpoints/blocking/create.ts index f00a2923d..50154dd6c 100644 --- a/packages/backend/src/server/api/endpoints/blocking/create.ts +++ b/packages/backend/src/server/api/endpoints/blocking/create.ts @@ -1,7 +1,7 @@ import create from "@/services/blocking/create.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { Blockings, NoteWatchings, Users } from "@/models/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/blocking/delete.ts b/packages/backend/src/server/api/endpoints/blocking/delete.ts index 037d5af22..addf4bbd1 100644 --- a/packages/backend/src/server/api/endpoints/blocking/delete.ts +++ b/packages/backend/src/server/api/endpoints/blocking/delete.ts @@ -1,7 +1,7 @@ import deleteBlocking from "@/services/blocking/delete.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { Blockings, Users } from "@/models/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/blocking/list.ts b/packages/backend/src/server/api/endpoints/blocking/list.ts index 83fca7b42..6f51a6458 100644 --- a/packages/backend/src/server/api/endpoints/blocking/list.ts +++ b/packages/backend/src/server/api/endpoints/blocking/list.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Blockings } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/channels/create.ts b/packages/backend/src/server/api/endpoints/channels/create.ts index 26a3448b2..177492ed2 100644 --- a/packages/backend/src/server/api/endpoints/channels/create.ts +++ b/packages/backend/src/server/api/endpoints/channels/create.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Channels, DriveFiles } from "@/models/index.js"; import type { Channel } from "@/models/entities/channel.js"; import { genId } from "@/misc/gen-id.js"; diff --git a/packages/backend/src/server/api/endpoints/channels/featured.ts b/packages/backend/src/server/api/endpoints/channels/featured.ts index 06e0e850f..e0575af26 100644 --- a/packages/backend/src/server/api/endpoints/channels/featured.ts +++ b/packages/backend/src/server/api/endpoints/channels/featured.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Channels } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/channels/follow.ts b/packages/backend/src/server/api/endpoints/channels/follow.ts index de0554383..878339827 100644 --- a/packages/backend/src/server/api/endpoints/channels/follow.ts +++ b/packages/backend/src/server/api/endpoints/channels/follow.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Channels, ChannelFollowings } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import { publishUserEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/channels/followed.ts b/packages/backend/src/server/api/endpoints/channels/followed.ts index 993a211f7..94374f6be 100644 --- a/packages/backend/src/server/api/endpoints/channels/followed.ts +++ b/packages/backend/src/server/api/endpoints/channels/followed.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Channels, ChannelFollowings } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/channels/owned.ts b/packages/backend/src/server/api/endpoints/channels/owned.ts index 78d9e80cc..23607b024 100644 --- a/packages/backend/src/server/api/endpoints/channels/owned.ts +++ b/packages/backend/src/server/api/endpoints/channels/owned.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Channels } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["channels", "account"], diff --git a/packages/backend/src/server/api/endpoints/channels/search.ts b/packages/backend/src/server/api/endpoints/channels/search.ts index b21fa7620..b2fab701c 100644 --- a/packages/backend/src/server/api/endpoints/channels/search.ts +++ b/packages/backend/src/server/api/endpoints/channels/search.ts @@ -1,9 +1,7 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Brackets } from "typeorm"; -import { Endpoint } from "@/server/api/endpoint-base.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; import { Channels } from "@/models/index.js"; -import { DI } from "@/di-symbols.js"; import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/channels/show.ts b/packages/backend/src/server/api/endpoints/channels/show.ts index e4ca75663..c5c1b6577 100644 --- a/packages/backend/src/server/api/endpoints/channels/show.ts +++ b/packages/backend/src/server/api/endpoints/channels/show.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Channels } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/channels/timeline.ts b/packages/backend/src/server/api/endpoints/channels/timeline.ts index b5d532523..f061acab0 100644 --- a/packages/backend/src/server/api/endpoints/channels/timeline.ts +++ b/packages/backend/src/server/api/endpoints/channels/timeline.ts @@ -1,7 +1,7 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Notes, Channels } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; import { activeUsersChart } from "@/services/chart/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/channels/unfollow.ts b/packages/backend/src/server/api/endpoints/channels/unfollow.ts index 654a4fbba..337100039 100644 --- a/packages/backend/src/server/api/endpoints/channels/unfollow.ts +++ b/packages/backend/src/server/api/endpoints/channels/unfollow.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Channels, ChannelFollowings } from "@/models/index.js"; import { publishUserEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/channels/update.ts b/packages/backend/src/server/api/endpoints/channels/update.ts index d9f6f7644..0de7a837a 100644 --- a/packages/backend/src/server/api/endpoints/channels/update.ts +++ b/packages/backend/src/server/api/endpoints/channels/update.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Channels, DriveFiles } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/charts/active-users.ts b/packages/backend/src/server/api/endpoints/charts/active-users.ts index 3817a32ca..d5c3c4eb8 100644 --- a/packages/backend/src/server/api/endpoints/charts/active-users.ts +++ b/packages/backend/src/server/api/endpoints/charts/active-users.ts @@ -1,6 +1,6 @@ import { getJsonSchema } from "@/services/chart/core.js"; import { activeUsersChart } from "@/services/chart/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["charts", "users"], diff --git a/packages/backend/src/server/api/endpoints/charts/ap-request.ts b/packages/backend/src/server/api/endpoints/charts/ap-request.ts index 9e9013ce5..bbf72030a 100644 --- a/packages/backend/src/server/api/endpoints/charts/ap-request.ts +++ b/packages/backend/src/server/api/endpoints/charts/ap-request.ts @@ -1,6 +1,6 @@ import { getJsonSchema } from "@/services/chart/core.js"; import { apRequestChart } from "@/services/chart/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["charts"], diff --git a/packages/backend/src/server/api/endpoints/charts/drive.ts b/packages/backend/src/server/api/endpoints/charts/drive.ts index 03ac4c047..0a5354743 100644 --- a/packages/backend/src/server/api/endpoints/charts/drive.ts +++ b/packages/backend/src/server/api/endpoints/charts/drive.ts @@ -1,6 +1,6 @@ import { getJsonSchema } from "@/services/chart/core.js"; import { driveChart } from "@/services/chart/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["charts", "drive"], diff --git a/packages/backend/src/server/api/endpoints/charts/federation.ts b/packages/backend/src/server/api/endpoints/charts/federation.ts index 5862aad56..f9c75d5ec 100644 --- a/packages/backend/src/server/api/endpoints/charts/federation.ts +++ b/packages/backend/src/server/api/endpoints/charts/federation.ts @@ -1,6 +1,6 @@ import { getJsonSchema } from "@/services/chart/core.js"; import { federationChart } from "@/services/chart/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["charts"], diff --git a/packages/backend/src/server/api/endpoints/charts/hashtag.ts b/packages/backend/src/server/api/endpoints/charts/hashtag.ts index 0af1e35ea..bbd1b70b0 100644 --- a/packages/backend/src/server/api/endpoints/charts/hashtag.ts +++ b/packages/backend/src/server/api/endpoints/charts/hashtag.ts @@ -1,6 +1,6 @@ import { getJsonSchema } from "@/services/chart/core.js"; import { hashtagChart } from "@/services/chart/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["charts", "hashtags"], diff --git a/packages/backend/src/server/api/endpoints/charts/instance.ts b/packages/backend/src/server/api/endpoints/charts/instance.ts index 11a1dbce1..4d746ec0b 100644 --- a/packages/backend/src/server/api/endpoints/charts/instance.ts +++ b/packages/backend/src/server/api/endpoints/charts/instance.ts @@ -1,6 +1,6 @@ import { getJsonSchema } from "@/services/chart/core.js"; import { instanceChart } from "@/services/chart/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["charts"], diff --git a/packages/backend/src/server/api/endpoints/charts/notes.ts b/packages/backend/src/server/api/endpoints/charts/notes.ts index 27e69a4c9..b2a1b93fd 100644 --- a/packages/backend/src/server/api/endpoints/charts/notes.ts +++ b/packages/backend/src/server/api/endpoints/charts/notes.ts @@ -1,6 +1,6 @@ import { getJsonSchema } from "@/services/chart/core.js"; import { notesChart } from "@/services/chart/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["charts", "notes"], diff --git a/packages/backend/src/server/api/endpoints/charts/user/drive.ts b/packages/backend/src/server/api/endpoints/charts/user/drive.ts index 178ba453c..c2745c860 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/drive.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/drive.ts @@ -1,6 +1,6 @@ import { getJsonSchema } from "@/services/chart/core.js"; import { perUserDriveChart } from "@/services/chart/index.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["charts", "drive", "users"], diff --git a/packages/backend/src/server/api/endpoints/charts/user/following.ts b/packages/backend/src/server/api/endpoints/charts/user/following.ts index 6a0c22df1..8d8177c30 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/following.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/following.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { getJsonSchema } from "@/services/chart/core.js"; import { perUserFollowingChart } from "@/services/chart/index.js"; diff --git a/packages/backend/src/server/api/endpoints/charts/user/notes.ts b/packages/backend/src/server/api/endpoints/charts/user/notes.ts index d78807696..4a398d4dd 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/notes.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/notes.ts @@ -1,6 +1,6 @@ import { getJsonSchema } from "@/services/chart/core.js"; import { perUserNotesChart } from "@/services/chart/index.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["charts", "users", "notes"], diff --git a/packages/backend/src/server/api/endpoints/charts/user/reactions.ts b/packages/backend/src/server/api/endpoints/charts/user/reactions.ts index 5b0048c50..fc75d40ba 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/reactions.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/reactions.ts @@ -1,6 +1,6 @@ import { getJsonSchema } from "@/services/chart/core.js"; import { perUserReactionsChart } from "@/services/chart/index.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["charts", "users", "reactions"], diff --git a/packages/backend/src/server/api/endpoints/charts/users.ts b/packages/backend/src/server/api/endpoints/charts/users.ts index 8973f013b..0dc5f3580 100644 --- a/packages/backend/src/server/api/endpoints/charts/users.ts +++ b/packages/backend/src/server/api/endpoints/charts/users.ts @@ -1,6 +1,6 @@ import { getJsonSchema } from "@/services/chart/core.js"; import { usersChart } from "@/services/chart/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["charts", "users"], diff --git a/packages/backend/src/server/api/endpoints/clips/add-note.ts b/packages/backend/src/server/api/endpoints/clips/add-note.ts index 416af6faa..887c8af08 100644 --- a/packages/backend/src/server/api/endpoints/clips/add-note.ts +++ b/packages/backend/src/server/api/endpoints/clips/add-note.ts @@ -1,8 +1,8 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { ClipNotes, Clips } from "@/models/index.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { genId } from "@/misc/gen-id.js"; -import { getNote } from "../../common/getters.js"; +import { getNote } from "@/server/api/common/getters.js"; export const meta = { tags: ["account", "notes", "clips"], diff --git a/packages/backend/src/server/api/endpoints/clips/create.ts b/packages/backend/src/server/api/endpoints/clips/create.ts index 918e9462a..df03b87b0 100644 --- a/packages/backend/src/server/api/endpoints/clips/create.ts +++ b/packages/backend/src/server/api/endpoints/clips/create.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { genId } from "@/misc/gen-id.js"; import { Clips } from "@/models/index.js"; diff --git a/packages/backend/src/server/api/endpoints/clips/delete.ts b/packages/backend/src/server/api/endpoints/clips/delete.ts index 8f2489ddd..02d95b315 100644 --- a/packages/backend/src/server/api/endpoints/clips/delete.ts +++ b/packages/backend/src/server/api/endpoints/clips/delete.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Clips } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/clips/list.ts b/packages/backend/src/server/api/endpoints/clips/list.ts index d1625ee03..d27622436 100644 --- a/packages/backend/src/server/api/endpoints/clips/list.ts +++ b/packages/backend/src/server/api/endpoints/clips/list.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Clips } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/clips/notes.ts b/packages/backend/src/server/api/endpoints/clips/notes.ts index c641d9ba9..13d8310e6 100644 --- a/packages/backend/src/server/api/endpoints/clips/notes.ts +++ b/packages/backend/src/server/api/endpoints/clips/notes.ts @@ -1,10 +1,10 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { ClipNotes, Clips, Notes } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { ApiError } from "../../error.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { ApiError } from "@/server/api/error.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; export const meta = { tags: ["account", "notes", "clips"], diff --git a/packages/backend/src/server/api/endpoints/clips/remove-note.ts b/packages/backend/src/server/api/endpoints/clips/remove-note.ts index 2cc19aca9..c081a87ab 100644 --- a/packages/backend/src/server/api/endpoints/clips/remove-note.ts +++ b/packages/backend/src/server/api/endpoints/clips/remove-note.ts @@ -1,7 +1,7 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { ClipNotes, Clips } from "@/models/index.js"; -import { ApiError } from "../../error.js"; -import { getNote } from "../../common/getters.js"; +import { ApiError } from "@/server/api/error.js"; +import { getNote } from "@/server/api/common/getters.js"; export const meta = { tags: ["account", "notes", "clips"], diff --git a/packages/backend/src/server/api/endpoints/clips/show.ts b/packages/backend/src/server/api/endpoints/clips/show.ts index 14709b504..8218a4fb7 100644 --- a/packages/backend/src/server/api/endpoints/clips/show.ts +++ b/packages/backend/src/server/api/endpoints/clips/show.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Clips } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/clips/update.ts b/packages/backend/src/server/api/endpoints/clips/update.ts index e78f36e45..fc88548b9 100644 --- a/packages/backend/src/server/api/endpoints/clips/update.ts +++ b/packages/backend/src/server/api/endpoints/clips/update.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Clips } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/compatibility/custom-emojis.ts b/packages/backend/src/server/api/endpoints/compatibility/custom-emojis.ts index 62e0836e8..f6c5573af 100644 --- a/packages/backend/src/server/api/endpoints/compatibility/custom-emojis.ts +++ b/packages/backend/src/server/api/endpoints/compatibility/custom-emojis.ts @@ -2,7 +2,7 @@ import { Emojis } from "@/models/index.js"; import type { Emoji } from "@/models/entities/emoji.js"; import { IsNull, In } from "typeorm"; import { FILE_TYPE_BROWSERSAFE } from "@/const.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { requireCredential: false, diff --git a/packages/backend/src/server/api/endpoints/compatibility/peers.ts b/packages/backend/src/server/api/endpoints/compatibility/peers.ts index 30f6e0e93..df81d2b0d 100644 --- a/packages/backend/src/server/api/endpoints/compatibility/peers.ts +++ b/packages/backend/src/server/api/endpoints/compatibility/peers.ts @@ -1,5 +1,5 @@ import { Instances } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/custom-motd.ts b/packages/backend/src/server/api/endpoints/custom-motd.ts index 098a676a5..d61b31fed 100644 --- a/packages/backend/src/server/api/endpoints/custom-motd.ts +++ b/packages/backend/src/server/api/endpoints/custom-motd.ts @@ -1,6 +1,6 @@ // import { IsNull } from 'typeorm'; import { fetchMeta } from "@/misc/fetch-meta.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/custom-splash-icons.ts b/packages/backend/src/server/api/endpoints/custom-splash-icons.ts index c4833a4ee..f63a1b960 100644 --- a/packages/backend/src/server/api/endpoints/custom-splash-icons.ts +++ b/packages/backend/src/server/api/endpoints/custom-splash-icons.ts @@ -1,6 +1,6 @@ // import { IsNull } from 'typeorm'; import { fetchMeta } from "@/misc/fetch-meta.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/drive.ts b/packages/backend/src/server/api/endpoints/drive.ts index ce98b53a6..164e7b8f9 100644 --- a/packages/backend/src/server/api/endpoints/drive.ts +++ b/packages/backend/src/server/api/endpoints/drive.ts @@ -1,6 +1,6 @@ import { fetchMeta } from "@/misc/fetch-meta.js"; import { DriveFiles } from "@/models/index.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["drive", "account"], diff --git a/packages/backend/src/server/api/endpoints/drive/files.ts b/packages/backend/src/server/api/endpoints/drive/files.ts index c749e4903..d5dae8767 100644 --- a/packages/backend/src/server/api/endpoints/drive/files.ts +++ b/packages/backend/src/server/api/endpoints/drive/files.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { DriveFiles } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts b/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts index 9267da585..5f821fa72 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFiles, Notes } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/drive/files/caption-image.ts b/packages/backend/src/server/api/endpoints/drive/files/caption-image.ts index 30c8e3de8..8b23e324d 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/caption-image.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/caption-image.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { createWorker } from "tesseract.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts b/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts index e26da30eb..2ce9fa470 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { DriveFiles } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/drive/files/create.ts b/packages/backend/src/server/api/endpoints/drive/files/create.ts index 51b9ea4c3..54ca5f8d1 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/create.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/create.ts @@ -4,9 +4,9 @@ import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; import { IdentifiableError } from "@/misc/identifiable-error.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { MINUTE } from "@/const.js"; -import define from "../../../define.js"; -import { apiLogger } from "../../../logger.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { apiLogger } from "@/server/api/logger.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/drive/files/delete.ts b/packages/backend/src/server/api/endpoints/drive/files/delete.ts index 4e8b4156f..062b69b9c 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/delete.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/delete.ts @@ -1,8 +1,8 @@ import { deleteFile } from "@/services/drive/delete-file.js"; import { publishDriveStream } from "@/services/stream.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { DriveFiles, Users } from "@/models/index.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { DriveFiles } from "@/models/index.js"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts b/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts index ce14f4e09..eb6881f5b 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts @@ -1,5 +1,5 @@ import { DriveFiles } from "@/models/index.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/drive/files/find.ts b/packages/backend/src/server/api/endpoints/drive/files/find.ts index c2ad95126..5a243de89 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/find.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/find.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { DriveFiles } from "@/models/index.js"; import { IsNull } from "typeorm"; diff --git a/packages/backend/src/server/api/endpoints/drive/files/show.ts b/packages/backend/src/server/api/endpoints/drive/files/show.ts index 291e3f56b..455eb76b3 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/show.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/show.ts @@ -1,7 +1,7 @@ import type { DriveFile } from "@/models/entities/drive-file.js"; -import { DriveFiles, Users } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import { DriveFiles } from "@/models/index.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/drive/files/update.ts b/packages/backend/src/server/api/endpoints/drive/files/update.ts index e833fddb5..bde81e007 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/update.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/update.ts @@ -1,8 +1,8 @@ import { publishDriveStream } from "@/services/stream.js"; import { DriveFiles, DriveFolders, Users } from "@/models/index.js"; import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts b/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts index 7bb47dbef..cdfcb0308 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts @@ -1,5 +1,5 @@ import { uploadFromUrl } from "@/services/drive/upload-from-url.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { DriveFiles } from "@/models/index.js"; import { publishMainStream } from "@/services/stream.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/drive/folders.ts b/packages/backend/src/server/api/endpoints/drive/folders.ts index ed0d38844..d02b4fac6 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { DriveFolders } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/drive/folders/create.ts b/packages/backend/src/server/api/endpoints/drive/folders/create.ts index d50f5f281..554e61ec9 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/create.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/create.ts @@ -1,6 +1,6 @@ import { publishDriveStream } from "@/services/stream.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFolders } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; diff --git a/packages/backend/src/server/api/endpoints/drive/folders/delete.ts b/packages/backend/src/server/api/endpoints/drive/folders/delete.ts index 98895a732..1954b4336 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/delete.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/delete.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { publishDriveStream } from "@/services/stream.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFolders, DriveFiles } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/drive/folders/find.ts b/packages/backend/src/server/api/endpoints/drive/folders/find.ts index 45451fb90..d29015e78 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/find.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/find.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { DriveFolders } from "@/models/index.js"; import { IsNull } from "typeorm"; diff --git a/packages/backend/src/server/api/endpoints/drive/folders/show.ts b/packages/backend/src/server/api/endpoints/drive/folders/show.ts index 6a72a2277..611724ae4 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/show.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/show.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFolders } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/drive/folders/update.ts b/packages/backend/src/server/api/endpoints/drive/folders/update.ts index 13673e9f2..5bd880da8 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/update.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/update.ts @@ -1,6 +1,6 @@ import { publishDriveStream } from "@/services/stream.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFolders } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/drive/stream.ts b/packages/backend/src/server/api/endpoints/drive/stream.ts index 0c9654ca2..cbd786017 100644 --- a/packages/backend/src/server/api/endpoints/drive/stream.ts +++ b/packages/backend/src/server/api/endpoints/drive/stream.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { DriveFiles } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/email-address/available.ts b/packages/backend/src/server/api/endpoints/email-address/available.ts index dc3c5e4b8..eb1d833bd 100644 --- a/packages/backend/src/server/api/endpoints/email-address/available.ts +++ b/packages/backend/src/server/api/endpoints/email-address/available.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { validateEmailForAccount } from "@/services/validate-email-for-account.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/emoji.ts b/packages/backend/src/server/api/endpoints/emoji.ts index f5a5be4ec..2675ba7bd 100644 --- a/packages/backend/src/server/api/endpoints/emoji.ts +++ b/packages/backend/src/server/api/endpoints/emoji.ts @@ -1,7 +1,7 @@ import { IsNull } from "typeorm"; import { Emojis } from "@/models/index.js"; -import define from "../define.js"; -import { ApiError } from "../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/endpoint.ts b/packages/backend/src/server/api/endpoints/endpoint.ts index ad0ce4562..7dd24f7b7 100644 --- a/packages/backend/src/server/api/endpoints/endpoint.ts +++ b/packages/backend/src/server/api/endpoints/endpoint.ts @@ -1,5 +1,5 @@ -import define from "../define.js"; -import endpoints from "../endpoints.js"; +import define from "@/server/api/define.js"; +import endpoints from "@/server/api/endpoints.js"; export const meta = { requireCredential: false, diff --git a/packages/backend/src/server/api/endpoints/endpoints.ts b/packages/backend/src/server/api/endpoints/endpoints.ts index c5844f843..3064fa07e 100644 --- a/packages/backend/src/server/api/endpoints/endpoints.ts +++ b/packages/backend/src/server/api/endpoints/endpoints.ts @@ -1,5 +1,5 @@ -import define from "../define.js"; -import endpoints from "../endpoints.js"; +import define from "@/server/api/define.js"; +import endpoints from "@/server/api/endpoints.js"; export const meta = { requireCredential: false, diff --git a/packages/backend/src/server/api/endpoints/export-custom-emojis.ts b/packages/backend/src/server/api/endpoints/export-custom-emojis.ts index f4fc43c17..ca013314e 100644 --- a/packages/backend/src/server/api/endpoints/export-custom-emojis.ts +++ b/packages/backend/src/server/api/endpoints/export-custom-emojis.ts @@ -1,5 +1,5 @@ import { createExportCustomEmojisJob } from "@/queue/index.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; import { HOUR } from "@/const.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/federation/followers.ts b/packages/backend/src/server/api/endpoints/federation/followers.ts index 4c6d83abd..2a88d27ae 100644 --- a/packages/backend/src/server/api/endpoints/federation/followers.ts +++ b/packages/backend/src/server/api/endpoints/federation/followers.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Followings } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["federation"], diff --git a/packages/backend/src/server/api/endpoints/federation/following.ts b/packages/backend/src/server/api/endpoints/federation/following.ts index 88b168600..c13ee8b19 100644 --- a/packages/backend/src/server/api/endpoints/federation/following.ts +++ b/packages/backend/src/server/api/endpoints/federation/following.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Followings } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["federation"], diff --git a/packages/backend/src/server/api/endpoints/federation/instances.ts b/packages/backend/src/server/api/endpoints/federation/instances.ts index fa1a41531..27a6dabb4 100644 --- a/packages/backend/src/server/api/endpoints/federation/instances.ts +++ b/packages/backend/src/server/api/endpoints/federation/instances.ts @@ -1,5 +1,4 @@ -import config from "@/config/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Instances } from "@/models/index.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; diff --git a/packages/backend/src/server/api/endpoints/federation/show-instance.ts b/packages/backend/src/server/api/endpoints/federation/show-instance.ts index 633bb5707..c4a6304d0 100644 --- a/packages/backend/src/server/api/endpoints/federation/show-instance.ts +++ b/packages/backend/src/server/api/endpoints/federation/show-instance.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Instances } from "@/models/index.js"; import { toPuny } from "@/misc/convert-host.js"; diff --git a/packages/backend/src/server/api/endpoints/federation/stats.ts b/packages/backend/src/server/api/endpoints/federation/stats.ts index ede7a56c2..6702eeff5 100644 --- a/packages/backend/src/server/api/endpoints/federation/stats.ts +++ b/packages/backend/src/server/api/endpoints/federation/stats.ts @@ -1,7 +1,7 @@ import { IsNull, MoreThan, Not } from "typeorm"; import { Followings, Instances } from "@/models/index.js"; import { awaitAll } from "@/prelude/await-all.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["federation"], diff --git a/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts b/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts index f4c3f6d18..e8ada9e62 100644 --- a/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts +++ b/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { getRemoteUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { getRemoteUser } from "@/server/api/common/getters.js"; import { updatePerson } from "@/remote/activitypub/models/person.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/federation/users.ts b/packages/backend/src/server/api/endpoints/federation/users.ts index ded0a26c5..4e925a29e 100644 --- a/packages/backend/src/server/api/endpoints/federation/users.ts +++ b/packages/backend/src/server/api/endpoints/federation/users.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["federation"], diff --git a/packages/backend/src/server/api/endpoints/fetch-rss.ts b/packages/backend/src/server/api/endpoints/fetch-rss.ts index b73d7262c..bda3c455d 100644 --- a/packages/backend/src/server/api/endpoints/fetch-rss.ts +++ b/packages/backend/src/server/api/endpoints/fetch-rss.ts @@ -1,7 +1,7 @@ import Parser from "rss-parser"; import { getResponse } from "@/misc/fetch.js"; import config from "@/config/index.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; const rssParser = new Parser(); diff --git a/packages/backend/src/server/api/endpoints/following/create.ts b/packages/backend/src/server/api/endpoints/following/create.ts index 48ae6ae7a..f6e341ad7 100644 --- a/packages/backend/src/server/api/endpoints/following/create.ts +++ b/packages/backend/src/server/api/endpoints/following/create.ts @@ -1,7 +1,7 @@ import create from "@/services/following/create.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { Followings, Users } from "@/models/index.js"; import { IdentifiableError } from "@/misc/identifiable-error.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/following/delete.ts b/packages/backend/src/server/api/endpoints/following/delete.ts index cbc6097f4..3ef031eb2 100644 --- a/packages/backend/src/server/api/endpoints/following/delete.ts +++ b/packages/backend/src/server/api/endpoints/following/delete.ts @@ -1,7 +1,7 @@ import deleteFollowing from "@/services/following/delete.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { Followings, Users } from "@/models/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/following/invalidate.ts b/packages/backend/src/server/api/endpoints/following/invalidate.ts index 01ccc2761..7559062c0 100644 --- a/packages/backend/src/server/api/endpoints/following/invalidate.ts +++ b/packages/backend/src/server/api/endpoints/following/invalidate.ts @@ -1,7 +1,7 @@ import deleteFollowing from "@/services/following/delete.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { Followings, Users } from "@/models/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/following/requests/accept.ts b/packages/backend/src/server/api/endpoints/following/requests/accept.ts index a4fc05236..cb6b01072 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/accept.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/accept.ts @@ -1,7 +1,7 @@ import acceptFollowRequest from "@/services/following/requests/accept.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getUser } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; export const meta = { tags: ["following", "account"], diff --git a/packages/backend/src/server/api/endpoints/following/requests/cancel.ts b/packages/backend/src/server/api/endpoints/following/requests/cancel.ts index f309e3299..7acb0f948 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/cancel.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/cancel.ts @@ -1,7 +1,7 @@ import cancelFollowRequest from "@/services/following/requests/cancel.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getUser } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { Users } from "@/models/index.js"; import { IdentifiableError } from "@/misc/identifiable-error.js"; diff --git a/packages/backend/src/server/api/endpoints/following/requests/list.ts b/packages/backend/src/server/api/endpoints/following/requests/list.ts index 6ba23de58..97f52d4ac 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/list.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/list.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { FollowRequests } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/following/requests/reject.ts b/packages/backend/src/server/api/endpoints/following/requests/reject.ts index fedc0db48..37e7bc0ab 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/reject.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/reject.ts @@ -1,7 +1,7 @@ import { rejectFollowRequest } from "@/services/following/reject.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getUser } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; export const meta = { tags: ["following", "account"], diff --git a/packages/backend/src/server/api/endpoints/gallery/featured.ts b/packages/backend/src/server/api/endpoints/gallery/featured.ts index d478e8e3b..e20e4ab20 100644 --- a/packages/backend/src/server/api/endpoints/gallery/featured.ts +++ b/packages/backend/src/server/api/endpoints/gallery/featured.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { GalleryPosts } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/gallery/popular.ts b/packages/backend/src/server/api/endpoints/gallery/popular.ts index 5eef68d97..805307e45 100644 --- a/packages/backend/src/server/api/endpoints/gallery/popular.ts +++ b/packages/backend/src/server/api/endpoints/gallery/popular.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { GalleryPosts } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/gallery/posts.ts b/packages/backend/src/server/api/endpoints/gallery/posts.ts index f97c161af..0dd02b930 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; import { GalleryPosts } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/create.ts b/packages/backend/src/server/api/endpoints/gallery/posts/create.ts index f3b3768e2..a74f2165c 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/create.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/create.ts @@ -1,8 +1,7 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { DriveFiles, GalleryPosts } from "@/models/index.js"; -import { genId } from "../../../../../misc/gen-id.js"; +import { genId } from "@/server/api/../../misc/gen-id.js"; import { GalleryPost } from "@/models/entities/gallery-post.js"; -import { ApiError } from "../../../error.js"; import type { DriveFile } from "@/models/entities/drive-file.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts b/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts index 9fd9a5009..360ca8c5a 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { GalleryPosts } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/like.ts b/packages/backend/src/server/api/endpoints/gallery/posts/like.ts index 2506e40aa..f5ccc5bc6 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/like.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/like.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { GalleryPosts, GalleryLikes } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/show.ts b/packages/backend/src/server/api/endpoints/gallery/posts/show.ts index 87e272f01..7e172da45 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/show.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/show.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { GalleryPosts } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts b/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts index 03bc299b9..f37456a62 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { GalleryPosts, GalleryLikes } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/update.ts b/packages/backend/src/server/api/endpoints/gallery/posts/update.ts index 64e204172..16c629706 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/update.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/update.ts @@ -1,7 +1,5 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { DriveFiles, GalleryPosts } from "@/models/index.js"; -import { GalleryPost } from "@/models/entities/gallery-post.js"; -import { ApiError } from "../../../error.js"; import type { DriveFile } from "@/models/entities/drive-file.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/get-online-users-count.ts b/packages/backend/src/server/api/endpoints/get-online-users-count.ts index 805674a5b..633e75335 100644 --- a/packages/backend/src/server/api/endpoints/get-online-users-count.ts +++ b/packages/backend/src/server/api/endpoints/get-online-users-count.ts @@ -1,7 +1,7 @@ import { MoreThan } from "typeorm"; import { USER_ONLINE_THRESHOLD } from "@/const.js"; import { Users } from "@/models/index.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/get-sounds.ts b/packages/backend/src/server/api/endpoints/get-sounds.ts index f7edd3860..4fd1498bd 100644 --- a/packages/backend/src/server/api/endpoints/get-sounds.ts +++ b/packages/backend/src/server/api/endpoints/get-sounds.ts @@ -1,5 +1,5 @@ import { readdir } from "fs/promises"; -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/hashtags/list.ts b/packages/backend/src/server/api/endpoints/hashtags/list.ts index df99a1e5a..6e8016f64 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/list.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/list.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Hashtags } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/hashtags/search.ts b/packages/backend/src/server/api/endpoints/hashtags/search.ts index cde586af0..1dc1fb492 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/search.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/search.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Hashtags } from "@/models/index.js"; import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; diff --git a/packages/backend/src/server/api/endpoints/hashtags/show.ts b/packages/backend/src/server/api/endpoints/hashtags/show.ts index 8cf90e450..09849dbd3 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/show.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/show.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Hashtags } from "@/models/index.js"; import { normalizeForSearch } from "@/misc/normalize-for-search.js"; diff --git a/packages/backend/src/server/api/endpoints/hashtags/trend.ts b/packages/backend/src/server/api/endpoints/hashtags/trend.ts index e2a834511..fe8bba95f 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/trend.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/trend.ts @@ -1,5 +1,5 @@ import { Brackets } from "typeorm"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { Notes } from "@/models/index.js"; import type { Note } from "@/models/entities/note.js"; diff --git a/packages/backend/src/server/api/endpoints/hashtags/users.ts b/packages/backend/src/server/api/endpoints/hashtags/users.ts index 532c66307..ccb70a059 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/users.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/users.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; import { normalizeForSearch } from "@/misc/normalize-for-search.js"; diff --git a/packages/backend/src/server/api/endpoints/i.ts b/packages/backend/src/server/api/endpoints/i.ts index 39543442c..69eabf4d2 100644 --- a/packages/backend/src/server/api/endpoints/i.ts +++ b/packages/backend/src/server/api/endpoints/i.ts @@ -1,5 +1,5 @@ import { Users } from "@/models/index.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/i/2fa/done.ts b/packages/backend/src/server/api/endpoints/i/2fa/done.ts index 05d57d282..c1a7b16a8 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/done.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/done.ts @@ -1,6 +1,6 @@ import { publishMainStream } from "@/services/stream.js"; import * as OTPAuth from "otpauth"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Users, UserProfiles } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts b/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts index 9ea437b03..b8104e318 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts @@ -1,5 +1,5 @@ import { decode } from "cbor-x"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { UserProfiles, UserSecurityKeys, @@ -7,7 +7,7 @@ import { Users, } from "@/models/index.js"; import config from "@/config/index.js"; -import { procedures, hash } from "../../../2fa.js"; +import { procedures, hash } from "@/server/api/2fa.js"; import { publishMainStream } from "@/services/stream.js"; import { comparePassword } from "@/misc/password.js"; diff --git a/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts b/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts index b9f342680..8125f817a 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts @@ -1,7 +1,7 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Users, UserProfiles, UserSecurityKeys } from "@/models/index.js"; import { publishMainStream } from "@/services/stream.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts b/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts index a10dc9b25..8080c9390 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts @@ -1,9 +1,9 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { UserProfiles, AttestationChallenges } from "@/models/index.js"; import { promisify } from "node:util"; import * as crypto from "node:crypto"; import { genId } from "@/misc/gen-id.js"; -import { hash } from "../../../2fa.js"; +import { hash } from "@/server/api/2fa.js"; import { comparePassword } from "@/misc/password.js"; const randomBytes = promisify(crypto.randomBytes); diff --git a/packages/backend/src/server/api/endpoints/i/2fa/register.ts b/packages/backend/src/server/api/endpoints/i/2fa/register.ts index cf391ca2f..52e1df39f 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/register.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/register.ts @@ -2,7 +2,7 @@ import * as OTPAuth from "otpauth"; import * as QRCode from "qrcode"; import config from "@/config/index.js"; import { UserProfiles } from "@/models/index.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { comparePassword } from "@/misc/password.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts b/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts index d91c8f214..b3bc5bdfa 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts @@ -1,5 +1,5 @@ import { comparePassword } from "@/misc/password.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { UserProfiles, UserSecurityKeys, Users } from "@/models/index.js"; import { publishMainStream } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts b/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts index 54f1422d4..c4e78eecb 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts @@ -1,5 +1,5 @@ import { publishMainStream } from "@/services/stream.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Users, UserProfiles } from "@/models/index.js"; import { comparePassword } from "@/misc/password.js"; diff --git a/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts b/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts index 7587ec780..d77ecc88e 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts @@ -1,7 +1,7 @@ import { publishMainStream } from "@/services/stream.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Users, UserSecurityKeys } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/i/apps.ts b/packages/backend/src/server/api/endpoints/i/apps.ts index b95160194..7e7574ec9 100644 --- a/packages/backend/src/server/api/endpoints/i/apps.ts +++ b/packages/backend/src/server/api/endpoints/i/apps.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { AccessTokens } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/authorized-apps.ts b/packages/backend/src/server/api/endpoints/i/authorized-apps.ts index f759b2303..ad66fe1fd 100644 --- a/packages/backend/src/server/api/endpoints/i/authorized-apps.ts +++ b/packages/backend/src/server/api/endpoints/i/authorized-apps.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { AccessTokens, Apps } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/change-password.ts b/packages/backend/src/server/api/endpoints/i/change-password.ts index 8bbb3ad93..b0dc8bba6 100644 --- a/packages/backend/src/server/api/endpoints/i/change-password.ts +++ b/packages/backend/src/server/api/endpoints/i/change-password.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { UserProfiles } from "@/models/index.js"; import { hashPassword, comparePassword } from "@/misc/password.js"; diff --git a/packages/backend/src/server/api/endpoints/i/delete-account.ts b/packages/backend/src/server/api/endpoints/i/delete-account.ts index 781abe0b3..606cde82e 100644 --- a/packages/backend/src/server/api/endpoints/i/delete-account.ts +++ b/packages/backend/src/server/api/endpoints/i/delete-account.ts @@ -1,6 +1,6 @@ import { UserProfiles, Users } from "@/models/index.js"; import { deleteAccount } from "@/services/delete-account.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { comparePassword } from "@/misc/password.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/export-blocking.ts b/packages/backend/src/server/api/endpoints/i/export-blocking.ts index 4517ad5fa..30e74ab2f 100644 --- a/packages/backend/src/server/api/endpoints/i/export-blocking.ts +++ b/packages/backend/src/server/api/endpoints/i/export-blocking.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createExportBlockingJob } from "@/queue/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/i/export-following.ts b/packages/backend/src/server/api/endpoints/i/export-following.ts index a228de8f1..07d2997a1 100644 --- a/packages/backend/src/server/api/endpoints/i/export-following.ts +++ b/packages/backend/src/server/api/endpoints/i/export-following.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createExportFollowingJob } from "@/queue/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/i/export-mute.ts b/packages/backend/src/server/api/endpoints/i/export-mute.ts index 7bddc434d..7d22a073e 100644 --- a/packages/backend/src/server/api/endpoints/i/export-mute.ts +++ b/packages/backend/src/server/api/endpoints/i/export-mute.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createExportMuteJob } from "@/queue/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/i/export-notes.ts b/packages/backend/src/server/api/endpoints/i/export-notes.ts index 48506ed6d..f167bb83c 100644 --- a/packages/backend/src/server/api/endpoints/i/export-notes.ts +++ b/packages/backend/src/server/api/endpoints/i/export-notes.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createExportNotesJob } from "@/queue/index.js"; import { DAY } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/i/export-user-lists.ts b/packages/backend/src/server/api/endpoints/i/export-user-lists.ts index a71b1730b..b68d889dc 100644 --- a/packages/backend/src/server/api/endpoints/i/export-user-lists.ts +++ b/packages/backend/src/server/api/endpoints/i/export-user-lists.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createExportUserListsJob } from "@/queue/index.js"; import { MINUTE } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/i/favorites.ts b/packages/backend/src/server/api/endpoints/i/favorites.ts index f0dbd2de6..f0961ea23 100644 --- a/packages/backend/src/server/api/endpoints/i/favorites.ts +++ b/packages/backend/src/server/api/endpoints/i/favorites.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { NoteFavorites } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["account", "notes", "favorites"], diff --git a/packages/backend/src/server/api/endpoints/i/gallery/likes.ts b/packages/backend/src/server/api/endpoints/i/gallery/likes.ts index d71ee3e5a..80c90e684 100644 --- a/packages/backend/src/server/api/endpoints/i/gallery/likes.ts +++ b/packages/backend/src/server/api/endpoints/i/gallery/likes.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { GalleryLikes } from "@/models/index.js"; -import { makePaginationQuery } from "../../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["account", "gallery"], diff --git a/packages/backend/src/server/api/endpoints/i/gallery/posts.ts b/packages/backend/src/server/api/endpoints/i/gallery/posts.ts index e471731ae..054784842 100644 --- a/packages/backend/src/server/api/endpoints/i/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/i/gallery/posts.ts @@ -1,6 +1,6 @@ import { GalleryPosts } from "@/models/index.js"; -import define from "../../../define.js"; -import { makePaginationQuery } from "../../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["account", "gallery"], diff --git a/packages/backend/src/server/api/endpoints/i/get-word-muted-notes-count.ts b/packages/backend/src/server/api/endpoints/i/get-word-muted-notes-count.ts index bd58f9257..39cc45e82 100644 --- a/packages/backend/src/server/api/endpoints/i/get-word-muted-notes-count.ts +++ b/packages/backend/src/server/api/endpoints/i/get-word-muted-notes-count.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { MutedNotes } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/import-blocking.ts b/packages/backend/src/server/api/endpoints/i/import-blocking.ts index e4f1da60c..58314aced 100644 --- a/packages/backend/src/server/api/endpoints/i/import-blocking.ts +++ b/packages/backend/src/server/api/endpoints/i/import-blocking.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createImportBlockingJob } from "@/queue/index.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFiles } from "@/models/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/i/import-following.ts b/packages/backend/src/server/api/endpoints/i/import-following.ts index 1a6c9b565..b7c475698 100644 --- a/packages/backend/src/server/api/endpoints/i/import-following.ts +++ b/packages/backend/src/server/api/endpoints/i/import-following.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createImportFollowingJob } from "@/queue/index.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFiles } from "@/models/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/i/import-muting.ts b/packages/backend/src/server/api/endpoints/i/import-muting.ts index 20d240e73..494fb0d42 100644 --- a/packages/backend/src/server/api/endpoints/i/import-muting.ts +++ b/packages/backend/src/server/api/endpoints/i/import-muting.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createImportMutingJob } from "@/queue/index.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFiles } from "@/models/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/i/import-posts.ts b/packages/backend/src/server/api/endpoints/i/import-posts.ts index 3adba0514..b8b52be98 100644 --- a/packages/backend/src/server/api/endpoints/i/import-posts.ts +++ b/packages/backend/src/server/api/endpoints/i/import-posts.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createImportPostsJob } from "@/queue/index.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFiles } from "@/models/index.js"; import { DAY } from "@/const.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; diff --git a/packages/backend/src/server/api/endpoints/i/import-user-lists.ts b/packages/backend/src/server/api/endpoints/i/import-user-lists.ts index 03b1dffbb..ed82a9605 100644 --- a/packages/backend/src/server/api/endpoints/i/import-user-lists.ts +++ b/packages/backend/src/server/api/endpoints/i/import-user-lists.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createImportUserListsJob } from "@/queue/index.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFiles } from "@/models/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/i/known-as.ts b/packages/backend/src/server/api/endpoints/i/known-as.ts index 384cbd7c3..39bf6fff8 100644 --- a/packages/backend/src/server/api/endpoints/i/known-as.ts +++ b/packages/backend/src/server/api/endpoints/i/known-as.ts @@ -5,9 +5,9 @@ import acceptAllFollowRequests from "@/services/following/requests/accept-all.js import { publishToFollowers } from "@/services/i/update.js"; import { publishMainStream } from "@/services/stream.js"; import { DAY } from "@/const.js"; -import { apiLogger } from "../../logger.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import { apiLogger } from "@/server/api/logger.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { parse } from "@/misc/acct.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/move.ts b/packages/backend/src/server/api/endpoints/i/move.ts index 2c064e1d6..c6d1205f9 100644 --- a/packages/backend/src/server/api/endpoints/i/move.ts +++ b/packages/backend/src/server/api/endpoints/i/move.ts @@ -3,9 +3,9 @@ import { resolveUser } from "@/remote/resolve-user.js"; import { DAY } from "@/const.js"; import DeliverManager from "@/remote/activitypub/deliver-manager.js"; import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { apiLogger } from "../../logger.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { apiLogger } from "@/server/api/logger.js"; import deleteFollowing from "@/services/following/delete.js"; import create from "@/services/following/create.js"; import { getUser } from "@/server/api/common/getters.js"; diff --git a/packages/backend/src/server/api/endpoints/i/notifications.ts b/packages/backend/src/server/api/endpoints/i/notifications.ts index 6e1aabef7..b07247dd8 100644 --- a/packages/backend/src/server/api/endpoints/i/notifications.ts +++ b/packages/backend/src/server/api/endpoints/i/notifications.ts @@ -8,9 +8,9 @@ import { } from "@/models/index.js"; import { notificationTypes } from "@/types.js"; import read from "@/services/note/read.js"; -import { readNotification } from "../../common/read-notification.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { readNotification } from "@/server/api/common/read-notification.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["account", "notifications"], diff --git a/packages/backend/src/server/api/endpoints/i/page-likes.ts b/packages/backend/src/server/api/endpoints/i/page-likes.ts index 1be783a06..289d07267 100644 --- a/packages/backend/src/server/api/endpoints/i/page-likes.ts +++ b/packages/backend/src/server/api/endpoints/i/page-likes.ts @@ -1,6 +1,6 @@ import { PageLikes } from "@/models/index.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["account", "pages"], diff --git a/packages/backend/src/server/api/endpoints/i/pages.ts b/packages/backend/src/server/api/endpoints/i/pages.ts index 78b72e3bc..1177d2e66 100644 --- a/packages/backend/src/server/api/endpoints/i/pages.ts +++ b/packages/backend/src/server/api/endpoints/i/pages.ts @@ -1,6 +1,6 @@ import { Pages } from "@/models/index.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["account", "pages"], diff --git a/packages/backend/src/server/api/endpoints/i/pin.ts b/packages/backend/src/server/api/endpoints/i/pin.ts index 752070526..4291541ea 100644 --- a/packages/backend/src/server/api/endpoints/i/pin.ts +++ b/packages/backend/src/server/api/endpoints/i/pin.ts @@ -1,6 +1,6 @@ import { addPinned } from "@/services/i/pin.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Users } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/read-all-messaging-messages.ts b/packages/backend/src/server/api/endpoints/i/read-all-messaging-messages.ts index 033367727..505c424ed 100644 --- a/packages/backend/src/server/api/endpoints/i/read-all-messaging-messages.ts +++ b/packages/backend/src/server/api/endpoints/i/read-all-messaging-messages.ts @@ -1,5 +1,5 @@ import { publishMainStream } from "@/services/stream.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { MessagingMessages, UserGroupJoinings } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts b/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts index 8a8857c83..6f70e55a1 100644 --- a/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts +++ b/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts @@ -1,5 +1,5 @@ import { publishMainStream } from "@/services/stream.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { NoteUnreads } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/read-announcement.ts b/packages/backend/src/server/api/endpoints/i/read-announcement.ts index d0dfa6657..a59d15b99 100644 --- a/packages/backend/src/server/api/endpoints/i/read-announcement.ts +++ b/packages/backend/src/server/api/endpoints/i/read-announcement.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { genId } from "@/misc/gen-id.js"; import { AnnouncementReads, Announcements, Users } from "@/models/index.js"; import { publishMainStream } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/i/regenerate-token.ts b/packages/backend/src/server/api/endpoints/i/regenerate-token.ts index b5b34c090..c1b4325ad 100644 --- a/packages/backend/src/server/api/endpoints/i/regenerate-token.ts +++ b/packages/backend/src/server/api/endpoints/i/regenerate-token.ts @@ -3,8 +3,8 @@ import { publishMainStream, publishUserEvent, } from "@/services/stream.js"; -import generateUserToken from "../../common/generate-native-user-token.js"; -import define from "../../define.js"; +import generateUserToken from "@/server/api/common/generate-native-user-token.js"; +import define from "@/server/api/define.js"; import { Users, UserProfiles } from "@/models/index.js"; import { comparePassword } from "@/misc/password.js"; diff --git a/packages/backend/src/server/api/endpoints/i/registry/get-all.ts b/packages/backend/src/server/api/endpoints/i/registry/get-all.ts index ee9fe7e9d..c267bb144 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get-all.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get-all.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { RegistryItems } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts b/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts index 85900bd74..57db3c714 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { RegistryItems } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts b/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts index a9bcf6935..ac37beea5 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts @@ -1,5 +1,5 @@ -import { ApiError } from "../../../error.js"; -import define from "../../../define.js"; +import { ApiError } from "@/server/api/error.js"; +import define from "@/server/api/define.js"; import { RegistryItems } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/registry/get.ts b/packages/backend/src/server/api/endpoints/i/registry/get.ts index b143b7228..d25047e00 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { RegistryItems } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts b/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts index 23698dc53..f691552bc 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { RegistryItems } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/registry/keys.ts b/packages/backend/src/server/api/endpoints/i/registry/keys.ts index ad7d08c5a..186e744bd 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/keys.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/keys.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { RegistryItems } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/registry/remove.ts b/packages/backend/src/server/api/endpoints/i/registry/remove.ts index d3793b0e2..aa459952e 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/remove.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/remove.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { RegistryItems } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/i/registry/scopes.ts b/packages/backend/src/server/api/endpoints/i/registry/scopes.ts index 3d66359c1..e235ef67f 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/scopes.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/scopes.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { RegistryItems } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/registry/set.ts b/packages/backend/src/server/api/endpoints/i/registry/set.ts index 7f9eebd5e..7a1f8ab5f 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/set.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/set.ts @@ -1,5 +1,5 @@ import { publishMainStream } from "@/services/stream.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { RegistryItems } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; diff --git a/packages/backend/src/server/api/endpoints/i/revoke-token.ts b/packages/backend/src/server/api/endpoints/i/revoke-token.ts index 3a410fa0e..f3e811694 100644 --- a/packages/backend/src/server/api/endpoints/i/revoke-token.ts +++ b/packages/backend/src/server/api/endpoints/i/revoke-token.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { AccessTokens } from "@/models/index.js"; import { publishUserEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/i/signin-history.ts b/packages/backend/src/server/api/endpoints/i/signin-history.ts index 288b750b7..14d303089 100644 --- a/packages/backend/src/server/api/endpoints/i/signin-history.ts +++ b/packages/backend/src/server/api/endpoints/i/signin-history.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Signins } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/i/unpin.ts b/packages/backend/src/server/api/endpoints/i/unpin.ts index c248eb34e..9aee1dfea 100644 --- a/packages/backend/src/server/api/endpoints/i/unpin.ts +++ b/packages/backend/src/server/api/endpoints/i/unpin.ts @@ -1,6 +1,6 @@ import { removePinned } from "@/services/i/pin.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Users } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/update-email.ts b/packages/backend/src/server/api/endpoints/i/update-email.ts index 94ad6b3c7..a48252ed1 100644 --- a/packages/backend/src/server/api/endpoints/i/update-email.ts +++ b/packages/backend/src/server/api/endpoints/i/update-email.ts @@ -1,10 +1,10 @@ import { publishMainStream } from "@/services/stream.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import rndstr from "rndstr"; import config from "@/config/index.js"; import { Users, UserProfiles } from "@/models/index.js"; import { sendEmail } from "@/services/send-email.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { validateEmailForAccount } from "@/services/validate-email-for-account.js"; import { HOUR } from "@/const.js"; import { comparePassword } from "@/misc/password.js"; diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index 0037839b5..082108383 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -13,9 +13,8 @@ import { notificationTypes } from "@/types.js"; import { normalizeForSearch } from "@/misc/normalize-for-search.js"; import { langmap } from "@/misc/langmap.js"; import { verifyLink } from "@/services/fetch-rel-me.js"; -import { ApiError } from "../../error.js"; -import config from "@/config/index.js"; -import define from "../../define.js"; +import { ApiError } from "@/server/api/error.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/i/user-group-invites.ts b/packages/backend/src/server/api/endpoints/i/user-group-invites.ts index d0c6caf0e..99e8209a3 100644 --- a/packages/backend/src/server/api/endpoints/i/user-group-invites.ts +++ b/packages/backend/src/server/api/endpoints/i/user-group-invites.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { UserGroupInvitations } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["account", "groups"], diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/create.ts b/packages/backend/src/server/api/endpoints/i/webhooks/create.ts index 2b0f1781e..ee38b7637 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/create.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/create.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { genId } from "@/misc/gen-id.js"; import { Webhooks } from "@/models/index.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts b/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts index 4a2c3d83b..a92ed179d 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Webhooks } from "@/models/index.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/list.ts b/packages/backend/src/server/api/endpoints/i/webhooks/list.ts index 3afead599..f937e560c 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/list.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/list.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Webhooks } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/show.ts b/packages/backend/src/server/api/endpoints/i/webhooks/show.ts index 96c045747..b24850f5e 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/show.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/show.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Webhooks } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/update.ts b/packages/backend/src/server/api/endpoints/i/webhooks/update.ts index 161d705e1..4a211b915 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/update.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/update.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Webhooks } from "@/models/index.js"; import { publishInternalEvent } from "@/services/stream.js"; import { webhookEventTypes } from "@/models/entities/webhook.js"; diff --git a/packages/backend/src/server/api/endpoints/latest-version.ts b/packages/backend/src/server/api/endpoints/latest-version.ts index 4d07406d1..a5c00e7a4 100644 --- a/packages/backend/src/server/api/endpoints/latest-version.ts +++ b/packages/backend/src/server/api/endpoints/latest-version.ts @@ -1,4 +1,4 @@ -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/messaging/history.ts b/packages/backend/src/server/api/endpoints/messaging/history.ts index 7d1df6985..25418a17a 100644 --- a/packages/backend/src/server/api/endpoints/messaging/history.ts +++ b/packages/backend/src/server/api/endpoints/messaging/history.ts @@ -5,7 +5,7 @@ import { Mutings, UserGroupJoinings, } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["messaging"], diff --git a/packages/backend/src/server/api/endpoints/messaging/messages.ts b/packages/backend/src/server/api/endpoints/messaging/messages.ts index 17f626b69..01f702867 100644 --- a/packages/backend/src/server/api/endpoints/messaging/messages.ts +++ b/packages/backend/src/server/api/endpoints/messaging/messages.ts @@ -1,19 +1,19 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { MessagingMessages, UserGroups, UserGroupJoinings, Users, } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; import { Brackets } from "typeorm"; import { readUserMessagingMessage, readGroupMessagingMessage, deliverReadActivity, -} from "../../common/read-messaging-message.js"; +} from "@/server/api/common/read-messaging-message.js"; export const meta = { tags: ["messaging"], diff --git a/packages/backend/src/server/api/endpoints/messaging/messages/create.ts b/packages/backend/src/server/api/endpoints/messaging/messages/create.ts index 4ffbb0699..6fd38eff7 100644 --- a/packages/backend/src/server/api/endpoints/messaging/messages/create.ts +++ b/packages/backend/src/server/api/endpoints/messaging/messages/create.ts @@ -1,8 +1,7 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getUser } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { - MessagingMessages, DriveFiles, UserGroups, UserGroupJoinings, diff --git a/packages/backend/src/server/api/endpoints/messaging/messages/delete.ts b/packages/backend/src/server/api/endpoints/messaging/messages/delete.ts index 42ff050d1..76691dd34 100644 --- a/packages/backend/src/server/api/endpoints/messaging/messages/delete.ts +++ b/packages/backend/src/server/api/endpoints/messaging/messages/delete.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { MessagingMessages } from "@/models/index.js"; import { deleteMessage } from "@/services/messages/delete.js"; import { SECOND, HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/messaging/messages/read.ts b/packages/backend/src/server/api/endpoints/messaging/messages/read.ts index 0ef013b79..5aa50155c 100644 --- a/packages/backend/src/server/api/endpoints/messaging/messages/read.ts +++ b/packages/backend/src/server/api/endpoints/messaging/messages/read.ts @@ -1,10 +1,10 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { MessagingMessages } from "@/models/index.js"; import { readUserMessagingMessage, readGroupMessagingMessage, -} from "../../../common/read-messaging-message.js"; +} from "@/server/api/common/read-messaging-message.js"; export const meta = { tags: ["messaging"], diff --git a/packages/backend/src/server/api/endpoints/meta.ts b/packages/backend/src/server/api/endpoints/meta.ts index 8c521fcff..03cf0fb63 100644 --- a/packages/backend/src/server/api/endpoints/meta.ts +++ b/packages/backend/src/server/api/endpoints/meta.ts @@ -4,7 +4,7 @@ import config from "@/config/index.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { Ads, Emojis, Users } from "@/models/index.js"; import { MAX_NOTE_TEXT_LENGTH, MAX_CAPTION_TEXT_LENGTH } from "@/const.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/miauth/gen-token.ts b/packages/backend/src/server/api/endpoints/miauth/gen-token.ts index 0525d79a7..bca09d3f0 100644 --- a/packages/backend/src/server/api/endpoints/miauth/gen-token.ts +++ b/packages/backend/src/server/api/endpoints/miauth/gen-token.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { AccessTokens } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import { secureRndstr } from "@/misc/secure-rndstr.js"; diff --git a/packages/backend/src/server/api/endpoints/mute/create.ts b/packages/backend/src/server/api/endpoints/mute/create.ts index 7b2f10905..2eb935198 100644 --- a/packages/backend/src/server/api/endpoints/mute/create.ts +++ b/packages/backend/src/server/api/endpoints/mute/create.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { genId } from "@/misc/gen-id.js"; import { Mutings, NoteWatchings } from "@/models/index.js"; import type { Muting } from "@/models/entities/muting.js"; diff --git a/packages/backend/src/server/api/endpoints/mute/delete.ts b/packages/backend/src/server/api/endpoints/mute/delete.ts index cd00c1a8a..8058e9a61 100644 --- a/packages/backend/src/server/api/endpoints/mute/delete.ts +++ b/packages/backend/src/server/api/endpoints/mute/delete.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { Mutings } from "@/models/index.js"; import { publishUserEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/mute/list.ts b/packages/backend/src/server/api/endpoints/mute/list.ts index 7bbe29a4c..9619457cd 100644 --- a/packages/backend/src/server/api/endpoints/mute/list.ts +++ b/packages/backend/src/server/api/endpoints/mute/list.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; import { Mutings } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/my/apps.ts b/packages/backend/src/server/api/endpoints/my/apps.ts index 8a097c8a0..bc75b38e5 100644 --- a/packages/backend/src/server/api/endpoints/my/apps.ts +++ b/packages/backend/src/server/api/endpoints/my/apps.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Apps } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/notes.ts b/packages/backend/src/server/api/endpoints/notes.ts index 9787740ab..6e2d3b4f3 100644 --- a/packages/backend/src/server/api/endpoints/notes.ts +++ b/packages/backend/src/server/api/endpoints/notes.ts @@ -1,6 +1,6 @@ import { Notes } from "@/models/index.js"; -import define from "../define.js"; -import { makePaginationQuery } from "../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/children.ts b/packages/backend/src/server/api/endpoints/notes/children.ts index a35b17a02..d76771c34 100644 --- a/packages/backend/src/server/api/endpoints/notes/children.ts +++ b/packages/backend/src/server/api/endpoints/notes/children.ts @@ -1,9 +1,9 @@ import { Notes } from "@/models/index.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/clips.ts b/packages/backend/src/server/api/endpoints/notes/clips.ts index 34b035add..430ed02ec 100644 --- a/packages/backend/src/server/api/endpoints/notes/clips.ts +++ b/packages/backend/src/server/api/endpoints/notes/clips.ts @@ -1,8 +1,8 @@ import { In } from "typeorm"; import { ClipNotes, Clips } from "@/models/index.js"; -import define from "../../define.js"; -import { getNote } from "../../common/getters.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["clips", "notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/conversation.ts b/packages/backend/src/server/api/endpoints/notes/conversation.ts index c74da2ec7..993974087 100644 --- a/packages/backend/src/server/api/endpoints/notes/conversation.ts +++ b/packages/backend/src/server/api/endpoints/notes/conversation.ts @@ -1,8 +1,8 @@ import type { Note } from "@/models/entities/note.js"; import { Notes } from "@/models/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getNote } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getNote } from "@/server/api/common/getters.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/create.ts b/packages/backend/src/server/api/endpoints/notes/create.ts index 150356811..0465d09ec 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -12,11 +12,11 @@ import type { DriveFile } from "@/models/entities/drive-file.js"; import type { Note } from "@/models/entities/note.js"; import type { Channel } from "@/models/entities/channel.js"; import { MAX_NOTE_TEXT_LENGTH } from "@/const.js"; -import { noteVisibilities } from "../../../../types.js"; -import { ApiError } from "../../error.js"; -import define from "../../define.js"; +import { noteVisibilities } from "@/types.js"; +import { ApiError } from "@/server/api/error.js"; +import define from "@/server/api/define.js"; import { HOUR } from "@/const.js"; -import { getNote } from "../../common/getters.js"; +import { getNote } from "@/server/api/common/getters.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/delete.ts b/packages/backend/src/server/api/endpoints/notes/delete.ts index 5fc79db7d..54aad1eba 100644 --- a/packages/backend/src/server/api/endpoints/notes/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/delete.ts @@ -1,8 +1,8 @@ import deleteNote from "@/services/note/delete.js"; import { Users } from "@/models/index.js"; -import define from "../../define.js"; -import { getNote } from "../../common/getters.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; import { SECOND, HOUR } from "@/const.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/notes/edit.ts b/packages/backend/src/server/api/endpoints/notes/edit.ts index e6d39c524..a0869e410 100644 --- a/packages/backend/src/server/api/endpoints/notes/edit.ts +++ b/packages/backend/src/server/api/endpoints/notes/edit.ts @@ -1,5 +1,5 @@ import { In } from "typeorm"; -import create, { index } from "@/services/note/create.js"; +import { index } from "@/services/note/create.js"; import type { IRemoteUser, User } from "@/models/entities/user.js"; import { Users, @@ -15,11 +15,11 @@ import type { DriveFile } from "@/models/entities/drive-file.js"; import type { IMentionedRemoteUsers, Note } from "@/models/entities/note.js"; import type { Channel } from "@/models/entities/channel.js"; import { MAX_NOTE_TEXT_LENGTH } from "@/const.js"; -import { noteVisibilities } from "../../../../types.js"; -import { ApiError } from "../../error.js"; -import define from "../../define.js"; +import { noteVisibilities } from "@/types.js"; +import { ApiError } from "@/server/api/error.js"; +import define from "@/server/api/define.js"; import { HOUR } from "@/const.js"; -import { getNote } from "../../common/getters.js"; +import { getNote } from "@/server/api/common/getters.js"; import { Poll } from "@/models/entities/poll.js"; import * as mfm from "mfm-js"; import { concat } from "@/prelude/array.js"; @@ -34,7 +34,6 @@ import renderNote from "@/remote/activitypub/renderer/note.js"; import renderUpdate from "@/remote/activitypub/renderer/update.js"; import { deliverToRelays } from "@/services/relay.js"; // import { deliverQuestionUpdate } from "@/services/note/polls/update.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; import { langmap } from "@/misc/langmap.js"; import detectLanguage from "@/misc/detect-language.js"; diff --git a/packages/backend/src/server/api/endpoints/notes/favorites/create.ts b/packages/backend/src/server/api/endpoints/notes/favorites/create.ts index 64862a373..8b2c7ad3a 100644 --- a/packages/backend/src/server/api/endpoints/notes/favorites/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/favorites/create.ts @@ -1,8 +1,8 @@ import { NoteFavorites } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getNote } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getNote } from "@/server/api/common/getters.js"; export const meta = { tags: ["notes", "favorites"], diff --git a/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts b/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts index e05d04a96..018ef91bc 100644 --- a/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts @@ -1,7 +1,7 @@ import { NoteFavorites } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getNote } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getNote } from "@/server/api/common/getters.js"; export const meta = { tags: ["notes", "favorites"], diff --git a/packages/backend/src/server/api/endpoints/notes/featured.ts b/packages/backend/src/server/api/endpoints/notes/featured.ts index 47c1e1381..4f90145ec 100644 --- a/packages/backend/src/server/api/endpoints/notes/featured.ts +++ b/packages/backend/src/server/api/endpoints/notes/featured.ts @@ -1,7 +1,7 @@ import { Notes } from "@/models/index.js"; -import define from "../../define.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import define from "@/server/api/define.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/global-timeline.ts b/packages/backend/src/server/api/endpoints/notes/global-timeline.ts index 0a365a6df..fee660ddb 100644 --- a/packages/backend/src/server/api/endpoints/notes/global-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/global-timeline.ts @@ -1,14 +1,14 @@ import { fetchMeta } from "@/misc/fetch-meta.js"; import { Notes } from "@/models/index.js"; import { activeUsersChart } from "@/services/chart/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { generateRepliesQuery } from "../../common/generate-replies-query.js"; -import { generateMutedNoteQuery } from "../../common/generate-muted-note-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; -import { generateMutedUserRenotesQueryForNotes } from "../../common/generated-muted-renote-query.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { generateRepliesQuery } from "@/server/api/common/generate-replies-query.js"; +import { generateMutedNoteQuery } from "@/server/api/common/generate-muted-note-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; +import { generateMutedUserRenotesQueryForNotes } from "@/server/api/common/generated-muted-renote-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts index 4e32b0ab2..c573a0c86 100644 --- a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts @@ -2,16 +2,16 @@ import { Brackets } from "typeorm"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { Followings, Notes } from "@/models/index.js"; import { activeUsersChart } from "@/services/chart/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { generateRepliesQuery } from "../../common/generate-replies-query.js"; -import { generateMutedNoteQuery } from "../../common/generate-muted-note-query.js"; -import { generateChannelQuery } from "../../common/generate-channel-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; -import { generateMutedUserRenotesQueryForNotes } from "../../common/generated-muted-renote-query.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { generateRepliesQuery } from "@/server/api/common/generate-replies-query.js"; +import { generateMutedNoteQuery } from "@/server/api/common/generate-muted-note-query.js"; +import { generateChannelQuery } from "@/server/api/common/generate-channel-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; +import { generateMutedUserRenotesQueryForNotes } from "@/server/api/common/generated-muted-renote-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts index 82e93e371..c89b8f871 100644 --- a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts @@ -1,17 +1,17 @@ import { Brackets } from "typeorm"; import { fetchMeta } from "@/misc/fetch-meta.js"; -import { Notes, Users } from "@/models/index.js"; +import { Notes } from "@/models/index.js"; import { activeUsersChart } from "@/services/chart/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateRepliesQuery } from "../../common/generate-replies-query.js"; -import { generateMutedNoteQuery } from "../../common/generate-muted-note-query.js"; -import { generateChannelQuery } from "../../common/generate-channel-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; -import { generateMutedUserRenotesQueryForNotes } from "../../common/generated-muted-renote-query.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateRepliesQuery } from "@/server/api/common/generate-replies-query.js"; +import { generateMutedNoteQuery } from "@/server/api/common/generate-muted-note-query.js"; +import { generateChannelQuery } from "@/server/api/common/generate-channel-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; +import { generateMutedUserRenotesQueryForNotes } from "@/server/api/common/generated-muted-renote-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/mentions.ts b/packages/backend/src/server/api/endpoints/notes/mentions.ts index 68688b504..44ee90938 100644 --- a/packages/backend/src/server/api/endpoints/notes/mentions.ts +++ b/packages/backend/src/server/api/endpoints/notes/mentions.ts @@ -1,12 +1,12 @@ import { Brackets } from "typeorm"; import read from "@/services/note/read.js"; import { Notes, Followings } from "@/models/index.js"; -import define from "../../define.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; -import { generateMutedNoteThreadQuery } from "../../common/generate-muted-note-thread-query.js"; +import define from "@/server/api/define.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; +import { generateMutedNoteThreadQuery } from "@/server/api/common/generate-muted-note-thread-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts b/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts index fcd24db99..ca0d0f03d 100644 --- a/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts +++ b/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts @@ -1,6 +1,6 @@ import { Brackets, In } from "typeorm"; import { Polls, Mutings, Notes, PollVotes } from "@/models/index.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/polls/vote.ts b/packages/backend/src/server/api/endpoints/notes/polls/vote.ts index 40535d340..1680eca64 100644 --- a/packages/backend/src/server/api/endpoints/notes/polls/vote.ts +++ b/packages/backend/src/server/api/endpoints/notes/polls/vote.ts @@ -13,9 +13,9 @@ import { } from "@/models/index.js"; import type { IRemoteUser } from "@/models/entities/user.js"; import { genId } from "@/misc/gen-id.js"; -import { getNote } from "../../../common/getters.js"; -import { ApiError } from "../../../error.js"; -import define from "../../../define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/reactions.ts b/packages/backend/src/server/api/endpoints/notes/reactions.ts index 3c8af119a..386a3a08d 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions.ts @@ -1,10 +1,9 @@ import type { FindOptionsWhere } from "typeorm"; -import { DeepPartial } from "typeorm"; import { NoteReactions } from "@/models/index.js"; import type { NoteReaction } from "@/models/entities/note-reaction.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getNote } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getNote } from "@/server/api/common/getters.js"; export const meta = { tags: ["notes", "reactions"], diff --git a/packages/backend/src/server/api/endpoints/notes/reactions/create.ts b/packages/backend/src/server/api/endpoints/notes/reactions/create.ts index 2c8671070..c49a957da 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions/create.ts @@ -1,7 +1,7 @@ import createReaction from "@/services/note/reaction/create.js"; -import define from "../../../define.js"; -import { getNote } from "../../../common/getters.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["reactions", "notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts b/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts index 59096c4c8..f135bd7ff 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts @@ -1,7 +1,7 @@ import deleteReaction from "@/services/note/reaction/delete.js"; -import define from "../../../define.js"; -import { getNote } from "../../../common/getters.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; import { SECOND, HOUR } from "@/const.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index d3b5cbff5..53ac1288a 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -2,16 +2,16 @@ import { Brackets } from "typeorm"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { Notes } from "@/models/index.js"; import { activeUsersChart } from "@/services/chart/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateRepliesQuery } from "../../common/generate-replies-query.js"; -import { generateMutedNoteQuery } from "../../common/generate-muted-note-query.js"; -import { generateChannelQuery } from "../../common/generate-channel-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; -import { generateMutedUserRenotesQueryForNotes } from "../../common/generated-muted-renote-query.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateRepliesQuery } from "@/server/api/common/generate-replies-query.js"; +import { generateMutedNoteQuery } from "@/server/api/common/generate-muted-note-query.js"; +import { generateChannelQuery } from "@/server/api/common/generate-channel-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; +import { generateMutedUserRenotesQueryForNotes } from "@/server/api/common/generated-muted-renote-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/renotes.ts b/packages/backend/src/server/api/endpoints/notes/renotes.ts index df801c7fc..683004ebe 100644 --- a/packages/backend/src/server/api/endpoints/notes/renotes.ts +++ b/packages/backend/src/server/api/endpoints/notes/renotes.ts @@ -1,11 +1,11 @@ import { Notes } from "@/models/index.js"; -import define from "../../define.js"; -import { getNote } from "../../common/getters.js"; -import { ApiError } from "../../error.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/replies.ts b/packages/backend/src/server/api/endpoints/notes/replies.ts index 5ea4d479c..e4341ebce 100644 --- a/packages/backend/src/server/api/endpoints/notes/replies.ts +++ b/packages/backend/src/server/api/endpoints/notes/replies.ts @@ -1,9 +1,9 @@ import { Notes } from "@/models/index.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts b/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts index f988acaa5..e87725e34 100644 --- a/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts +++ b/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts @@ -2,11 +2,11 @@ import { Brackets } from "typeorm"; import { Notes } from "@/models/index.js"; import { safeForSql } from "@/misc/safe-for-sql.js"; import { normalizeForSearch } from "@/misc/normalize-for-search.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; export const meta = { tags: ["notes", "hashtags"], diff --git a/packages/backend/src/server/api/endpoints/notes/search.ts b/packages/backend/src/server/api/endpoints/notes/search.ts index 8143c8bf0..4ddcf11ab 100644 --- a/packages/backend/src/server/api/endpoints/notes/search.ts +++ b/packages/backend/src/server/api/endpoints/notes/search.ts @@ -5,11 +5,11 @@ import config from "@/config/index.js"; import es from "@/db/elasticsearch.js"; import sonic from "@/db/sonic.js"; import meilisearch, { MeilisearchNote } from "@/db/meilisearch.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/notes/show.ts b/packages/backend/src/server/api/endpoints/notes/show.ts index 8c5f91c5c..1319e47d9 100644 --- a/packages/backend/src/server/api/endpoints/notes/show.ts +++ b/packages/backend/src/server/api/endpoints/notes/show.ts @@ -1,7 +1,7 @@ import { Notes } from "@/models/index.js"; -import define from "../../define.js"; -import { getNote } from "../../common/getters.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/state.ts b/packages/backend/src/server/api/endpoints/notes/state.ts index 630b2a800..b14e6842d 100644 --- a/packages/backend/src/server/api/endpoints/notes/state.ts +++ b/packages/backend/src/server/api/endpoints/notes/state.ts @@ -1,11 +1,10 @@ import { NoteFavorites, - Notes, NoteThreadMutings, NoteWatchings, } from "@/models/index.js"; -import { getNote } from "../../common/getters.js"; -import define from "../../define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts b/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts index e4803cc29..7c40a4592 100644 --- a/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts @@ -1,9 +1,9 @@ import { Notes, NoteThreadMutings } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import readNote from "@/services/note/read.js"; -import define from "../../../define.js"; -import { getNote } from "../../../common/getters.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts b/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts index c06fd59ba..62766bedc 100644 --- a/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts @@ -1,7 +1,7 @@ import { NoteThreadMutings } from "@/models/index.js"; -import define from "../../../define.js"; -import { getNote } from "../../../common/getters.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/timeline.ts b/packages/backend/src/server/api/endpoints/notes/timeline.ts index 56243977f..0f8da62e2 100644 --- a/packages/backend/src/server/api/endpoints/notes/timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/timeline.ts @@ -1,16 +1,16 @@ import { Brackets } from "typeorm"; import { Notes, Followings } from "@/models/index.js"; import { activeUsersChart } from "@/services/chart/index.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { generateRepliesQuery } from "../../common/generate-replies-query.js"; -import { generateMutedNoteQuery } from "../../common/generate-muted-note-query.js"; -import { generateChannelQuery } from "../../common/generate-channel-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; -import { generateMutedUserRenotesQueryForNotes } from "../../common/generated-muted-renote-query.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { generateRepliesQuery } from "@/server/api/common/generate-replies-query.js"; +import { generateMutedNoteQuery } from "@/server/api/common/generate-muted-note-query.js"; +import { generateChannelQuery } from "@/server/api/common/generate-channel-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; +import { generateMutedUserRenotesQueryForNotes } from "@/server/api/common/generated-muted-renote-query.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/translate.ts b/packages/backend/src/server/api/endpoints/notes/translate.ts index d46a81934..d1de39993 100644 --- a/packages/backend/src/server/api/endpoints/notes/translate.ts +++ b/packages/backend/src/server/api/endpoints/notes/translate.ts @@ -4,9 +4,9 @@ import config from "@/config/index.js"; import { Converter } from "opencc-js"; import { getAgentByUrl } from "@/misc/fetch.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; -import { ApiError } from "../../error.js"; -import { getNote } from "../../common/getters.js"; -import define from "../../define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getNote } from "@/server/api/common/getters.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/unrenote.ts b/packages/backend/src/server/api/endpoints/notes/unrenote.ts index a30a19f19..4a3966123 100644 --- a/packages/backend/src/server/api/endpoints/notes/unrenote.ts +++ b/packages/backend/src/server/api/endpoints/notes/unrenote.ts @@ -1,8 +1,8 @@ import deleteNote from "@/services/note/delete.js"; import { Notes, Users } from "@/models/index.js"; -import define from "../../define.js"; -import { getNote } from "../../common/getters.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; import { SECOND, HOUR } from "@/const.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts b/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts index 5c3fc55be..3a87ed647 100644 --- a/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts @@ -1,10 +1,10 @@ import { Brackets } from "typeorm"; import { UserLists, UserListJoinings, Notes } from "@/models/index.js"; import { activeUsersChart } from "@/services/chart/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; export const meta = { tags: ["notes", "lists"], diff --git a/packages/backend/src/server/api/endpoints/notes/watching/create.ts b/packages/backend/src/server/api/endpoints/notes/watching/create.ts index f8921099a..ec13f5aa2 100644 --- a/packages/backend/src/server/api/endpoints/notes/watching/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/watching/create.ts @@ -1,7 +1,7 @@ import watch from "@/services/note/watch.js"; -import define from "../../../define.js"; -import { getNote } from "../../../common/getters.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/watching/delete.ts b/packages/backend/src/server/api/endpoints/notes/watching/delete.ts index b441ad74b..18994fa80 100644 --- a/packages/backend/src/server/api/endpoints/notes/watching/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/watching/delete.ts @@ -1,7 +1,7 @@ import unwatch from "@/services/note/unwatch.js"; -import define from "../../../define.js"; -import { getNote } from "../../../common/getters.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notifications/create.ts b/packages/backend/src/server/api/endpoints/notifications/create.ts index bc5723369..2077cceba 100644 --- a/packages/backend/src/server/api/endpoints/notifications/create.ts +++ b/packages/backend/src/server/api/endpoints/notifications/create.ts @@ -1,5 +1,5 @@ import { createNotification } from "@/services/create-notification.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["notifications"], diff --git a/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts b/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts index e0888ad75..568036380 100644 --- a/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts +++ b/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts @@ -1,7 +1,7 @@ import { publishMainStream } from "@/services/stream.js"; import { pushNotification } from "@/services/push-notification.js"; import { Notifications } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["notifications", "account"], diff --git a/packages/backend/src/server/api/endpoints/notifications/read.ts b/packages/backend/src/server/api/endpoints/notifications/read.ts index 9efb2fcc0..358ca062f 100644 --- a/packages/backend/src/server/api/endpoints/notifications/read.ts +++ b/packages/backend/src/server/api/endpoints/notifications/read.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { readNotification } from "../../common/read-notification.js"; +import define from "@/server/api/define.js"; +import { readNotification } from "@/server/api/common/read-notification.js"; export const meta = { tags: ["notifications", "account"], diff --git a/packages/backend/src/server/api/endpoints/page-push.ts b/packages/backend/src/server/api/endpoints/page-push.ts index a0f1e912f..1f87372d6 100644 --- a/packages/backend/src/server/api/endpoints/page-push.ts +++ b/packages/backend/src/server/api/endpoints/page-push.ts @@ -1,7 +1,7 @@ import { publishMainStream } from "@/services/stream.js"; import { Users, Pages } from "@/models/index.js"; -import define from "../define.js"; -import { ApiError } from "../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/pages/create.ts b/packages/backend/src/server/api/endpoints/pages/create.ts index 716d3265c..ea0f8ba83 100644 --- a/packages/backend/src/server/api/endpoints/pages/create.ts +++ b/packages/backend/src/server/api/endpoints/pages/create.ts @@ -1,8 +1,8 @@ import { Pages, DriveFiles } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import { Page } from "@/models/entities/page.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { HOUR } from "@/const.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/pages/delete.ts b/packages/backend/src/server/api/endpoints/pages/delete.ts index 98b035f7c..85688d9b4 100644 --- a/packages/backend/src/server/api/endpoints/pages/delete.ts +++ b/packages/backend/src/server/api/endpoints/pages/delete.ts @@ -1,6 +1,6 @@ import { Pages } from "@/models/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["pages"], diff --git a/packages/backend/src/server/api/endpoints/pages/featured.ts b/packages/backend/src/server/api/endpoints/pages/featured.ts index a76346589..c3ff1f57f 100644 --- a/packages/backend/src/server/api/endpoints/pages/featured.ts +++ b/packages/backend/src/server/api/endpoints/pages/featured.ts @@ -1,5 +1,5 @@ import { Pages } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["pages"], diff --git a/packages/backend/src/server/api/endpoints/pages/like.ts b/packages/backend/src/server/api/endpoints/pages/like.ts index 03482c961..ab64b9b93 100644 --- a/packages/backend/src/server/api/endpoints/pages/like.ts +++ b/packages/backend/src/server/api/endpoints/pages/like.ts @@ -1,7 +1,7 @@ import { Pages, PageLikes } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["pages"], diff --git a/packages/backend/src/server/api/endpoints/pages/show.ts b/packages/backend/src/server/api/endpoints/pages/show.ts index a25eb30b6..ac347cf13 100644 --- a/packages/backend/src/server/api/endpoints/pages/show.ts +++ b/packages/backend/src/server/api/endpoints/pages/show.ts @@ -1,8 +1,8 @@ import { IsNull } from "typeorm"; import { Pages, Users } from "@/models/index.js"; import type { Page } from "@/models/entities/page.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["pages"], diff --git a/packages/backend/src/server/api/endpoints/pages/unlike.ts b/packages/backend/src/server/api/endpoints/pages/unlike.ts index e607d7a54..428f98458 100644 --- a/packages/backend/src/server/api/endpoints/pages/unlike.ts +++ b/packages/backend/src/server/api/endpoints/pages/unlike.ts @@ -1,6 +1,6 @@ import { Pages, PageLikes } from "@/models/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["pages"], diff --git a/packages/backend/src/server/api/endpoints/pages/update.ts b/packages/backend/src/server/api/endpoints/pages/update.ts index 65e1b3b2d..5f434d02e 100644 --- a/packages/backend/src/server/api/endpoints/pages/update.ts +++ b/packages/backend/src/server/api/endpoints/pages/update.ts @@ -1,7 +1,7 @@ import { Not } from "typeorm"; import { Pages, DriveFiles } from "@/models/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { HOUR } from "@/const.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/patrons.ts b/packages/backend/src/server/api/endpoints/patrons.ts index d4793e1b9..12a41742b 100644 --- a/packages/backend/src/server/api/endpoints/patrons.ts +++ b/packages/backend/src/server/api/endpoints/patrons.ts @@ -1,4 +1,4 @@ -import define from "../define.js"; +import define from "@/server/api/define.js"; import { redisClient } from "@/db/redis.js"; import * as fs from "node:fs"; import { fileURLToPath } from "node:url"; diff --git a/packages/backend/src/server/api/endpoints/ping.ts b/packages/backend/src/server/api/endpoints/ping.ts index c1f7e110b..7b45edad1 100644 --- a/packages/backend/src/server/api/endpoints/ping.ts +++ b/packages/backend/src/server/api/endpoints/ping.ts @@ -1,4 +1,4 @@ -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { requireCredential: false, diff --git a/packages/backend/src/server/api/endpoints/pinned-users.ts b/packages/backend/src/server/api/endpoints/pinned-users.ts index 22020068c..b32737870 100644 --- a/packages/backend/src/server/api/endpoints/pinned-users.ts +++ b/packages/backend/src/server/api/endpoints/pinned-users.ts @@ -3,7 +3,7 @@ import { Users } from "@/models/index.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; import * as Acct from "@/misc/acct.js"; import type { User } from "@/models/entities/user.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/promo/read.ts b/packages/backend/src/server/api/endpoints/promo/read.ts index 5310382a4..4b4146790 100644 --- a/packages/backend/src/server/api/endpoints/promo/read.ts +++ b/packages/backend/src/server/api/endpoints/promo/read.ts @@ -1,8 +1,8 @@ import { PromoReads } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getNote } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getNote } from "@/server/api/common/getters.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/recommended-instances.ts b/packages/backend/src/server/api/endpoints/recommended-instances.ts index 8407afb1d..b23567842 100644 --- a/packages/backend/src/server/api/endpoints/recommended-instances.ts +++ b/packages/backend/src/server/api/endpoints/recommended-instances.ts @@ -1,6 +1,6 @@ // import { IsNull } from 'typeorm'; import { fetchMeta } from "@/misc/fetch-meta.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/release.ts b/packages/backend/src/server/api/endpoints/release.ts index bce1bc082..1314e9036 100644 --- a/packages/backend/src/server/api/endpoints/release.ts +++ b/packages/backend/src/server/api/endpoints/release.ts @@ -1,4 +1,4 @@ -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/renote-mute/create.ts b/packages/backend/src/server/api/endpoints/renote-mute/create.ts index f09f197c0..afe23f38d 100644 --- a/packages/backend/src/server/api/endpoints/renote-mute/create.ts +++ b/packages/backend/src/server/api/endpoints/renote-mute/create.ts @@ -1,9 +1,9 @@ import { genId } from "@/misc/gen-id.js"; import { RenoteMutings } from "@/models/index.js"; import { RenoteMuting } from "@/models/entities/renote-muting.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/renote-mute/delete.ts b/packages/backend/src/server/api/endpoints/renote-mute/delete.ts index 7a898141c..6a824881b 100644 --- a/packages/backend/src/server/api/endpoints/renote-mute/delete.ts +++ b/packages/backend/src/server/api/endpoints/renote-mute/delete.ts @@ -1,7 +1,7 @@ import { RenoteMutings } from "@/models/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/renote-mute/list.ts b/packages/backend/src/server/api/endpoints/renote-mute/list.ts index 9149dd975..b19452714 100644 --- a/packages/backend/src/server/api/endpoints/renote-mute/list.ts +++ b/packages/backend/src/server/api/endpoints/renote-mute/list.ts @@ -1,6 +1,6 @@ import { RenoteMutings } from "@/models/index.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/request-reset-password.ts b/packages/backend/src/server/api/endpoints/request-reset-password.ts index bac564c1d..3c78058af 100644 --- a/packages/backend/src/server/api/endpoints/request-reset-password.ts +++ b/packages/backend/src/server/api/endpoints/request-reset-password.ts @@ -1,12 +1,10 @@ import rndstr from "rndstr"; import { IsNull } from "typeorm"; -import { publishMainStream } from "@/services/stream.js"; import config from "@/config/index.js"; import { Users, UserProfiles, PasswordResetRequests } from "@/models/index.js"; import { sendEmail } from "@/services/send-email.js"; import { genId } from "@/misc/gen-id.js"; -import { ApiError } from "../error.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; import { HOUR } from "@/const.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/reset-db.ts b/packages/backend/src/server/api/endpoints/reset-db.ts index c64db7bca..daba09b8e 100644 --- a/packages/backend/src/server/api/endpoints/reset-db.ts +++ b/packages/backend/src/server/api/endpoints/reset-db.ts @@ -1,6 +1,5 @@ import { resetDb } from "@/db/postgre.js"; -import define from "../define.js"; -import { ApiError } from "../error.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["non-productive"], diff --git a/packages/backend/src/server/api/endpoints/reset-password.ts b/packages/backend/src/server/api/endpoints/reset-password.ts index f695ae41f..ff5c8d987 100644 --- a/packages/backend/src/server/api/endpoints/reset-password.ts +++ b/packages/backend/src/server/api/endpoints/reset-password.ts @@ -1,7 +1,5 @@ -import { publishMainStream } from "@/services/stream.js"; -import { Users, UserProfiles, PasswordResetRequests } from "@/models/index.js"; -import define from "../define.js"; -import { ApiError } from "../error.js"; +import { UserProfiles, PasswordResetRequests } from "@/models/index.js"; +import define from "@/server/api/define.js"; import { hashPassword } from "@/misc/password.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/server-info.ts b/packages/backend/src/server/api/endpoints/server-info.ts index 87132758f..ff3bfcd10 100644 --- a/packages/backend/src/server/api/endpoints/server-info.ts +++ b/packages/backend/src/server/api/endpoints/server-info.ts @@ -1,6 +1,6 @@ import * as os from "node:os"; import si from "systeminformation"; -import define from "../define.js"; +import define from "@/server/api/define.js"; import meilisearch from "@/db/meilisearch.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; diff --git a/packages/backend/src/server/api/endpoints/stats.ts b/packages/backend/src/server/api/endpoints/stats.ts index 97889c42e..e50305c69 100644 --- a/packages/backend/src/server/api/endpoints/stats.ts +++ b/packages/backend/src/server/api/endpoints/stats.ts @@ -1,7 +1,6 @@ import { Instances, NoteReactions, Notes, Users } from "@/models/index.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; import { driveChart, notesChart, usersChart } from "@/services/chart/index.js"; -import { IsNull } from "typeorm"; export const meta = { requireCredential: false, diff --git a/packages/backend/src/server/api/endpoints/sw/register.ts b/packages/backend/src/server/api/endpoints/sw/register.ts index 6268ae26d..ee6b3bbf4 100644 --- a/packages/backend/src/server/api/endpoints/sw/register.ts +++ b/packages/backend/src/server/api/endpoints/sw/register.ts @@ -1,7 +1,7 @@ import { fetchMeta } from "@/misc/fetch-meta.js"; import { genId } from "@/misc/gen-id.js"; import { SwSubscriptions } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/sw/show-registration.ts b/packages/backend/src/server/api/endpoints/sw/show-registration.ts index 3ccb7de94..412179244 100644 --- a/packages/backend/src/server/api/endpoints/sw/show-registration.ts +++ b/packages/backend/src/server/api/endpoints/sw/show-registration.ts @@ -1,5 +1,5 @@ import { SwSubscriptions } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/sw/unregister.ts b/packages/backend/src/server/api/endpoints/sw/unregister.ts index e2a40f51c..d8a49cbea 100644 --- a/packages/backend/src/server/api/endpoints/sw/unregister.ts +++ b/packages/backend/src/server/api/endpoints/sw/unregister.ts @@ -1,5 +1,5 @@ import { SwSubscriptions } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/sw/update-registration.ts b/packages/backend/src/server/api/endpoints/sw/update-registration.ts index 5ba53ee8a..ece1c8449 100644 --- a/packages/backend/src/server/api/endpoints/sw/update-registration.ts +++ b/packages/backend/src/server/api/endpoints/sw/update-registration.ts @@ -1,5 +1,5 @@ import { SwSubscriptions } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/test.ts b/packages/backend/src/server/api/endpoints/test.ts index 2c43c6115..f5041cfbf 100644 --- a/packages/backend/src/server/api/endpoints/test.ts +++ b/packages/backend/src/server/api/endpoints/test.ts @@ -1,4 +1,4 @@ -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["non-productive"], diff --git a/packages/backend/src/server/api/endpoints/username/available.ts b/packages/backend/src/server/api/endpoints/username/available.ts index 6fa09ba36..cd634a798 100644 --- a/packages/backend/src/server/api/endpoints/username/available.ts +++ b/packages/backend/src/server/api/endpoints/username/available.ts @@ -1,7 +1,7 @@ import { IsNull } from "typeorm"; import { Users, UsedUsernames } from "@/models/index.js"; import config from "@/config/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/users.ts b/packages/backend/src/server/api/endpoints/users.ts index f0a867090..20371fce9 100644 --- a/packages/backend/src/server/api/endpoints/users.ts +++ b/packages/backend/src/server/api/endpoints/users.ts @@ -1,7 +1,7 @@ import { Users } from "@/models/index.js"; -import define from "../define.js"; -import { generateMutedUserQueryForUsers } from "../common/generate-muted-user-query.js"; -import { generateBlockQueryForUsers } from "../common/generate-block-query.js"; +import define from "@/server/api/define.js"; +import { generateMutedUserQueryForUsers } from "@/server/api/common/generate-muted-user-query.js"; +import { generateBlockQueryForUsers } from "@/server/api/common/generate-block-query.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/users/clips.ts b/packages/backend/src/server/api/endpoints/users/clips.ts index 0dc90b8f9..132e190bb 100644 --- a/packages/backend/src/server/api/endpoints/users/clips.ts +++ b/packages/backend/src/server/api/endpoints/users/clips.ts @@ -1,6 +1,6 @@ import { Clips } from "@/models/index.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["users", "clips"], diff --git a/packages/backend/src/server/api/endpoints/users/followers.ts b/packages/backend/src/server/api/endpoints/users/followers.ts index 31719bad3..f57983d4b 100644 --- a/packages/backend/src/server/api/endpoints/users/followers.ts +++ b/packages/backend/src/server/api/endpoints/users/followers.ts @@ -1,9 +1,9 @@ import { IsNull } from "typeorm"; import { Users, Followings, UserProfiles } from "@/models/index.js"; import { toPunyNullable } from "@/misc/convert-host.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/users/following.ts b/packages/backend/src/server/api/endpoints/users/following.ts index 1c1da0e11..84eb7cccc 100644 --- a/packages/backend/src/server/api/endpoints/users/following.ts +++ b/packages/backend/src/server/api/endpoints/users/following.ts @@ -1,9 +1,9 @@ import { IsNull } from "typeorm"; import { Users, Followings, UserProfiles } from "@/models/index.js"; import { toPunyNullable } from "@/misc/convert-host.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/users/gallery/posts.ts b/packages/backend/src/server/api/endpoints/users/gallery/posts.ts index 5d64fb472..e2edbee86 100644 --- a/packages/backend/src/server/api/endpoints/users/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/users/gallery/posts.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { GalleryPosts } from "@/models/index.js"; -import { makePaginationQuery } from "../../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["users", "gallery"], diff --git a/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts b/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts index 9722804c8..0694bd663 100644 --- a/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts +++ b/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts @@ -1,9 +1,9 @@ import { Not, In, IsNull } from "typeorm"; import { maximum } from "@/prelude/array.js"; import { Notes, Users } from "@/models/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/create.ts b/packages/backend/src/server/api/endpoints/users/groups/create.ts index 76bd78c49..1cfb22301 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/create.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/create.ts @@ -2,7 +2,7 @@ import { UserGroups, UserGroupJoinings } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import type { UserGroup } from "@/models/entities/user-group.js"; import type { UserGroupJoining } from "@/models/entities/user-group-joining.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["groups"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/delete.ts b/packages/backend/src/server/api/endpoints/users/groups/delete.ts index 81c15ad38..93bf594f5 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/delete.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/delete.ts @@ -1,6 +1,6 @@ import { UserGroups } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["groups"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/invitations/accept.ts b/packages/backend/src/server/api/endpoints/users/groups/invitations/accept.ts index 5cb3a7bad..a483ccd18 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/invitations/accept.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/invitations/accept.ts @@ -1,8 +1,8 @@ import { UserGroupJoinings, UserGroupInvitations } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import type { UserGroupJoining } from "@/models/entities/user-group-joining.js"; -import { ApiError } from "../../../../error.js"; -import define from "../../../../define.js"; +import { ApiError } from "@/server/api/error.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["groups", "users"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/invitations/reject.ts b/packages/backend/src/server/api/endpoints/users/groups/invitations/reject.ts index c04ebed23..9d4e51cca 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/invitations/reject.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/invitations/reject.ts @@ -1,6 +1,6 @@ import { UserGroupInvitations } from "@/models/index.js"; -import define from "../../../../define.js"; -import { ApiError } from "../../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["groups", "users"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/invite.ts b/packages/backend/src/server/api/endpoints/users/groups/invite.ts index 10cc21586..8a1e6b31e 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/invite.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/invite.ts @@ -6,9 +6,9 @@ import { import { genId } from "@/misc/gen-id.js"; import type { UserGroupInvitation } from "@/models/entities/user-group-invitation.js"; import { createNotification } from "@/services/create-notification.js"; -import { getUser } from "../../../common/getters.js"; -import { ApiError } from "../../../error.js"; -import define from "../../../define.js"; +import { getUser } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["groups", "users"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/joined.ts b/packages/backend/src/server/api/endpoints/users/groups/joined.ts index 8422cf586..5d50b5e33 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/joined.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/joined.ts @@ -1,6 +1,6 @@ import { Not, In } from "typeorm"; import { UserGroups, UserGroupJoinings } from "@/models/index.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["groups", "account"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/leave.ts b/packages/backend/src/server/api/endpoints/users/groups/leave.ts index fac0a47fc..8165b1d98 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/leave.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/leave.ts @@ -1,6 +1,6 @@ import { UserGroups, UserGroupJoinings } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["groups", "users"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/owned.ts b/packages/backend/src/server/api/endpoints/users/groups/owned.ts index d86185ff0..293897c16 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/owned.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/owned.ts @@ -1,5 +1,5 @@ import { UserGroups } from "@/models/index.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["groups", "account"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/pull.ts b/packages/backend/src/server/api/endpoints/users/groups/pull.ts index ce294b8c8..5e7f91d70 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/pull.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/pull.ts @@ -1,7 +1,7 @@ import { UserGroups, UserGroupJoinings } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getUser } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; export const meta = { tags: ["groups", "users"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/show.ts b/packages/backend/src/server/api/endpoints/users/groups/show.ts index 46f4410c8..0cd5a9233 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/show.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/show.ts @@ -1,6 +1,6 @@ import { UserGroups, UserGroupJoinings } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["groups", "account"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/transfer.ts b/packages/backend/src/server/api/endpoints/users/groups/transfer.ts index 032244157..b58ea57b7 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/transfer.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/transfer.ts @@ -1,7 +1,7 @@ import { UserGroups, UserGroupJoinings } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getUser } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; export const meta = { tags: ["groups", "users"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/update.ts b/packages/backend/src/server/api/endpoints/users/groups/update.ts index fa720c9c4..77e63c6dc 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/update.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/update.ts @@ -1,6 +1,6 @@ import { UserGroups } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["groups"], diff --git a/packages/backend/src/server/api/endpoints/users/lists/create.ts b/packages/backend/src/server/api/endpoints/users/lists/create.ts index 6bbbf603e..c23e8f6f5 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/create.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/create.ts @@ -1,7 +1,7 @@ import { UserLists } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import type { UserList } from "@/models/entities/user-list.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["lists"], diff --git a/packages/backend/src/server/api/endpoints/users/lists/delete-all.ts b/packages/backend/src/server/api/endpoints/users/lists/delete-all.ts index 49c4cf6f6..49ab4f102 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/delete-all.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/delete-all.ts @@ -1,6 +1,6 @@ import { UserLists } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["lists"], diff --git a/packages/backend/src/server/api/endpoints/users/lists/delete.ts b/packages/backend/src/server/api/endpoints/users/lists/delete.ts index 456629567..e1df68135 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/delete.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/delete.ts @@ -1,6 +1,6 @@ import { UserLists } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["lists"], diff --git a/packages/backend/src/server/api/endpoints/users/lists/list.ts b/packages/backend/src/server/api/endpoints/users/lists/list.ts index 5d590ee0e..2a731b70d 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/list.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/list.ts @@ -1,5 +1,5 @@ import { UserLists } from "@/models/index.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["lists", "account"], diff --git a/packages/backend/src/server/api/endpoints/users/lists/pull.ts b/packages/backend/src/server/api/endpoints/users/lists/pull.ts index 07fae2067..ffca5b205 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/pull.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/pull.ts @@ -1,8 +1,8 @@ import { publishUserListStream } from "@/services/stream.js"; import { UserLists, UserListJoinings, Users } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getUser } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; export const meta = { tags: ["lists", "users"], diff --git a/packages/backend/src/server/api/endpoints/users/lists/push.ts b/packages/backend/src/server/api/endpoints/users/lists/push.ts index 899754aaf..8dd4442d0 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/push.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/push.ts @@ -1,8 +1,8 @@ import { pushUserToUserList } from "@/services/user-list/push.js"; import { UserLists, UserListJoinings, Blockings } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getUser } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; export const meta = { tags: ["lists", "users"], diff --git a/packages/backend/src/server/api/endpoints/users/lists/show.ts b/packages/backend/src/server/api/endpoints/users/lists/show.ts index cb4893b0e..ca90fec38 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/show.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/show.ts @@ -1,6 +1,6 @@ import { UserLists } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["lists", "account"], diff --git a/packages/backend/src/server/api/endpoints/users/lists/update.ts b/packages/backend/src/server/api/endpoints/users/lists/update.ts index 0ac788fd3..e331ce33c 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/update.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/update.ts @@ -1,6 +1,6 @@ import { UserLists } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["lists"], diff --git a/packages/backend/src/server/api/endpoints/users/notes.ts b/packages/backend/src/server/api/endpoints/users/notes.ts index 724cfc9af..1485dfa6c 100644 --- a/packages/backend/src/server/api/endpoints/users/notes.ts +++ b/packages/backend/src/server/api/endpoints/users/notes.ts @@ -1,12 +1,12 @@ import { Brackets } from "typeorm"; import { Notes } from "@/models/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; export const meta = { tags: ["users", "notes"], diff --git a/packages/backend/src/server/api/endpoints/users/pages.ts b/packages/backend/src/server/api/endpoints/users/pages.ts index c08258b19..1af50e78a 100644 --- a/packages/backend/src/server/api/endpoints/users/pages.ts +++ b/packages/backend/src/server/api/endpoints/users/pages.ts @@ -1,6 +1,6 @@ import { Pages } from "@/models/index.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["users", "pages"], diff --git a/packages/backend/src/server/api/endpoints/users/reactions.ts b/packages/backend/src/server/api/endpoints/users/reactions.ts index 6b6d32e8a..3c0e33b2f 100644 --- a/packages/backend/src/server/api/endpoints/users/reactions.ts +++ b/packages/backend/src/server/api/endpoints/users/reactions.ts @@ -1,8 +1,8 @@ import { NoteReactions, UserProfiles } from "@/models/index.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["users", "reactions"], diff --git a/packages/backend/src/server/api/endpoints/users/recommendation.ts b/packages/backend/src/server/api/endpoints/users/recommendation.ts index 615cca785..4ea0d618e 100644 --- a/packages/backend/src/server/api/endpoints/users/recommendation.ts +++ b/packages/backend/src/server/api/endpoints/users/recommendation.ts @@ -1,10 +1,10 @@ import { Users, Followings } from "@/models/index.js"; -import define from "../../define.js"; -import { generateMutedUserQueryForUsers } from "../../common/generate-muted-user-query.js"; +import define from "@/server/api/define.js"; +import { generateMutedUserQueryForUsers } from "@/server/api/common/generate-muted-user-query.js"; import { generateBlockedUserQuery, generateBlockQueryForUsers, -} from "../../common/generate-block-query.js"; +} from "@/server/api/common/generate-block-query.js"; import { DAY } from "@/const.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/users/relation.ts b/packages/backend/src/server/api/endpoints/users/relation.ts index 5580eaea0..61cc76116 100644 --- a/packages/backend/src/server/api/endpoints/users/relation.ts +++ b/packages/backend/src/server/api/endpoints/users/relation.ts @@ -1,5 +1,5 @@ import { Users } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/users/report-abuse.ts b/packages/backend/src/server/api/endpoints/users/report-abuse.ts index 1368f9e2b..7e9ba7238 100644 --- a/packages/backend/src/server/api/endpoints/users/report-abuse.ts +++ b/packages/backend/src/server/api/endpoints/users/report-abuse.ts @@ -5,9 +5,9 @@ import { AbuseUserReports, UserProfiles, Users } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import { sendEmail } from "@/services/send-email.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; -import { getUser } from "../../common/getters.js"; -import { ApiError } from "../../error.js"; -import define from "../../define.js"; +import { getUser } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; +import define from "@/server/api/define.js"; import { toHtml } from "@/mfm/to-html.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts b/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts index f34083233..517ef615b 100644 --- a/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts +++ b/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts @@ -1,8 +1,7 @@ import { Brackets } from "typeorm"; import { Followings, Users } from "@/models/index.js"; -import { USER_ACTIVE_THRESHOLD } from "@/const.js"; import type { User } from "@/models/entities/user.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/users/search.ts b/packages/backend/src/server/api/endpoints/users/search.ts index 2d84d5bfe..3aef6dc90 100644 --- a/packages/backend/src/server/api/endpoints/users/search.ts +++ b/packages/backend/src/server/api/endpoints/users/search.ts @@ -1,7 +1,7 @@ import { Brackets } from "typeorm"; import { UserProfiles, Users } from "@/models/index.js"; import type { User } from "@/models/entities/user.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/users/show.ts b/packages/backend/src/server/api/endpoints/users/show.ts index bead8df0a..61812a018 100644 --- a/packages/backend/src/server/api/endpoints/users/show.ts +++ b/packages/backend/src/server/api/endpoints/users/show.ts @@ -3,9 +3,9 @@ import { In, IsNull } from "typeorm"; import { resolveUser } from "@/remote/resolve-user.js"; import { Users } from "@/models/index.js"; import type { User } from "@/models/entities/user.js"; -import define from "../../define.js"; -import { apiLogger } from "../../logger.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { apiLogger } from "@/server/api/logger.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/users/stats.ts b/packages/backend/src/server/api/endpoints/users/stats.ts index 83e821f49..ed4dd3b0c 100644 --- a/packages/backend/src/server/api/endpoints/users/stats.ts +++ b/packages/backend/src/server/api/endpoints/users/stats.ts @@ -9,8 +9,8 @@ import { Users, } from "@/models/index.js"; import { awaitAll } from "@/prelude/await-all.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/index.ts b/packages/backend/src/server/api/index.ts index bf617f06f..a5970d584 100644 --- a/packages/backend/src/server/api/index.ts +++ b/packages/backend/src/server/api/index.ts @@ -11,9 +11,8 @@ import { apiMastodonCompatible, getClient, } from "./mastodon/ApiMastodonCompatibleService.js"; -import { Instances, AccessTokens, Users } from "@/models/index.js"; +import { AccessTokens, Users } from "@/models/index.js"; import config from "@/config/index.js"; -import fs from "fs"; import endpoints from "./endpoints.js"; import compatibility from "./compatibility.js"; import handler from "./api-handler.js"; @@ -22,11 +21,13 @@ import signin from "./private/signin.js"; import signupPending from "./private/signup-pending.js"; import verifyEmail from "./private/verify-email.js"; import { koaBody } from "koa-body"; +import { convertAttachment } from "./mastodon/converters.js"; + +// TODO?: should we avoid importing things from built directory? import { convertId, IdConvertType as IdType, -} from "../../../native-utils/built/index.js"; -import { convertAttachment } from "./mastodon/converters.js"; +} from "native-utils/built/index.js"; // re-export native rust id conversion (function and enum) export { IdType, convertId }; diff --git a/packages/backend/src/server/api/limiter.ts b/packages/backend/src/server/api/limiter.ts index 367fb3d27..f03f8754c 100644 --- a/packages/backend/src/server/api/limiter.ts +++ b/packages/backend/src/server/api/limiter.ts @@ -1,7 +1,6 @@ import Limiter from "ratelimiter"; -import { CacheableLocalUser, User } from "@/models/entities/user.js"; import Logger from "@/services/logger.js"; -import { redisClient } from "../../db/redis.js"; +import { redisClient } from "@/db/redis.js"; import type { IEndpointMeta } from "./endpoints.js"; import { convertMilliseconds } from "@/misc/convert-milliseconds.js"; diff --git a/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts b/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts index 44485ac42..e029bc604 100644 --- a/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts +++ b/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts @@ -13,7 +13,7 @@ import { convertAnnouncement, convertFilter, } from "./converters.js"; -import { convertId, IdType } from "../index.js"; +import { convertId, IdType } from "@/server/api/index.js"; import { Users } from "@/models/index.js"; import { IsNull } from "typeorm"; diff --git a/packages/backend/src/server/api/mastodon/converters.ts b/packages/backend/src/server/api/mastodon/converters.ts index 6469d9c97..30506d9c5 100644 --- a/packages/backend/src/server/api/mastodon/converters.ts +++ b/packages/backend/src/server/api/mastodon/converters.ts @@ -1,5 +1,5 @@ import { Entity } from "megalodon"; -import { convertId, IdType } from "../index.js"; +import { convertId, IdType } from "@/server/api/index.js"; function simpleConvert(data: any) { // copy the object to bypass weird pass by reference bugs diff --git a/packages/backend/src/server/api/mastodon/endpoints/account.ts b/packages/backend/src/server/api/mastodon/endpoints/account.ts index 36548cd3b..76c3af378 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/account.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/account.ts @@ -1,10 +1,7 @@ -import { Users } from "@/models/index.js"; -import { resolveUser } from "@/remote/resolve-user.js"; import Router from "@koa/router"; -import { FindOptionsWhere, IsNull } from "typeorm"; import { getClient } from "../ApiMastodonCompatibleService.js"; import { argsToBools, convertTimelinesArgsId, limitToInt } from "./timeline.js"; -import { convertId, IdType } from "../../index.js"; +import { convertId, IdType } from "@/server/api/index.js"; import { convertAccount, convertFeaturedTag, diff --git a/packages/backend/src/server/api/mastodon/endpoints/auth.ts b/packages/backend/src/server/api/mastodon/endpoints/auth.ts index b55cb6388..3c7ece920 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/auth.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/auth.ts @@ -1,8 +1,5 @@ -import megalodon, { MegalodonInterface } from "megalodon"; import Router from "@koa/router"; -import { koaBody } from "koa-body"; import { getClient } from "../ApiMastodonCompatibleService.js"; -import bodyParser from "koa-bodyparser"; const readScope = [ "read:account", diff --git a/packages/backend/src/server/api/mastodon/endpoints/filter.ts b/packages/backend/src/server/api/mastodon/endpoints/filter.ts index e27b7e22a..6524fd2f6 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/filter.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/filter.ts @@ -1,7 +1,6 @@ -import megalodon, { MegalodonInterface } from "megalodon"; import Router from "@koa/router"; import { getClient } from "../ApiMastodonCompatibleService.js"; -import { IdType, convertId } from "../../index.js"; +import { IdType, convertId } from "@/server/api/index.js"; import { convertFilter } from "../converters.js"; export function apiFilterMastodon(router: Router): void { diff --git a/packages/backend/src/server/api/mastodon/endpoints/notifications.ts b/packages/backend/src/server/api/mastodon/endpoints/notifications.ts index f0a0bab98..9628eccdd 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/notifications.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/notifications.ts @@ -1,7 +1,5 @@ -import megalodon, { MegalodonInterface } from "megalodon"; import Router from "@koa/router"; -import { koaBody } from "koa-body"; -import { convertId, IdType } from "../../index.js"; +import { convertId, IdType } from "@/server/api/index.js"; import { getClient } from "../ApiMastodonCompatibleService.js"; import { convertTimelinesArgsId } from "./timeline.js"; import { convertNotification } from "../converters.js"; diff --git a/packages/backend/src/server/api/mastodon/endpoints/search.ts b/packages/backend/src/server/api/mastodon/endpoints/search.ts index 8a4817557..c9bbab0a4 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/search.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/search.ts @@ -1,4 +1,3 @@ -import megalodon, { MegalodonInterface } from "megalodon"; import Router from "@koa/router"; import { getClient } from "../ApiMastodonCompatibleService.js"; import axios from "axios"; diff --git a/packages/backend/src/server/api/mastodon/endpoints/status.ts b/packages/backend/src/server/api/mastodon/endpoints/status.ts index bc95d7776..ac1cbe602 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/status.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/status.ts @@ -1,11 +1,10 @@ import Router from "@koa/router"; import { getClient } from "../ApiMastodonCompatibleService.js"; import { emojiRegexAtStartToEnd } from "@/misc/emoji-regex.js"; -import axios from "axios"; import querystring from "node:querystring"; import qs from "qs"; import { convertTimelinesArgsId, limitToInt } from "./timeline.js"; -import { convertId, IdType } from "../../index.js"; +import { convertId, IdType } from "@/server/api/index.js"; import { convertAccount, convertAttachment, diff --git a/packages/backend/src/server/api/mastodon/endpoints/timeline.ts b/packages/backend/src/server/api/mastodon/endpoints/timeline.ts index 0a4da322d..05741c4ce 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/timeline.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/timeline.ts @@ -7,7 +7,7 @@ import { convertList, convertStatus, } from "../converters.js"; -import { convertId, IdType } from "../../index.js"; +import { convertId, IdType } from "@/server/api/index.js"; export function limitToInt(q: ParsedUrlQuery) { let object: any = q; diff --git a/packages/backend/src/server/api/openapi/gen-spec.ts b/packages/backend/src/server/api/openapi/gen-spec.ts index ee14f249f..ec8c1ca03 100644 --- a/packages/backend/src/server/api/openapi/gen-spec.ts +++ b/packages/backend/src/server/api/openapi/gen-spec.ts @@ -1,4 +1,4 @@ -import endpoints from "../endpoints.js"; +import endpoints from "@/server/api/endpoints.js"; import config from "@/config/index.js"; import { errors as basicErrors } from "./errors.js"; import { schemas, convertSchemaToOpenApiSchema } from "./schemas.js"; diff --git a/packages/backend/src/server/api/private/signin.ts b/packages/backend/src/server/api/private/signin.ts index 06d801a95..3e70d80fe 100644 --- a/packages/backend/src/server/api/private/signin.ts +++ b/packages/backend/src/server/api/private/signin.ts @@ -1,6 +1,6 @@ import type Koa from "koa"; import * as OTPAuth from "otpauth"; -import signin from "../common/signin.js"; +import signin from "@/server/api/common/signin.js"; import config from "@/config/index.js"; import { Users, @@ -16,10 +16,10 @@ import { hashPassword, isOldAlgorithm, } from "@/misc/password.js"; -import { verifyLogin, hash } from "../2fa.js"; +import { verifyLogin, hash } from "@/server/api/2fa.js"; import { randomBytes } from "node:crypto"; import { IsNull } from "typeorm"; -import { limiter } from "../limiter.js"; +import { limiter } from "@/server/api/limiter.js"; import { getIpHash } from "@/misc/get-ip-hash.js"; export default async (ctx: Koa.Context) => { diff --git a/packages/backend/src/server/api/private/signup-pending.ts b/packages/backend/src/server/api/private/signup-pending.ts index c7fdcea22..b92fb90b3 100644 --- a/packages/backend/src/server/api/private/signup-pending.ts +++ b/packages/backend/src/server/api/private/signup-pending.ts @@ -1,7 +1,7 @@ import type Koa from "koa"; -import { Users, UserPendings, UserProfiles } from "@/models/index.js"; -import { signup } from "../common/signup.js"; -import signin from "../common/signin.js"; +import { UserPendings, UserProfiles } from "@/models/index.js"; +import { signup } from "@/server/api/common/signup.js"; +import signin from "@/server/api/common/signin.js"; export default async (ctx: Koa.Context) => { const body = ctx.request.body; diff --git a/packages/backend/src/server/api/private/signup.ts b/packages/backend/src/server/api/private/signup.ts index 440d0e368..d60e5a191 100644 --- a/packages/backend/src/server/api/private/signup.ts +++ b/packages/backend/src/server/api/private/signup.ts @@ -3,7 +3,7 @@ import rndstr from "rndstr"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { verifyHcaptcha, verifyRecaptcha } from "@/misc/captcha.js"; import { Users, RegistrationTickets, UserPendings } from "@/models/index.js"; -import { signup } from "../common/signup.js"; +import { signup } from "@/server/api/common/signup.js"; import config from "@/config/index.js"; import { sendEmail } from "@/services/send-email.js"; import { genId } from "@/misc/gen-id.js"; diff --git a/packages/backend/src/server/api/stream/channels/messaging.ts b/packages/backend/src/server/api/stream/channels/messaging.ts index 0622bd464..a650db8b9 100644 --- a/packages/backend/src/server/api/stream/channels/messaging.ts +++ b/packages/backend/src/server/api/stream/channels/messaging.ts @@ -2,7 +2,7 @@ import { readUserMessagingMessage, readGroupMessagingMessage, deliverReadActivity, -} from "../../common/read-messaging-message.js"; +} from "@/server/api/common/read-messaging-message.js"; import Channel from "../channel.js"; import { UserGroupJoinings, Users, MessagingMessages } from "@/models/index.js"; import type { User, ILocalUser, IRemoteUser } from "@/models/entities/user.js"; diff --git a/packages/backend/src/server/api/stream/index.ts b/packages/backend/src/server/api/stream/index.ts index e48368315..86408a03d 100644 --- a/packages/backend/src/server/api/stream/index.ts +++ b/packages/backend/src/server/api/stream/index.ts @@ -21,12 +21,12 @@ import { } from "@/services/stream.js"; import type { UserGroup } from "@/models/entities/user-group.js"; import type { Packed } from "@/misc/schema.js"; -import { readNotification } from "../common/read-notification.js"; +import { readNotification } from "@/server/api/common/read-notification.js"; import channels from "./channels/index.js"; import type Channel from "./channel.js"; import type { StreamEventEmitter, StreamMessages } from "./types.js"; import { Converter } from "megalodon"; -import { getClient } from "../mastodon/ApiMastodonCompatibleService.js"; +import { getClient } from "@/server/api/mastodon/ApiMastodonCompatibleService.js"; /** * Main stream connection diff --git a/packages/backend/src/server/file/byte-range-readable.ts b/packages/backend/src/server/file/byte-range-readable.ts index d80e783cc..96dcbc4a5 100644 --- a/packages/backend/src/server/file/byte-range-readable.ts +++ b/packages/backend/src/server/file/byte-range-readable.ts @@ -1,5 +1,5 @@ import { Readable, ReadableOptions } from "node:stream"; -import { Buffer, constants as BufferConstants } from "node:buffer"; +import { Buffer } from "node:buffer"; import * as fs from "node:fs"; interface ByteRange { diff --git a/packages/backend/src/server/index.ts b/packages/backend/src/server/index.ts index f26853eb8..3a9f62f33 100644 --- a/packages/backend/src/server/index.ts +++ b/packages/backend/src/server/index.ts @@ -15,11 +15,10 @@ import * as slow from "koa-slow"; import { IsNull } from "typeorm"; import config from "@/config/index.js"; import Logger from "@/services/logger.js"; -import { UserProfiles, Users } from "@/models/index.js"; +import { Users } from "@/models/index.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { genIdenticon } from "@/misc/gen-identicon.js"; import { createTemp } from "@/misc/create-temp.js"; -import { publishMainStream } from "@/services/stream.js"; import * as Acct from "@/misc/acct.js"; import { envOption } from "@/env.js"; import megalodon, { MegalodonInterface } from "megalodon"; diff --git a/packages/backend/src/services/blocking/create.ts b/packages/backend/src/services/blocking/create.ts index 60bd6e943..321f5c8ea 100644 --- a/packages/backend/src/services/blocking/create.ts +++ b/packages/backend/src/services/blocking/create.ts @@ -17,7 +17,6 @@ import { } from "@/models/index.js"; import { perUserFollowingChart } from "@/services/chart/index.js"; import { genId } from "@/misc/gen-id.js"; -import { IdentifiableError } from "@/misc/identifiable-error.js"; import { getActiveWebhooks } from "@/misc/webhook-cache.js"; import { webhookDeliver } from "@/queue/index.js"; diff --git a/packages/backend/src/services/blocking/delete.ts b/packages/backend/src/services/blocking/delete.ts index 67f1e76f0..271883fe8 100644 --- a/packages/backend/src/services/blocking/delete.ts +++ b/packages/backend/src/services/blocking/delete.ts @@ -2,9 +2,8 @@ import { renderActivity } from "@/remote/activitypub/renderer/index.js"; import { renderBlock } from "@/remote/activitypub/renderer/block.js"; import renderUndo from "@/remote/activitypub/renderer/undo.js"; import { deliver } from "@/queue/index.js"; -import Logger from "../logger.js"; +import Logger from "@/services/logger.js"; import type { CacheableUser } from "@/models/entities/user.js"; -import { User } from "@/models/entities/user.js"; import { Blockings, Users } from "@/models/index.js"; const logger = new Logger("blocking/delete"); diff --git a/packages/backend/src/services/chart/charts/active-users.ts b/packages/backend/src/services/chart/charts/active-users.ts index 322bfd25b..b88fc2282 100644 --- a/packages/backend/src/services/chart/charts/active-users.ts +++ b/packages/backend/src/services/chart/charts/active-users.ts @@ -1,7 +1,6 @@ import type { KVs } from "../core.js"; import Chart from "../core.js"; import type { User } from "@/models/entities/user.js"; -import { Users } from "@/models/index.js"; import { name, schema } from "./entities/active-users.js"; const week = 1000 * 60 * 60 * 24 * 7; diff --git a/packages/backend/src/services/chart/charts/drive.ts b/packages/backend/src/services/chart/charts/drive.ts index 9793ff79d..d94c8cce7 100644 --- a/packages/backend/src/services/chart/charts/drive.ts +++ b/packages/backend/src/services/chart/charts/drive.ts @@ -1,7 +1,5 @@ import type { KVs } from "../core.js"; import Chart from "../core.js"; -import { DriveFiles } from "@/models/index.js"; -import { Not, IsNull } from "typeorm"; import type { DriveFile } from "@/models/entities/drive-file.js"; import { name, schema } from "./entities/drive.js"; diff --git a/packages/backend/src/services/create-system-user.ts b/packages/backend/src/services/create-system-user.ts index 24536090a..0ebd1142f 100644 --- a/packages/backend/src/services/create-system-user.ts +++ b/packages/backend/src/services/create-system-user.ts @@ -1,5 +1,5 @@ import { v4 as uuid } from "uuid"; -import generateNativeUserToken from "../server/api/common/generate-native-user-token.js"; +import generateNativeUserToken from "@/server/api/common/generate-native-user-token.js"; import { genRsaKeyPair } from "@/misc/gen-key-pair.js"; import { User } from "@/models/entities/user.js"; import { UserProfile } from "@/models/entities/user-profile.js"; diff --git a/packages/backend/src/services/delete-account.ts b/packages/backend/src/services/delete-account.ts index 927776199..b307611cf 100644 --- a/packages/backend/src/services/delete-account.ts +++ b/packages/backend/src/services/delete-account.ts @@ -1,7 +1,7 @@ import { Users } from "@/models/index.js"; import { createDeleteAccountJob } from "@/queue/index.js"; -import { publishUserEvent } from "./stream.js"; -import { doPostSuspend } from "./suspend-user.js"; +import { publishUserEvent } from "@/services/stream.js"; +import { doPostSuspend } from "@/services/suspend-user.js"; export async function deleteAccount(user: { id: string; diff --git a/packages/backend/src/services/drive/add-file.ts b/packages/backend/src/services/drive/add-file.ts index 6730ddff2..2f3d3c6e1 100644 --- a/packages/backend/src/services/drive/add-file.ts +++ b/packages/backend/src/services/drive/add-file.ts @@ -2,7 +2,7 @@ import * as fs from "node:fs"; import { v4 as uuid } from "uuid"; -import type S3 from "aws-sdk/clients/s3.js"; +import type S3 from "aws-sdk/clients/s3.js"; // TODO: migrate to SDK v3 import sharp from "sharp"; import { IsNull } from "typeorm"; import { publishMainStream, publishDriveStream } from "@/services/stream.js"; @@ -13,7 +13,6 @@ import { DriveFiles, DriveFolders, Users, - Instances, UserProfiles, } from "@/models/index.js"; import { DriveFile } from "@/models/entities/drive-file.js"; diff --git a/packages/backend/src/services/drive/delete-file.ts b/packages/backend/src/services/drive/delete-file.ts index 215270df6..515c1d1c6 100644 --- a/packages/backend/src/services/drive/delete-file.ts +++ b/packages/backend/src/services/drive/delete-file.ts @@ -1,6 +1,6 @@ import type { DriveFile } from "@/models/entities/drive-file.js"; import { InternalStorage } from "./internal-storage.js"; -import { DriveFiles, Instances } from "@/models/index.js"; +import { DriveFiles } from "@/models/index.js"; import { driveChart, perUserDriveChart, diff --git a/packages/backend/src/services/drive/generate-video-thumbnail.ts b/packages/backend/src/services/drive/generate-video-thumbnail.ts index 356623e79..0e3f0db58 100644 --- a/packages/backend/src/services/drive/generate-video-thumbnail.ts +++ b/packages/backend/src/services/drive/generate-video-thumbnail.ts @@ -1,4 +1,3 @@ -import * as fs from "node:fs"; import { createTempDir } from "@/misc/create-temp.js"; import type { IImage } from "./image-processor.js"; import { convertToWebp } from "./image-processor.js"; diff --git a/packages/backend/src/services/drive/logger.ts b/packages/backend/src/services/drive/logger.ts index ebde2d705..06382ddd7 100644 --- a/packages/backend/src/services/drive/logger.ts +++ b/packages/backend/src/services/drive/logger.ts @@ -1,3 +1,3 @@ -import Logger from "../logger.js"; +import Logger from "@/services/logger.js"; export const driveLogger = new Logger("drive", "blue"); diff --git a/packages/backend/src/services/drive/s3.ts b/packages/backend/src/services/drive/s3.ts index 9357be21c..d01f89cbb 100644 --- a/packages/backend/src/services/drive/s3.ts +++ b/packages/backend/src/services/drive/s3.ts @@ -1,5 +1,5 @@ import { URL } from "node:url"; -import S3 from "aws-sdk/clients/s3.js"; +import S3 from "aws-sdk/clients/s3.js"; // TODO: migrate to SDK v3 import type { Meta } from "@/models/entities/meta.js"; import { getAgentByUrl } from "@/misc/fetch.js"; diff --git a/packages/backend/src/services/fetch-instance-metadata.ts b/packages/backend/src/services/fetch-instance-metadata.ts index 01ad91764..a4cc33bca 100644 --- a/packages/backend/src/services/fetch-instance-metadata.ts +++ b/packages/backend/src/services/fetch-instance-metadata.ts @@ -6,7 +6,7 @@ import { getJson, getAgentByUrl } from "@/misc/fetch.js"; import type { Instance } from "@/models/entities/instance.js"; import { Instances } from "@/models/index.js"; import { getFetchInstanceMetadataLock } from "@/misc/app-lock.js"; -import Logger from "./logger.js"; +import Logger from "@/services/logger.js"; const logger = new Logger("metadata", "cyan"); diff --git a/packages/backend/src/services/fetch-rel-me.ts b/packages/backend/src/services/fetch-rel-me.ts index 31e7a95a5..c9a37d1c8 100644 --- a/packages/backend/src/services/fetch-rel-me.ts +++ b/packages/backend/src/services/fetch-rel-me.ts @@ -1,4 +1,3 @@ -import { getHtml } from "@/misc/fetch.js"; import { Window } from "happy-dom"; import config from "@/config/index.js"; diff --git a/packages/backend/src/services/following/create.ts b/packages/backend/src/services/following/create.ts index 3a77676b3..934b235bb 100644 --- a/packages/backend/src/services/following/create.ts +++ b/packages/backend/src/services/following/create.ts @@ -5,7 +5,7 @@ import renderAccept from "@/remote/activitypub/renderer/accept.js"; import renderReject from "@/remote/activitypub/renderer/reject.js"; import { deliver } from "@/queue/index.js"; import createFollowRequest from "./requests/create.js"; -import { registerOrFetchInstanceDoc } from "../register-or-fetch-instance-doc.js"; +import { registerOrFetchInstanceDoc } from "@/services/register-or-fetch-instance-doc.js"; import Logger from "../logger.js"; import { IdentifiableError } from "@/misc/identifiable-error.js"; import type { User } from "@/models/entities/user.js"; @@ -22,7 +22,7 @@ import { perUserFollowingChart, } from "@/services/chart/index.js"; import { genId } from "@/misc/gen-id.js"; -import { createNotification } from "../create-notification.js"; +import { createNotification } from "@/services/create-notification.js"; import { isDuplicateKeyValueError } from "@/misc/is-duplicate-key-value-error.js"; import type { Packed } from "@/misc/schema.js"; import { getActiveWebhooks } from "@/misc/webhook-cache.js"; diff --git a/packages/backend/src/services/following/delete.ts b/packages/backend/src/services/following/delete.ts index fae4bd3ce..8a07244da 100644 --- a/packages/backend/src/services/following/delete.ts +++ b/packages/backend/src/services/following/delete.ts @@ -5,7 +5,7 @@ import renderUndo from "@/remote/activitypub/renderer/undo.js"; import renderReject from "@/remote/activitypub/renderer/reject.js"; import { deliver, webhookDeliver } from "@/queue/index.js"; import Logger from "../logger.js"; -import { registerOrFetchInstanceDoc } from "../register-or-fetch-instance-doc.js"; +import { registerOrFetchInstanceDoc } from "@/services/register-or-fetch-instance-doc.js"; import type { User } from "@/models/entities/user.js"; import { Followings, Users, Instances } from "@/models/index.js"; import { diff --git a/packages/backend/src/services/following/reject.ts b/packages/backend/src/services/following/reject.ts index 7464219bf..3f461268d 100644 --- a/packages/backend/src/services/following/reject.ts +++ b/packages/backend/src/services/following/reject.ts @@ -4,7 +4,6 @@ import renderReject from "@/remote/activitypub/renderer/reject.js"; import { deliver, webhookDeliver } from "@/queue/index.js"; import { publishMainStream, publishUserEvent } from "@/services/stream.js"; import type { ILocalUser, IRemoteUser } from "@/models/entities/user.js"; -import { User } from "@/models/entities/user.js"; import { Users, FollowRequests, Followings } from "@/models/index.js"; import { decrementFollowing } from "./delete.js"; import { getActiveWebhooks } from "@/misc/webhook-cache.js"; diff --git a/packages/backend/src/services/following/requests/accept.ts b/packages/backend/src/services/following/requests/accept.ts index 6aa17b09a..1bc10f608 100644 --- a/packages/backend/src/services/following/requests/accept.ts +++ b/packages/backend/src/services/following/requests/accept.ts @@ -5,7 +5,6 @@ import { deliver } from "@/queue/index.js"; import { publishMainStream } from "@/services/stream.js"; import { insertFollowingDoc } from "../create.js"; import type { User, CacheableUser } from "@/models/entities/user.js"; -import { ILocalUser } from "@/models/entities/user.js"; import { FollowRequests, Users } from "@/models/index.js"; import { IdentifiableError } from "@/misc/identifiable-error.js"; diff --git a/packages/backend/src/services/following/requests/cancel.ts b/packages/backend/src/services/following/requests/cancel.ts index 00daae380..45b8ee063 100644 --- a/packages/backend/src/services/following/requests/cancel.ts +++ b/packages/backend/src/services/following/requests/cancel.ts @@ -5,7 +5,6 @@ import { deliver } from "@/queue/index.js"; import { publishMainStream } from "@/services/stream.js"; import { IdentifiableError } from "@/misc/identifiable-error.js"; import type { User } from "@/models/entities/user.js"; -import { ILocalUser } from "@/models/entities/user.js"; import { Users, FollowRequests } from "@/models/index.js"; export default async function ( diff --git a/packages/backend/src/services/following/requests/create.ts b/packages/backend/src/services/following/requests/create.ts index 50dbd9b3b..12dfddf30 100644 --- a/packages/backend/src/services/following/requests/create.ts +++ b/packages/backend/src/services/following/requests/create.ts @@ -5,7 +5,7 @@ import { deliver } from "@/queue/index.js"; import type { User } from "@/models/entities/user.js"; import { Blockings, FollowRequests, Users } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; -import { createNotification } from "../../create-notification.js"; +import { createNotification } from "@/services/create-notification.js"; import config from "@/config/index.js"; export default async function ( diff --git a/packages/backend/src/services/i/pin.ts b/packages/backend/src/services/i/pin.ts index ee13ce6fe..8cb1bf518 100644 --- a/packages/backend/src/services/i/pin.ts +++ b/packages/backend/src/services/i/pin.ts @@ -9,7 +9,7 @@ import { Notes, UserNotePinings, Users } from "@/models/index.js"; import type { UserNotePining } from "@/models/entities/user-note-pining.js"; import { genId } from "@/misc/gen-id.js"; import { deliverToFollowers } from "@/remote/activitypub/deliver-manager.js"; -import { deliverToRelays } from "../relay.js"; +import { deliverToRelays } from "@/services/relay.js"; /** * 指定した投稿をピン留めします diff --git a/packages/backend/src/services/i/update.ts b/packages/backend/src/services/i/update.ts index cc950ac85..21b03d982 100644 --- a/packages/backend/src/services/i/update.ts +++ b/packages/backend/src/services/i/update.ts @@ -4,7 +4,7 @@ import { Users } from "@/models/index.js"; import type { User } from "@/models/entities/user.js"; import { renderPerson } from "@/remote/activitypub/renderer/person.js"; import { deliverToFollowers } from "@/remote/activitypub/deliver-manager.js"; -import { deliverToRelays } from "../relay.js"; +import { deliverToRelays } from "@/services/relay.js"; export async function publishToFollowers(userId: User["id"]) { const user = await Users.findOneBy({ id: userId }); diff --git a/packages/backend/src/services/logger.ts b/packages/backend/src/services/logger.ts index 330d27502..df4c2e356 100644 --- a/packages/backend/src/services/logger.ts +++ b/packages/backend/src/services/logger.ts @@ -2,7 +2,7 @@ import cluster from "node:cluster"; import chalk from "chalk"; import { default as convertColor } from "color-convert"; import { format as dateFormat } from "date-fns"; -import { envOption } from "../env.js"; +import { envOption } from "@/env.js"; import config from "@/config/index.js"; import * as SyslogPro from "syslog-pro"; diff --git a/packages/backend/src/services/note/create.ts b/packages/backend/src/services/note/create.ts index cc932060b..1a80ff280 100644 --- a/packages/backend/src/services/note/create.ts +++ b/packages/backend/src/services/note/create.ts @@ -13,10 +13,10 @@ import renderAnnounce from "@/remote/activitypub/renderer/announce.js"; import { renderActivity } from "@/remote/activitypub/renderer/index.js"; import { resolveUser } from "@/remote/resolve-user.js"; import config from "@/config/index.js"; -import { updateHashtags } from "../update-hashtag.js"; +import { updateHashtags } from "@/services/update-hashtag.js"; import { concat } from "@/prelude/array.js"; import { insertNoteUnread } from "@/services/note/unread.js"; -import { registerOrFetchInstanceDoc } from "../register-or-fetch-instance-doc.js"; +import { registerOrFetchInstanceDoc } from "@/services/register-or-fetch-instance-doc.js"; import { extractMentions } from "@/misc/extract-mentions.js"; import { extractCustomEmojisFromMfm } from "@/misc/extract-custom-emojis-from-mfm.js"; import { extractHashtags } from "@/misc/extract-hashtags.js"; @@ -47,11 +47,11 @@ import { } from "@/services/chart/index.js"; import type { IPoll } from "@/models/entities/poll.js"; import { Poll } from "@/models/entities/poll.js"; -import { createNotification } from "../create-notification.js"; +import { createNotification } from "@/services/create-notification.js"; import { isDuplicateKeyValueError } from "@/misc/is-duplicate-key-value-error.js"; import { checkHitAntenna } from "@/misc/check-hit-antenna.js"; import { getWordHardMute } from "@/misc/check-word-mute.js"; -import { addNoteToAntenna } from "../add-note-to-antenna.js"; +import { addNoteToAntenna } from "@/services/add-note-to-antenna.js"; import { countSameRenotes } from "@/misc/count-same-renotes.js"; import { deliverToRelays, getCachedRelays } from "../relay.js"; import type { Channel } from "@/models/entities/channel.js"; diff --git a/packages/backend/src/services/note/delete.ts b/packages/backend/src/services/note/delete.ts index 90175ccdc..8a7582580 100644 --- a/packages/backend/src/services/note/delete.ts +++ b/packages/backend/src/services/note/delete.ts @@ -19,8 +19,8 @@ import { deliverToUser, } from "@/remote/activitypub/deliver-manager.js"; import { countSameRenotes } from "@/misc/count-same-renotes.js"; -import { registerOrFetchInstanceDoc } from "../register-or-fetch-instance-doc.js"; -import { deliverToRelays } from "../relay.js"; +import { registerOrFetchInstanceDoc } from "@/services/register-or-fetch-instance-doc.js"; +import { deliverToRelays } from "@/services/relay.js"; import meilisearch from "@/db/meilisearch.js"; /** diff --git a/packages/backend/src/services/note/polls/update.ts b/packages/backend/src/services/note/polls/update.ts index e02d48d05..270b4d9bf 100644 --- a/packages/backend/src/services/note/polls/update.ts +++ b/packages/backend/src/services/note/polls/update.ts @@ -4,7 +4,7 @@ import renderNote from "@/remote/activitypub/renderer/note.js"; import { Users, Notes } from "@/models/index.js"; import type { Note } from "@/models/entities/note.js"; import { deliverToFollowers } from "@/remote/activitypub/deliver-manager.js"; -import { deliverToRelays } from "../../relay.js"; +import { deliverToRelays } from "@/services/relay.js"; export async function deliverQuestionUpdate(noteId: Note["id"]) { const note = await Notes.findOneBy({ id: noteId }); diff --git a/packages/backend/src/services/note/polls/vote.ts b/packages/backend/src/services/note/polls/vote.ts index 582af0b17..6ade89972 100644 --- a/packages/backend/src/services/note/polls/vote.ts +++ b/packages/backend/src/services/note/polls/vote.ts @@ -1,11 +1,10 @@ import { publishNoteStream } from "@/services/stream.js"; import type { CacheableUser } from "@/models/entities/user.js"; -import { User } from "@/models/entities/user.js"; import type { Note } from "@/models/entities/note.js"; import { PollVotes, NoteWatchings, Polls, Blockings } from "@/models/index.js"; import { Not } from "typeorm"; import { genId } from "@/misc/gen-id.js"; -import { createNotification } from "../../create-notification.js"; +import { createNotification } from "@/services/create-notification.js"; export default async function ( user: CacheableUser, diff --git a/packages/backend/src/services/note/reaction/create.ts b/packages/backend/src/services/note/reaction/create.ts index 4cf1fd094..123356515 100644 --- a/packages/backend/src/services/note/reaction/create.ts +++ b/packages/backend/src/services/note/reaction/create.ts @@ -16,7 +16,7 @@ import { import { IsNull, Not } from "typeorm"; import { perUserReactionsChart } from "@/services/chart/index.js"; import { genId } from "@/misc/gen-id.js"; -import { createNotification } from "../../create-notification.js"; +import { createNotification } from "@/services/create-notification.js"; import deleteReaction from "./delete.js"; import { isDuplicateKeyValueError } from "@/misc/is-duplicate-key-value-error.js"; import type { NoteReaction } from "@/models/entities/note-reaction.js"; diff --git a/packages/backend/src/services/relay.ts b/packages/backend/src/services/relay.ts index e969d783a..fdc42616e 100644 --- a/packages/backend/src/services/relay.ts +++ b/packages/backend/src/services/relay.ts @@ -11,7 +11,7 @@ import { Users, Relays } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import { Cache } from "@/misc/cache.js"; import type { Relay } from "@/models/entities/relay.js"; -import { createSystemUser } from "./create-system-user.js"; +import { createSystemUser } from "@/services/create-system-user.js"; const ACTOR_USERNAME = "relay.actor" as const; diff --git a/packages/backend/src/services/send-email-notification.ts b/packages/backend/src/services/send-email-notification.ts index 14a9754fe..a2f422a96 100644 --- a/packages/backend/src/services/send-email-notification.ts +++ b/packages/backend/src/services/send-email-notification.ts @@ -1,8 +1,8 @@ -import { UserProfiles } from "@/models/index.js"; +// import { UserProfiles } from "@/models/index.js"; import type { User } from "@/models/entities/user.js"; -import { sendEmail } from "./send-email.js"; -import { I18n } from "@/misc/i18n.js"; -import * as Acct from "@/misc/acct.js"; +// import { sendEmail } from "./send-email.js"; +// import { I18n } from "@/misc/i18n.js"; +// import * as Acct from "@/misc/acct.js"; // TODO //const locales = await import('../../../../locales/index.js'); diff --git a/packages/backend/src/services/send-email.ts b/packages/backend/src/services/send-email.ts index 070386588..ccc6b365d 100644 --- a/packages/backend/src/services/send-email.ts +++ b/packages/backend/src/services/send-email.ts @@ -1,6 +1,6 @@ import * as nodemailer from "nodemailer"; import { fetchMeta } from "@/misc/fetch-meta.js"; -import Logger from "./logger.js"; +import Logger from "@/services/logger.js"; import config from "@/config/index.js"; export const logger = new Logger("email"); diff --git a/packages/backend/src/services/stream.ts b/packages/backend/src/services/stream.ts index f3846feaf..f59674ad6 100644 --- a/packages/backend/src/services/stream.ts +++ b/packages/backend/src/services/stream.ts @@ -1,4 +1,4 @@ -import { redisClient } from "../db/redis.js"; +import { redisClient } from "@/db/redis.js"; import type { User } from "@/models/entities/user.js"; import type { Note } from "@/models/entities/note.js"; import type { UserList } from "@/models/entities/user-list.js"; diff --git a/packages/backend/src/services/user-list/push.ts b/packages/backend/src/services/user-list/push.ts index 01bb06601..db01b0a90 100644 --- a/packages/backend/src/services/user-list/push.ts +++ b/packages/backend/src/services/user-list/push.ts @@ -5,7 +5,7 @@ import { UserListJoinings, Users } from "@/models/index.js"; import type { UserListJoining } from "@/models/entities/user-list-joining.js"; import { genId } from "@/misc/gen-id.js"; import { fetchProxyAccount } from "@/misc/fetch-proxy-account.js"; -import createFollowing from "../following/create.js"; +import createFollowing from "@/services/following/create.js"; export async function pushUserToUserList(target: User, list: UserList) { await UserListJoinings.insert({ diff --git a/packages/backend/tsconfig.json b/packages/backend/tsconfig.json index 692d7b95b..324d7da8f 100644 --- a/packages/backend/tsconfig.json +++ b/packages/backend/tsconfig.json @@ -10,7 +10,7 @@ "declaration": false, "sourceMap": false, "target": "es2021", - "module": "es2020", + "module": "esnext", "moduleResolution": "node", "allowSyntheticDefaultImports": true, "removeComments": false, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 32e8fd06c..d632f174e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -458,6 +458,12 @@ importers: '@types/bcryptjs': specifier: 2.4.2 version: 2.4.2 + '@types/color-convert': + specifier: ^2.0.2 + version: 2.0.2 + '@types/content-disposition': + specifier: ^0.5.7 + version: 0.5.7 '@types/escape-regexp': specifier: 0.0.1 version: 0.0.1 @@ -521,6 +527,12 @@ importers: '@types/oauth': specifier: 0.9.1 version: 0.9.1 + '@types/opencc-js': + specifier: ^1.0.2 + version: 1.0.2 + '@types/pg': + specifier: ^8.10.7 + version: 8.10.7 '@types/probe-image-size': specifier: ^7.2.0 version: 7.2.0 @@ -557,6 +569,9 @@ importers: '@types/sinonjs__fake-timers': specifier: 8.1.2 version: 8.1.2 + '@types/syslog-pro': + specifier: ^1.0.2 + version: 1.0.2 '@types/tinycolor2': specifier: 1.4.3 version: 1.4.3 @@ -2667,7 +2682,7 @@ packages: dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.11.18 + '@types/node': 20.8.7 jest-mock: 29.7.0 dev: true @@ -3870,14 +3885,14 @@ packages: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 - '@types/node': 18.11.18 + '@types/node': 20.8.7 /@types/cacheable-request@6.0.3: resolution: {integrity: sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==} dependencies: '@types/http-cache-semantics': 4.0.1 '@types/keyv': 3.1.4 - '@types/node': 18.11.18 + '@types/node': 20.8.7 '@types/responselike': 1.0.0 /@types/co-body@6.1.0: @@ -3887,13 +3902,23 @@ packages: '@types/qs': 6.9.7 dev: false + /@types/color-convert@2.0.2: + resolution: {integrity: sha512-KGRIgCxwcgazts4MXRCikPbIMzBpjfdgEZSy8TRHU/gtg+f9sOfHdtK8unPfxIoBtyd2aTTwINVLSNENlC8U8A==} + dependencies: + '@types/color-name': 1.1.2 + dev: true + + /@types/color-name@1.1.2: + resolution: {integrity: sha512-JWO/ZyxTKk0bLuOhAavGjnwLR73rUE7qzACnU7gMeyA/gdrSHm2xJwqNPipw2MtaZUaqQ2UG/q7pP6AQiZ8mqw==} + dev: true + /@types/connect@3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 18.11.18 + '@types/node': 20.8.7 - /@types/content-disposition@0.5.5: - resolution: {integrity: sha512-v6LCdKfK6BwcqMo+wYW05rLS12S0ZO0Fl4w1h4aaZMD7bqT3gVUns6FvLJKGZHQmYn3SX55JWGpziwJRwVgutA==} + /@types/content-disposition@0.5.7: + resolution: {integrity: sha512-V9/5u21RHFR1zfdm3rQ6pJUKV+zSSVQt+yq16i1YhdivVzWgPEoKedc3GdT8aFjsqQbakdxuy3FnEdePUQOamQ==} /@types/cookies@0.7.7: resolution: {integrity: sha512-h7BcvPUogWbKCzBR2lY4oqaZbO3jXZksexYJVFvkrFeLgbZjQkU4x8pRq6eg2MHXQhY0McQdqmmsxRWlVAHooA==} @@ -3951,7 +3976,7 @@ packages: /@types/express-serve-static-core@4.17.35: resolution: {integrity: sha512-wALWQwrgiB2AWTT91CB62b6Yt0sNHpznUXeZEcnPU3DRdlDIz74x8Qg1UUYKSVFi+va5vKOLYRBI1bRKiLLKIg==} dependencies: - '@types/node': 18.11.18 + '@types/node': 20.8.7 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 '@types/send': 0.17.1 @@ -3986,7 +4011,7 @@ packages: /@types/glob-stream@8.0.0: resolution: {integrity: sha512-fxTWwdQmX9LWSHD7ZLlv3BHR992mKcVcDnT/2v+l/QZZo7TfDdyasqlSYVzOnMGWhRbrWeWkbj/mgezFjKynhw==} dependencies: - '@types/node': 20.5.8 + '@types/node': 20.8.7 '@types/picomatch': 2.3.0 '@types/streamx': 2.9.1 dev: true @@ -4085,7 +4110,7 @@ packages: /@types/keyv@3.1.4: resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} dependencies: - '@types/node': 18.11.18 + '@types/node': 20.8.7 /@types/koa-bodyparser@4.3.10: resolution: {integrity: sha512-6ae05pjhmrmGhUR8GYD5qr5p9LTEMEGfGXCsK8VaSL+totwigm8+H/7MHW7K4854CMeuwRAubT8qcc/EagaeIA==} @@ -4195,7 +4220,7 @@ packages: resolution: {integrity: sha512-Ugmxmgk/yPRW3ptBTh9VjOLwsKWJuGbymo1uGX0qdaqqL18uJiiG1ZoV0rxCOYSaDGhvEp5Ece02Amx0iwaxQQ==} dependencies: '@types/accepts': 1.3.5 - '@types/content-disposition': 0.5.5 + '@types/content-disposition': 0.5.7 '@types/cookies': 0.7.7 '@types/http-assert': 1.5.3 '@types/http-errors': 2.0.1 @@ -4262,7 +4287,7 @@ packages: /@types/node-fetch@2.6.4: resolution: {integrity: sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==} dependencies: - '@types/node': 20.5.8 + '@types/node': 20.8.7 form-data: 3.0.1 dev: false @@ -4281,12 +4306,12 @@ packages: /@types/node@20.5.8: resolution: {integrity: sha512-eajsR9aeljqNhK028VG0Wuw+OaY5LLxYmxeoXynIoE6jannr9/Ucd1LL0hSSoafk5LTYG+FfqsyGt81Q6Zkybw==} + dev: true /@types/node@20.8.7: resolution: {integrity: sha512-21TKHHh3eUHIi2MloeptJWALuCu5H7HQTdTrWIFReA8ad+aggoX+lRes3ex7/FtpC+sVUpFMQ+QTfYr74mruiQ==} dependencies: undici-types: 5.25.3 - dev: true /@types/nodemailer@6.4.9: resolution: {integrity: sha512-XYG8Gv+sHjaOtUpiuytahMy2mM3rectgroNbs6R3djZEKmPNiIJwe9KqOJBGzKKnNZNKvnuvmugBgpq3w/S0ig==} @@ -4315,10 +4340,22 @@ packages: resolution: {integrity: sha512-PGcyveRIpL1XIqK8eBsmRBt76eFgtzuPiSTyKHZxnGemp2yzGzWpjYKAfK3wIMiU7eH+851yEpiuP8JZerTmWg==} dev: false + /@types/opencc-js@1.0.2: + resolution: {integrity: sha512-46nm84b43jngyljQkO3rwDBRfFMyLW6jflkvHb1Q3VQGGaH3Do00jO12mQNB8ErPdxr6JyBVk1tCFb9g0l7APg==} + dev: true + /@types/parse-link-header@2.0.2: resolution: {integrity: sha512-RKU5SIF0oyM2ZI0ubw66FkM/0RJUv/r84I7vJcXkcICcfeOpd1WXfpcqkFJPaWli5z3YdxMsfWojyU5uofT6sA==} dev: true + /@types/pg@8.10.7: + resolution: {integrity: sha512-ksJqHipwYaSEHz9e1fr6H6erjoEdNNaOxwyJgPx9bNeaqOW3iWBQgVHfpwiSAoqGzchfc+ZyRLwEfeCcyYD3uQ==} + dependencies: + '@types/node': 20.8.7 + pg-protocol: 1.6.0 + pg-types: 4.0.1 + dev: true + /@types/picomatch@2.3.0: resolution: {integrity: sha512-O397rnSS9iQI4OirieAtsDqvCj4+3eY1J+EPdNTKuHuRWIfUoGyzX294o8C4KJYaLqgSrd2o60c5EqCU8Zv02g==} dev: true @@ -4372,7 +4409,7 @@ packages: /@types/responselike@1.0.0: resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==} dependencies: - '@types/node': 18.11.18 + '@types/node': 20.8.7 /@types/sanitize-html@2.9.0: resolution: {integrity: sha512-4fP/kEcKNj2u39IzrxWYuf/FnCCwwQCpif6wwY6ROUS1EPRIfWJjGkY3HIowY1EX/VbX5e86yq8AAE7UPMgATg==} @@ -4396,14 +4433,14 @@ packages: resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==} dependencies: '@types/mime': 1.3.2 - '@types/node': 18.11.18 + '@types/node': 20.8.7 /@types/serve-static@1.15.2: resolution: {integrity: sha512-J2LqtvFYCzaj8pVYKw8klQXrLLk7TBZmQ4ShlcdkELFKGwGMfevMLneMMRkMgZxotOD9wg497LpC7O8PcvAmfw==} dependencies: '@types/http-errors': 2.0.1 '@types/mime': 3.0.1 - '@types/node': 18.11.18 + '@types/node': 20.8.7 /@types/sinonjs__fake-timers@8.1.1: resolution: {integrity: sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g==} @@ -4428,7 +4465,11 @@ packages: /@types/streamx@2.9.1: resolution: {integrity: sha512-9bywzhouyedmci7WCIPFwJ8zASDnxt2gaVUy52X0p0Tt085IJSAEP0L6j4SSNeDMSLzpYu6cPz0GrJZ7kPJ6Bg==} dependencies: - '@types/node': 20.5.8 + '@types/node': 20.8.7 + dev: true + + /@types/syslog-pro@1.0.2: + resolution: {integrity: sha512-wFRRgINEkchvvMi3zouVNulFsnghytbWesO79ktfs75SAMPJUDoxx0AjPWpauEGR12u1g0ky7bPzZmuWbMdYZw==} dev: true /@types/throttle-debounce@5.0.0: @@ -4523,7 +4564,7 @@ packages: resolution: {integrity: sha512-Km7XAtUIduROw7QPgvcft0lIupeG8a8rdKL8RiSyKvlE7dYY31fEn41HVuQsRFDuROA8tA4K2UVL+WdfFmErBA==} requiresBuild: true dependencies: - '@types/node': 20.5.8 + '@types/node': 20.8.7 dev: true optional: true @@ -11769,7 +11810,7 @@ packages: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.11.18 + '@types/node': 20.8.7 jest-mock: 29.7.0 jest-util: 29.7.0 dev: true @@ -11845,7 +11886,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 18.11.18 + '@types/node': 20.8.7 jest-util: 29.7.0 dev: true @@ -12027,7 +12068,7 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.11.18 + '@types/node': 20.8.7 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true @@ -13992,6 +14033,10 @@ packages: resolution: {integrity: sha512-Oh+8fK09mgGmAshFdH6hSVco6KZmd1tTwNFWj35OvzdmJTMZtAkbn05zar2iG3v6sDs1JLEtOiBGNb6BHwkb2w==} dev: true + /obuf@1.1.2: + resolution: {integrity: sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==} + dev: true + /omggif@1.0.10: resolution: {integrity: sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw==} dev: false @@ -14447,7 +14492,11 @@ packages: /pg-int8@1.0.1: resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==} engines: {node: '>=4.0.0'} - dev: false + + /pg-numeric@1.0.2: + resolution: {integrity: sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw==} + engines: {node: '>=4'} + dev: true /pg-pool@3.6.1(pg@8.11.3): resolution: {integrity: sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==} @@ -14459,7 +14508,6 @@ packages: /pg-protocol@1.6.0: resolution: {integrity: sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==} - dev: false /pg-types@2.2.0: resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==} @@ -14472,6 +14520,19 @@ packages: postgres-interval: 1.2.0 dev: false + /pg-types@4.0.1: + resolution: {integrity: sha512-hRCSDuLII9/LE3smys1hRHcu5QGcLs9ggT7I/TCs0IE+2Eesxi9+9RWAAwZ0yaGjxoWICF/YHLOEjydGujoJ+g==} + engines: {node: '>=10'} + dependencies: + pg-int8: 1.0.1 + pg-numeric: 1.0.2 + postgres-array: 3.0.2 + postgres-bytea: 3.0.0 + postgres-date: 2.0.1 + postgres-interval: 3.0.0 + postgres-range: 1.1.3 + dev: true + /pg@8.11.3: resolution: {integrity: sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==} engines: {node: '>= 8.0.0'} @@ -14881,16 +14942,33 @@ packages: engines: {node: '>=4'} dev: false + /postgres-array@3.0.2: + resolution: {integrity: sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog==} + engines: {node: '>=12'} + dev: true + /postgres-bytea@1.0.0: resolution: {integrity: sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==} engines: {node: '>=0.10.0'} dev: false + /postgres-bytea@3.0.0: + resolution: {integrity: sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw==} + engines: {node: '>= 6'} + dependencies: + obuf: 1.1.2 + dev: true + /postgres-date@1.0.7: resolution: {integrity: sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==} engines: {node: '>=0.10.0'} dev: false + /postgres-date@2.0.1: + resolution: {integrity: sha512-YtMKdsDt5Ojv1wQRvUhnyDJNSr2dGIC96mQVKz7xufp07nfuFONzdaowrMHjlAzY6GDLd4f+LUHHAAM1h4MdUw==} + engines: {node: '>=12'} + dev: true + /postgres-interval@1.2.0: resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==} engines: {node: '>=0.10.0'} @@ -14898,6 +14976,15 @@ packages: xtend: 4.0.2 dev: false + /postgres-interval@3.0.0: + resolution: {integrity: sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==} + engines: {node: '>=12'} + dev: true + + /postgres-range@1.1.3: + resolution: {integrity: sha512-VdlZoocy5lCP0c/t66xAfclglEapXPCIVhqqJRncYpvbCgImF0w67aPKfbqUMr72tO2k5q0TdTZwCLjPTI6C9g==} + dev: true + /prebuild-install@7.1.1: resolution: {integrity: sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==} engines: {node: '>=10'} @@ -17630,7 +17717,6 @@ packages: /undici-types@5.25.3: resolution: {integrity: sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==} - dev: true /undici@5.23.0: resolution: {integrity: sha512-1D7w+fvRsqlQ9GscLBwcAJinqcZGHUKjbOmXdlE/v8BvEGXjeWAax+341q44EuTcHXXnfyKNbKRq4Lg7OzhMmg==}