refactor: replace import paths containing ../ in API server

This is a big one...
This commit is contained in:
Johann150 2023-02-19 21:47:46 +01:00
parent e701bdadbe
commit 73d546372e
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1
314 changed files with 654 additions and 654 deletions

View file

@ -1,6 +1,6 @@
import { Announcements } from '@/models/index.js'; import { Announcements } from '@/models/index.js';
import { genId } from '@/misc/gen-id.js'; import { genId } from '@/misc/gen-id.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,6 +1,6 @@
import { Announcements } from '@/models/index.js'; import { Announcements } from '@/models/index.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,7 +1,7 @@
import { Announcements, AnnouncementReads } from '@/models/index.js'; import { Announcements, AnnouncementReads } from '@/models/index.js';
import { Announcement } from '@/models/entities/announcement.js'; import { Announcement } from '@/models/entities/announcement.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
import { makePaginationQuery } from '../../../common/make-pagination-query.js'; import { makePaginationQuery } from '@/server/api/common/make-pagination-query.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,6 +1,6 @@
import { Announcements } from '@/models/index.js'; import { Announcements } from '@/models/index.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,5 +1,5 @@
import { createCleanRemoteFilesJob } from '@/queue/index.js'; import { createCleanRemoteFilesJob } from '@/queue/index.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,6 +1,6 @@
import { DriveFiles } from '@/models/index.js'; import { DriveFiles } from '@/models/index.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
import { makePaginationQuery } from '../../../common/make-pagination-query.js'; import { makePaginationQuery } from '@/server/api/common/make-pagination-query.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,6 +1,6 @@
import { DriveFiles } from '@/models/index.js'; import { DriveFiles } from '@/models/index.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,7 +1,7 @@
import { In } from 'typeorm'; import { In } from 'typeorm';
import { Emojis } from '@/models/index.js'; import { Emojis } from '@/models/index.js';
import { db } from '@/db/postgre.js'; import { db } from '@/db/postgre.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -3,8 +3,8 @@ import { db } from '@/db/postgre.js';
import { Emojis, DriveFiles } from '@/models/index.js'; import { Emojis, DriveFiles } from '@/models/index.js';
import { genId } from '@/misc/gen-id.js'; import { genId } from '@/misc/gen-id.js';
import { insertModerationLog } from '@/services/insert-moderation-log.js'; import { insertModerationLog } from '@/services/insert-moderation-log.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -4,8 +4,8 @@ import { DriveFile } from '@/models/entities/drive-file.js';
import { uploadFromUrl } from '@/services/drive/upload-from-url.js'; import { uploadFromUrl } from '@/services/drive/upload-from-url.js';
import { publishBroadcastStream } from '@/services/stream.js'; import { publishBroadcastStream } from '@/services/stream.js';
import { db } from '@/db/postgre.js'; import { db } from '@/db/postgre.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -2,7 +2,7 @@ import { In } from 'typeorm';
import { Emojis } from '@/models/index.js'; import { Emojis } from '@/models/index.js';
import { insertModerationLog } from '@/services/insert-moderation-log.js'; import { insertModerationLog } from '@/services/insert-moderation-log.js';
import { db } from '@/db/postgre.js'; import { db } from '@/db/postgre.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,8 +1,8 @@
import { Emojis } from '@/models/index.js'; import { Emojis } from '@/models/index.js';
import { insertModerationLog } from '@/services/insert-moderation-log.js'; import { insertModerationLog } from '@/services/insert-moderation-log.js';
import { db } from '@/db/postgre.js'; import { db } from '@/db/postgre.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,5 +1,5 @@
import { createImportCustomEmojisJob } from '@/queue/index.js'; import { createImportCustomEmojisJob } from '@/queue/index.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
secure: true, secure: true,

View file

@ -1,7 +1,7 @@
import { Emojis } from '@/models/index.js'; import { Emojis } from '@/models/index.js';
import { toPuny } from '@/misc/convert-host.js'; import { toPuny } from '@/misc/convert-host.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
import { makePaginationQuery } from '../../../common/make-pagination-query.js'; import { makePaginationQuery } from '@/server/api/common/make-pagination-query.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,7 +1,7 @@
import { Emoji } from '@/models/entities/emoji.js'; import { Emoji } from '@/models/entities/emoji.js';
import { Emojis } from '@/models/index.js'; import { Emojis } from '@/models/index.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
import { makePaginationQuery } from '../../../common/make-pagination-query.js'; import { makePaginationQuery } from '@/server/api/common/make-pagination-query.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,7 +1,7 @@
import { In } from 'typeorm'; import { In } from 'typeorm';
import { db } from '@/db/postgre.js'; import { db } from '@/db/postgre.js';
import { Emojis } from '@/models/index.js'; import { Emojis } from '@/models/index.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,7 +1,7 @@
import { In } from 'typeorm'; import { In } from 'typeorm';
import { Emojis } from '@/models/index.js'; import { Emojis } from '@/models/index.js';
import { db } from '@/db/postgre.js'; import { db } from '@/db/postgre.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,7 +1,7 @@
import { In } from 'typeorm'; import { In } from 'typeorm';
import { db } from '@/db/postgre.js'; import { db } from '@/db/postgre.js';
import { Emojis } from '@/models/index.js'; import { Emojis } from '@/models/index.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,7 +1,7 @@
import { db } from '@/db/postgre.js'; import { db } from '@/db/postgre.js';
import { Emojis } from '@/models/index.js'; import { Emojis } from '@/models/index.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,6 +1,6 @@
import { deleteFile } from '@/services/drive/delete-file.js'; import { deleteFile } from '@/services/drive/delete-file.js';
import { DriveFiles } from '@/models/index.js'; import { DriveFiles } from '@/models/index.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -2,7 +2,7 @@ import { Instances } from '@/models/index.js';
import { toPuny } from '@/misc/convert-host.js'; import { toPuny } from '@/misc/convert-host.js';
import { ApiError } from '@/server/api/error.js'; import { ApiError } from '@/server/api/error.js';
import { fetchInstanceMetadata } from '@/services/fetch-instance-metadata.js'; import { fetchInstanceMetadata } from '@/services/fetch-instance-metadata.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,6 +1,6 @@
import deleteFollowing from '@/services/following/delete.js'; import deleteFollowing from '@/services/following/delete.js';
import { Followings, Users } from '@/models/index.js'; import { Followings, Users } from '@/models/index.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,7 +1,7 @@
import { Instances } from '@/models/index.js'; import { Instances } from '@/models/index.js';
import { toPuny } from '@/misc/convert-host.js'; import { toPuny } from '@/misc/convert-host.js';
import { ApiError } from '@/server/api/error.js'; import { ApiError } from '@/server/api/error.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,5 +1,5 @@
import { db } from '@/db/postgre.js'; import { db } from '@/db/postgre.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
requireCredential: true, requireCredential: true,

View file

@ -1,5 +1,5 @@
import { db } from '@/db/postgre.js'; import { db } from '@/db/postgre.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
requireCredential: true, requireCredential: true,

View file

@ -1,7 +1,7 @@
import { RegistrationTickets } from '@/models/index.js'; import { RegistrationTickets } from '@/models/index.js';
import { genId } from '@/misc/gen-id.js'; import { genId } from '@/misc/gen-id.js';
import { secureRndstrCustom } from '@/misc/secure-rndstr.js'; import { secureRndstrCustom } from '@/misc/secure-rndstr.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,8 +1,8 @@
import config from '@/config/index.js'; import config from '@/config/index.js';
import { fetchMeta } from '@/misc/fetch-meta.js'; import { fetchMeta } from '@/misc/fetch-meta.js';
import { TranslationService } from '@/models/entities/meta.js'; import { TranslationService } from '@/models/entities/meta.js';
import { translatorAvailable } from '../../common/translator.js'; import { translatorAvailable } from '@/server/api/common/translator.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['meta'], tags: ['meta'],

View file

@ -1,7 +1,7 @@
import { Users } from '@/models/index.js'; import { Users } from '@/models/index.js';
import { ApiError } from '@/server/api/error.js'; import { ApiError } from '@/server/api/error.js';
import { publishInternalEvent } from '@/services/stream.js'; import { publishInternalEvent } from '@/services/stream.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,7 +1,7 @@
import { Users } from '@/models/index.js'; import { Users } from '@/models/index.js';
import { ApiError } from '@/server/api/error.js'; import { ApiError } from '@/server/api/error.js';
import { publishInternalEvent } from '@/services/stream.js'; import { publishInternalEvent } from '@/services/stream.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,6 +1,6 @@
import { destroy } from '@/queue/index.js'; import { destroy } from '@/queue/index.js';
import { insertModerationLog } from '@/services/insert-moderation-log.js'; import { insertModerationLog } from '@/services/insert-moderation-log.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,6 +1,6 @@
import { URL } from 'node:url'; import { URL } from 'node:url';
import { deliverQueue } from '@/queue/queues.js'; import { deliverQueue } from '@/queue/queues.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,6 +1,6 @@
import { URL } from 'node:url'; import { URL } from 'node:url';
import { inboxQueue } from '@/queue/queues.js'; import { inboxQueue } from '@/queue/queues.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,5 +1,5 @@
import { deliverQueue, inboxQueue, dbQueue, objectStorageQueue } from '@/queue/queues.js'; import { deliverQueue, inboxQueue, dbQueue, objectStorageQueue } from '@/queue/queues.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,7 +1,7 @@
import { URL } from 'node:url'; import { URL } from 'node:url';
import { addRelay } from '@/services/relay.js'; import { addRelay } from '@/services/relay.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,5 +1,5 @@
import { listRelay } from '@/services/relay.js'; import { listRelay } from '@/services/relay.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,5 +1,5 @@
import { removeRelay } from '@/services/relay.js'; import { removeRelay } from '@/services/relay.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,6 +1,6 @@
import { AbuseUserReports } from '@/models/index.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';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -3,7 +3,7 @@ import { getInstanceActor } from '@/services/instance-actor.js';
import { deliver } from '@/queue/index.js'; import { deliver } from '@/queue/index.js';
import { renderActivity } from '@/remote/activitypub/renderer/index.js'; import { renderActivity } from '@/remote/activitypub/renderer/index.js';
import { renderFlag } from '@/remote/activitypub/renderer/flag.js'; import { renderFlag } from '@/remote/activitypub/renderer/flag.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,5 +1,5 @@
import { sendEmail } from '@/services/send-email.js'; import { sendEmail } from '@/services/send-email.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -2,7 +2,7 @@ import * as os from 'node:os';
import si from 'systeminformation'; import si from 'systeminformation';
import { db } from '@/db/postgre.js'; import { db } from '@/db/postgre.js';
import { redisClient } from '@/db/redis.js'; import { redisClient } from '@/db/redis.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
requireCredential: true, requireCredential: true,

View file

@ -1,6 +1,6 @@
import { ModerationLogs } from '@/models/index.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';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,7 +1,7 @@
import { insertModerationLog } from '@/services/insert-moderation-log.js'; import { insertModerationLog } from '@/services/insert-moderation-log.js';
import { fetchMeta, setMeta } from '@/misc/fetch-meta.js'; import { fetchMeta, setMeta } from '@/misc/fetch-meta.js';
import { TranslationService } from '@/models/entities/meta.js'; import { TranslationService } from '@/models/entities/meta.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,6 +1,6 @@
import { DAY } from '@/const.js'; import { DAY } from '@/const.js';
import { Users } from '@/models/index.js'; import { Users } from '@/models/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,8 +1,8 @@
import { IsNull } from 'typeorm'; import { IsNull } from 'typeorm';
import { Users } from '@/models/index.js'; import { Users } from '@/models/index.js';
import { ApiError } from '@/server/api/error.js'; import { ApiError } from '@/server/api/error.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
import { signup } from '../../../common/signup.js'; import { signup } from '@/server/api/common/signup.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,6 +1,6 @@
import { deleteFile } from '@/services/drive/delete-file.js'; import { deleteFile } from '@/services/drive/delete-file.js';
import { DriveFiles } from '@/models/index.js'; import { DriveFiles } from '@/models/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,7 +1,7 @@
import { Users } from '@/models/index.js'; import { Users } from '@/models/index.js';
import { ApiError } from '@/server/api/error.js'; import { ApiError } from '@/server/api/error.js';
import { deleteAccount } from '@/services/delete-account.js'; import { deleteAccount } from '@/services/delete-account.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -2,7 +2,7 @@ import { hashPassword } from '@/misc/password.js';
import { secureRndstr } from '@/misc/secure-rndstr.js'; import { secureRndstr } from '@/misc/secure-rndstr.js';
import { Users, UserProfiles } from '@/models/index.js'; import { Users, UserProfiles } from '@/models/index.js';
import { ApiError } from '@/server/api/error.js'; import { ApiError } from '@/server/api/error.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,6 +1,6 @@
import { Signins, UserProfiles, Users } from '@/models/index.js'; import { Signins, UserProfiles, Users } from '@/models/index.js';
import { ApiError } from '@/server/api/error.js'; import { ApiError } from '@/server/api/error.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -2,7 +2,7 @@ import { Users } from '@/models/index.js';
import { ApiError } from '@/server/api/error.js'; import { ApiError } from '@/server/api/error.js';
import { insertModerationLog } from '@/services/insert-moderation-log.js'; import { insertModerationLog } from '@/services/insert-moderation-log.js';
import { publishInternalEvent } from '@/services/stream.js'; import { publishInternalEvent } from '@/services/stream.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -5,7 +5,7 @@ import { ApiError } from '@/server/api/error.js';
import { insertModerationLog } from '@/services/insert-moderation-log.js'; import { insertModerationLog } from '@/services/insert-moderation-log.js';
import { doPostSuspend } from '@/services/suspend-user.js'; import { doPostSuspend } from '@/services/suspend-user.js';
import { publishUserEvent } from '@/services/stream.js'; import { publishUserEvent } from '@/services/stream.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -2,7 +2,7 @@ import { Users } from '@/models/index.js';
import { ApiError } from '@/server/api/error.js'; import { ApiError } from '@/server/api/error.js';
import { insertModerationLog } from '@/services/insert-moderation-log.js'; import { insertModerationLog } from '@/services/insert-moderation-log.js';
import { publishInternalEvent } from '@/services/stream.js'; import { publishInternalEvent } from '@/services/stream.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -2,7 +2,7 @@ import { Users } from '@/models/index.js';
import { ApiError } from '@/server/api/error.js'; import { ApiError } from '@/server/api/error.js';
import { insertModerationLog } from '@/services/insert-moderation-log.js'; import { insertModerationLog } from '@/services/insert-moderation-log.js';
import { doPostUnsuspend } from '@/services/unsuspend-user.js'; import { doPostUnsuspend } from '@/services/unsuspend-user.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,6 +1,6 @@
import { insertModerationLog } from '@/services/insert-moderation-log.js'; import { insertModerationLog } from '@/services/insert-moderation-log.js';
import { db } from '@/db/postgre.js'; import { db } from '@/db/postgre.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],

View file

@ -1,6 +1,6 @@
import { Announcements, AnnouncementReads } from '@/models/index.js'; import { Announcements, AnnouncementReads } from '@/models/index.js';
import define from '../define.js'; import define from '@/server/api/define.js';
import { makePaginationQuery } from '../common/make-pagination-query.js'; import { makePaginationQuery } from '@/server/api/common/make-pagination-query.js';
export const meta = { export const meta = {
tags: ['meta'], tags: ['meta'],

View file

@ -1,8 +1,8 @@
import { genId } from '@/misc/gen-id.js'; import { genId } from '@/misc/gen-id.js';
import { Antennas, UserLists, UserGroupJoinings } from '@/models/index.js'; import { Antennas, UserLists, UserGroupJoinings } from '@/models/index.js';
import { publishInternalEvent } from '@/services/stream.js'; import { publishInternalEvent } from '@/services/stream.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['antennas'], tags: ['antennas'],

View file

@ -1,7 +1,7 @@
import { Antennas } from '@/models/index.js'; import { Antennas } from '@/models/index.js';
import { publishInternalEvent } from '@/services/stream.js'; import { publishInternalEvent } from '@/services/stream.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['antennas'], tags: ['antennas'],

View file

@ -1,5 +1,5 @@
import { Antennas } from '@/models/index.js'; import { Antennas } from '@/models/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['antennas', 'account'], tags: ['antennas', 'account'],

View file

@ -1,11 +1,11 @@
import { readNote } from '@/services/note/read.js'; import { readNote } from '@/services/note/read.js';
import { Antennas, Notes, AntennaNotes } from '@/models/index.js'; import { Antennas, Notes, AntennaNotes } from '@/models/index.js';
import { makePaginationQuery } from '../../common/make-pagination-query.js'; import { makePaginationQuery } from '@/server/api/common/make-pagination-query.js';
import { generateVisibilityQuery } from '../../common/generate-visibility-query.js'; import { generateVisibilityQuery } from '@/server/api/common/generate-visibility-query.js';
import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js'; import { generateMutedUserQuery } from '@/server/api/common/generate-muted-user-query.js';
import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; import { generateBlockedUserQuery } from '@/server/api/common/generate-block-query.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['antennas', 'account', 'notes'], tags: ['antennas', 'account', 'notes'],

View file

@ -1,6 +1,6 @@
import { Antennas } from '@/models/index.js'; import { Antennas } from '@/models/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['antennas', 'account'], tags: ['antennas', 'account'],

View file

@ -1,7 +1,7 @@
import { Antennas, UserLists, UserGroupJoinings } from '@/models/index.js'; import { Antennas, UserLists, UserGroupJoinings } from '@/models/index.js';
import { publishInternalEvent } from '@/services/stream.js'; import { publishInternalEvent } from '@/services/stream.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['antennas'], tags: ['antennas'],

View file

@ -1,6 +1,6 @@
import { Resolver } from '@/remote/activitypub/resolver.js'; import { Resolver } from '@/remote/activitypub/resolver.js';
import { HOUR } from '@/const.js'; import { HOUR } from '@/const.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['federation'], tags: ['federation'],

View file

@ -10,8 +10,8 @@ import { isActor, isPost } from '@/remote/activitypub/type.js';
import { SchemaType } from '@/misc/schema.js'; import { SchemaType } from '@/misc/schema.js';
import { HOUR } from '@/const.js'; import { HOUR } from '@/const.js';
import { shouldBlockInstance } from '@/misc/should-block-instance.js'; import { shouldBlockInstance } from '@/misc/should-block-instance.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['federation'], tags: ['federation'],

View file

@ -2,7 +2,7 @@ import { Apps } from '@/models/index.js';
import { genId } from '@/misc/gen-id.js'; import { genId } from '@/misc/gen-id.js';
import { secureRndstr } from '@/misc/secure-rndstr.js'; import { secureRndstr } from '@/misc/secure-rndstr.js';
import { kinds } from '@/misc/api-permissions.js'; import { kinds } from '@/misc/api-permissions.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['app'], tags: ['app'],

View file

@ -1,6 +1,6 @@
import { Apps } from '@/models/index.js'; import { Apps } from '@/models/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['app'], tags: ['app'],

View file

@ -3,8 +3,8 @@ import { AuthSessions, AccessTokens, Apps } from '@/models/index.js';
import { genId } from '@/misc/gen-id.js'; import { genId } from '@/misc/gen-id.js';
import { secureRndstr } from '@/misc/secure-rndstr.js'; import { secureRndstr } from '@/misc/secure-rndstr.js';
import { kinds } from '@/misc/api-permissions.js'; import { kinds } from '@/misc/api-permissions.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['auth'], tags: ['auth'],

View file

@ -1,6 +1,6 @@
import { AuthSessions } from '@/models/index.js'; import { AuthSessions } from '@/models/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['auth'], tags: ['auth'],

View file

@ -3,8 +3,8 @@ import config from '@/config/index.js';
import { Apps, AuthSessions } from '@/models/index.js'; import { Apps, AuthSessions } from '@/models/index.js';
import { genId } from '@/misc/gen-id.js'; import { genId } from '@/misc/gen-id.js';
import { compareUrl } from '@/server/api/common/compare-url.js'; import { compareUrl } from '@/server/api/common/compare-url.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['auth'], tags: ['auth'],

View file

@ -1,6 +1,6 @@
import { AuthSessions } from '@/models/index.js'; import { AuthSessions } from '@/models/index.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['auth'], tags: ['auth'],

View file

@ -1,6 +1,6 @@
import { Apps, AuthSessions, Users } from '@/models/index.js'; import { Apps, AuthSessions, Users } from '@/models/index.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['auth'], tags: ['auth'],

View file

@ -1,9 +1,9 @@
import create from '@/services/blocking/create.js'; import create from '@/services/blocking/create.js';
import { Blockings, NoteWatchings, Users } from '@/models/index.js'; import { Blockings, NoteWatchings, Users } from '@/models/index.js';
import { HOUR } from '@/const.js'; import { HOUR } from '@/const.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
import { getUser } from '../../common/getters.js'; import { getUser } from '@/server/api/common/getters.js';
export const meta = { export const meta = {
tags: ['account'], tags: ['account'],

View file

@ -1,9 +1,9 @@
import deleteBlocking from '@/services/blocking/delete.js'; import deleteBlocking from '@/services/blocking/delete.js';
import { Blockings, Users } from '@/models/index.js'; import { Blockings, Users } from '@/models/index.js';
import { HOUR } from '@/const.js'; import { HOUR } from '@/const.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
import { getUser } from '../../common/getters.js'; import { getUser } from '@/server/api/common/getters.js';
export const meta = { export const meta = {
tags: ['account'], tags: ['account'],

View file

@ -1,6 +1,6 @@
import { Blockings } from '@/models/index.js'; import { Blockings } from '@/models/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { makePaginationQuery } from '../../common/make-pagination-query.js'; import { makePaginationQuery } from '@/server/api/common/make-pagination-query.js';
export const meta = { export const meta = {
tags: ['account'], tags: ['account'],

View file

@ -1,8 +1,8 @@
import { Channels, DriveFiles } from '@/models/index.js'; import { Channels, DriveFiles } from '@/models/index.js';
import { Channel } from '@/models/entities/channel.js'; import { Channel } from '@/models/entities/channel.js';
import { genId } from '@/misc/gen-id.js'; import { genId } from '@/misc/gen-id.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['channels'], tags: ['channels'],

View file

@ -1,5 +1,5 @@
import { Channels } from '@/models/index.js'; import { Channels } from '@/models/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['channels'], tags: ['channels'],

View file

@ -1,8 +1,8 @@
import { Channels, ChannelFollowings } from '@/models/index.js'; import { Channels, ChannelFollowings } from '@/models/index.js';
import { genId } from '@/misc/gen-id.js'; import { genId } from '@/misc/gen-id.js';
import { publishUserEvent } from '@/services/stream.js'; import { publishUserEvent } from '@/services/stream.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['channels'], tags: ['channels'],

View file

@ -1,6 +1,6 @@
import { Channels, ChannelFollowings } from '@/models/index.js'; import { Channels, ChannelFollowings } from '@/models/index.js';
import { makePaginationQuery } from '../../common/make-pagination-query.js'; import { makePaginationQuery } from '@/server/api/common/make-pagination-query.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['channels', 'account'], tags: ['channels', 'account'],

View file

@ -1,6 +1,6 @@
import { Channels } from '@/models/index.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';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['channels', 'account'], tags: ['channels', 'account'],

View file

@ -1,6 +1,6 @@
import { Channels } from '@/models/index.js'; import { Channels } from '@/models/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['channels'], tags: ['channels'],

View file

@ -1,8 +1,8 @@
import { Notes, Channels } from '@/models/index.js'; import { Notes, Channels } from '@/models/index.js';
import { activeUsersChart } from '@/services/chart/index.js'; import { activeUsersChart } from '@/services/chart/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
import { makePaginationQuery } from '../../common/make-pagination-query.js'; import { makePaginationQuery } from '@/server/api/common/make-pagination-query.js';
export const meta = { export const meta = {
tags: ['notes', 'channels'], tags: ['notes', 'channels'],

View file

@ -1,7 +1,7 @@
import { Channels, ChannelFollowings } from '@/models/index.js'; import { Channels, ChannelFollowings } from '@/models/index.js';
import { publishUserEvent } from '@/services/stream.js'; import { publishUserEvent } from '@/services/stream.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['channels'], tags: ['channels'],

View file

@ -1,6 +1,6 @@
import { Channels, DriveFiles } from '@/models/index.js'; import { Channels, DriveFiles } from '@/models/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['channels'], tags: ['channels'],

View file

@ -1,6 +1,6 @@
import { getJsonSchema } from '@/services/chart/core.js'; import { getJsonSchema } from '@/services/chart/core.js';
import { activeUsersChart } from '@/services/chart/index.js'; import { activeUsersChart } from '@/services/chart/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['charts', 'users'], tags: ['charts', 'users'],

View file

@ -1,6 +1,6 @@
import { getJsonSchema } from '@/services/chart/core.js'; import { getJsonSchema } from '@/services/chart/core.js';
import { apRequestChart } from '@/services/chart/index.js'; import { apRequestChart } from '@/services/chart/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['charts'], tags: ['charts'],

View file

@ -1,6 +1,6 @@
import { getJsonSchema } from '@/services/chart/core.js'; import { getJsonSchema } from '@/services/chart/core.js';
import { driveChart } from '@/services/chart/index.js'; import { driveChart } from '@/services/chart/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['charts', 'drive'], tags: ['charts', 'drive'],

View file

@ -1,6 +1,6 @@
import { getJsonSchema } from '@/services/chart/core.js'; import { getJsonSchema } from '@/services/chart/core.js';
import { federationChart } from '@/services/chart/index.js'; import { federationChart } from '@/services/chart/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['charts'], tags: ['charts'],

View file

@ -1,6 +1,6 @@
import { getJsonSchema } from '@/services/chart/core.js'; import { getJsonSchema } from '@/services/chart/core.js';
import { hashtagChart } from '@/services/chart/index.js'; import { hashtagChart } from '@/services/chart/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['charts', 'hashtags'], tags: ['charts', 'hashtags'],

View file

@ -1,6 +1,6 @@
import { getJsonSchema } from '@/services/chart/core.js'; import { getJsonSchema } from '@/services/chart/core.js';
import { instanceChart } from '@/services/chart/index.js'; import { instanceChart } from '@/services/chart/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['charts'], tags: ['charts'],

View file

@ -1,6 +1,6 @@
import { getJsonSchema } from '@/services/chart/core.js'; import { getJsonSchema } from '@/services/chart/core.js';
import { notesChart } from '@/services/chart/index.js'; import { notesChart } from '@/services/chart/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['charts', 'notes'], tags: ['charts', 'notes'],

View file

@ -1,6 +1,6 @@
import { getJsonSchema } from '@/services/chart/core.js'; import { getJsonSchema } from '@/services/chart/core.js';
import { perUserDriveChart } from '@/services/chart/index.js'; import { perUserDriveChart } from '@/services/chart/index.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['charts', 'drive', 'users'], tags: ['charts', 'drive', 'users'],

View file

@ -1,6 +1,6 @@
import { getJsonSchema } from '@/services/chart/core.js'; import { getJsonSchema } from '@/services/chart/core.js';
import { perUserFollowingChart } from '@/services/chart/index.js'; import { perUserFollowingChart } from '@/services/chart/index.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['charts', 'users', 'following'], tags: ['charts', 'users', 'following'],

View file

@ -1,6 +1,6 @@
import { getJsonSchema } from '@/services/chart/core.js'; import { getJsonSchema } from '@/services/chart/core.js';
import { perUserNotesChart } from '@/services/chart/index.js'; import { perUserNotesChart } from '@/services/chart/index.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['charts', 'users', 'notes'], tags: ['charts', 'users', 'notes'],

View file

@ -1,6 +1,6 @@
import { getJsonSchema } from '@/services/chart/core.js'; import { getJsonSchema } from '@/services/chart/core.js';
import { perUserReactionsChart } from '@/services/chart/index.js'; import { perUserReactionsChart } from '@/services/chart/index.js';
import define from '../../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['charts', 'users', 'reactions'], tags: ['charts', 'users', 'reactions'],

View file

@ -1,6 +1,6 @@
import { getJsonSchema } from '@/services/chart/core.js'; import { getJsonSchema } from '@/services/chart/core.js';
import { usersChart } from '@/services/chart/index.js'; import { usersChart } from '@/services/chart/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['charts', 'users'], tags: ['charts', 'users'],

View file

@ -1,8 +1,8 @@
import { ClipNotes, Clips } from '@/models/index.js'; import { ClipNotes, Clips } from '@/models/index.js';
import { genId } from '@/misc/gen-id.js'; import { genId } from '@/misc/gen-id.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
import { getNote } from '../../common/getters.js'; import { getNote } from '@/server/api/common/getters.js';
export const meta = { export const meta = {
tags: ['account', 'notes', 'clips'], tags: ['account', 'notes', 'clips'],

View file

@ -1,6 +1,6 @@
import { genId } from '@/misc/gen-id.js'; import { genId } from '@/misc/gen-id.js';
import { Clips } from '@/models/index.js'; import { Clips } from '@/models/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['clips'], tags: ['clips'],

View file

@ -1,6 +1,6 @@
import { Clips } from '@/models/index.js'; import { Clips } from '@/models/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['clips'], tags: ['clips'],

View file

@ -1,5 +1,5 @@
import { Clips } from '@/models/index.js'; import { Clips } from '@/models/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
export const meta = { export const meta = {
tags: ['clips', 'account'], tags: ['clips', 'account'],

View file

@ -1,10 +1,10 @@
import { ClipNotes, Clips, Notes } from '@/models/index.js'; import { ClipNotes, Clips, Notes } from '@/models/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { makePaginationQuery } from '../../common/make-pagination-query.js'; import { makePaginationQuery } from '@/server/api/common/make-pagination-query.js';
import { generateVisibilityQuery } from '../../common/generate-visibility-query.js'; import { generateVisibilityQuery } from '@/server/api/common/generate-visibility-query.js';
import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js'; import { generateMutedUserQuery } from '@/server/api/common/generate-muted-user-query.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; import { generateBlockedUserQuery } from '@/server/api/common/generate-block-query.js';
export const meta = { export const meta = {
tags: ['account', 'notes', 'clips'], tags: ['account', 'notes', 'clips'],

View file

@ -1,45 +1,45 @@
import { ClipNotes, Clips } from '@/models/index.js'; import { ClipNotes, Clips } from '@/models/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
import { getNote } from '../../common/getters.js'; import { getNote } from '@/server/api/common/getters.js';
export const meta = { export const meta = {
tags: ['account', 'notes', 'clips'], tags: ['account', 'notes', 'clips'],
requireCredential: true, requireCredential: true,
kind: 'write:account', kind: 'write:account',
errors: ['NO_SUCH_CLIP', 'NO_SUCH_NOTE', 'NOT_CLIPPED'], errors: ['NO_SUCH_CLIP', 'NO_SUCH_NOTE', 'NOT_CLIPPED'],
} as const; } as const;
export const paramDef = { export const paramDef = {
type: 'object', type: 'object',
properties: { properties: {
clipId: { type: 'string', format: 'misskey:id' }, clipId: { type: 'string', format: 'misskey:id' },
noteId: { type: 'string', format: 'misskey:id' }, noteId: { type: 'string', format: 'misskey:id' },
}, },
required: ['clipId', 'noteId'], required: ['clipId', 'noteId'],
} as const; } as const;
// eslint-disable-next-line import/no-default-export // eslint-disable-next-line import/no-default-export
export default define(meta, paramDef, async (ps, user) => { export default define(meta, paramDef, async (ps, user) => {
const clip = await Clips.findOneBy({ const clip = await Clips.findOneBy({
id: ps.clipId, id: ps.clipId,
userId: user.id, userId: user.id,
}); });
if (clip == null) throw new ApiError('NO_SUCH_CLIP'); if (clip == null) throw new ApiError('NO_SUCH_CLIP');
const note = await getNote(ps.noteId).catch(e => { const note = await getNote(ps.noteId).catch(e => {
if (e.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError('NO_SUCH_NOTE'); if (e.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError('NO_SUCH_NOTE');
throw e; throw e;
}); });
const { affected } = await ClipNotes.delete({ const { affected } = await ClipNotes.delete({
noteId: note.id, noteId: note.id,
clipId: clip.id, clipId: clip.id,
}); });
if (affected === 0) throw new ApiError('NOT_CLIPPED'); if (affected === 0) throw new ApiError('NOT_CLIPPED');
}); });

View file

@ -1,6 +1,6 @@
import { Clips } from '@/models/index.js'; import { Clips } from '@/models/index.js';
import define from '../../define.js'; import define from '@/server/api/define.js';
import { ApiError } from '../../error.js'; import { ApiError } from '@/server/api/error.js';
export const meta = { export const meta = {
tags: ['clips', 'account'], tags: ['clips', 'account'],

Some files were not shown because too many files have changed in this diff Show more