From 3570406b05f29a7fa50d2cf14b061bb7a763c6c6 Mon Sep 17 00:00:00 2001 From: naskya Date: Wed, 29 Nov 2023 04:22:11 +0900 Subject: [PATCH 1/6] fix: nodeinfo 2.0 compliance --- packages/backend/src/server/nodeinfo.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/backend/src/server/nodeinfo.ts b/packages/backend/src/server/nodeinfo.ts index 665636dc97..1d63868923 100644 --- a/packages/backend/src/server/nodeinfo.ts +++ b/packages/backend/src/server/nodeinfo.ts @@ -114,6 +114,7 @@ router.get(nodeinfo2_0path, async (ctx) => { // @ts-ignore base.software.repository = undefined; + base.software.homepage = undefined; ctx.body = { version: "2.0", ...base }; ctx.set("Cache-Control", "public, max-age=600"); From a6f0143017c3205fc215100711b2a9df77eb207e Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Mon, 4 Dec 2023 22:36:57 -0800 Subject: [PATCH 2/6] refactor: :recycle: isNan -> Number.isNan --- packages/backend/src/db/meilisearch.ts | 2 +- packages/backend/src/server/web/index.ts | 10 +++++----- packages/backend/src/services/note/create.ts | 4 ++-- packages/client/src/components/mfm.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/backend/src/db/meilisearch.ts b/packages/backend/src/db/meilisearch.ts index a98c3e80ce..6762986284 100644 --- a/packages/backend/src/db/meilisearch.ts +++ b/packages/backend/src/db/meilisearch.ts @@ -154,7 +154,7 @@ function timestampToUnix(timestamp: string) { if (unix === 0) { // Try to parse the timestamp as JavaScript Date const date = Date.parse(timestamp); - if (isNaN(date)) return 0; + if (Number.isNaN(date)) return 0; unix = date / 1000; } diff --git a/packages/backend/src/server/web/index.ts b/packages/backend/src/server/web/index.ts index d3c751acc6..12119ef3c3 100644 --- a/packages/backend/src/server/web/index.ts +++ b/packages/backend/src/server/web/index.ts @@ -301,12 +301,12 @@ const getFeed = async ( return; } let thread = parseInt(threadDepth, 10); - if (isNaN(thread) || thread < 0 || thread > 30) { + if (Number.isNaN(thread) || thread < 0 || thread > 30) { thread = 3; } let history = parseInt(historyCount, 10); //cant be 0 here or it will get all posts - if (isNaN(history) || history <= 0 || history > 30) { + if (Number.isNaN(history) || history <= 0 || history > 30) { history = 20; } return ( @@ -315,9 +315,9 @@ const getFeed = async ( user, thread, history, - !isNaN(noteInTitle), - isNaN(noRenotes), - isNaN(noReplies), + !Number.isNaN(noteInTitle), + Number.isNaN(noRenotes), + Number.isNaN(noReplies), )) ); }; diff --git a/packages/backend/src/services/note/create.ts b/packages/backend/src/services/note/create.ts index 1e57d20f00..ed6ab932c1 100644 --- a/packages/backend/src/services/note/create.ts +++ b/packages/backend/src/services/note/create.ts @@ -201,7 +201,7 @@ export default async ( const now = new Date(); if ( !data.createdAt || - isNaN(data.createdAt.getTime()) || + Number.isNaN(data.createdAt.getTime()) || data.createdAt > now ) data.createdAt = now; @@ -782,7 +782,7 @@ async function insertNote( await transactionalEntityManager.insert(Note, insert); let expiresAt: Date | null; - if (!data.poll.expiresAt || isNaN(data.poll.expiresAt.getTime())) { + if (!data.poll.expiresAt || Number.isNaN(data.poll.expiresAt.getTime())) { expiresAt = null; } else { expiresAt = data.poll.expiresAt; diff --git a/packages/client/src/components/mfm.ts b/packages/client/src/components/mfm.ts index 5dbf710118..8de385c40f 100644 --- a/packages/client/src/components/mfm.ts +++ b/packages/client/src/components/mfm.ts @@ -61,7 +61,7 @@ export default defineComponent({ const validNumber = (n: string | null | undefined) => { if (n == null) return null; const parsed = parseFloat(n); - return !isNaN(parsed) && isFinite(parsed) && parsed > 0; + return !Number.isNaN(parsed) && Number.isFinite(parsed) && parsed > 0; }; // const validEase = (e: string | null | undefined) => { // if (e == null) return null; From 623cadf9815bfec8ea17deb2a66304f14be5eb84 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Mon, 4 Dec 2023 23:12:10 -0800 Subject: [PATCH 3/6] Revert "chore: lint import order" This reverts commit 8d3c35c0c6521d3f394386705c4e8242f69398ee. --- packages/backend/src/boot/index.ts | 2 +- packages/backend/src/boot/master.ts | 10 +- packages/backend/src/boot/worker.ts | 2 +- packages/backend/src/config/load.ts | 4 +- packages/backend/src/daemons/queue-stats.ts | 2 +- packages/backend/src/daemons/server-stats.ts | 6 +- packages/backend/src/db/elasticsearch.ts | 2 +- packages/backend/src/db/meilisearch.ts | 2 +- packages/backend/src/db/postgre.ts | 110 +++++++-------- packages/backend/src/db/redis.ts | 2 +- packages/backend/src/mfm/to-html.ts | 6 +- packages/backend/src/misc/antenna-cache.ts | 4 +- packages/backend/src/misc/before-shutdown.ts | 2 + packages/backend/src/misc/cache.ts | 2 +- packages/backend/src/misc/captcha.ts | 6 +- .../backend/src/misc/check-hit-antenna.ts | 10 +- packages/backend/src/misc/check-word-mute.ts | 2 +- packages/backend/src/misc/convert-host.ts | 2 +- packages/backend/src/misc/detect-language.ts | 2 +- packages/backend/src/misc/download-url.ts | 8 +- packages/backend/src/misc/emoji-meta.ts | 2 +- .../misc/extract-custom-emojis-from-mfm.ts | 2 +- packages/backend/src/misc/extract-hashtags.ts | 2 +- .../backend/src/misc/fetch-proxy-account.ts | 2 +- packages/backend/src/misc/fetch.ts | 4 +- packages/backend/src/misc/gen-id.ts | 2 +- packages/backend/src/misc/get-file-info.ts | 8 +- packages/backend/src/misc/keypair-store.ts | 4 +- packages/backend/src/misc/password.ts | 2 +- packages/backend/src/misc/populate-emojis.ts | 10 +- .../backend/src/misc/process-masto-notes.ts | 12 +- packages/backend/src/misc/reaction-lib.ts | 6 +- packages/backend/src/misc/schema.ts | 58 ++++---- .../backend/src/misc/show-machine-info.ts | 2 +- .../backend/src/misc/skipped-instances.ts | 8 +- packages/backend/src/misc/webhook-cache.ts | 4 +- .../src/models/entities/abuse-user-report.ts | 6 +- .../src/models/entities/access-token.ts | 12 +- packages/backend/src/models/entities/ad.ts | 2 +- .../src/models/entities/announcement-read.ts | 8 +- .../src/models/entities/announcement.ts | 2 +- .../backend/src/models/entities/antenna.ts | 10 +- packages/backend/src/models/entities/app.ts | 4 +- .../models/entities/attestation-challenge.ts | 12 +- .../src/models/entities/auth-session.ts | 12 +- .../backend/src/models/entities/blocking.ts | 6 +- .../src/models/entities/channel-following.ts | 6 +- .../models/entities/channel-note-pining.ts | 8 +- .../backend/src/models/entities/channel.ts | 6 +- .../backend/src/models/entities/clip-note.ts | 6 +- packages/backend/src/models/entities/clip.ts | 6 +- .../backend/src/models/entities/drive-file.ts | 8 +- .../src/models/entities/drive-folder.ts | 8 +- packages/backend/src/models/entities/emoji.ts | 2 +- .../src/models/entities/follow-request.ts | 6 +- .../backend/src/models/entities/following.ts | 6 +- .../src/models/entities/gallery-like.ts | 6 +- .../src/models/entities/gallery-post.ts | 6 +- .../backend/src/models/entities/hashtag.ts | 4 +- .../backend/src/models/entities/instance.ts | 2 +- .../src/models/entities/messaging-message.ts | 10 +- packages/backend/src/models/entities/meta.ts | 4 +- .../src/models/entities/moderation-log.ts | 6 +- .../backend/src/models/entities/muted-note.ts | 6 +- .../backend/src/models/entities/muting.ts | 6 +- .../backend/src/models/entities/note-edit.ts | 6 +- .../src/models/entities/note-favorite.ts | 6 +- .../src/models/entities/note-reaction.ts | 8 +- .../src/models/entities/note-thread-muting.ts | 6 +- .../src/models/entities/note-unread.ts | 8 +- .../src/models/entities/note-watching.ts | 8 +- packages/backend/src/models/entities/note.ts | 12 +- .../src/models/entities/notification.ts | 14 +- .../backend/src/models/entities/page-like.ts | 6 +- packages/backend/src/models/entities/page.ts | 6 +- .../models/entities/password-reset-request.ts | 6 +- .../backend/src/models/entities/poll-vote.ts | 8 +- packages/backend/src/models/entities/poll.ts | 6 +- .../backend/src/models/entities/promo-note.ts | 6 +- .../backend/src/models/entities/promo-read.ts | 6 +- .../models/entities/registration-tickets.ts | 2 +- .../src/models/entities/registry-item.ts | 6 +- packages/backend/src/models/entities/relay.ts | 2 +- .../src/models/entities/renote-muting.ts | 4 +- .../backend/src/models/entities/signin.ts | 6 +- .../src/models/entities/sw-subscription.ts | 6 +- .../src/models/entities/used-username.ts | 2 +- .../models/entities/user-group-invitation.ts | 8 +- .../src/models/entities/user-group-joining.ts | 8 +- .../backend/src/models/entities/user-group.ts | 6 +- .../backend/src/models/entities/user-ip.ts | 2 +- .../src/models/entities/user-keypair.ts | 4 +- .../src/models/entities/user-list-joining.ts | 8 +- .../backend/src/models/entities/user-list.ts | 6 +- .../src/models/entities/user-note-pining.ts | 6 +- .../src/models/entities/user-pending.ts | 2 +- .../src/models/entities/user-profile.ts | 8 +- .../src/models/entities/user-publickey.ts | 6 +- .../src/models/entities/user-security-key.ts | 12 +- packages/backend/src/models/entities/user.ts | 4 +- .../backend/src/models/entities/webhook.ts | 6 +- packages/backend/src/models/index.ts | 112 ++++++++-------- .../models/repositories/abuse-user-report.ts | 2 +- .../backend/src/models/repositories/app.ts | 4 +- .../src/models/repositories/auth-session.ts | 6 +- .../src/models/repositories/blocking.ts | 8 +- .../src/models/repositories/channel.ts | 4 +- .../backend/src/models/repositories/clip.ts | 4 +- .../src/models/repositories/drive-file.ts | 12 +- .../src/models/repositories/drive-folder.ts | 4 +- .../backend/src/models/repositories/emoji.ts | 2 +- .../src/models/repositories/follow-request.ts | 2 +- .../src/models/repositories/following.ts | 8 +- .../src/models/repositories/gallery-post.ts | 6 +- .../src/models/repositories/hashtag.ts | 2 +- .../src/models/repositories/instance.ts | 2 +- .../models/repositories/messaging-message.ts | 4 +- .../models/repositories/moderation-logs.ts | 2 +- .../backend/src/models/repositories/muting.ts | 8 +- .../src/models/repositories/note-favorite.ts | 2 +- .../src/models/repositories/note-reaction.ts | 6 +- .../backend/src/models/repositories/note.ts | 38 +++--- .../src/models/repositories/notification.ts | 22 +-- .../backend/src/models/repositories/page.ts | 8 +- .../src/models/repositories/user-group.ts | 2 +- .../src/models/repositories/user-list.ts | 2 +- .../backend/src/models/repositories/user.ts | 28 ++-- packages/backend/src/queue/index.ts | 20 +-- packages/backend/src/queue/initialize.ts | 2 +- .../processors/background/index-all-notes.ts | 10 +- .../src/queue/processors/db/delete-account.ts | 12 +- .../queue/processors/db/delete-drive-files.ts | 8 +- .../queue/processors/db/export-blocking.ts | 12 +- .../processors/db/export-custom-emojis.ts | 16 +-- .../queue/processors/db/export-following.ts | 14 +- .../src/queue/processors/db/export-mute.ts | 12 +- .../src/queue/processors/db/export-notes.ts | 14 +- .../queue/processors/db/export-user-lists.ts | 12 +- .../queue/processors/db/import-blocking.ts | 10 +- .../processors/db/import-custom-emojis.ts | 12 +- .../processors/db/import-firefish-post.ts | 20 +-- .../queue/processors/db/import-following.ts | 12 +- .../queue/processors/db/import-masto-post.ts | 16 +-- .../src/queue/processors/db/import-muting.ts | 18 +-- .../src/queue/processors/db/import-posts.ts | 8 +- .../queue/processors/db/import-user-lists.ts | 22 +-- .../backend/src/queue/processors/db/index.ts | 18 +-- .../backend/src/queue/processors/deliver.ts | 14 +- .../processors/ended-poll-notification.ts | 2 +- .../backend/src/queue/processors/inbox.ts | 32 ++--- .../object-storage/clean-remote-files.ts | 6 +- .../processors/object-storage/delete-file.ts | 2 +- .../queue/processors/object-storage/index.ts | 4 +- .../system/check-expired-mutings.ts | 4 +- .../queue/processors/system/clean-charts.ts | 4 +- .../src/queue/processors/system/clean.ts | 2 +- .../src/queue/processors/system/index.ts | 6 +- .../processors/system/local-emoji-size.ts | 4 +- .../queue/processors/system/resync-charts.ts | 2 +- .../queue/processors/system/tick-charts.ts | 4 +- .../queue/processors/system/verify-links.ts | 2 +- .../src/queue/processors/webhook-deliver.ts | 8 +- packages/backend/src/queue/queues.ts | 4 +- .../src/remote/activitypub/audience.ts | 12 +- .../src/remote/activitypub/check-fetch.ts | 18 +-- .../src/remote/activitypub/db-resolver.ts | 14 +- .../src/remote/activitypub/deliver-manager.ts | 8 +- .../activitypub/kernel/accept/follow.ts | 4 +- .../remote/activitypub/kernel/accept/index.ts | 8 +- .../remote/activitypub/kernel/add/index.ts | 4 +- .../activitypub/kernel/announce/index.ts | 6 +- .../activitypub/kernel/announce/note.ts | 20 +-- .../remote/activitypub/kernel/block/index.ts | 8 +- .../remote/activitypub/kernel/create/index.ts | 10 +- .../remote/activitypub/kernel/create/note.ts | 10 +- .../remote/activitypub/kernel/delete/actor.ts | 4 +- .../remote/activitypub/kernel/delete/index.ts | 6 +- .../remote/activitypub/kernel/delete/note.ts | 6 +- .../remote/activitypub/kernel/flag/index.ts | 8 +- .../src/remote/activitypub/kernel/follow.ts | 2 +- .../src/remote/activitypub/kernel/index.ts | 64 ++++----- .../src/remote/activitypub/kernel/like.ts | 4 +- .../src/remote/activitypub/kernel/read.ts | 6 +- .../activitypub/kernel/reject/follow.ts | 6 +- .../remote/activitypub/kernel/reject/index.ts | 8 +- .../remote/activitypub/kernel/remove/index.ts | 4 +- .../remote/activitypub/kernel/undo/accept.ts | 4 +- .../activitypub/kernel/undo/announce.ts | 4 +- .../remote/activitypub/kernel/undo/block.ts | 8 +- .../remote/activitypub/kernel/undo/follow.ts | 6 +- .../remote/activitypub/kernel/undo/index.ts | 18 +-- .../remote/activitypub/kernel/undo/like.ts | 4 +- .../remote/activitypub/kernel/update/index.ts | 8 +- .../remote/activitypub/misc/get-note-html.ts | 4 +- .../remote/activitypub/misc/html-to-mfm.ts | 4 +- .../remote/activitypub/misc/ld-signature.ts | 4 +- .../src/remote/activitypub/models/image.ts | 14 +- .../src/remote/activitypub/models/mention.ts | 8 +- .../src/remote/activitypub/models/note.ts | 84 ++++++------ .../src/remote/activitypub/models/person.ts | 68 +++++----- .../src/remote/activitypub/models/question.ts | 6 +- .../src/remote/activitypub/models/tag.ts | 2 +- .../backend/src/remote/activitypub/perform.ts | 2 +- .../activitypub/renderer/follow-user.ts | 2 +- .../src/remote/activitypub/renderer/index.ts | 2 +- .../src/remote/activitypub/renderer/key.ts | 4 +- .../src/remote/activitypub/renderer/like.ts | 4 +- .../remote/activitypub/renderer/mention.ts | 2 +- .../src/remote/activitypub/renderer/note.ts | 20 +-- .../src/remote/activitypub/renderer/person.ts | 10 +- .../remote/activitypub/renderer/question.ts | 2 +- .../src/remote/activitypub/renderer/read.ts | 2 +- .../src/remote/activitypub/renderer/vote.ts | 2 +- .../backend/src/remote/activitypub/request.ts | 4 +- .../src/remote/activitypub/resolver.ts | 28 ++-- packages/backend/src/remote/resolve-user.ts | 10 +- packages/backend/src/server/activitypub.ts | 38 +++--- .../src/server/activitypub/featured.ts | 16 +-- .../src/server/activitypub/followers.ts | 24 ++-- .../src/server/activitypub/following.ts | 18 +-- .../backend/src/server/activitypub/outbox.ts | 24 ++-- packages/backend/src/server/api/2fa.ts | 2 +- .../backend/src/server/api/api-handler.ts | 4 +- .../backend/src/server/api/authenticate.ts | 10 +- packages/backend/src/server/api/call.ts | 14 +- .../api/common/generate-muted-user-query.ts | 4 +- .../common/generated-muted-renote-query.ts | 2 +- .../backend/src/server/api/common/getters.ts | 2 +- .../src/server/api/common/inject-featured.ts | 6 +- .../src/server/api/common/inject-promo.ts | 4 +- .../api/common/read-messaging-message.ts | 24 ++-- .../server/api/common/read-notification.ts | 10 +- .../backend/src/server/api/common/signin.ts | 2 +- .../backend/src/server/api/common/signup.ts | 24 ++-- packages/backend/src/server/api/define.ts | 4 +- packages/backend/src/server/api/endpoints.ts | 58 ++++---- .../api/endpoints/admin/abuse-user-reports.ts | 2 +- .../api/endpoints/admin/accounts/create.ts | 2 +- .../api/endpoints/admin/accounts/delete.ts | 6 +- .../api/endpoints/admin/accounts/hosted.ts | 4 +- .../server/api/endpoints/admin/ad/create.ts | 4 +- .../server/api/endpoints/admin/ad/delete.ts | 2 +- .../src/server/api/endpoints/admin/ad/list.ts | 2 +- .../server/api/endpoints/admin/ad/update.ts | 2 +- .../endpoints/admin/announcements/create.ts | 4 +- .../endpoints/admin/announcements/delete.ts | 2 +- .../api/endpoints/admin/announcements/list.ts | 4 +- .../endpoints/admin/announcements/update.ts | 2 +- .../server/api/endpoints/admin/delete-2fa.ts | 4 +- .../api/endpoints/admin/delete-account.ts | 2 +- .../admin/delete-all-files-of-a-user.ts | 2 +- .../api/endpoints/admin/delete-passkeys.ts | 4 +- .../admin/drive-capacity-override.ts | 2 +- .../admin/drive/clean-remote-files.ts | 2 +- .../api/endpoints/admin/drive/cleanup.ts | 4 +- .../server/api/endpoints/admin/drive/files.ts | 2 +- .../endpoints/admin/emoji/add-aliases-bulk.ts | 4 +- .../server/api/endpoints/admin/emoji/add.ts | 14 +- .../server/api/endpoints/admin/emoji/copy.ts | 10 +- .../api/endpoints/admin/emoji/delete-bulk.ts | 6 +- .../api/endpoints/admin/emoji/delete.ts | 6 +- .../api/endpoints/admin/emoji/import-zip.ts | 2 +- .../api/endpoints/admin/emoji/list-remote.ts | 8 +- .../server/api/endpoints/admin/emoji/list.ts | 4 +- .../admin/emoji/remove-aliases-bulk.ts | 4 +- .../endpoints/admin/emoji/set-aliases-bulk.ts | 4 +- .../admin/emoji/set-category-bulk.ts | 4 +- .../endpoints/admin/emoji/set-license-bulk.ts | 4 +- .../api/endpoints/admin/emoji/update.ts | 4 +- .../admin/federation/delete-all-files.ts | 2 +- .../refresh-remote-instance-metadata.ts | 4 +- .../admin/federation/remove-all-following.ts | 2 +- .../admin/federation/update-instance.ts | 4 +- .../api/endpoints/admin/get-index-stats.ts | 2 +- .../src/server/api/endpoints/admin/invite.ts | 6 +- .../src/server/api/endpoints/admin/meta.ts | 2 +- .../api/endpoints/admin/moderators/add.ts | 2 +- .../api/endpoints/admin/moderators/remove.ts | 2 +- .../api/endpoints/admin/promo/create.ts | 4 +- .../server/api/endpoints/admin/queue/clear.ts | 2 +- .../endpoints/admin/queue/deliver-delayed.ts | 2 +- .../endpoints/admin/queue/inbox-delayed.ts | 2 +- .../server/api/endpoints/admin/queue/stats.ts | 4 +- .../server/api/endpoints/admin/relays/add.ts | 2 +- .../api/endpoints/admin/reset-password.ts | 4 +- .../admin/resolve-abuse-user-report.ts | 8 +- .../api/endpoints/admin/search/index-all.ts | 2 +- .../api/endpoints/admin/send-mod-mail.ts | 10 +- .../server/api/endpoints/admin/server-info.ts | 6 +- .../endpoints/admin/show-moderation-logs.ts | 2 +- .../server/api/endpoints/admin/show-users.ts | 2 +- .../api/endpoints/admin/silence-user.ts | 2 +- .../api/endpoints/admin/suspend-user.ts | 6 +- .../api/endpoints/admin/unsilence-user.ts | 2 +- .../api/endpoints/admin/unsuspend-user.ts | 2 +- .../server/api/endpoints/admin/update-meta.ts | 4 +- .../src/server/api/endpoints/admin/vacuum.ts | 2 +- .../src/server/api/endpoints/announcements.ts | 4 +- .../server/api/endpoints/antennas/create.ts | 4 +- .../server/api/endpoints/antennas/delete.ts | 2 +- .../src/server/api/endpoints/antennas/list.ts | 2 +- .../server/api/endpoints/antennas/markread.ts | 2 +- .../server/api/endpoints/antennas/notes.ts | 12 +- .../src/server/api/endpoints/antennas/show.ts | 2 +- .../server/api/endpoints/antennas/update.ts | 2 +- .../src/server/api/endpoints/ap/get.ts | 4 +- .../src/server/api/endpoints/ap/show.ts | 26 ++-- .../src/server/api/endpoints/app/create.ts | 8 +- .../src/server/api/endpoints/app/show.ts | 2 +- .../src/server/api/endpoints/auth/accept.ts | 6 +- .../api/endpoints/auth/session/generate.ts | 6 +- .../server/api/endpoints/auth/session/show.ts | 2 +- .../api/endpoints/auth/session/userkey.ts | 2 +- .../server/api/endpoints/blocking/create.ts | 8 +- .../server/api/endpoints/blocking/delete.ts | 8 +- .../src/server/api/endpoints/blocking/list.ts | 2 +- .../server/api/endpoints/channels/create.ts | 6 +- .../server/api/endpoints/channels/featured.ts | 2 +- .../server/api/endpoints/channels/follow.ts | 4 +- .../server/api/endpoints/channels/followed.ts | 2 +- .../server/api/endpoints/channels/owned.ts | 2 +- .../server/api/endpoints/channels/search.ts | 6 +- .../src/server/api/endpoints/channels/show.ts | 2 +- .../server/api/endpoints/channels/timeline.ts | 4 +- .../server/api/endpoints/channels/unfollow.ts | 2 +- .../server/api/endpoints/channels/update.ts | 2 +- .../api/endpoints/charts/active-users.ts | 2 +- .../server/api/endpoints/charts/ap-request.ts | 2 +- .../src/server/api/endpoints/charts/drive.ts | 2 +- .../server/api/endpoints/charts/federation.ts | 2 +- .../server/api/endpoints/charts/hashtag.ts | 2 +- .../server/api/endpoints/charts/instance.ts | 2 +- .../src/server/api/endpoints/charts/notes.ts | 2 +- .../server/api/endpoints/charts/user/drive.ts | 2 +- .../server/api/endpoints/charts/user/notes.ts | 2 +- .../api/endpoints/charts/user/reactions.ts | 2 +- .../src/server/api/endpoints/charts/users.ts | 2 +- .../server/api/endpoints/clips/add-note.ts | 6 +- .../src/server/api/endpoints/clips/create.ts | 2 +- .../src/server/api/endpoints/clips/delete.ts | 2 +- .../src/server/api/endpoints/clips/list.ts | 2 +- .../src/server/api/endpoints/clips/notes.ts | 10 +- .../server/api/endpoints/clips/remove-note.ts | 4 +- .../src/server/api/endpoints/clips/show.ts | 2 +- .../src/server/api/endpoints/clips/update.ts | 2 +- .../endpoints/compatibility/custom-emojis.ts | 6 +- .../src/server/api/endpoints/drive/files.ts | 2 +- .../endpoints/drive/files/attached-notes.ts | 2 +- .../endpoints/drive/files/check-existence.ts | 2 +- .../api/endpoints/drive/files/create.ts | 10 +- .../api/endpoints/drive/files/delete.ts | 6 +- .../server/api/endpoints/drive/files/find.ts | 2 +- .../api/endpoints/drive/files/update.ts | 4 +- .../endpoints/drive/files/upload-from-url.ts | 6 +- .../src/server/api/endpoints/drive/folders.ts | 2 +- .../api/endpoints/drive/folders/create.ts | 6 +- .../api/endpoints/drive/folders/delete.ts | 4 +- .../api/endpoints/drive/folders/find.ts | 2 +- .../api/endpoints/drive/folders/show.ts | 2 +- .../api/endpoints/drive/folders/update.ts | 4 +- .../src/server/api/endpoints/drive/stream.ts | 2 +- .../backend/src/server/api/endpoints/emoji.ts | 2 +- .../api/endpoints/export-custom-emojis.ts | 2 +- .../api/endpoints/federation/followers.ts | 2 +- .../api/endpoints/federation/following.ts | 2 +- .../api/endpoints/federation/instances.ts | 4 +- .../api/endpoints/federation/show-instance.ts | 4 +- .../server/api/endpoints/federation/stats.ts | 2 +- .../federation/update-remote-user.ts | 4 +- .../server/api/endpoints/federation/users.ts | 2 +- .../src/server/api/endpoints/fetch-rss.ts | 6 +- .../server/api/endpoints/following/create.ts | 10 +- .../server/api/endpoints/following/delete.ts | 8 +- .../api/endpoints/following/invalidate.ts | 8 +- .../endpoints/following/requests/accept.ts | 4 +- .../endpoints/following/requests/cancel.ts | 8 +- .../api/endpoints/following/requests/list.ts | 2 +- .../endpoints/following/requests/reject.ts | 4 +- .../server/api/endpoints/gallery/featured.ts | 2 +- .../server/api/endpoints/gallery/popular.ts | 2 +- .../src/server/api/endpoints/gallery/posts.ts | 4 +- .../api/endpoints/gallery/posts/create.ts | 8 +- .../api/endpoints/gallery/posts/delete.ts | 2 +- .../api/endpoints/gallery/posts/like.ts | 4 +- .../api/endpoints/gallery/posts/show.ts | 2 +- .../api/endpoints/gallery/posts/unlike.ts | 2 +- .../api/endpoints/gallery/posts/update.ts | 6 +- .../api/endpoints/get-online-users-count.ts | 2 +- .../src/server/api/endpoints/get-sounds.ts | 2 +- .../src/server/api/endpoints/hashtags/list.ts | 2 +- .../server/api/endpoints/hashtags/search.ts | 4 +- .../src/server/api/endpoints/hashtags/show.ts | 4 +- .../server/api/endpoints/hashtags/trend.ts | 12 +- .../server/api/endpoints/hashtags/users.ts | 4 +- .../src/server/api/endpoints/i/2fa/done.ts | 4 +- .../server/api/endpoints/i/2fa/key-done.ts | 14 +- .../api/endpoints/i/2fa/password-less.ts | 4 +- .../api/endpoints/i/2fa/register-key.ts | 12 +- .../server/api/endpoints/i/2fa/register.ts | 8 +- .../server/api/endpoints/i/2fa/remove-key.ts | 2 +- .../server/api/endpoints/i/2fa/unregister.ts | 6 +- .../server/api/endpoints/i/2fa/update-key.ts | 6 +- .../src/server/api/endpoints/i/apps.ts | 2 +- .../server/api/endpoints/i/authorized-apps.ts | 2 +- .../server/api/endpoints/i/change-password.ts | 4 +- .../server/api/endpoints/i/delete-account.ts | 4 +- .../server/api/endpoints/i/export-blocking.ts | 4 +- .../api/endpoints/i/export-following.ts | 4 +- .../src/server/api/endpoints/i/export-mute.ts | 4 +- .../server/api/endpoints/i/export-notes.ts | 4 +- .../api/endpoints/i/export-user-lists.ts | 4 +- .../src/server/api/endpoints/i/favorites.ts | 2 +- .../server/api/endpoints/i/gallery/likes.ts | 2 +- .../server/api/endpoints/i/gallery/posts.ts | 2 +- .../endpoints/i/get-word-muted-notes-count.ts | 2 +- .../server/api/endpoints/i/import-blocking.ts | 6 +- .../api/endpoints/i/import-following.ts | 6 +- .../server/api/endpoints/i/import-muting.ts | 6 +- .../server/api/endpoints/i/import-posts.ts | 8 +- .../api/endpoints/i/import-user-lists.ts | 6 +- .../src/server/api/endpoints/i/known-as.ts | 10 +- .../src/server/api/endpoints/i/move.ts | 14 +- .../server/api/endpoints/i/notifications.ts | 12 +- .../src/server/api/endpoints/i/page-likes.ts | 2 +- .../src/server/api/endpoints/i/pages.ts | 2 +- .../backend/src/server/api/endpoints/i/pin.ts | 4 +- .../i/read-all-messaging-messages.ts | 4 +- .../api/endpoints/i/read-all-unread-notes.ts | 4 +- .../api/endpoints/i/read-announcement.ts | 4 +- .../api/endpoints/i/regenerate-token.ts | 8 +- .../api/endpoints/i/registry/get-all.ts | 2 +- .../api/endpoints/i/registry/get-detail.ts | 2 +- .../api/endpoints/i/registry/get-unsecure.ts | 4 +- .../server/api/endpoints/i/registry/get.ts | 2 +- .../endpoints/i/registry/keys-with-type.ts | 2 +- .../server/api/endpoints/i/registry/keys.ts | 2 +- .../server/api/endpoints/i/registry/remove.ts | 2 +- .../server/api/endpoints/i/registry/scopes.ts | 2 +- .../server/api/endpoints/i/registry/set.ts | 6 +- .../server/api/endpoints/i/revoke-token.ts | 2 +- .../server/api/endpoints/i/signin-history.ts | 2 +- .../src/server/api/endpoints/i/unpin.ts | 4 +- .../server/api/endpoints/i/update-email.ts | 14 +- .../src/server/api/endpoints/i/update.ts | 26 ++-- .../api/endpoints/i/user-group-invites.ts | 2 +- .../server/api/endpoints/i/webhooks/create.ts | 6 +- .../server/api/endpoints/i/webhooks/delete.ts | 2 +- .../server/api/endpoints/i/webhooks/list.ts | 2 +- .../server/api/endpoints/i/webhooks/show.ts | 2 +- .../server/api/endpoints/i/webhooks/update.ts | 4 +- .../server/api/endpoints/messaging/history.ts | 2 +- .../api/endpoints/messaging/messages.ts | 26 ++-- .../endpoints/messaging/messages/create.ts | 18 +-- .../endpoints/messaging/messages/delete.ts | 4 +- .../api/endpoints/messaging/messages/read.ts | 10 +- .../backend/src/server/api/endpoints/meta.ts | 10 +- .../server/api/endpoints/miauth/gen-token.ts | 4 +- .../src/server/api/endpoints/mute/create.ts | 8 +- .../src/server/api/endpoints/mute/delete.ts | 4 +- .../src/server/api/endpoints/mute/list.ts | 4 +- .../src/server/api/endpoints/my/apps.ts | 2 +- .../backend/src/server/api/endpoints/notes.ts | 2 +- .../server/api/endpoints/notes/children.ts | 8 +- .../src/server/api/endpoints/notes/clips.ts | 8 +- .../api/endpoints/notes/conversation.ts | 2 +- .../src/server/api/endpoints/notes/create.ts | 26 ++-- .../src/server/api/endpoints/notes/delete.ts | 10 +- .../src/server/api/endpoints/notes/edit.ts | 56 ++++---- .../api/endpoints/notes/favorites/create.ts | 4 +- .../api/endpoints/notes/favorites/delete.ts | 2 +- .../server/api/endpoints/notes/featured.ts | 4 +- .../api/endpoints/notes/global-timeline.ts | 14 +- .../api/endpoints/notes/hybrid-timeline.ts | 20 +-- .../api/endpoints/notes/local-timeline.ts | 20 +-- .../server/api/endpoints/notes/mentions.ts | 14 +- .../endpoints/notes/polls/recommendation.ts | 4 +- .../server/api/endpoints/notes/polls/vote.ts | 26 ++-- .../server/api/endpoints/notes/reactions.ts | 6 +- .../api/endpoints/notes/reactions/create.ts | 6 +- .../api/endpoints/notes/reactions/delete.ts | 8 +- .../endpoints/notes/recommended-timeline.ts | 20 +-- .../src/server/api/endpoints/notes/renotes.ts | 12 +- .../src/server/api/endpoints/notes/replies.ts | 8 +- .../api/endpoints/notes/search-by-tag.ts | 12 +- .../src/server/api/endpoints/notes/search.ts | 20 +-- .../src/server/api/endpoints/notes/show.ts | 2 +- .../endpoints/notes/thread-muting/create.ts | 8 +- .../endpoints/notes/thread-muting/delete.ts | 2 +- .../server/api/endpoints/notes/timeline.ts | 18 +-- .../server/api/endpoints/notes/translate.ts | 8 +- .../server/api/endpoints/notes/unrenote.ts | 10 +- .../api/endpoints/notes/user-list-timeline.ts | 10 +- .../api/endpoints/notes/watching/create.ts | 6 +- .../api/endpoints/notes/watching/delete.ts | 6 +- .../api/endpoints/notifications/create.ts | 2 +- .../notifications/mark-all-as-read.ts | 4 +- .../api/endpoints/notifications/read.ts | 2 +- .../src/server/api/endpoints/page-push.ts | 4 +- .../src/server/api/endpoints/pages/create.ts | 4 +- .../src/server/api/endpoints/pages/like.ts | 2 +- .../src/server/api/endpoints/pages/show.ts | 4 +- .../src/server/api/endpoints/pages/unlike.ts | 2 +- .../src/server/api/endpoints/pages/update.ts | 6 +- .../src/server/api/endpoints/patrons.ts | 8 +- .../src/server/api/endpoints/pinned-users.ts | 10 +- .../src/server/api/endpoints/promo/read.ts | 4 +- .../api/endpoints/renote-mute/create.ts | 4 +- .../api/endpoints/renote-mute/delete.ts | 2 +- .../server/api/endpoints/renote-mute/list.ts | 2 +- .../api/endpoints/request-reset-password.ts | 12 +- .../server/api/endpoints/reset-password.ts | 4 +- .../src/server/api/endpoints/server-info.ts | 4 +- .../api/endpoints/username/available.ts | 6 +- .../backend/src/server/api/endpoints/users.ts | 4 +- .../src/server/api/endpoints/users/clips.ts | 2 +- .../server/api/endpoints/users/followers.ts | 6 +- .../server/api/endpoints/users/following.ts | 6 +- .../api/endpoints/users/gallery/posts.ts | 2 +- .../users/get-frequently-replied-users.ts | 6 +- .../api/endpoints/users/groups/create.ts | 4 +- .../users/groups/invitations/accept.ts | 4 +- .../api/endpoints/users/groups/invite.ts | 16 +-- .../api/endpoints/users/groups/joined.ts | 4 +- .../api/endpoints/users/groups/leave.ts | 2 +- .../server/api/endpoints/users/groups/pull.ts | 4 +- .../server/api/endpoints/users/groups/show.ts | 2 +- .../api/endpoints/users/groups/transfer.ts | 4 +- .../api/endpoints/users/lists/create.ts | 2 +- .../server/api/endpoints/users/lists/pull.ts | 6 +- .../server/api/endpoints/users/lists/push.ts | 6 +- .../src/server/api/endpoints/users/notes.ts | 12 +- .../src/server/api/endpoints/users/pages.ts | 2 +- .../server/api/endpoints/users/reactions.ts | 4 +- .../api/endpoints/users/recommendation.ts | 14 +- .../api/endpoints/users/report-abuse.ts | 18 +-- .../users/search-by-username-and-host.ts | 8 +- .../src/server/api/endpoints/users/search.ts | 8 +- .../src/server/api/endpoints/users/show.ts | 12 +- packages/backend/src/server/api/index.ts | 24 ++-- packages/backend/src/server/api/limiter.ts | 6 +- .../mastodon/ApiMastodonCompatibleService.ts | 22 +-- .../src/server/api/mastodon/converters.ts | 2 +- .../server/api/mastodon/endpoints/account.ts | 14 +- .../server/api/mastodon/endpoints/filter.ts | 2 +- .../src/server/api/mastodon/endpoints/meta.ts | 6 +- .../api/mastodon/endpoints/notifications.ts | 4 +- .../server/api/mastodon/endpoints/search.ts | 4 +- .../server/api/mastodon/endpoints/status.ts | 12 +- .../server/api/mastodon/endpoints/timeline.ts | 8 +- .../src/server/api/openapi/gen-spec.ts | 4 +- .../backend/src/server/api/private/signin.ts | 30 ++--- .../src/server/api/private/signup-pending.ts | 6 +- .../backend/src/server/api/private/signup.ts | 18 +-- .../src/server/api/private/verify-email.ts | 4 +- .../backend/src/server/api/stream/channel.ts | 6 +- .../src/server/api/stream/channels/antenna.ts | 6 +- .../src/server/api/stream/channels/channel.ts | 8 +- .../api/stream/channels/global-timeline.ts | 4 +- .../src/server/api/stream/channels/hashtag.ts | 6 +- .../api/stream/channels/home-timeline.ts | 8 +- .../api/stream/channels/hybrid-timeline.ts | 10 +- .../src/server/api/stream/channels/index.ts | 24 ++-- .../api/stream/channels/local-timeline.ts | 4 +- .../src/server/api/stream/channels/main.ts | 2 +- .../server/api/stream/channels/messaging.ts | 10 +- .../stream/channels/recommended-timeline.ts | 10 +- .../server/api/stream/channels/user-list.ts | 6 +- .../backend/src/server/api/stream/index.ts | 30 ++--- .../backend/src/server/api/stream/types.ts | 22 +-- packages/backend/src/server/api/streaming.ts | 4 +- .../src/server/file/byte-range-readable.ts | 4 +- packages/backend/src/server/file/index.ts | 4 +- .../src/server/file/send-drive-file.ts | 22 +-- packages/backend/src/server/index.ts | 32 ++--- packages/backend/src/server/nodeinfo.ts | 10 +- packages/backend/src/server/proxy/index.ts | 2 +- .../backend/src/server/proxy/proxy-media.ts | 18 +-- packages/backend/src/server/web/feed.ts | 6 +- packages/backend/src/server/web/index.ts | 36 ++--- packages/backend/src/server/web/manifest.ts | 4 +- .../backend/src/server/web/url-preview.ts | 10 +- packages/backend/src/server/well-known.ts | 6 +- .../src/services/add-note-to-antenna.ts | 6 +- .../backend/src/services/blocking/create.ts | 22 +-- .../backend/src/services/blocking/delete.ts | 10 +- .../src/services/chart/charts/active-users.ts | 2 +- .../src/services/chart/charts/drive.ts | 2 +- .../src/services/chart/charts/federation.ts | 4 +- .../src/services/chart/charts/hashtag.ts | 4 +- .../src/services/chart/charts/instance.ts | 8 +- .../src/services/chart/charts/notes.ts | 6 +- .../services/chart/charts/per-user-drive.ts | 4 +- .../chart/charts/per-user-following.ts | 6 +- .../services/chart/charts/per-user-notes.ts | 6 +- .../chart/charts/per-user-reactions.ts | 6 +- .../src/services/chart/charts/users.ts | 6 +- packages/backend/src/services/chart/core.ts | 24 ++-- .../backend/src/services/chart/entities.ts | 24 ++-- packages/backend/src/services/chart/index.ts | 18 +-- .../src/services/create-notification.ts | 16 +-- .../src/services/create-system-user.ts | 20 +-- .../backend/src/services/detect-sensitive.ts | 2 +- .../backend/src/services/drive/add-file.ts | 50 +++---- .../backend/src/services/drive/delete-file.ts | 10 +- .../drive/generate-video-thumbnail.ts | 2 +- .../src/services/drive/internal-storage.ts | 2 +- packages/backend/src/services/drive/s3.ts | 4 +- .../src/services/drive/upload-from-url.ts | 6 +- .../src/services/fetch-instance-metadata.ts | 10 +- packages/backend/src/services/fetch-rel-me.ts | 2 +- .../backend/src/services/following/create.ts | 36 ++--- .../backend/src/services/following/delete.ts | 18 +-- .../backend/src/services/following/reject.ts | 10 +- .../services/following/requests/accept-all.ts | 2 +- .../src/services/following/requests/accept.ts | 12 +- .../src/services/following/requests/cancel.ts | 12 +- .../src/services/following/requests/create.ts | 12 +- packages/backend/src/services/i/pin.ts | 16 +-- packages/backend/src/services/i/update.ts | 10 +- .../src/services/insert-moderation-log.ts | 2 +- .../backend/src/services/instance-actor.ts | 4 +- packages/backend/src/services/logger.ts | 4 +- .../backend/src/services/messages/create.ts | 32 ++--- .../backend/src/services/messages/delete.ts | 10 +- packages/backend/src/services/note/create.ts | 126 +++++++++--------- packages/backend/src/services/note/delete.ts | 34 ++--- .../backend/src/services/note/polls/update.ts | 8 +- .../backend/src/services/note/polls/vote.ts | 10 +- .../src/services/note/reaction/create.ts | 38 +++--- .../src/services/note/reaction/delete.ts | 16 +-- packages/backend/src/services/note/read.ts | 12 +- packages/backend/src/services/note/unread.ts | 4 +- packages/backend/src/services/note/unwatch.ts | 2 +- packages/backend/src/services/note/watch.ts | 6 +- .../backend/src/services/push-notification.ts | 10 +- .../register-or-fetch-instance-doc.ts | 6 +- packages/backend/src/services/relay.ts | 16 +-- packages/backend/src/services/send-email.ts | 4 +- packages/backend/src/services/stream.ts | 12 +- packages/backend/src/services/suspend-user.ts | 10 +- .../backend/src/services/unsuspend-user.ts | 12 +- .../backend/src/services/update-hashtag.ts | 6 +- packages/backend/src/services/user-cache.ts | 4 +- .../backend/src/services/user-list/push.ts | 14 +- .../services/validate-email-for-account.ts | 4 +- 645 files changed, 2587 insertions(+), 2585 deletions(-) diff --git a/packages/backend/src/boot/index.ts b/packages/backend/src/boot/index.ts index 37c4ab0980..489350a155 100644 --- a/packages/backend/src/boot/index.ts +++ b/packages/backend/src/boot/index.ts @@ -5,11 +5,11 @@ import Xev from "xev"; import Logger from "@/services/logger.js"; import { envOption } from "../env.js"; -import os from "node:os"; // for typeorm import "reflect-metadata"; import { masterMain } from "./master.js"; import { workerMain } from "./worker.js"; +import os from "node:os"; const logger = new Logger("core", "cyan"); const clusterLogger = logger.createSubLogger("cluster", "orange", false); diff --git a/packages/backend/src/boot/master.ts b/packages/backend/src/boot/master.ts index f330d69f4b..84767a92ce 100644 --- a/packages/backend/src/boot/master.ts +++ b/packages/backend/src/boot/master.ts @@ -1,18 +1,18 @@ -import cluster from "node:cluster"; import * as fs from "node:fs"; -import * as os from "node:os"; -import { dirname } from "node:path"; import { fileURLToPath } from "node:url"; +import { dirname } from "node:path"; +import * as os from "node:os"; +import cluster from "node:cluster"; import chalk from "chalk"; import chalkTemplate from "chalk-template"; import semver from "semver"; +import Logger from "@/services/logger.js"; import loadConfig from "@/config/load.js"; import type { Config } from "@/config/types.js"; -import { db, initDb } from "@/db/postgre.js"; import { envOption } from "@/env.js"; import { showMachineInfo } from "@/misc/show-machine-info.js"; -import Logger from "@/services/logger.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 b407004ac1..0acdcd97c6 100644 --- a/packages/backend/src/boot/worker.ts +++ b/packages/backend/src/boot/worker.ts @@ -1,6 +1,6 @@ import cluster from "node:cluster"; -import os from "node:os"; import { initDb } from "@/db/postgre.js"; +import os from "node:os"; /** * Init worker process diff --git a/packages/backend/src/config/load.ts b/packages/backend/src/config/load.ts index e5279d2b21..2ff3309264 100644 --- a/packages/backend/src/config/load.ts +++ b/packages/backend/src/config/load.ts @@ -3,10 +3,10 @@ */ import * as fs from "node:fs"; -import { dirname } from "node:path"; import { fileURLToPath } from "node:url"; +import { dirname } from "node:path"; import * as yaml from "js-yaml"; -import type { Mixin, Source } from "./types.js"; +import type { Source, Mixin } from "./types.js"; const _filename = fileURLToPath(import.meta.url); const _dirname = dirname(_filename); diff --git a/packages/backend/src/daemons/queue-stats.ts b/packages/backend/src/daemons/queue-stats.ts index 82e8226e99..c358518fa4 100644 --- a/packages/backend/src/daemons/queue-stats.ts +++ b/packages/backend/src/daemons/queue-stats.ts @@ -1,5 +1,5 @@ -import { deliverQueue, inboxQueue } from "@/queue/queues.js"; import Xev from "xev"; +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 aad5d6b36c..dc7493381c 100644 --- a/packages/backend/src/daemons/server-stats.ts +++ b/packages/backend/src/daemons/server-stats.ts @@ -1,8 +1,8 @@ -import meilisearch from "@/db/meilisearch.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import * as osUtils from "os-utils"; 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"; const ev = new Xev(); diff --git a/packages/backend/src/db/elasticsearch.ts b/packages/backend/src/db/elasticsearch.ts index f6ecc1b72f..2640e7f918 100644 --- a/packages/backend/src/db/elasticsearch.ts +++ b/packages/backend/src/db/elasticsearch.ts @@ -1,5 +1,5 @@ -import config from "@/config/index.js"; import * as elasticsearch from "@elastic/elasticsearch"; +import config from "@/config/index.js"; const index = { settings: { diff --git a/packages/backend/src/db/meilisearch.ts b/packages/backend/src/db/meilisearch.ts index 6762986284..1f294058e5 100644 --- a/packages/backend/src/db/meilisearch.ts +++ b/packages/backend/src/db/meilisearch.ts @@ -1,9 +1,9 @@ import { Health, Index, MeiliSearch, Stats } from "meilisearch"; import { dbLogger } from "./logger.js"; -import * as url from "url"; import config from "@/config/index.js"; import { Note } from "@/models/entities/note.js"; +import * as url from "url"; import { ILocalUser } from "@/models/entities/user.js"; import { Followings, Users } from "@/models/index.js"; diff --git a/packages/backend/src/db/postgre.ts b/packages/backend/src/db/postgre.ts index 7d4666bba5..d68f919a75 100644 --- a/packages/backend/src/db/postgre.ts +++ b/packages/backend/src/db/postgre.ts @@ -2,76 +2,76 @@ import pg from "pg"; pg.types.setTypeParser(20, Number); -import config from "@/config/index.js"; -import * as highlight from "cli-highlight"; import type { Logger } from "typeorm"; import { DataSource } from "typeorm"; +import * as highlight from "cli-highlight"; +import config from "@/config/index.js"; -import { AbuseUserReport } from "@/models/entities/abuse-user-report.js"; -import { AccessToken } from "@/models/entities/access-token.js"; -import { Ad } from "@/models/entities/ad.js"; -import { AnnouncementRead } from "@/models/entities/announcement-read.js"; -import { Announcement } from "@/models/entities/announcement.js"; -import { Antenna } from "@/models/entities/antenna.js"; -import { App } from "@/models/entities/app.js"; -import { AttestationChallenge } from "@/models/entities/attestation-challenge.js"; -import { AuthSession } from "@/models/entities/auth-session.js"; -import { Blocking } from "@/models/entities/blocking.js"; -import { ChannelFollowing } from "@/models/entities/channel-following.js"; -import { ChannelNotePining } from "@/models/entities/channel-note-pining.js"; -import { Channel } from "@/models/entities/channel.js"; -import { ClipNote } from "@/models/entities/clip-note.js"; -import { Clip } from "@/models/entities/clip.js"; +import { User } from "@/models/entities/user.js"; import { DriveFile } from "@/models/entities/drive-file.js"; import { DriveFolder } from "@/models/entities/drive-folder.js"; -import { Emoji } from "@/models/entities/emoji.js"; -import { FollowRequest } from "@/models/entities/follow-request.js"; -import { Following } from "@/models/entities/following.js"; -import { GalleryLike } from "@/models/entities/gallery-like.js"; -import { GalleryPost } from "@/models/entities/gallery-post.js"; -import { Hashtag } from "@/models/entities/hashtag.js"; -import { Instance } from "@/models/entities/instance.js"; -import { MessagingMessage } from "@/models/entities/messaging-message.js"; -import { Meta } from "@/models/entities/meta.js"; -import { ModerationLog } from "@/models/entities/moderation-log.js"; -import { MutedNote } from "@/models/entities/muted-note.js"; -import { Muting } from "@/models/entities/muting.js"; -import { NoteEdit } from "@/models/entities/note-edit.js"; -import { NoteFavorite } from "@/models/entities/note-favorite.js"; +import { AccessToken } from "@/models/entities/access-token.js"; +import { App } from "@/models/entities/app.js"; +import { PollVote } from "@/models/entities/poll-vote.js"; +import { Note } from "@/models/entities/note.js"; import { NoteReaction } from "@/models/entities/note-reaction.js"; +import { NoteWatching } from "@/models/entities/note-watching.js"; import { NoteThreadMuting } from "@/models/entities/note-thread-muting.js"; import { NoteUnread } from "@/models/entities/note-unread.js"; -import { NoteWatching } from "@/models/entities/note-watching.js"; -import { Note } from "@/models/entities/note.js"; import { Notification } from "@/models/entities/notification.js"; -import { PageLike } from "@/models/entities/page-like.js"; -import { Page } from "@/models/entities/page.js"; -import { PasswordResetRequest } from "@/models/entities/password-reset-request.js"; -import { PollVote } from "@/models/entities/poll-vote.js"; +import { Meta } from "@/models/entities/meta.js"; +import { Following } from "@/models/entities/following.js"; +import { Instance } from "@/models/entities/instance.js"; +import { Muting } from "@/models/entities/muting.js"; +import { RenoteMuting } from "@/models/entities/renote-muting.js"; +import { SwSubscription } from "@/models/entities/sw-subscription.js"; +import { Blocking } from "@/models/entities/blocking.js"; +import { UserList } from "@/models/entities/user-list.js"; +import { UserListJoining } from "@/models/entities/user-list-joining.js"; +import { UserGroup } from "@/models/entities/user-group.js"; +import { UserGroupJoining } from "@/models/entities/user-group-joining.js"; +import { UserGroupInvitation } from "@/models/entities/user-group-invitation.js"; +import { Hashtag } from "@/models/entities/hashtag.js"; +import { NoteFavorite } from "@/models/entities/note-favorite.js"; +import { AbuseUserReport } from "@/models/entities/abuse-user-report.js"; +import { RegistrationTicket } from "@/models/entities/registration-tickets.js"; +import { MessagingMessage } from "@/models/entities/messaging-message.js"; +import { Signin } from "@/models/entities/signin.js"; +import { AuthSession } from "@/models/entities/auth-session.js"; +import { FollowRequest } from "@/models/entities/follow-request.js"; +import { Emoji } from "@/models/entities/emoji.js"; +import { UserNotePining } from "@/models/entities/user-note-pining.js"; import { Poll } from "@/models/entities/poll.js"; +import { UserKeypair } from "@/models/entities/user-keypair.js"; +import { UserPublickey } from "@/models/entities/user-publickey.js"; +import { UserProfile } from "@/models/entities/user-profile.js"; +import { UserSecurityKey } from "@/models/entities/user-security-key.js"; +import { AttestationChallenge } from "@/models/entities/attestation-challenge.js"; +import { Page } from "@/models/entities/page.js"; +import { PageLike } from "@/models/entities/page-like.js"; +import { GalleryPost } from "@/models/entities/gallery-post.js"; +import { GalleryLike } from "@/models/entities/gallery-like.js"; +import { ModerationLog } from "@/models/entities/moderation-log.js"; +import { UsedUsername } from "@/models/entities/used-username.js"; +import { Announcement } from "@/models/entities/announcement.js"; +import { AnnouncementRead } from "@/models/entities/announcement-read.js"; +import { Clip } from "@/models/entities/clip.js"; +import { ClipNote } from "@/models/entities/clip-note.js"; +import { Antenna } from "@/models/entities/antenna.js"; import { PromoNote } from "@/models/entities/promo-note.js"; import { PromoRead } from "@/models/entities/promo-read.js"; -import { RegistrationTicket } from "@/models/entities/registration-tickets.js"; -import { RegistryItem } from "@/models/entities/registry-item.js"; import { Relay } from "@/models/entities/relay.js"; -import { RenoteMuting } from "@/models/entities/renote-muting.js"; -import { Signin } from "@/models/entities/signin.js"; -import { SwSubscription } from "@/models/entities/sw-subscription.js"; -import { UsedUsername } from "@/models/entities/used-username.js"; -import { UserGroupInvitation } from "@/models/entities/user-group-invitation.js"; -import { UserGroupJoining } from "@/models/entities/user-group-joining.js"; -import { UserGroup } from "@/models/entities/user-group.js"; -import { UserIp } from "@/models/entities/user-ip.js"; -import { UserKeypair } from "@/models/entities/user-keypair.js"; -import { UserListJoining } from "@/models/entities/user-list-joining.js"; -import { UserList } from "@/models/entities/user-list.js"; -import { UserNotePining } from "@/models/entities/user-note-pining.js"; +import { MutedNote } from "@/models/entities/muted-note.js"; +import { Channel } from "@/models/entities/channel.js"; +import { ChannelFollowing } from "@/models/entities/channel-following.js"; +import { ChannelNotePining } from "@/models/entities/channel-note-pining.js"; +import { RegistryItem } from "@/models/entities/registry-item.js"; +import { Ad } from "@/models/entities/ad.js"; +import { PasswordResetRequest } from "@/models/entities/password-reset-request.js"; import { UserPending } from "@/models/entities/user-pending.js"; -import { UserProfile } from "@/models/entities/user-profile.js"; -import { UserPublickey } from "@/models/entities/user-publickey.js"; -import { UserSecurityKey } from "@/models/entities/user-security-key.js"; -import { User } from "@/models/entities/user.js"; import { Webhook } from "@/models/entities/webhook.js"; +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 { dbLogger } from "./logger.js"; diff --git a/packages/backend/src/db/redis.ts b/packages/backend/src/db/redis.ts index aa7ffbb415..215effd8ea 100644 --- a/packages/backend/src/db/redis.ts +++ b/packages/backend/src/db/redis.ts @@ -1,5 +1,5 @@ -import config from "@/config/index.js"; import Redis from "ioredis"; +import config from "@/config/index.js"; export function createConnection() { let source = config.redis; diff --git a/packages/backend/src/mfm/to-html.ts b/packages/backend/src/mfm/to-html.ts index c2f4a9e78e..47ee0c8890 100644 --- a/packages/backend/src/mfm/to-html.ts +++ b/packages/backend/src/mfm/to-html.ts @@ -1,8 +1,8 @@ -import config from "@/config/index.js"; -import type { IMentionedRemoteUsers } from "@/models/entities/note.js"; -import { intersperse } from "@/prelude/array.js"; import { Window } from "happy-dom"; import type * as mfm from "mfm-js"; +import config from "@/config/index.js"; +import { intersperse } from "@/prelude/array.js"; +import type { IMentionedRemoteUsers } from "@/models/entities/note.js"; export function toHtml( nodes: mfm.MfmNode[] | null, diff --git a/packages/backend/src/misc/antenna-cache.ts b/packages/backend/src/misc/antenna-cache.ts index a4fc874140..7f199c3967 100644 --- a/packages/backend/src/misc/antenna-cache.ts +++ b/packages/backend/src/misc/antenna-cache.ts @@ -1,6 +1,6 @@ -import { subscriber } from "@/db/redis.js"; -import type { Antenna } from "@/models/entities/antenna.js"; import { Antennas } from "@/models/index.js"; +import type { Antenna } from "@/models/entities/antenna.js"; +import { subscriber } from "@/db/redis.js"; let antennasFetched = false; let antennas: Antenna[] = []; diff --git a/packages/backend/src/misc/before-shutdown.ts b/packages/backend/src/misc/before-shutdown.ts index 721e1af1b8..0820418356 100644 --- a/packages/backend/src/misc/before-shutdown.ts +++ b/packages/backend/src/misc/before-shutdown.ts @@ -1,5 +1,7 @@ // https://gist.github.com/nfantone/1eaa803772025df69d07f4dbf5df7e58 +"use strict"; + /** * @callback BeforeShutdownListener * @param {string} [signalOrEvent] The exit signal or event name received on the process. diff --git a/packages/backend/src/misc/cache.ts b/packages/backend/src/misc/cache.ts index b86dd6ed37..913258f05a 100644 --- a/packages/backend/src/misc/cache.ts +++ b/packages/backend/src/misc/cache.ts @@ -1,6 +1,6 @@ import { redisClient } from "@/db/redis.js"; +import { encode, decode } from "msgpackr"; import { ChainableCommander } from "ioredis"; -import { decode, encode } from "msgpackr"; export class Cache { private ttl: number; diff --git a/packages/backend/src/misc/captcha.ts b/packages/backend/src/misc/captcha.ts index 4da04905f6..b3b3dca39d 100644 --- a/packages/backend/src/misc/captcha.ts +++ b/packages/backend/src/misc/captcha.ts @@ -1,7 +1,7 @@ -import { URLSearchParams } from "node:url"; -import config from "@/config/index.js"; -import { getAgentByUrl } from "@/misc/fetch.js"; import fetch from "node-fetch"; +import { URLSearchParams } from "node:url"; +import { getAgentByUrl } from "@/misc/fetch.js"; +import config from "@/config/index.js"; export async function verifyRecaptcha(secret: string, response: string) { const result = await getCaptchaResponse( diff --git a/packages/backend/src/misc/check-hit-antenna.ts b/packages/backend/src/misc/check-hit-antenna.ts index 6d2a01ac08..1f4f2f2fae 100644 --- a/packages/backend/src/misc/check-hit-antenna.ts +++ b/packages/backend/src/misc/check-hit-antenna.ts @@ -1,12 +1,12 @@ -import * as Acct from "@/misc/acct.js"; -import { Cache } from "@/misc/cache.js"; -import { getWordHardMute } from "@/misc/check-word-mute.js"; -import { getFullApAccount } from "@/misc/convert-host.js"; -import type { Packed } from "@/misc/schema.js"; 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 "@/misc/convert-host.js"; +import * as Acct from "@/misc/acct.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/misc/check-word-mute.ts b/packages/backend/src/misc/check-word-mute.ts index c5348d168d..5686aef2f7 100644 --- a/packages/backend/src/misc/check-word-mute.ts +++ b/packages/backend/src/misc/check-word-mute.ts @@ -1,5 +1,5 @@ -import type { Note } from "@/models/entities/note.js"; import RE2 from "re2"; +import type { Note } from "@/models/entities/note.js"; type NoteLike = { userId: Note["userId"]; diff --git a/packages/backend/src/misc/convert-host.ts b/packages/backend/src/misc/convert-host.ts index 3d7a7abbd7..856ce3c127 100644 --- a/packages/backend/src/misc/convert-host.ts +++ b/packages/backend/src/misc/convert-host.ts @@ -1,6 +1,6 @@ import { URL } from "node:url"; -import { toASCII } from "punycode"; import config from "@/config/index.js"; +import { toASCII } from "punycode"; export function getFullApAccount(username: string, host: string | null) { return host diff --git a/packages/backend/src/misc/detect-language.ts b/packages/backend/src/misc/detect-language.ts index 15763d5afa..6147247dee 100644 --- a/packages/backend/src/misc/detect-language.ts +++ b/packages/backend/src/misc/detect-language.ts @@ -1,5 +1,5 @@ -import * as mfm from "mfm-js"; import { detect } from "tinyld"; +import * as mfm from "mfm-js"; export default function detectLanguage(text: string): string { const nodes = mfm.parse(text); diff --git a/packages/backend/src/misc/download-url.ts b/packages/backend/src/misc/download-url.ts index 0112dcfbac..83680c175f 100644 --- a/packages/backend/src/misc/download-url.ts +++ b/packages/backend/src/misc/download-url.ts @@ -1,13 +1,13 @@ import * as fs from "node:fs"; import * as stream from "node:stream"; import * as util from "node:util"; -import config from "@/config/index.js"; -import Logger from "@/services/logger.js"; -import chalk from "chalk"; import got, * as Got from "got"; +import { httpAgent, httpsAgent, StatusError } from "./fetch.js"; +import config from "@/config/index.js"; +import chalk from "chalk"; +import Logger from "@/services/logger.js"; import IPCIDR from "ip-cidr"; import PrivateIp from "private-ip"; -import { StatusError, httpAgent, httpsAgent } from "./fetch.js"; const pipeline = util.promisify(stream.pipeline); diff --git a/packages/backend/src/misc/emoji-meta.ts b/packages/backend/src/misc/emoji-meta.ts index 360cf93145..2b9365b826 100644 --- a/packages/backend/src/misc/emoji-meta.ts +++ b/packages/backend/src/misc/emoji-meta.ts @@ -2,9 +2,9 @@ import probeImageSize from "probe-image-size"; import { Mutex } from "redis-semaphore"; import { FILE_TYPE_BROWSERSAFE } from "@/const.js"; -import { redisClient } from "@/db/redis.js"; import Logger from "@/services/logger.js"; import { Cache } from "./cache.js"; +import { redisClient } from "@/db/redis.js"; export type Size = { width: number; diff --git a/packages/backend/src/misc/extract-custom-emojis-from-mfm.ts b/packages/backend/src/misc/extract-custom-emojis-from-mfm.ts index f79f8c431c..7de32e6d60 100644 --- a/packages/backend/src/misc/extract-custom-emojis-from-mfm.ts +++ b/packages/backend/src/misc/extract-custom-emojis-from-mfm.ts @@ -1,5 +1,5 @@ -import { unique } from "@/prelude/array.js"; import * as mfm from "mfm-js"; +import { unique } from "@/prelude/array.js"; export function extractCustomEmojisFromMfm(nodes: mfm.MfmNode[]): string[] { const emojiNodes = mfm.extract(nodes, (node) => { diff --git a/packages/backend/src/misc/extract-hashtags.ts b/packages/backend/src/misc/extract-hashtags.ts index 2b575e8a9e..826e36221b 100644 --- a/packages/backend/src/misc/extract-hashtags.ts +++ b/packages/backend/src/misc/extract-hashtags.ts @@ -1,5 +1,5 @@ -import { unique } from "@/prelude/array.js"; import * as mfm from "mfm-js"; +import { unique } from "@/prelude/array.js"; export function extractHashtags(nodes: mfm.MfmNode[]): string[] { const hashtagNodes = mfm.extract(nodes, (node) => node.type === "hashtag"); diff --git a/packages/backend/src/misc/fetch-proxy-account.ts b/packages/backend/src/misc/fetch-proxy-account.ts index 4aa20cbcbb..a277db6fb9 100644 --- a/packages/backend/src/misc/fetch-proxy-account.ts +++ b/packages/backend/src/misc/fetch-proxy-account.ts @@ -1,6 +1,6 @@ +import { fetchMeta } from "./fetch-meta.js"; import type { ILocalUser } from "@/models/entities/user.js"; import { Users } from "@/models/index.js"; -import { fetchMeta } from "./fetch-meta.js"; export async function fetchProxyAccount(): Promise { const meta = await fetchMeta(); diff --git a/packages/backend/src/misc/fetch.ts b/packages/backend/src/misc/fetch.ts index d7e8ce69fb..e47ef0d47a 100644 --- a/packages/backend/src/misc/fetch.ts +++ b/packages/backend/src/misc/fetch.ts @@ -1,10 +1,10 @@ import * as http from "node:http"; import * as https from "node:https"; import type { URL } from "node:url"; -import config from "@/config/index.js"; import CacheableLookup from "cacheable-lookup"; -import { HttpProxyAgent, HttpsProxyAgent } from "hpagent"; import fetch from "node-fetch"; +import { HttpProxyAgent, HttpsProxyAgent } from "hpagent"; +import config from "@/config/index.js"; export async function getJson( url: string, diff --git a/packages/backend/src/misc/gen-id.ts b/packages/backend/src/misc/gen-id.ts index 5da622b97a..737bbe488f 100644 --- a/packages/backend/src/misc/gen-id.ts +++ b/packages/backend/src/misc/gen-id.ts @@ -1,8 +1,8 @@ import config from "@/config/index.js"; import { nativeCreateId, - nativeGetTimestamp, nativeInitIdGenerator, + nativeGetTimestamp, } from "native-utils/built/index.js"; const length = Math.min(Math.max(config.cuid?.length ?? 16, 16), 24); diff --git a/packages/backend/src/misc/get-file-info.ts b/packages/backend/src/misc/get-file-info.ts index a008e9c294..76964890e7 100644 --- a/packages/backend/src/misc/get-file-info.ts +++ b/packages/backend/src/misc/get-file-info.ts @@ -1,17 +1,17 @@ -import * as crypto from "node:crypto"; import * as fs from "node:fs"; +import * as crypto from "node:crypto"; import { join } from "node:path"; import * as stream from "node:stream"; import * as util from "node:util"; -import { detectSensitive } from "@/services/detect-sensitive.js"; -import { encode } from "blurhash"; import { FSWatcher } from "chokidar"; import { fileTypeFromFile } from "file-type"; +import probeImageSize from "probe-image-size"; import FFmpeg from "fluent-ffmpeg"; import isSvg from "is-svg"; import { type predictionType } from "nsfwjs"; -import probeImageSize from "probe-image-size"; import sharp from "sharp"; +import { encode } from "blurhash"; +import { detectSensitive } from "@/services/detect-sensitive.js"; import { createTempDir } from "./create-temp.js"; const pipeline = util.promisify(stream.pipeline); diff --git a/packages/backend/src/misc/keypair-store.ts b/packages/backend/src/misc/keypair-store.ts index b8c0ed5dcd..6255773599 100644 --- a/packages/backend/src/misc/keypair-store.ts +++ b/packages/backend/src/misc/keypair-store.ts @@ -1,6 +1,6 @@ -import type { UserKeypair } from "@/models/entities/user-keypair.js"; -import type { User } from "@/models/entities/user.js"; import { UserKeypairs } from "@/models/index.js"; +import type { User } from "@/models/entities/user.js"; +import type { UserKeypair } from "@/models/entities/user-keypair.js"; import { Cache } from "./cache.js"; const cache = new Cache("keypairStore", 60 * 30); diff --git a/packages/backend/src/misc/password.ts b/packages/backend/src/misc/password.ts index 52c1393424..c63f89f5c9 100644 --- a/packages/backend/src/misc/password.ts +++ b/packages/backend/src/misc/password.ts @@ -1,5 +1,5 @@ -import * as argon2 from "argon2"; import bcrypt from "bcryptjs"; +import * as argon2 from "argon2"; export async function hashPassword(password: string): Promise { return argon2.hash(password); diff --git a/packages/backend/src/misc/populate-emojis.ts b/packages/backend/src/misc/populate-emojis.ts index d509a9f5be..795a267f91 100644 --- a/packages/backend/src/misc/populate-emojis.ts +++ b/packages/backend/src/misc/populate-emojis.ts @@ -1,13 +1,13 @@ -import config from "@/config/index.js"; -import { redisClient } from "@/db/redis.js"; +import { In, IsNull } from "typeorm"; +import { Emojis } from "@/models/index.js"; import type { Emoji } from "@/models/entities/emoji.js"; import type { Note } from "@/models/entities/note.js"; -import { Emojis } from "@/models/index.js"; -import { query } from "@/prelude/url.js"; -import { In, IsNull } from "typeorm"; import { Cache } from "./cache.js"; import { isSelfHost, toPunyNullable } from "./convert-host.js"; import { decodeReaction } from "./reaction-lib.js"; +import config from "@/config/index.js"; +import { query } from "@/prelude/url.js"; +import { redisClient } from "@/db/redis.js"; const cache = new Cache("populateEmojis", 60 * 60 * 12); diff --git a/packages/backend/src/misc/process-masto-notes.ts b/packages/backend/src/misc/process-masto-notes.ts index 886574218c..1327b4cff0 100644 --- a/packages/backend/src/misc/process-masto-notes.ts +++ b/packages/backend/src/misc/process-masto-notes.ts @@ -1,13 +1,13 @@ import * as fs from "node:fs"; -import * as Path from "node:path"; -import { Users } from "@/models/index.js"; -import { addFile } from "@/services/drive/add-file.js"; import Logger from "@/services/logger.js"; -import decompress from "decompress"; -import gunzip from "gunzip-maybe"; -import * as tar from "tar-stream"; import { createTemp, createTempDir } from "./create-temp.js"; import { downloadUrl } from "./download-url.js"; +import { addFile } from "@/services/drive/add-file.js"; +import { Users } from "@/models/index.js"; +import * as tar from "tar-stream"; +import gunzip from "gunzip-maybe"; +import decompress from "decompress"; +import * as Path from "node:path"; const logger = new Logger("process-masto-notes"); diff --git a/packages/backend/src/misc/reaction-lib.ts b/packages/backend/src/misc/reaction-lib.ts index b3e4903fa3..db88b05900 100644 --- a/packages/backend/src/misc/reaction-lib.ts +++ b/packages/backend/src/misc/reaction-lib.ts @@ -1,8 +1,8 @@ -import { Emojis } from "@/models/index.js"; -import { IsNull } from "typeorm"; -import { toPunyNullable } from "./convert-host.js"; import { emojiRegex } from "./emoji-regex.js"; import { fetchMeta } from "./fetch-meta.js"; +import { Emojis } from "@/models/index.js"; +import { toPunyNullable } from "./convert-host.js"; +import { IsNull } from "typeorm"; export function convertReactions(reactions: Record) { const result = new Map(); diff --git a/packages/backend/src/misc/schema.ts b/packages/backend/src/misc/schema.ts index 4e0fdc5d4b..6e03d30d91 100644 --- a/packages/backend/src/misc/schema.ts +++ b/packages/backend/src/misc/schema.ts @@ -1,36 +1,36 @@ -import { packedAntennaSchema } from "@/models/schema/antenna.js"; -import { packedAppSchema } from "@/models/schema/app.js"; -import { packedBlockingSchema } from "@/models/schema/blocking.js"; -import { packedChannelSchema } from "@/models/schema/channel.js"; -import { packedClipSchema } from "@/models/schema/clip.js"; -import { packedDriveFileSchema } from "@/models/schema/drive-file.js"; -import { packedDriveFolderSchema } from "@/models/schema/drive-folder.js"; -import { packedEmojiSchema } from "@/models/schema/emoji.js"; -import { packedFederationInstanceSchema } from "@/models/schema/federation-instance.js"; -import { packedFollowingSchema } from "@/models/schema/following.js"; -import { packedGalleryPostSchema } from "@/models/schema/gallery-post.js"; -import { packedHashtagSchema } from "@/models/schema/hashtag.js"; -import { packedMessagingMessageSchema } from "@/models/schema/messaging-message.js"; -import { packedMutingSchema } from "@/models/schema/muting.js"; -import { packedNoteEdit } from "@/models/schema/note-edit.js"; -import { packedNoteFavoriteSchema } from "@/models/schema/note-favorite.js"; -import { packedNoteReactionSchema } from "@/models/schema/note-reaction.js"; -import { packedNoteSchema } from "@/models/schema/note.js"; -import { packedNotificationSchema } from "@/models/schema/notification.js"; -import { packedPageSchema } from "@/models/schema/page.js"; -import { packedQueueCountSchema } from "@/models/schema/queue.js"; -import { packedRenoteMutingSchema } from "@/models/schema/renote-muting.js"; -import { packedUserGroupSchema } from "@/models/schema/user-group.js"; -import { packedUserListSchema } from "@/models/schema/user-list.js"; import { - packedMeDetailedOnlySchema, - packedMeDetailedSchema, - packedUserDetailedNotMeOnlySchema, - packedUserDetailedNotMeSchema, - packedUserDetailedSchema, packedUserLiteSchema, + packedUserDetailedNotMeOnlySchema, + packedMeDetailedOnlySchema, + packedUserDetailedNotMeSchema, + packedMeDetailedSchema, + packedUserDetailedSchema, packedUserSchema, } from "@/models/schema/user.js"; +import { packedNoteSchema } from "@/models/schema/note.js"; +import { packedUserListSchema } from "@/models/schema/user-list.js"; +import { packedAppSchema } from "@/models/schema/app.js"; +import { packedMessagingMessageSchema } from "@/models/schema/messaging-message.js"; +import { packedNotificationSchema } from "@/models/schema/notification.js"; +import { packedDriveFileSchema } from "@/models/schema/drive-file.js"; +import { packedDriveFolderSchema } from "@/models/schema/drive-folder.js"; +import { packedFollowingSchema } from "@/models/schema/following.js"; +import { packedMutingSchema } from "@/models/schema/muting.js"; +import { packedRenoteMutingSchema } from "@/models/schema/renote-muting.js"; +import { packedBlockingSchema } from "@/models/schema/blocking.js"; +import { packedNoteReactionSchema } from "@/models/schema/note-reaction.js"; +import { packedHashtagSchema } from "@/models/schema/hashtag.js"; +import { packedPageSchema } from "@/models/schema/page.js"; +import { packedUserGroupSchema } from "@/models/schema/user-group.js"; +import { packedNoteFavoriteSchema } from "@/models/schema/note-favorite.js"; +import { packedChannelSchema } from "@/models/schema/channel.js"; +import { packedAntennaSchema } from "@/models/schema/antenna.js"; +import { packedClipSchema } from "@/models/schema/clip.js"; +import { packedFederationInstanceSchema } from "@/models/schema/federation-instance.js"; +import { packedQueueCountSchema } from "@/models/schema/queue.js"; +import { packedGalleryPostSchema } from "@/models/schema/gallery-post.js"; +import { packedEmojiSchema } from "@/models/schema/emoji.js"; +import { packedNoteEdit } from "@/models/schema/note-edit.js"; export const refs = { UserLite: packedUserLiteSchema, diff --git a/packages/backend/src/misc/show-machine-info.ts b/packages/backend/src/misc/show-machine-info.ts index 7b5db8d2aa..d3a28cbd37 100644 --- a/packages/backend/src/misc/show-machine-info.ts +++ b/packages/backend/src/misc/show-machine-info.ts @@ -1,6 +1,6 @@ import * as os from "node:os"; -import type Logger from "@/services/logger.js"; import sysUtils from "systeminformation"; +import type Logger from "@/services/logger.js"; export async function showMachineInfo(parentLogger: Logger) { const logger = parentLogger.createSubLogger("machine"); diff --git a/packages/backend/src/misc/skipped-instances.ts b/packages/backend/src/misc/skipped-instances.ts index 59d5a2fc6e..785393022a 100644 --- a/packages/backend/src/misc/skipped-instances.ts +++ b/packages/backend/src/misc/skipped-instances.ts @@ -1,8 +1,8 @@ -import { DAY } from "@/const.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import type { Instance } from "@/models/entities/instance.js"; -import { Instances } from "@/models/index.js"; import { Brackets } from "typeorm"; +import { fetchMeta } from "@/misc/fetch-meta.js"; +import { Instances } from "@/models/index.js"; +import type { Instance } from "@/models/entities/instance.js"; +import { DAY } from "@/const.js"; import { shouldBlockInstance } from "./should-block-instance.js"; // Threshold from last contact after which an instance will be considered diff --git a/packages/backend/src/misc/webhook-cache.ts b/packages/backend/src/misc/webhook-cache.ts index 6ffbde5cb7..1eda5eaecd 100644 --- a/packages/backend/src/misc/webhook-cache.ts +++ b/packages/backend/src/misc/webhook-cache.ts @@ -1,6 +1,6 @@ -import { subscriber } from "@/db/redis.js"; -import type { Webhook } from "@/models/entities/webhook.js"; import { Webhooks } from "@/models/index.js"; +import type { Webhook } from "@/models/entities/webhook.js"; +import { subscriber } from "@/db/redis.js"; let webhooksFetched = false; let webhooks: Webhook[] = []; diff --git a/packages/backend/src/models/entities/abuse-user-report.ts b/packages/backend/src/models/entities/abuse-user-report.ts index 47063cca53..cb4d55851d 100644 --- a/packages/backend/src/models/entities/abuse-user-report.ts +++ b/packages/backend/src/models/entities/abuse-user-report.ts @@ -1,13 +1,13 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() export class AbuseUserReport { diff --git a/packages/backend/src/models/entities/access-token.ts b/packages/backend/src/models/entities/access-token.ts index 260f3f832d..8b950b171b 100644 --- a/packages/backend/src/models/entities/access-token.ts +++ b/packages/backend/src/models/entities/access-token.ts @@ -1,14 +1,14 @@ import { - Column, Entity, - Index, - JoinColumn, - ManyToOne, PrimaryColumn, + Index, + Column, + ManyToOne, + JoinColumn, } from "typeorm"; -import { id } from "../id.js"; -import { App } from "./app.js"; import { User } from "./user.js"; +import { App } from "./app.js"; +import { id } from "../id.js"; @Entity() export class AccessToken { diff --git a/packages/backend/src/models/entities/ad.ts b/packages/backend/src/models/entities/ad.ts index 0fad2bdbbb..80d54ddd52 100644 --- a/packages/backend/src/models/entities/ad.ts +++ b/packages/backend/src/models/entities/ad.ts @@ -1,4 +1,4 @@ -import { Column, Entity, Index, PrimaryColumn } from "typeorm"; +import { Entity, Index, Column, PrimaryColumn } from "typeorm"; import { id } from "../id.js"; @Entity() diff --git a/packages/backend/src/models/entities/announcement-read.ts b/packages/backend/src/models/entities/announcement-read.ts index 68dcbffc0c..79af9e48e3 100644 --- a/packages/backend/src/models/entities/announcement-read.ts +++ b/packages/backend/src/models/entities/announcement-read.ts @@ -1,14 +1,14 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; -import { Announcement } from "./announcement.js"; import { User } from "./user.js"; +import { Announcement } from "./announcement.js"; +import { id } from "../id.js"; @Entity() @Index(["userId", "announcementId"], { unique: true }) diff --git a/packages/backend/src/models/entities/announcement.ts b/packages/backend/src/models/entities/announcement.ts index baa69ebe8b..7872c0fe1c 100644 --- a/packages/backend/src/models/entities/announcement.ts +++ b/packages/backend/src/models/entities/announcement.ts @@ -1,4 +1,4 @@ -import { Column, Entity, Index, PrimaryColumn } from "typeorm"; +import { Entity, Index, Column, PrimaryColumn } from "typeorm"; import { id } from "../id.js"; @Entity() diff --git a/packages/backend/src/models/entities/antenna.ts b/packages/backend/src/models/entities/antenna.ts index b535afc1e9..633dcc1d27 100644 --- a/packages/backend/src/models/entities/antenna.ts +++ b/packages/backend/src/models/entities/antenna.ts @@ -1,15 +1,15 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; -import { UserGroupJoining } from "./user-group-joining.js"; -import { UserList } from "./user-list.js"; import { User } from "./user.js"; +import { id } from "../id.js"; +import { UserList } from "./user-list.js"; +import { UserGroupJoining } from "./user-group-joining.js"; @Entity() export class Antenna { diff --git a/packages/backend/src/models/entities/app.ts b/packages/backend/src/models/entities/app.ts index 30f893c1aa..a41e35aa91 100644 --- a/packages/backend/src/models/entities/app.ts +++ b/packages/backend/src/models/entities/app.ts @@ -1,6 +1,6 @@ -import { Column, Entity, Index, ManyToOne, PrimaryColumn } from "typeorm"; -import { id } from "../id.js"; +import { Entity, PrimaryColumn, Column, Index, ManyToOne } from "typeorm"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() export class App { diff --git a/packages/backend/src/models/entities/attestation-challenge.ts b/packages/backend/src/models/entities/attestation-challenge.ts index 1fe363a236..6a3a9c8ed7 100644 --- a/packages/backend/src/models/entities/attestation-challenge.ts +++ b/packages/backend/src/models/entities/attestation-challenge.ts @@ -1,13 +1,13 @@ import { - Column, - Entity, - Index, - JoinColumn, - ManyToOne, PrimaryColumn, + Entity, + JoinColumn, + Column, + ManyToOne, + Index, } from "typeorm"; -import { id } from "../id.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() export class AttestationChallenge { diff --git a/packages/backend/src/models/entities/auth-session.ts b/packages/backend/src/models/entities/auth-session.ts index c7028cff09..b31dca56cf 100644 --- a/packages/backend/src/models/entities/auth-session.ts +++ b/packages/backend/src/models/entities/auth-session.ts @@ -1,14 +1,14 @@ import { - Column, Entity, - Index, - JoinColumn, - ManyToOne, PrimaryColumn, + Index, + Column, + ManyToOne, + JoinColumn, } from "typeorm"; -import { id } from "../id.js"; -import { App } from "./app.js"; import { User } from "./user.js"; +import { App } from "./app.js"; +import { id } from "../id.js"; @Entity() export class AuthSession { diff --git a/packages/backend/src/models/entities/blocking.ts b/packages/backend/src/models/entities/blocking.ts index edbbca9c11..55f677a981 100644 --- a/packages/backend/src/models/entities/blocking.ts +++ b/packages/backend/src/models/entities/blocking.ts @@ -1,13 +1,13 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() @Index(["blockerId", "blockeeId"], { unique: true }) diff --git a/packages/backend/src/models/entities/channel-following.ts b/packages/backend/src/models/entities/channel-following.ts index 9c1ac9eacc..ee329fa50f 100644 --- a/packages/backend/src/models/entities/channel-following.ts +++ b/packages/backend/src/models/entities/channel-following.ts @@ -1,14 +1,14 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; +import { User } from "./user.js"; import { id } from "../id.js"; import { Channel } from "./channel.js"; -import { User } from "./user.js"; @Entity() @Index(["followerId", "followeeId"], { unique: true }) diff --git a/packages/backend/src/models/entities/channel-note-pining.ts b/packages/backend/src/models/entities/channel-note-pining.ts index adef9a4612..67d1d48ccd 100644 --- a/packages/backend/src/models/entities/channel-note-pining.ts +++ b/packages/backend/src/models/entities/channel-note-pining.ts @@ -1,14 +1,14 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; -import { Channel } from "./channel.js"; import { Note } from "./note.js"; +import { Channel } from "./channel.js"; +import { id } from "../id.js"; @Entity() @Index(["channelId", "noteId"], { unique: true }) diff --git a/packages/backend/src/models/entities/channel.ts b/packages/backend/src/models/entities/channel.ts index 06b835c0f2..ea22fed50b 100644 --- a/packages/backend/src/models/entities/channel.ts +++ b/packages/backend/src/models/entities/channel.ts @@ -1,14 +1,14 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; +import { User } from "./user.js"; import { id } from "../id.js"; import { DriveFile } from "./drive-file.js"; -import { User } from "./user.js"; @Entity() export class Channel { diff --git a/packages/backend/src/models/entities/clip-note.ts b/packages/backend/src/models/entities/clip-note.ts index 1e2c0f89a0..1697474a84 100644 --- a/packages/backend/src/models/entities/clip-note.ts +++ b/packages/backend/src/models/entities/clip-note.ts @@ -1,14 +1,14 @@ import { - Column, Entity, Index, JoinColumn, + Column, ManyToOne, PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; -import { Clip } from "./clip.js"; import { Note } from "./note.js"; +import { Clip } from "./clip.js"; +import { id } from "../id.js"; @Entity() @Index(["noteId", "clipId"], { unique: true }) diff --git a/packages/backend/src/models/entities/clip.ts b/packages/backend/src/models/entities/clip.ts index 8f5ce524e3..9554703a4c 100644 --- a/packages/backend/src/models/entities/clip.ts +++ b/packages/backend/src/models/entities/clip.ts @@ -1,13 +1,13 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() export class Clip { diff --git a/packages/backend/src/models/entities/drive-file.ts b/packages/backend/src/models/entities/drive-file.ts index 1174a628f5..da93f32a82 100644 --- a/packages/backend/src/models/entities/drive-file.ts +++ b/packages/backend/src/models/entities/drive-file.ts @@ -1,15 +1,15 @@ -import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; import { id } from "../id.js"; -import { DriveFolder } from "./drive-folder.js"; import { User } from "./user.js"; +import { DriveFolder } from "./drive-folder.js"; +import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; @Entity() @Index(["userId", "folderId", "id"]) diff --git a/packages/backend/src/models/entities/drive-folder.ts b/packages/backend/src/models/entities/drive-folder.ts index bc4ef9d309..0bb2c7a3d2 100644 --- a/packages/backend/src/models/entities/drive-folder.ts +++ b/packages/backend/src/models/entities/drive-folder.ts @@ -1,13 +1,13 @@ import { - Column, - Entity, - Index, JoinColumn, ManyToOne, + Entity, PrimaryColumn, + Index, + Column, } from "typeorm"; -import { id } from "../id.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() export class DriveFolder { diff --git a/packages/backend/src/models/entities/emoji.ts b/packages/backend/src/models/entities/emoji.ts index 760213e670..87b525dc59 100644 --- a/packages/backend/src/models/entities/emoji.ts +++ b/packages/backend/src/models/entities/emoji.ts @@ -1,4 +1,4 @@ -import { Column, Entity, Index, PrimaryColumn } from "typeorm"; +import { PrimaryColumn, Entity, Index, Column } from "typeorm"; import { id } from "../id.js"; @Entity() diff --git a/packages/backend/src/models/entities/follow-request.ts b/packages/backend/src/models/entities/follow-request.ts index 3e4bf423b4..281eab9174 100644 --- a/packages/backend/src/models/entities/follow-request.ts +++ b/packages/backend/src/models/entities/follow-request.ts @@ -1,13 +1,13 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() @Index(["followerId", "followeeId"], { unique: true }) diff --git a/packages/backend/src/models/entities/following.ts b/packages/backend/src/models/entities/following.ts index 841553e5f7..ea8f325650 100644 --- a/packages/backend/src/models/entities/following.ts +++ b/packages/backend/src/models/entities/following.ts @@ -1,13 +1,13 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() @Index(["followerId", "followeeId"], { unique: true }) diff --git a/packages/backend/src/models/entities/gallery-like.ts b/packages/backend/src/models/entities/gallery-like.ts index 8393930ae9..259feb8bbb 100644 --- a/packages/backend/src/models/entities/gallery-like.ts +++ b/packages/backend/src/models/entities/gallery-like.ts @@ -1,14 +1,14 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; +import { User } from "./user.js"; import { id } from "../id.js"; import { GalleryPost } from "./gallery-post.js"; -import { User } from "./user.js"; @Entity() @Index(["userId", "postId"], { unique: true }) diff --git a/packages/backend/src/models/entities/gallery-post.ts b/packages/backend/src/models/entities/gallery-post.ts index 601d323a84..938348659d 100644 --- a/packages/backend/src/models/entities/gallery-post.ts +++ b/packages/backend/src/models/entities/gallery-post.ts @@ -1,14 +1,14 @@ import { - Column, Entity, Index, JoinColumn, - ManyToOne, + Column, PrimaryColumn, + ManyToOne, } from "typeorm"; +import { User } from "./user.js"; import { id } from "../id.js"; import type { DriveFile } from "./drive-file.js"; -import { User } from "./user.js"; @Entity() export class GalleryPost { diff --git a/packages/backend/src/models/entities/hashtag.ts b/packages/backend/src/models/entities/hashtag.ts index 60a4c4049d..7b3df1cc22 100644 --- a/packages/backend/src/models/entities/hashtag.ts +++ b/packages/backend/src/models/entities/hashtag.ts @@ -1,6 +1,6 @@ -import { Column, Entity, Index, PrimaryColumn } from "typeorm"; -import { id } from "../id.js"; +import { Entity, PrimaryColumn, Index, Column } from "typeorm"; import type { User } from "./user.js"; +import { id } from "../id.js"; @Entity() export class Hashtag { diff --git a/packages/backend/src/models/entities/instance.ts b/packages/backend/src/models/entities/instance.ts index d2e147803d..7b7701d07d 100644 --- a/packages/backend/src/models/entities/instance.ts +++ b/packages/backend/src/models/entities/instance.ts @@ -1,4 +1,4 @@ -import { Column, Entity, Index, PrimaryColumn } from "typeorm"; +import { Entity, PrimaryColumn, Index, Column } from "typeorm"; import { id } from "../id.js"; @Entity() diff --git a/packages/backend/src/models/entities/messaging-message.ts b/packages/backend/src/models/entities/messaging-message.ts index 38fcb92d35..d1da00eaef 100644 --- a/packages/backend/src/models/entities/messaging-message.ts +++ b/packages/backend/src/models/entities/messaging-message.ts @@ -1,15 +1,15 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; -import { DriveFile } from "./drive-file.js"; -import { UserGroup } from "./user-group.js"; import { User } from "./user.js"; +import { DriveFile } from "./drive-file.js"; +import { id } from "../id.js"; +import { UserGroup } from "./user-group.js"; @Entity() export class MessagingMessage { diff --git a/packages/backend/src/models/entities/meta.ts b/packages/backend/src/models/entities/meta.ts index b8e71368d3..c1e3be58f4 100644 --- a/packages/backend/src/models/entities/meta.ts +++ b/packages/backend/src/models/entities/meta.ts @@ -1,7 +1,7 @@ -import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm"; +import { Entity, Column, PrimaryColumn, ManyToOne, JoinColumn } from "typeorm"; import { id } from "../id.js"; -import type { Clip } from "./clip.js"; import { User } from "./user.js"; +import type { Clip } from "./clip.js"; @Entity() export class Meta { diff --git a/packages/backend/src/models/entities/moderation-log.ts b/packages/backend/src/models/entities/moderation-log.ts index dd81139512..26bf1cdfa4 100644 --- a/packages/backend/src/models/entities/moderation-log.ts +++ b/packages/backend/src/models/entities/moderation-log.ts @@ -1,13 +1,13 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() export class ModerationLog { diff --git a/packages/backend/src/models/entities/muted-note.ts b/packages/backend/src/models/entities/muted-note.ts index 5d9566a198..0ee245aea9 100644 --- a/packages/backend/src/models/entities/muted-note.ts +++ b/packages/backend/src/models/entities/muted-note.ts @@ -1,15 +1,15 @@ import { - Column, Entity, Index, JoinColumn, + Column, ManyToOne, PrimaryColumn, } from "typeorm"; -import { mutedNoteReasons } from "../../types.js"; -import { id } from "../id.js"; import { Note } from "./note.js"; import { User } from "./user.js"; +import { id } from "../id.js"; +import { mutedNoteReasons } from "../../types.js"; @Entity() @Index(["noteId", "userId"], { unique: true }) diff --git a/packages/backend/src/models/entities/muting.ts b/packages/backend/src/models/entities/muting.ts index b4c3a580b3..603619b468 100644 --- a/packages/backend/src/models/entities/muting.ts +++ b/packages/backend/src/models/entities/muting.ts @@ -1,13 +1,13 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() @Index(["muterId", "muteeId"], { unique: true }) diff --git a/packages/backend/src/models/entities/note-edit.ts b/packages/backend/src/models/entities/note-edit.ts index fea5c3520e..8761e2b153 100644 --- a/packages/backend/src/models/entities/note-edit.ts +++ b/packages/backend/src/models/entities/note-edit.ts @@ -1,14 +1,14 @@ import { - Column, Entity, - Index, JoinColumn, + Column, ManyToOne, PrimaryColumn, + Index, } from "typeorm"; +import { Note } from "./note.js"; import { id } from "../id.js"; import { DriveFile } from "./drive-file.js"; -import { Note } from "./note.js"; @Entity() export class NoteEdit { diff --git a/packages/backend/src/models/entities/note-favorite.ts b/packages/backend/src/models/entities/note-favorite.ts index 5076695c20..19641ecf45 100644 --- a/packages/backend/src/models/entities/note-favorite.ts +++ b/packages/backend/src/models/entities/note-favorite.ts @@ -1,14 +1,14 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; import { Note } from "./note.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() @Index(["userId", "noteId"], { unique: true }) diff --git a/packages/backend/src/models/entities/note-reaction.ts b/packages/backend/src/models/entities/note-reaction.ts index 35bac22b01..5e2a8d3e89 100644 --- a/packages/backend/src/models/entities/note-reaction.ts +++ b/packages/backend/src/models/entities/note-reaction.ts @@ -1,14 +1,14 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; -import { Note } from "./note.js"; import { User } from "./user.js"; +import { Note } from "./note.js"; +import { id } from "../id.js"; @Entity() @Index(["userId", "noteId"], { unique: true }) diff --git a/packages/backend/src/models/entities/note-thread-muting.ts b/packages/backend/src/models/entities/note-thread-muting.ts index 1b2bbebdc3..7e5fad59a4 100644 --- a/packages/backend/src/models/entities/note-thread-muting.ts +++ b/packages/backend/src/models/entities/note-thread-muting.ts @@ -1,13 +1,13 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() @Index(["userId", "threadId"], { unique: true }) diff --git a/packages/backend/src/models/entities/note-unread.ts b/packages/backend/src/models/entities/note-unread.ts index a85db90959..95695cbc8e 100644 --- a/packages/backend/src/models/entities/note-unread.ts +++ b/packages/backend/src/models/entities/note-unread.ts @@ -1,15 +1,15 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; +import { User } from "./user.js"; +import { Note } from "./note.js"; import { id } from "../id.js"; import type { Channel } from "./channel.js"; -import { Note } from "./note.js"; -import { User } from "./user.js"; @Entity() @Index(["userId", "noteId"], { unique: true }) diff --git a/packages/backend/src/models/entities/note-watching.ts b/packages/backend/src/models/entities/note-watching.ts index 8bc296df5e..724b084af2 100644 --- a/packages/backend/src/models/entities/note-watching.ts +++ b/packages/backend/src/models/entities/note-watching.ts @@ -1,14 +1,14 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; -import { Note } from "./note.js"; import { User } from "./user.js"; +import { Note } from "./note.js"; +import { id } from "../id.js"; @Entity() @Index(["userId", "noteId"], { unique: true }) diff --git a/packages/backend/src/models/entities/note.ts b/packages/backend/src/models/entities/note.ts index 3c6fb9d1a7..2b9de38cbe 100644 --- a/packages/backend/src/models/entities/note.ts +++ b/packages/backend/src/models/entities/note.ts @@ -1,16 +1,16 @@ import { - Column, Entity, Index, JoinColumn, - ManyToOne, + Column, PrimaryColumn, + ManyToOne, } from "typeorm"; -import { noteVisibilities } from "../../types.js"; -import { id } from "../id.js"; -import { Channel } from "./channel.js"; -import type { DriveFile } from "./drive-file.js"; import { User } from "./user.js"; +import type { DriveFile } from "./drive-file.js"; +import { id } from "../id.js"; +import { noteVisibilities } from "../../types.js"; +import { Channel } from "./channel.js"; @Entity() @Index("IDX_NOTE_TAGS", { synchronize: false }) diff --git a/packages/backend/src/models/entities/notification.ts b/packages/backend/src/models/entities/notification.ts index ea1a0f8c20..da23f7d3ee 100644 --- a/packages/backend/src/models/entities/notification.ts +++ b/packages/backend/src/models/entities/notification.ts @@ -1,18 +1,18 @@ -import { notificationTypes } from "@/types.js"; import { - Column, Entity, Index, JoinColumn, ManyToOne, + Column, PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; -import { AccessToken } from "./access-token.js"; -import { FollowRequest } from "./follow-request.js"; -import { Note } from "./note.js"; -import { UserGroupInvitation } from "./user-group-invitation.js"; import { User } from "./user.js"; +import { id } from "../id.js"; +import { Note } from "./note.js"; +import { FollowRequest } from "./follow-request.js"; +import { UserGroupInvitation } from "./user-group-invitation.js"; +import { AccessToken } from "./access-token.js"; +import { notificationTypes } from "@/types.js"; @Entity() export class Notification { diff --git a/packages/backend/src/models/entities/page-like.ts b/packages/backend/src/models/entities/page-like.ts index f93221e281..6304e0b24c 100644 --- a/packages/backend/src/models/entities/page-like.ts +++ b/packages/backend/src/models/entities/page-like.ts @@ -1,14 +1,14 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; +import { User } from "./user.js"; import { id } from "../id.js"; import { Page } from "./page.js"; -import { User } from "./user.js"; @Entity() @Index(["userId", "pageId"], { unique: true }) diff --git a/packages/backend/src/models/entities/page.ts b/packages/backend/src/models/entities/page.ts index f80ac570b9..d0733c8ce4 100644 --- a/packages/backend/src/models/entities/page.ts +++ b/packages/backend/src/models/entities/page.ts @@ -1,14 +1,14 @@ import { - Column, Entity, Index, JoinColumn, - ManyToOne, + Column, PrimaryColumn, + ManyToOne, } from "typeorm"; +import { User } from "./user.js"; import { id } from "../id.js"; import { DriveFile } from "./drive-file.js"; -import { User } from "./user.js"; @Entity() @Index(["userId", "name"], { unique: true }) diff --git a/packages/backend/src/models/entities/password-reset-request.ts b/packages/backend/src/models/entities/password-reset-request.ts index 4833519607..ab0bccbbef 100644 --- a/packages/backend/src/models/entities/password-reset-request.ts +++ b/packages/backend/src/models/entities/password-reset-request.ts @@ -1,10 +1,10 @@ import { - Column, + PrimaryColumn, Entity, Index, - JoinColumn, + Column, ManyToOne, - PrimaryColumn, + JoinColumn, } from "typeorm"; import { id } from "../id.js"; import { User } from "./user.js"; diff --git a/packages/backend/src/models/entities/poll-vote.ts b/packages/backend/src/models/entities/poll-vote.ts index e14734a77a..d59a720c37 100644 --- a/packages/backend/src/models/entities/poll-vote.ts +++ b/packages/backend/src/models/entities/poll-vote.ts @@ -1,14 +1,14 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; -import { Note } from "./note.js"; import { User } from "./user.js"; +import { Note } from "./note.js"; +import { id } from "../id.js"; @Entity() @Index(["userId", "noteId", "choice"], { unique: true }) diff --git a/packages/backend/src/models/entities/poll.ts b/packages/backend/src/models/entities/poll.ts index ae6be59987..c117d4e733 100644 --- a/packages/backend/src/models/entities/poll.ts +++ b/packages/backend/src/models/entities/poll.ts @@ -1,15 +1,15 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, OneToOne, - PrimaryColumn, } from "typeorm"; -import { noteVisibilities } from "../../types.js"; import { id } from "../id.js"; import { Note } from "./note.js"; import type { User } from "./user.js"; +import { noteVisibilities } from "../../types.js"; @Entity() export class Poll { diff --git a/packages/backend/src/models/entities/promo-note.ts b/packages/backend/src/models/entities/promo-note.ts index 142634c2e2..caa64927e9 100644 --- a/packages/backend/src/models/entities/promo-note.ts +++ b/packages/backend/src/models/entities/promo-note.ts @@ -1,14 +1,14 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, OneToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; import { Note } from "./note.js"; import type { User } from "./user.js"; +import { id } from "../id.js"; @Entity() export class PromoNote { diff --git a/packages/backend/src/models/entities/promo-read.ts b/packages/backend/src/models/entities/promo-read.ts index a5a54af4bf..b31877dc34 100644 --- a/packages/backend/src/models/entities/promo-read.ts +++ b/packages/backend/src/models/entities/promo-read.ts @@ -1,14 +1,14 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; import { Note } from "./note.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() @Index(["userId", "noteId"], { unique: true }) diff --git a/packages/backend/src/models/entities/registration-tickets.ts b/packages/backend/src/models/entities/registration-tickets.ts index cb4547fb8b..549f05d07a 100644 --- a/packages/backend/src/models/entities/registration-tickets.ts +++ b/packages/backend/src/models/entities/registration-tickets.ts @@ -1,4 +1,4 @@ -import { Column, Entity, Index, PrimaryColumn } from "typeorm"; +import { PrimaryColumn, Entity, Index, Column } from "typeorm"; import { id } from "../id.js"; @Entity() diff --git a/packages/backend/src/models/entities/registry-item.ts b/packages/backend/src/models/entities/registry-item.ts index d2c70f7ba7..d044222e6e 100644 --- a/packages/backend/src/models/entities/registry-item.ts +++ b/packages/backend/src/models/entities/registry-item.ts @@ -1,13 +1,13 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; import { User } from "./user.js"; +import { id } from "../id.js"; // TODO: 同じdomain、同じscope、同じkeyのレコードは二つ以上存在しないように制約付けたい @Entity() diff --git a/packages/backend/src/models/entities/relay.ts b/packages/backend/src/models/entities/relay.ts index 5b3ebef55f..c7509dcf41 100644 --- a/packages/backend/src/models/entities/relay.ts +++ b/packages/backend/src/models/entities/relay.ts @@ -1,4 +1,4 @@ -import { Column, Entity, Index, PrimaryColumn } from "typeorm"; +import { PrimaryColumn, Entity, Index, Column } from "typeorm"; import { id } from "../id.js"; @Entity() diff --git a/packages/backend/src/models/entities/renote-muting.ts b/packages/backend/src/models/entities/renote-muting.ts index 793c39df64..e8856492f1 100644 --- a/packages/backend/src/models/entities/renote-muting.ts +++ b/packages/backend/src/models/entities/renote-muting.ts @@ -1,10 +1,10 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; import { id } from "../id.js"; import { User } from "./user.js"; diff --git a/packages/backend/src/models/entities/signin.ts b/packages/backend/src/models/entities/signin.ts index 6ecb452ebf..517e71c8fd 100644 --- a/packages/backend/src/models/entities/signin.ts +++ b/packages/backend/src/models/entities/signin.ts @@ -1,13 +1,13 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() export class Signin { diff --git a/packages/backend/src/models/entities/sw-subscription.ts b/packages/backend/src/models/entities/sw-subscription.ts index 9e65fff537..f7823fbaaa 100644 --- a/packages/backend/src/models/entities/sw-subscription.ts +++ b/packages/backend/src/models/entities/sw-subscription.ts @@ -1,13 +1,13 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() export class SwSubscription { diff --git a/packages/backend/src/models/entities/used-username.ts b/packages/backend/src/models/entities/used-username.ts index b7937f648e..d00a25991e 100644 --- a/packages/backend/src/models/entities/used-username.ts +++ b/packages/backend/src/models/entities/used-username.ts @@ -1,4 +1,4 @@ -import { Column, Entity, PrimaryColumn } from "typeorm"; +import { PrimaryColumn, Entity, Column } from "typeorm"; @Entity() export class UsedUsername { diff --git a/packages/backend/src/models/entities/user-group-invitation.ts b/packages/backend/src/models/entities/user-group-invitation.ts index 7af3ad6142..fa2655ab67 100644 --- a/packages/backend/src/models/entities/user-group-invitation.ts +++ b/packages/backend/src/models/entities/user-group-invitation.ts @@ -1,14 +1,14 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; -import { UserGroup } from "./user-group.js"; import { User } from "./user.js"; +import { UserGroup } from "./user-group.js"; +import { id } from "../id.js"; @Entity() @Index(["userId", "userGroupId"], { unique: true }) diff --git a/packages/backend/src/models/entities/user-group-joining.ts b/packages/backend/src/models/entities/user-group-joining.ts index a60d6f0397..78f820d0e8 100644 --- a/packages/backend/src/models/entities/user-group-joining.ts +++ b/packages/backend/src/models/entities/user-group-joining.ts @@ -1,14 +1,14 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; -import { UserGroup } from "./user-group.js"; import { User } from "./user.js"; +import { UserGroup } from "./user-group.js"; +import { id } from "../id.js"; @Entity() @Index(["userId", "userGroupId"], { unique: true }) diff --git a/packages/backend/src/models/entities/user-group.ts b/packages/backend/src/models/entities/user-group.ts index 9e374858ca..23876ec8b8 100644 --- a/packages/backend/src/models/entities/user-group.ts +++ b/packages/backend/src/models/entities/user-group.ts @@ -1,13 +1,13 @@ import { - Column, Entity, Index, JoinColumn, - ManyToOne, + Column, PrimaryColumn, + ManyToOne, } from "typeorm"; -import { id } from "../id.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() export class UserGroup { diff --git a/packages/backend/src/models/entities/user-ip.ts b/packages/backend/src/models/entities/user-ip.ts index b7226c52e1..adef48e4c4 100644 --- a/packages/backend/src/models/entities/user-ip.ts +++ b/packages/backend/src/models/entities/user-ip.ts @@ -1,4 +1,4 @@ -import { Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm"; +import { Entity, Index, Column, PrimaryGeneratedColumn } from "typeorm"; import { id } from "../id.js"; import type { User } from "./user.js"; diff --git a/packages/backend/src/models/entities/user-keypair.ts b/packages/backend/src/models/entities/user-keypair.ts index eb0e259326..f98384f538 100644 --- a/packages/backend/src/models/entities/user-keypair.ts +++ b/packages/backend/src/models/entities/user-keypair.ts @@ -1,6 +1,6 @@ -import { Column, Entity, JoinColumn, OneToOne, PrimaryColumn } from "typeorm"; -import { id } from "../id.js"; +import { PrimaryColumn, Entity, JoinColumn, Column, OneToOne } from "typeorm"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() export class UserKeypair { diff --git a/packages/backend/src/models/entities/user-list-joining.ts b/packages/backend/src/models/entities/user-list-joining.ts index a692deca7e..4caa71ad32 100644 --- a/packages/backend/src/models/entities/user-list-joining.ts +++ b/packages/backend/src/models/entities/user-list-joining.ts @@ -1,14 +1,14 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; -import { UserList } from "./user-list.js"; import { User } from "./user.js"; +import { UserList } from "./user-list.js"; +import { id } from "../id.js"; @Entity() @Index(["userId", "userListId"], { unique: true }) diff --git a/packages/backend/src/models/entities/user-list.ts b/packages/backend/src/models/entities/user-list.ts index add0454a41..3c95d44d6b 100644 --- a/packages/backend/src/models/entities/user-list.ts +++ b/packages/backend/src/models/entities/user-list.ts @@ -1,13 +1,13 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() export class UserList { diff --git a/packages/backend/src/models/entities/user-note-pining.ts b/packages/backend/src/models/entities/user-note-pining.ts index 2417f73a4b..c30fe1e028 100644 --- a/packages/backend/src/models/entities/user-note-pining.ts +++ b/packages/backend/src/models/entities/user-note-pining.ts @@ -1,14 +1,14 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; import { Note } from "./note.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() @Index(["userId", "noteId"], { unique: true }) diff --git a/packages/backend/src/models/entities/user-pending.ts b/packages/backend/src/models/entities/user-pending.ts index f36decc174..18ae5ad993 100644 --- a/packages/backend/src/models/entities/user-pending.ts +++ b/packages/backend/src/models/entities/user-pending.ts @@ -1,4 +1,4 @@ -import { Column, Entity, Index, PrimaryColumn } from "typeorm"; +import { PrimaryColumn, Entity, Index, Column } from "typeorm"; import { id } from "../id.js"; @Entity() diff --git a/packages/backend/src/models/entities/user-profile.ts b/packages/backend/src/models/entities/user-profile.ts index 7f6bafedc8..a4c2e09754 100644 --- a/packages/backend/src/models/entities/user-profile.ts +++ b/packages/backend/src/models/entities/user-profile.ts @@ -1,15 +1,15 @@ -import { ffVisibility, notificationTypes } from "@/types.js"; import { - Column, Entity, + Column, Index, - JoinColumn, OneToOne, + JoinColumn, PrimaryColumn, } from "typeorm"; +import { ffVisibility, notificationTypes } from "@/types.js"; import { id } from "../id.js"; -import { Page } from "./page.js"; import { User } from "./user.js"; +import { Page } from "./page.js"; // TODO: このテーブルで管理している情報すべてレジストリで管理するようにしても良いかも // ただ、「emailVerified が true なユーザーを find する」のようなクエリは書けなくなるからウーン diff --git a/packages/backend/src/models/entities/user-publickey.ts b/packages/backend/src/models/entities/user-publickey.ts index ea13e049f2..e39b084d32 100644 --- a/packages/backend/src/models/entities/user-publickey.ts +++ b/packages/backend/src/models/entities/user-publickey.ts @@ -1,13 +1,13 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, OneToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() export class UserPublickey { diff --git a/packages/backend/src/models/entities/user-security-key.ts b/packages/backend/src/models/entities/user-security-key.ts index ae721d7e38..511cab4ae4 100644 --- a/packages/backend/src/models/entities/user-security-key.ts +++ b/packages/backend/src/models/entities/user-security-key.ts @@ -1,13 +1,13 @@ import { - Column, - Entity, - Index, - JoinColumn, - ManyToOne, PrimaryColumn, + Entity, + JoinColumn, + Column, + ManyToOne, + Index, } from "typeorm"; -import { id } from "../id.js"; import { User } from "./user.js"; +import { id } from "../id.js"; @Entity() export class UserSecurityKey { diff --git a/packages/backend/src/models/entities/user.ts b/packages/backend/src/models/entities/user.ts index c5e633766e..2d5e5dca3e 100644 --- a/packages/backend/src/models/entities/user.ts +++ b/packages/backend/src/models/entities/user.ts @@ -1,9 +1,9 @@ import { - Column, Entity, + Column, Index, - JoinColumn, OneToOne, + JoinColumn, PrimaryColumn, } from "typeorm"; import { id } from "../id.js"; diff --git a/packages/backend/src/models/entities/webhook.ts b/packages/backend/src/models/entities/webhook.ts index fa8b61457e..47fd79966d 100644 --- a/packages/backend/src/models/entities/webhook.ts +++ b/packages/backend/src/models/entities/webhook.ts @@ -1,13 +1,13 @@ import { - Column, + PrimaryColumn, Entity, Index, JoinColumn, + Column, ManyToOne, - PrimaryColumn, } from "typeorm"; -import { id } from "../id.js"; import { User } from "./user.js"; +import { id } from "../id.js"; export const webhookEventTypes = [ "mention", diff --git a/packages/backend/src/models/index.ts b/packages/backend/src/models/index.ts index f842f024c3..c1f37cf6d4 100644 --- a/packages/backend/src/models/index.ts +++ b/packages/backend/src/models/index.ts @@ -1,70 +1,70 @@ import { db } from "@/db/postgre.js"; -import { AccessToken } from "./entities/access-token.js"; -import { Ad } from "./entities/ad.js"; -import { AnnouncementRead } from "./entities/announcement-read.js"; import { Announcement } from "./entities/announcement.js"; -import { AttestationChallenge } from "./entities/attestation-challenge.js"; -import { ChannelFollowing } from "./entities/channel-following.js"; -import { ChannelNotePining } from "./entities/channel-note-pining.js"; -import { ClipNote } from "./entities/clip-note.js"; +import { AnnouncementRead } from "./entities/announcement-read.js"; +import { Poll } from "./entities/poll.js"; +import { PollVote } from "./entities/poll-vote.js"; import { Meta } from "./entities/meta.js"; -import { MutedNote } from "./entities/muted-note.js"; -import { NoteEdit } from "./entities/note-edit.js"; +import { SwSubscription } from "./entities/sw-subscription.js"; +import { NoteWatching } from "./entities/note-watching.js"; import { NoteThreadMuting } from "./entities/note-thread-muting.js"; import { NoteUnread } from "./entities/note-unread.js"; -import { NoteWatching } from "./entities/note-watching.js"; -import { PasswordResetRequest } from "./entities/password-reset-request.js"; -import { PollVote } from "./entities/poll-vote.js"; -import { Poll } from "./entities/poll.js"; -import { PromoNote } from "./entities/promo-note.js"; -import { PromoRead } from "./entities/promo-read.js"; import { RegistrationTicket } from "./entities/registration-tickets.js"; -import { RegistryItem } from "./entities/registry-item.js"; -import { SwSubscription } from "./entities/sw-subscription.js"; -import { UsedUsername } from "./entities/used-username.js"; -import { UserGroupJoining } from "./entities/user-group-joining.js"; -import { UserIp } from "./entities/user-ip.js"; -import { UserKeypair } from "./entities/user-keypair.js"; -import { UserListJoining } from "./entities/user-list-joining.js"; -import { UserNotePining } from "./entities/user-note-pining.js"; -import { UserPending } from "./entities/user-pending.js"; -import { UserProfile } from "./entities/user-profile.js"; -import { UserPublickey } from "./entities/user-publickey.js"; -import { UserSecurityKey } from "./entities/user-security-key.js"; -import { Webhook } from "./entities/webhook.js"; -import { AbuseUserReportRepository } from "./repositories/abuse-user-report.js"; -import { AntennaRepository } from "./repositories/antenna.js"; -import { AppRepository } from "./repositories/app.js"; -import { AuthSessionRepository } from "./repositories/auth-session.js"; -import { BlockingRepository } from "./repositories/blocking.js"; -import { ChannelRepository } from "./repositories/channel.js"; -import { ClipRepository } from "./repositories/clip.js"; +import { UserRepository } from "./repositories/user.js"; +import { NoteRepository } from "./repositories/note.js"; import { DriveFileRepository } from "./repositories/drive-file.js"; import { DriveFolderRepository } from "./repositories/drive-folder.js"; -import { EmojiRepository } from "./repositories/emoji.js"; -import { FollowRequestRepository } from "./repositories/follow-request.js"; -import { FollowingRepository } from "./repositories/following.js"; -import { GalleryLikeRepository } from "./repositories/gallery-like.js"; -import { GalleryPostRepository } from "./repositories/gallery-post.js"; -import { HashtagRepository } from "./repositories/hashtag.js"; -import { InstanceRepository } from "./repositories/instance.js"; -import { MessagingMessageRepository } from "./repositories/messaging-message.js"; -import { ModerationLogRepository } from "./repositories/moderation-logs.js"; -import { MutingRepository } from "./repositories/muting.js"; -import { NoteFavoriteRepository } from "./repositories/note-favorite.js"; -import { NoteReactionRepository } from "./repositories/note-reaction.js"; -import { NoteRepository } from "./repositories/note.js"; -import { NotificationRepository } from "./repositories/notification.js"; -import { PageLikeRepository } from "./repositories/page-like.js"; -import { PageRepository } from "./repositories/page.js"; -import { RelayRepository } from "./repositories/relay.js"; -import { RenoteMutingRepository } from "./repositories/renote-muting.js"; +import { AccessToken } from "./entities/access-token.js"; +import { UserNotePining } from "./entities/user-note-pining.js"; import { SigninRepository } from "./repositories/signin.js"; -import { UserGroupInvitationRepository } from "./repositories/user-group-invitation.js"; -import { UserGroupRepository } from "./repositories/user-group.js"; +import { MessagingMessageRepository } from "./repositories/messaging-message.js"; import { UserListRepository } from "./repositories/user-list.js"; -import { UserRepository } from "./repositories/user.js"; +import { UserListJoining } from "./entities/user-list-joining.js"; +import { UserGroupRepository } from "./repositories/user-group.js"; +import { UserGroupJoining } from "./entities/user-group-joining.js"; +import { UserGroupInvitationRepository } from "./repositories/user-group-invitation.js"; +import { FollowRequestRepository } from "./repositories/follow-request.js"; +import { MutingRepository } from "./repositories/muting.js"; +import { RenoteMutingRepository } from "./repositories/renote-muting.js"; +import { BlockingRepository } from "./repositories/blocking.js"; +import { NoteReactionRepository } from "./repositories/note-reaction.js"; +import { NotificationRepository } from "./repositories/notification.js"; +import { NoteFavoriteRepository } from "./repositories/note-favorite.js"; +import { UserPublickey } from "./entities/user-publickey.js"; +import { UserKeypair } from "./entities/user-keypair.js"; +import { AppRepository } from "./repositories/app.js"; +import { FollowingRepository } from "./repositories/following.js"; +import { AbuseUserReportRepository } from "./repositories/abuse-user-report.js"; +import { AuthSessionRepository } from "./repositories/auth-session.js"; +import { UserProfile } from "./entities/user-profile.js"; +import { AttestationChallenge } from "./entities/attestation-challenge.js"; +import { UserSecurityKey } from "./entities/user-security-key.js"; +import { HashtagRepository } from "./repositories/hashtag.js"; +import { PageRepository } from "./repositories/page.js"; +import { PageLikeRepository } from "./repositories/page-like.js"; +import { GalleryPostRepository } from "./repositories/gallery-post.js"; +import { GalleryLikeRepository } from "./repositories/gallery-like.js"; +import { ModerationLogRepository } from "./repositories/moderation-logs.js"; +import { UsedUsername } from "./entities/used-username.js"; +import { ClipRepository } from "./repositories/clip.js"; +import { ClipNote } from "./entities/clip-note.js"; +import { AntennaRepository } from "./repositories/antenna.js"; +import { PromoNote } from "./entities/promo-note.js"; +import { PromoRead } from "./entities/promo-read.js"; +import { EmojiRepository } from "./repositories/emoji.js"; +import { RelayRepository } from "./repositories/relay.js"; +import { ChannelRepository } from "./repositories/channel.js"; +import { MutedNote } from "./entities/muted-note.js"; +import { ChannelFollowing } from "./entities/channel-following.js"; +import { ChannelNotePining } from "./entities/channel-note-pining.js"; +import { RegistryItem } from "./entities/registry-item.js"; +import { Ad } from "./entities/ad.js"; +import { PasswordResetRequest } from "./entities/password-reset-request.js"; +import { UserPending } from "./entities/user-pending.js"; +import { InstanceRepository } from "./repositories/instance.js"; +import { Webhook } from "./entities/webhook.js"; +import { UserIp } from "./entities/user-ip.js"; +import { NoteEdit } from "./entities/note-edit.js"; export const Announcements = db.getRepository(Announcement); export const AnnouncementReads = db.getRepository(AnnouncementRead); diff --git a/packages/backend/src/models/repositories/abuse-user-report.ts b/packages/backend/src/models/repositories/abuse-user-report.ts index 071c399ac0..07afef48c4 100644 --- a/packages/backend/src/models/repositories/abuse-user-report.ts +++ b/packages/backend/src/models/repositories/abuse-user-report.ts @@ -1,7 +1,7 @@ import { db } from "@/db/postgre.js"; +import { Users } from "../index.js"; import { AbuseUserReport } from "@/models/entities/abuse-user-report.js"; import { awaitAll } from "@/prelude/await-all.js"; -import { Users } from "../index.js"; export const AbuseUserReportRepository = db .getRepository(AbuseUserReport) diff --git a/packages/backend/src/models/repositories/app.ts b/packages/backend/src/models/repositories/app.ts index abad561f66..af3dfb81a1 100644 --- a/packages/backend/src/models/repositories/app.ts +++ b/packages/backend/src/models/repositories/app.ts @@ -1,8 +1,8 @@ import { db } from "@/db/postgre.js"; -import type { Packed } from "@/misc/schema.js"; import { App } from "@/models/entities/app.js"; -import type { User } from "../entities/user.js"; import { AccessTokens } from "../index.js"; +import type { Packed } from "@/misc/schema.js"; +import type { User } from "../entities/user.js"; export const AppRepository = db.getRepository(App).extend({ async pack( diff --git a/packages/backend/src/models/repositories/auth-session.ts b/packages/backend/src/models/repositories/auth-session.ts index c129f734fc..d3e1d45d6d 100644 --- a/packages/backend/src/models/repositories/auth-session.ts +++ b/packages/backend/src/models/repositories/auth-session.ts @@ -1,8 +1,8 @@ import { db } from "@/db/postgre.js"; -import { AuthSession } from "@/models/entities/auth-session.js"; -import type { User } from "@/models/entities/user.js"; -import { awaitAll } from "@/prelude/await-all.js"; import { Apps } from "../index.js"; +import { AuthSession } from "@/models/entities/auth-session.js"; +import { awaitAll } from "@/prelude/await-all.js"; +import type { User } from "@/models/entities/user.js"; export const AuthSessionRepository = db.getRepository(AuthSession).extend({ async pack( diff --git a/packages/backend/src/models/repositories/blocking.ts b/packages/backend/src/models/repositories/blocking.ts index 280631e705..3dfa74e763 100644 --- a/packages/backend/src/models/repositories/blocking.ts +++ b/packages/backend/src/models/repositories/blocking.ts @@ -1,9 +1,9 @@ import { db } from "@/db/postgre.js"; -import type { Packed } from "@/misc/schema.js"; -import { Blocking } from "@/models/entities/blocking.js"; -import type { User } from "@/models/entities/user.js"; -import { awaitAll } from "@/prelude/await-all.js"; import { Users } from "../index.js"; +import { Blocking } from "@/models/entities/blocking.js"; +import { awaitAll } from "@/prelude/await-all.js"; +import type { Packed } from "@/misc/schema.js"; +import type { User } from "@/models/entities/user.js"; export const BlockingRepository = db.getRepository(Blocking).extend({ async pack( diff --git a/packages/backend/src/models/repositories/channel.ts b/packages/backend/src/models/repositories/channel.ts index 9012c5e650..7800a65940 100644 --- a/packages/backend/src/models/repositories/channel.ts +++ b/packages/backend/src/models/repositories/channel.ts @@ -1,8 +1,8 @@ import { db } from "@/db/postgre.js"; -import type { Packed } from "@/misc/schema.js"; import { Channel } from "@/models/entities/channel.js"; +import type { Packed } from "@/misc/schema.js"; +import { DriveFiles, ChannelFollowings, NoteUnreads } from "../index.js"; import type { User } from "@/models/entities/user.js"; -import { ChannelFollowings, DriveFiles, NoteUnreads } from "../index.js"; export const ChannelRepository = db.getRepository(Channel).extend({ async pack( diff --git a/packages/backend/src/models/repositories/clip.ts b/packages/backend/src/models/repositories/clip.ts index 87c796aedb..0c21691bff 100644 --- a/packages/backend/src/models/repositories/clip.ts +++ b/packages/backend/src/models/repositories/clip.ts @@ -1,8 +1,8 @@ import { db } from "@/db/postgre.js"; -import type { Packed } from "@/misc/schema.js"; import { Clip } from "@/models/entities/clip.js"; -import { awaitAll } from "@/prelude/await-all.js"; +import type { Packed } from "@/misc/schema.js"; import { Users } from "../index.js"; +import { awaitAll } from "@/prelude/await-all.js"; export const ClipRepository = db.getRepository(Clip).extend({ async pack(src: Clip["id"] | Clip): Promise> { diff --git a/packages/backend/src/models/repositories/drive-file.ts b/packages/backend/src/models/repositories/drive-file.ts index 2de8d7fa8a..1b4f477d33 100644 --- a/packages/backend/src/models/repositories/drive-file.ts +++ b/packages/backend/src/models/repositories/drive-file.ts @@ -1,13 +1,13 @@ -import config from "@/config/index.js"; import { db } from "@/db/postgre.js"; -import { deepClone } from "@/misc/clone.js"; -import { toPuny } from "@/misc/convert-host.js"; -import type { Packed } from "@/misc/schema.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 } from "@/prelude/await-all.js"; -import { appendQuery, query } from "@/prelude/url.js"; -import { DriveFolders, Users } from "../index.js"; +import type { Packed } from "@/misc/schema.js"; +import config from "@/config/index.js"; +import { query, appendQuery } from "@/prelude/url.js"; +import { Users, DriveFolders } from "../index.js"; +import { deepClone } from "@/misc/clone.js"; type PackOptions = { detail?: boolean; diff --git a/packages/backend/src/models/repositories/drive-folder.ts b/packages/backend/src/models/repositories/drive-folder.ts index 7c73d2617a..9823561d0b 100644 --- a/packages/backend/src/models/repositories/drive-folder.ts +++ b/packages/backend/src/models/repositories/drive-folder.ts @@ -1,8 +1,8 @@ import { db } from "@/db/postgre.js"; -import type { Packed } from "@/misc/schema.js"; +import { DriveFolders, DriveFiles } from "../index.js"; import { DriveFolder } from "@/models/entities/drive-folder.js"; import { awaitAll } from "@/prelude/await-all.js"; -import { DriveFiles, DriveFolders } from "../index.js"; +import type { Packed } from "@/misc/schema.js"; export const DriveFolderRepository = db.getRepository(DriveFolder).extend({ async pack( diff --git a/packages/backend/src/models/repositories/emoji.ts b/packages/backend/src/models/repositories/emoji.ts index 0589097a64..e9a940f958 100644 --- a/packages/backend/src/models/repositories/emoji.ts +++ b/packages/backend/src/models/repositories/emoji.ts @@ -1,6 +1,6 @@ import { db } from "@/db/postgre.js"; -import type { Packed } from "@/misc/schema.js"; import { Emoji } from "@/models/entities/emoji.js"; +import type { Packed } from "@/misc/schema.js"; export const EmojiRepository = db.getRepository(Emoji).extend({ async pack(src: Emoji["id"] | Emoji): Promise> { diff --git a/packages/backend/src/models/repositories/follow-request.ts b/packages/backend/src/models/repositories/follow-request.ts index 17100c157c..cef6ea7228 100644 --- a/packages/backend/src/models/repositories/follow-request.ts +++ b/packages/backend/src/models/repositories/follow-request.ts @@ -1,7 +1,7 @@ import { db } from "@/db/postgre.js"; import { FollowRequest } from "@/models/entities/follow-request.js"; -import type { User } from "@/models/entities/user.js"; import { Users } from "../index.js"; +import type { User } from "@/models/entities/user.js"; export const FollowRequestRepository = db.getRepository(FollowRequest).extend({ async pack( diff --git a/packages/backend/src/models/repositories/following.ts b/packages/backend/src/models/repositories/following.ts index 12e5380ce7..b102365e09 100644 --- a/packages/backend/src/models/repositories/following.ts +++ b/packages/backend/src/models/repositories/following.ts @@ -1,9 +1,9 @@ import { db } from "@/db/postgre.js"; -import type { Packed } from "@/misc/schema.js"; -import { Following } from "@/models/entities/following.js"; -import type { User } from "@/models/entities/user.js"; -import { awaitAll } from "@/prelude/await-all.js"; import { Users } from "../index.js"; +import { Following } from "@/models/entities/following.js"; +import { awaitAll } from "@/prelude/await-all.js"; +import type { Packed } from "@/misc/schema.js"; +import type { User } from "@/models/entities/user.js"; type LocalFollowerFollowing = Following & { followerHost: null; diff --git a/packages/backend/src/models/repositories/gallery-post.ts b/packages/backend/src/models/repositories/gallery-post.ts index 3d91d47ce2..b4206b0bf4 100644 --- a/packages/backend/src/models/repositories/gallery-post.ts +++ b/packages/backend/src/models/repositories/gallery-post.ts @@ -1,9 +1,9 @@ import { db } from "@/db/postgre.js"; -import type { Packed } from "@/misc/schema.js"; import { GalleryPost } from "@/models/entities/gallery-post.js"; -import type { User } from "@/models/entities/user.js"; +import type { Packed } from "@/misc/schema.js"; +import { Users, DriveFiles, GalleryLikes } from "../index.js"; import { awaitAll } from "@/prelude/await-all.js"; -import { DriveFiles, GalleryLikes, Users } from "../index.js"; +import type { User } from "@/models/entities/user.js"; export const GalleryPostRepository = db.getRepository(GalleryPost).extend({ async pack( diff --git a/packages/backend/src/models/repositories/hashtag.ts b/packages/backend/src/models/repositories/hashtag.ts index e3b90c1536..7bd76c1c70 100644 --- a/packages/backend/src/models/repositories/hashtag.ts +++ b/packages/backend/src/models/repositories/hashtag.ts @@ -1,6 +1,6 @@ import { db } from "@/db/postgre.js"; -import type { Packed } from "@/misc/schema.js"; import { Hashtag } from "@/models/entities/hashtag.js"; +import type { Packed } from "@/misc/schema.js"; export const HashtagRepository = db.getRepository(Hashtag).extend({ async pack(src: Hashtag): Promise> { diff --git a/packages/backend/src/models/repositories/instance.ts b/packages/backend/src/models/repositories/instance.ts index f2cce2ac5d..667ec948de 100644 --- a/packages/backend/src/models/repositories/instance.ts +++ b/packages/backend/src/models/repositories/instance.ts @@ -1,10 +1,10 @@ import { db } from "@/db/postgre.js"; +import { Instance } from "@/models/entities/instance.js"; import type { Packed } from "@/misc/schema.js"; import { shouldBlockInstance, shouldSilenceInstance, } from "@/misc/should-block-instance.js"; -import { Instance } from "@/models/entities/instance.js"; export const InstanceRepository = db.getRepository(Instance).extend({ async pack(instance: Instance): Promise> { diff --git a/packages/backend/src/models/repositories/messaging-message.ts b/packages/backend/src/models/repositories/messaging-message.ts index 85d2053a66..6c0987bf08 100644 --- a/packages/backend/src/models/repositories/messaging-message.ts +++ b/packages/backend/src/models/repositories/messaging-message.ts @@ -1,8 +1,8 @@ import { db } from "@/db/postgre.js"; -import type { Packed } from "@/misc/schema.js"; import { MessagingMessage } from "@/models/entities/messaging-message.js"; +import { Users, DriveFiles, UserGroups } from "../index.js"; +import type { Packed } from "@/misc/schema.js"; import type { User } from "@/models/entities/user.js"; -import { DriveFiles, UserGroups, Users } from "../index.js"; export const MessagingMessageRepository = db .getRepository(MessagingMessage) diff --git a/packages/backend/src/models/repositories/moderation-logs.ts b/packages/backend/src/models/repositories/moderation-logs.ts index 03f91c6f8e..3858b9509b 100644 --- a/packages/backend/src/models/repositories/moderation-logs.ts +++ b/packages/backend/src/models/repositories/moderation-logs.ts @@ -1,7 +1,7 @@ import { db } from "@/db/postgre.js"; +import { Users } from "../index.js"; import { ModerationLog } from "@/models/entities/moderation-log.js"; import { awaitAll } from "@/prelude/await-all.js"; -import { Users } from "../index.js"; export const ModerationLogRepository = db.getRepository(ModerationLog).extend({ async pack(src: ModerationLog["id"] | ModerationLog) { diff --git a/packages/backend/src/models/repositories/muting.ts b/packages/backend/src/models/repositories/muting.ts index 29686c337d..4d0201d5a0 100644 --- a/packages/backend/src/models/repositories/muting.ts +++ b/packages/backend/src/models/repositories/muting.ts @@ -1,9 +1,9 @@ import { db } from "@/db/postgre.js"; -import type { Packed } from "@/misc/schema.js"; -import { Muting } from "@/models/entities/muting.js"; -import type { User } from "@/models/entities/user.js"; -import { awaitAll } from "@/prelude/await-all.js"; import { Users } from "../index.js"; +import { Muting } from "@/models/entities/muting.js"; +import { awaitAll } from "@/prelude/await-all.js"; +import type { Packed } from "@/misc/schema.js"; +import type { User } from "@/models/entities/user.js"; export const MutingRepository = db.getRepository(Muting).extend({ async pack( diff --git a/packages/backend/src/models/repositories/note-favorite.ts b/packages/backend/src/models/repositories/note-favorite.ts index a472fb9367..ba43e3c3b4 100644 --- a/packages/backend/src/models/repositories/note-favorite.ts +++ b/packages/backend/src/models/repositories/note-favorite.ts @@ -1,7 +1,7 @@ import { db } from "@/db/postgre.js"; import { NoteFavorite } from "@/models/entities/note-favorite.js"; -import type { User } from "@/models/entities/user.js"; import { Notes } from "../index.js"; +import type { User } from "@/models/entities/user.js"; export const NoteFavoriteRepository = db.getRepository(NoteFavorite).extend({ async pack( diff --git a/packages/backend/src/models/repositories/note-reaction.ts b/packages/backend/src/models/repositories/note-reaction.ts index 4c182b2438..4075c7d43a 100644 --- a/packages/backend/src/models/repositories/note-reaction.ts +++ b/packages/backend/src/models/repositories/note-reaction.ts @@ -1,9 +1,9 @@ import { db } from "@/db/postgre.js"; -import { decodeReaction } from "@/misc/reaction-lib.js"; -import type { Packed } from "@/misc/schema.js"; import { NoteReaction } from "@/models/entities/note-reaction.js"; -import type { User } from "@/models/entities/user.js"; import { Notes, Users } from "../index.js"; +import type { Packed } from "@/misc/schema.js"; +import { decodeReaction } from "@/misc/reaction-lib.js"; +import type { User } from "@/models/entities/user.js"; export const NoteReactionRepository = db.getRepository(NoteReaction).extend({ async pack( diff --git a/packages/backend/src/models/repositories/note.ts b/packages/backend/src/models/repositories/note.ts index e946c30e04..60e5a8d5ca 100644 --- a/packages/backend/src/models/repositories/note.ts +++ b/packages/backend/src/models/repositories/note.ts @@ -1,28 +1,28 @@ -import { db } from "@/db/postgre.js"; -import { IdentifiableError } from "@/misc/identifiable-error.js"; +import { In } from "typeorm"; +import * as mfm from "mfm-js"; +import { Note } from "@/models/entities/note.js"; +import type { User } from "@/models/entities/user.js"; +import { + Users, + PollVotes, + DriveFiles, + NoteReactions, + Followings, + Polls, + Channels, +} from "../index.js"; +import type { Packed } from "@/misc/schema.js"; import { nyaize } from "@/misc/nyaize.js"; +import { awaitAll } from "@/prelude/await-all.js"; +import { convertReactions, decodeReaction } from "@/misc/reaction-lib.js"; +import type { NoteReaction } from "@/models/entities/note-reaction.js"; import { aggregateNoteEmojis, populateEmojis, prefetchEmojis, } from "@/misc/populate-emojis.js"; -import { convertReactions, decodeReaction } from "@/misc/reaction-lib.js"; -import type { Packed } from "@/misc/schema.js"; -import type { NoteReaction } from "@/models/entities/note-reaction.js"; -import { Note } from "@/models/entities/note.js"; -import type { User } from "@/models/entities/user.js"; -import { awaitAll } from "@/prelude/await-all.js"; -import * as mfm from "mfm-js"; -import { In } from "typeorm"; -import { - Channels, - DriveFiles, - Followings, - NoteReactions, - PollVotes, - Polls, - Users, -} from "../index.js"; +import { db } from "@/db/postgre.js"; +import { IdentifiableError } from "@/misc/identifiable-error.js"; export async function populatePoll(note: Note, meId: User["id"] | null) { const poll = await Polls.findOneByOrFail({ noteId: note.id }); diff --git a/packages/backend/src/models/repositories/notification.ts b/packages/backend/src/models/repositories/notification.ts index 9dd4934215..90dfbd7397 100644 --- a/packages/backend/src/models/repositories/notification.ts +++ b/packages/backend/src/models/repositories/notification.ts @@ -1,18 +1,18 @@ -import { db } from "@/db/postgre.js"; -import { aggregateNoteEmojis, prefetchEmojis } from "@/misc/populate-emojis.js"; -import type { Packed } from "@/misc/schema.js"; -import type { NoteReaction } from "@/models/entities/note-reaction.js"; -import type { Note } from "@/models/entities/note.js"; -import { Notification } from "@/models/entities/notification.js"; -import type { User } from "@/models/entities/user.js"; -import { awaitAll } from "@/prelude/await-all.js"; 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"; +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 { db } from "@/db/postgre.js"; import { - AccessTokens, - NoteReactions, + Users, Notes, UserGroupInvitations, - Users, + AccessTokens, + NoteReactions, } from "../index.js"; export const NotificationRepository = db.getRepository(Notification).extend({ diff --git a/packages/backend/src/models/repositories/page.ts b/packages/backend/src/models/repositories/page.ts index 0f335164bc..d9241c3629 100644 --- a/packages/backend/src/models/repositories/page.ts +++ b/packages/backend/src/models/repositories/page.ts @@ -1,10 +1,10 @@ import { db } from "@/db/postgre.js"; -import type { Packed } from "@/misc/schema.js"; -import type { DriveFile } from "@/models/entities/drive-file.js"; import { Page } from "@/models/entities/page.js"; -import type { User } from "@/models/entities/user.js"; +import type { Packed } from "@/misc/schema.js"; import { awaitAll } from "@/prelude/await-all.js"; -import { DriveFiles, PageLikes, Users } from "../index.js"; +import type { DriveFile } from "@/models/entities/drive-file.js"; +import type { User } from "@/models/entities/user.js"; +import { Users, DriveFiles, PageLikes } from "../index.js"; export const PageRepository = db.getRepository(Page).extend({ async pack( diff --git a/packages/backend/src/models/repositories/user-group.ts b/packages/backend/src/models/repositories/user-group.ts index 6a70f83d90..daec94490e 100644 --- a/packages/backend/src/models/repositories/user-group.ts +++ b/packages/backend/src/models/repositories/user-group.ts @@ -1,7 +1,7 @@ import { db } from "@/db/postgre.js"; -import type { Packed } from "@/misc/schema.js"; import { UserGroup } from "@/models/entities/user-group.js"; import { UserGroupJoinings } from "../index.js"; +import type { Packed } from "@/misc/schema.js"; export const UserGroupRepository = db.getRepository(UserGroup).extend({ async pack(src: UserGroup["id"] | UserGroup): Promise> { diff --git a/packages/backend/src/models/repositories/user-list.ts b/packages/backend/src/models/repositories/user-list.ts index 33133a05d8..e3abeac3f6 100644 --- a/packages/backend/src/models/repositories/user-list.ts +++ b/packages/backend/src/models/repositories/user-list.ts @@ -1,7 +1,7 @@ import { db } from "@/db/postgre.js"; -import type { Packed } from "@/misc/schema.js"; import { UserList } from "@/models/entities/user-list.js"; import { UserListJoinings } from "../index.js"; +import type { Packed } from "@/misc/schema.js"; export const UserListRepository = db.getRepository(UserList).extend({ async pack(src: UserList["id"] | UserList): Promise> { diff --git a/packages/backend/src/models/repositories/user.ts b/packages/backend/src/models/repositories/user.ts index 5061797767..be1dbc4531 100644 --- a/packages/backend/src/models/repositories/user.ts +++ b/packages/backend/src/models/repositories/user.ts @@ -1,41 +1,41 @@ -import config from "@/config/index.js"; -import { USER_ACTIVE_THRESHOLD, USER_ONLINE_THRESHOLD } from "@/const.js"; -import { db } from "@/db/postgre.js"; -import { Cache } from "@/misc/cache.js"; -import { populateEmojis } from "@/misc/populate-emojis.js"; -import type { Packed } from "@/misc/schema.js"; +import { In, Not } from "typeorm"; +import Ajv from "ajv"; import type { ILocalUser, IRemoteUser } from "@/models/entities/user.js"; import { User } from "@/models/entities/user.js"; +import config from "@/config/index.js"; +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 { USER_ACTIVE_THRESHOLD, USER_ONLINE_THRESHOLD } from "@/const.js"; +import { Cache } from "@/misc/cache.js"; +import { db } from "@/db/postgre.js"; +import { isActor, getApId } from "@/remote/activitypub/type.js"; import DbResolver from "@/remote/activitypub/db-resolver.js"; -import { createPerson } from "@/remote/activitypub/models/person.js"; import Resolver from "@/remote/activitypub/resolver.js"; -import { getApId, isActor } from "@/remote/activitypub/type.js"; -import Ajv from "ajv"; -import { In, Not } from "typeorm"; -import type { Instance } from "../entities/instance.js"; +import { createPerson } from "@/remote/activitypub/models/person.js"; import { AnnouncementReads, Announcements, Blockings, ChannelFollowings, DriveFiles, - FollowRequests, Followings, + FollowRequests, Instances, MessagingMessages, Mutings, - NoteUnreads, + RenoteMutings, Notes, + NoteUnreads, Notifications, Pages, - RenoteMutings, UserGroupJoinings, UserNotePinings, UserProfiles, UserSecurityKeys, } from "../index.js"; +import type { Instance } from "../entities/instance.js"; const userInstanceCache = new Cache( "userInstance", diff --git a/packages/backend/src/queue/index.ts b/packages/backend/src/queue/index.ts index 051dd9681d..0500737a48 100644 --- a/packages/backend/src/queue/index.ts +++ b/packages/backend/src/queue/index.ts @@ -3,32 +3,32 @@ import { v4 as uuid } from "uuid"; import config from "@/config/index.js"; import type { DriveFile } from "@/models/entities/drive-file.js"; -import type { Webhook, webhookEventTypes } from "@/models/entities/webhook.js"; import type { IActivity } from "@/remote/activitypub/type.js"; +import type { Webhook, webhookEventTypes } from "@/models/entities/webhook.js"; import { envOption } from "../env.js"; -import { Note } from "@/models/entities/note.js"; -import { getJobInfo } from "./get-job-info.js"; -import { queueLogger } from "./logger.js"; -import processBackground from "./processors/background/index.js"; -import processDb from "./processors/db/index.js"; import processDeliver from "./processors/deliver.js"; -import { endedPollNotification } from "./processors/ended-poll-notification.js"; import processInbox from "./processors/inbox.js"; +import processDb from "./processors/db/index.js"; import processObjectStorage from "./processors/object-storage/index.js"; import processSystemQueue from "./processors/system/index.js"; import processWebhookDeliver from "./processors/webhook-deliver.js"; +import processBackground from "./processors/background/index.js"; +import { endedPollNotification } from "./processors/ended-poll-notification.js"; +import { queueLogger } from "./logger.js"; +import { getJobInfo } from "./get-job-info.js"; import { - backgroundQueue, + systemQueue, dbQueue, deliverQueue, - endedPollNotificationQueue, inboxQueue, objectStorageQueue, - systemQueue, + endedPollNotificationQueue, webhookDeliverQueue, + backgroundQueue, } from "./queues.js"; import type { ThinUser } from "./types.js"; +import { Note } from "@/models/entities/note.js"; function renderError(e: Error): any { return { diff --git a/packages/backend/src/queue/initialize.ts b/packages/backend/src/queue/initialize.ts index a85ab3963d..16e623d137 100644 --- a/packages/backend/src/queue/initialize.ts +++ b/packages/backend/src/queue/initialize.ts @@ -1,5 +1,5 @@ -import config from "@/config/index.js"; import Bull from "bull"; +import config from "@/config/index.js"; export function initialize(name: string, limitPerSec = -1) { return new Bull(name, { 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 07a7b756d8..262724cbd6 100644 --- a/packages/backend/src/queue/processors/background/index-all-notes.ts +++ b/packages/backend/src/queue/processors/background/index-all-notes.ts @@ -1,12 +1,12 @@ import type Bull from "bull"; import type { DoneCallback } from "bull"; -import meilisearch from "@/db/meilisearch.js"; -import { Note } from "@/models/entities/note.js"; -import { Notes } from "@/models/index.js"; -import { index } from "@/services/note/create.js"; -import { MoreThan } from "typeorm"; import { queueLogger } from "../../logger.js"; +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"; const logger = queueLogger.createSubLogger("index-all-notes"); diff --git a/packages/backend/src/queue/processors/db/delete-account.ts b/packages/backend/src/queue/processors/db/delete-account.ts index 336db43322..adb93484bd 100644 --- a/packages/backend/src/queue/processors/db/delete-account.ts +++ b/packages/backend/src/queue/processors/db/delete-account.ts @@ -1,13 +1,13 @@ -import meilisearch from "@/db/meilisearch.js"; -import type { DriveFile } from "@/models/entities/drive-file.js"; -import type { Note } from "@/models/entities/note.js"; +import type Bull from "bull"; +import { queueLogger } from "../../logger.js"; import { DriveFiles, Notes, UserProfiles, Users } from "@/models/index.js"; import type { DbUserDeleteJobData } from "@/queue/types.js"; +import type { Note } from "@/models/entities/note.js"; +import type { DriveFile } from "@/models/entities/drive-file.js"; +import { MoreThan } from "typeorm"; import { deleteFileSync } from "@/services/drive/delete-file.js"; import { sendEmail } from "@/services/send-email.js"; -import type Bull from "bull"; -import { MoreThan } from "typeorm"; -import { queueLogger } from "../../logger.js"; +import meilisearch from "@/db/meilisearch.js"; const logger = queueLogger.createSubLogger("delete-account"); diff --git a/packages/backend/src/queue/processors/db/delete-drive-files.ts b/packages/backend/src/queue/processors/db/delete-drive-files.ts index 8bff6382f8..28e4771329 100644 --- a/packages/backend/src/queue/processors/db/delete-drive-files.ts +++ b/packages/backend/src/queue/processors/db/delete-drive-files.ts @@ -1,10 +1,10 @@ import type Bull from "bull"; -import { DriveFiles, Users } from "@/models/index.js"; -import type { DbUserJobData } from "@/queue/types.js"; -import { deleteFileSync } from "@/services/drive/delete-file.js"; -import { MoreThan } from "typeorm"; import { queueLogger } from "../../logger.js"; +import { deleteFileSync } from "@/services/drive/delete-file.js"; +import { Users, DriveFiles } from "@/models/index.js"; +import { MoreThan } from "typeorm"; +import type { DbUserJobData } from "@/queue/types.js"; const logger = queueLogger.createSubLogger("delete-drive-files"); diff --git a/packages/backend/src/queue/processors/db/export-blocking.ts b/packages/backend/src/queue/processors/db/export-blocking.ts index 75ba44d36c..90da76b872 100644 --- a/packages/backend/src/queue/processors/db/export-blocking.ts +++ b/packages/backend/src/queue/processors/db/export-blocking.ts @@ -1,14 +1,14 @@ -import * as fs from "node:fs"; import type Bull from "bull"; +import * as fs from "node:fs"; -import { getFullApAccount } from "@/misc/convert-host.js"; -import { createTemp } from "@/misc/create-temp.js"; -import { Blockings, Users } from "@/models/index.js"; -import type { DbUserJobData } from "@/queue/types.js"; +import { queueLogger } from "../../logger.js"; import { addFile } from "@/services/drive/add-file.js"; import { format as dateFormat } from "date-fns"; +import { getFullApAccount } from "@/misc/convert-host.js"; +import { createTemp } from "@/misc/create-temp.js"; +import { Users, Blockings } from "@/models/index.js"; import { MoreThan } from "typeorm"; -import { queueLogger } from "../../logger.js"; +import type { DbUserJobData } from "@/queue/types.js"; const logger = queueLogger.createSubLogger("export-blocking"); 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 a664bc59bc..86de43af42 100644 --- a/packages/backend/src/queue/processors/db/export-custom-emojis.ts +++ b/packages/backend/src/queue/processors/db/export-custom-emojis.ts @@ -1,16 +1,16 @@ -import * as fs from "node:fs"; import type Bull from "bull"; +import * as fs from "node:fs"; -import config from "@/config/index.js"; +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 { createTemp, createTempDir } from "@/misc/create-temp.js"; import { downloadUrl } from "@/misc/download-url.js"; -import { Emojis, Users } from "@/models/index.js"; -import { addFile } from "@/services/drive/add-file.js"; -import archiver from "archiver"; -import { format as dateFormat } from "date-fns"; -import mime from "mime-types"; +import config from "@/config/index.js"; import { IsNull } from "typeorm"; -import { queueLogger } from "../../logger.js"; const logger = queueLogger.createSubLogger("export-custom-emojis"); diff --git a/packages/backend/src/queue/processors/db/export-following.ts b/packages/backend/src/queue/processors/db/export-following.ts index 0c8e432a67..80e8e6b925 100644 --- a/packages/backend/src/queue/processors/db/export-following.ts +++ b/packages/backend/src/queue/processors/db/export-following.ts @@ -1,15 +1,15 @@ -import * as fs from "node:fs"; import type Bull from "bull"; +import * as fs from "node:fs"; -import { getFullApAccount } from "@/misc/convert-host.js"; -import { createTemp } from "@/misc/create-temp.js"; -import type { Following } from "@/models/entities/following.js"; -import { Followings, Mutings, Users } from "@/models/index.js"; -import type { DbUserJobData } from "@/queue/types.js"; +import { queueLogger } from "../../logger.js"; import { addFile } from "@/services/drive/add-file.js"; import { format as dateFormat } from "date-fns"; +import { getFullApAccount } from "@/misc/convert-host.js"; +import { createTemp } from "@/misc/create-temp.js"; +import { Users, Followings, Mutings } from "@/models/index.js"; import { In, MoreThan, Not } from "typeorm"; -import { queueLogger } from "../../logger.js"; +import type { DbUserJobData } from "@/queue/types.js"; +import type { Following } from "@/models/entities/following.js"; const logger = queueLogger.createSubLogger("export-following"); diff --git a/packages/backend/src/queue/processors/db/export-mute.ts b/packages/backend/src/queue/processors/db/export-mute.ts index a0be219ad6..87b140b762 100644 --- a/packages/backend/src/queue/processors/db/export-mute.ts +++ b/packages/backend/src/queue/processors/db/export-mute.ts @@ -1,14 +1,14 @@ -import * as fs from "node:fs"; import type Bull from "bull"; +import * as fs from "node:fs"; -import { getFullApAccount } from "@/misc/convert-host.js"; -import { createTemp } from "@/misc/create-temp.js"; -import { Mutings, Users } from "@/models/index.js"; -import type { DbUserJobData } from "@/queue/types.js"; +import { queueLogger } from "../../logger.js"; import { addFile } from "@/services/drive/add-file.js"; import { format as dateFormat } from "date-fns"; +import { getFullApAccount } from "@/misc/convert-host.js"; +import { createTemp } from "@/misc/create-temp.js"; +import { Users, Mutings } from "@/models/index.js"; import { IsNull, MoreThan } from "typeorm"; -import { queueLogger } from "../../logger.js"; +import type { DbUserJobData } from "@/queue/types.js"; const logger = queueLogger.createSubLogger("export-mute"); diff --git a/packages/backend/src/queue/processors/db/export-notes.ts b/packages/backend/src/queue/processors/db/export-notes.ts index fb2e282cb3..bf53f83603 100644 --- a/packages/backend/src/queue/processors/db/export-notes.ts +++ b/packages/backend/src/queue/processors/db/export-notes.ts @@ -1,15 +1,15 @@ -import * as fs from "node:fs"; import type Bull from "bull"; +import * as fs from "node:fs"; -import { createTemp } from "@/misc/create-temp.js"; -import type { Note } from "@/models/entities/note.js"; -import type { Poll } from "@/models/entities/poll.js"; -import { DriveFiles, Notes, Polls, Users } from "@/models/index.js"; -import type { DbUserJobData } from "@/queue/types.js"; +import { queueLogger } from "../../logger.js"; import { addFile } from "@/services/drive/add-file.js"; import { format as dateFormat } from "date-fns"; +import { Users, Notes, Polls, DriveFiles } from "@/models/index.js"; import { MoreThan } from "typeorm"; -import { queueLogger } from "../../logger.js"; +import type { Note } from "@/models/entities/note.js"; +import type { Poll } from "@/models/entities/poll.js"; +import type { DbUserJobData } from "@/queue/types.js"; +import { createTemp } from "@/misc/create-temp.js"; const logger = queueLogger.createSubLogger("export-notes"); diff --git a/packages/backend/src/queue/processors/db/export-user-lists.ts b/packages/backend/src/queue/processors/db/export-user-lists.ts index 860170065a..e0c9cd8f3f 100644 --- a/packages/backend/src/queue/processors/db/export-user-lists.ts +++ b/packages/backend/src/queue/processors/db/export-user-lists.ts @@ -1,14 +1,14 @@ -import * as fs from "node:fs"; import type Bull from "bull"; +import * as fs from "node:fs"; -import { getFullApAccount } from "@/misc/convert-host.js"; -import { createTemp } from "@/misc/create-temp.js"; -import { UserListJoinings, UserLists, Users } from "@/models/index.js"; -import type { DbUserJobData } from "@/queue/types.js"; +import { queueLogger } from "../../logger.js"; import { addFile } from "@/services/drive/add-file.js"; import { format as dateFormat } from "date-fns"; +import { getFullApAccount } from "@/misc/convert-host.js"; +import { createTemp } from "@/misc/create-temp.js"; +import { Users, UserLists, UserListJoinings } from "@/models/index.js"; import { In } from "typeorm"; -import { queueLogger } from "../../logger.js"; +import type { DbUserJobData } from "@/queue/types.js"; const logger = queueLogger.createSubLogger("export-user-lists"); diff --git a/packages/backend/src/queue/processors/db/import-blocking.ts b/packages/backend/src/queue/processors/db/import-blocking.ts index ff07ed1217..290c9dbceb 100644 --- a/packages/backend/src/queue/processors/db/import-blocking.ts +++ b/packages/backend/src/queue/processors/db/import-blocking.ts @@ -1,14 +1,14 @@ import type Bull from "bull"; +import { queueLogger } from "../../logger.js"; import * as Acct from "@/misc/acct.js"; -import { isSelfHost, toPuny } from "@/misc/convert-host.js"; -import { downloadTextFile } from "@/misc/download-text-file.js"; -import { DriveFiles, Users } from "@/models/index.js"; -import type { DbUserImportJobData } from "@/queue/types.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 } from "@/models/index.js"; +import type { DbUserImportJobData } from "@/queue/types.js"; import block from "@/services/blocking/create.js"; import { IsNull } from "typeorm"; -import { queueLogger } from "../../logger.js"; const logger = queueLogger.createSubLogger("import-blocking"); diff --git a/packages/backend/src/queue/processors/db/import-custom-emojis.ts b/packages/backend/src/queue/processors/db/import-custom-emojis.ts index 4f46f49c96..9e8b3b174e 100644 --- a/packages/backend/src/queue/processors/db/import-custom-emojis.ts +++ b/packages/backend/src/queue/processors/db/import-custom-emojis.ts @@ -1,17 +1,17 @@ +import type Bull from "bull"; import * as fs from "node:fs"; import AdmZip from "adm-zip"; -import type Bull from "bull"; -import * as path from "path"; -import { db } from "@/db/postgre.js"; +import { queueLogger } from "../../logger.js"; import { createTempDir } from "@/misc/create-temp.js"; import { downloadUrl } from "@/misc/download-url.js"; -import { genId } from "@/misc/gen-id.js"; import { DriveFiles, Emojis } from "@/models/index.js"; import type { DbUserImportJobData } from "@/queue/types.js"; import { addFile } from "@/services/drive/add-file.js"; +import { genId } from "@/misc/gen-id.js"; +import { db } from "@/db/postgre.js"; import probeImageSize from "probe-image-size"; -import { queueLogger } from "../../logger.js"; +import * as path from "path"; const logger = queueLogger.createSubLogger("import-custom-emojis"); @@ -92,7 +92,7 @@ export async function importCustomEmojis( } else { logger.info("starting emoji import without metadata"); // Since we lack metadata, we import into a randomized category name instead - const categoryName = genId(); + let categoryName = genId(); let containedEmojis = fs.readdirSync(outputPath); diff --git a/packages/backend/src/queue/processors/db/import-firefish-post.ts b/packages/backend/src/queue/processors/db/import-firefish-post.ts index 2c71c3d9f8..4ec88d32cc 100644 --- a/packages/backend/src/queue/processors/db/import-firefish-post.ts +++ b/packages/backend/src/queue/processors/db/import-firefish-post.ts @@ -1,15 +1,15 @@ -import { genId } from "@/misc/gen-id.js"; import * as Post from "@/misc/post.js"; -import type { DriveFile } from "@/models/entities/drive-file.js"; -import type { Note } from "@/models/entities/note.js"; -import { Users } from "@/models/index.js"; -import { NoteEdits, Notes } from "@/models/index.js"; -import { createImportCkPostJob } from "@/queue/index.js"; -import type { DbUserImportMastoPostJobData } from "@/queue/types.js"; -import { uploadFromUrl } from "@/services/drive/upload-from-url.js"; import create from "@/services/note/create.js"; -import type Bull from "bull"; +import { Users } from "@/models/index.js"; +import type { DbUserImportMastoPostJobData } from "@/queue/types.js"; import { queueLogger } from "../../logger.js"; +import { uploadFromUrl } from "@/services/drive/upload-from-url.js"; +import type { DriveFile } from "@/models/entities/drive-file.js"; +import type Bull from "bull"; +import { createImportCkPostJob } from "@/queue/index.js"; +import { Notes, NoteEdits } from "@/models/index.js"; +import type { Note } from "@/models/entities/note.js"; +import { genId } from "@/misc/gen-id.js"; const logger = queueLogger.createSubLogger("import-firefish-post"); @@ -39,7 +39,7 @@ export async function importCkPost( */ const urls = (post.files || []) .map((x: any) => x.url) - .filter((x: string) => x.startsWith("http")); + .filter((x: String) => x.startsWith("http")); const files: DriveFile[] = []; for (const url of urls) { try { diff --git a/packages/backend/src/queue/processors/db/import-following.ts b/packages/backend/src/queue/processors/db/import-following.ts index 1789c8e9b7..b1a7cd2c9b 100644 --- a/packages/backend/src/queue/processors/db/import-following.ts +++ b/packages/backend/src/queue/processors/db/import-following.ts @@ -1,14 +1,14 @@ -import follow from "@/services/following/create.js"; import { IsNull } from "typeorm"; +import follow from "@/services/following/create.js"; import * as Acct from "@/misc/acct.js"; -import { isSelfHost, toPuny } from "@/misc/convert-host.js"; -import { downloadTextFile } from "@/misc/download-text-file.js"; -import { DriveFiles, Users } from "@/models/index.js"; -import type { DbUserImportJobData } from "@/queue/types.js"; import { resolveUser } from "@/remote/resolve-user.js"; -import type Bull from "bull"; +import { downloadTextFile } from "@/misc/download-text-file.js"; +import { isSelfHost, toPuny } from "@/misc/convert-host.js"; +import { Users, DriveFiles } from "@/models/index.js"; +import type { DbUserImportJobData } from "@/queue/types.js"; import { queueLogger } from "../../logger.js"; +import type Bull from "bull"; const logger = queueLogger.createSubLogger("import-following"); 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 f775e388f2..c484ac0e17 100644 --- a/packages/backend/src/queue/processors/db/import-masto-post.ts +++ b/packages/backend/src/queue/processors/db/import-masto-post.ts @@ -1,15 +1,15 @@ -import { genId } from "@/misc/gen-id.js"; -import type { DriveFile } from "@/models/entities/drive-file.js"; -import type { Note } from "@/models/entities/note.js"; +import create from "@/services/note/create.js"; import { Users } from "@/models/index.js"; -import { NoteEdits, Notes } from "@/models/index.js"; import type { DbUserImportMastoPostJobData } from "@/queue/types.js"; +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 { uploadFromUrl } from "@/services/drive/upload-from-url.js"; -import create from "@/services/note/create.js"; -import type Bull from "bull"; -import { queueLogger } from "../../logger.js"; +import type { DriveFile } from "@/models/entities/drive-file.js"; +import { Notes, NoteEdits } from "@/models/index.js"; +import type { Note } from "@/models/entities/note.js"; +import { genId } from "@/misc/gen-id.js"; const logger = queueLogger.createSubLogger("import-masto-post"); @@ -55,7 +55,7 @@ export async function importMastoPost( if (files.length == 0) { const urls = post.object.attachment .map((x: any) => x.url) - .filter((x: string) => x.startsWith("http")); + .filter((x: String) => x.startsWith("http")); files = []; for (const url of urls) { try { diff --git a/packages/backend/src/queue/processors/db/import-muting.ts b/packages/backend/src/queue/processors/db/import-muting.ts index 7ff4fad96f..80e0567397 100644 --- a/packages/backend/src/queue/processors/db/import-muting.ts +++ b/packages/backend/src/queue/processors/db/import-muting.ts @@ -1,15 +1,15 @@ import type Bull from "bull"; -import * as Acct from "@/misc/acct.js"; -import { isSelfHost, toPuny } from "@/misc/convert-host.js"; -import { downloadTextFile } from "@/misc/download-text-file.js"; -import { genId } from "@/misc/gen-id.js"; -import type { User } from "@/models/entities/user.js"; -import { DriveFiles, Mutings, Users } from "@/models/index.js"; -import type { DbUserImportJobData } from "@/queue/types.js"; -import { resolveUser } from "@/remote/resolve-user.js"; -import { IsNull } from "typeorm"; import { queueLogger } from "../../logger.js"; +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, Mutings } from "@/models/index.js"; +import type { DbUserImportJobData } from "@/queue/types.js"; +import type { User } from "@/models/entities/user.js"; +import { genId } from "@/misc/gen-id.js"; +import { IsNull } from "typeorm"; const logger = queueLogger.createSubLogger("import-muting"); diff --git a/packages/backend/src/queue/processors/db/import-posts.ts b/packages/backend/src/queue/processors/db/import-posts.ts index 273b61778c..526489c634 100644 --- a/packages/backend/src/queue/processors/db/import-posts.ts +++ b/packages/backend/src/queue/processors/db/import-posts.ts @@ -1,13 +1,13 @@ import { downloadTextFile } from "@/misc/download-text-file.js"; import { processMastoNotes } from "@/misc/process-masto-notes.js"; -import { DriveFiles, Users } from "@/models/index.js"; +import { Users, DriveFiles } from "@/models/index.js"; +import type { DbUserImportPostsJobData } from "@/queue/types.js"; +import { queueLogger } from "../../logger.js"; +import type Bull from "bull"; import { createImportCkPostJob, createImportMastoPostJob, } from "@/queue/index.js"; -import type { DbUserImportPostsJobData } from "@/queue/types.js"; -import type Bull from "bull"; -import { queueLogger } from "../../logger.js"; const logger = queueLogger.createSubLogger("import-posts"); diff --git a/packages/backend/src/queue/processors/db/import-user-lists.ts b/packages/backend/src/queue/processors/db/import-user-lists.ts index 4ba5d8a63e..0c23f06991 100644 --- a/packages/backend/src/queue/processors/db/import-user-lists.ts +++ b/packages/backend/src/queue/processors/db/import-user-lists.ts @@ -1,20 +1,20 @@ import type Bull from "bull"; +import { queueLogger } from "../../logger.js"; import * as Acct from "@/misc/acct.js"; -import { isSelfHost, toPuny } from "@/misc/convert-host.js"; -import { downloadTextFile } from "@/misc/download-text-file.js"; -import { genId } from "@/misc/gen-id.js"; -import { - DriveFiles, - UserListJoinings, - UserLists, - Users, -} from "@/models/index.js"; -import type { DbUserImportJobData } from "@/queue/types.js"; import { resolveUser } from "@/remote/resolve-user.js"; import { pushUserToUserList } from "@/services/user-list/push.js"; +import { downloadTextFile } from "@/misc/download-text-file.js"; +import { isSelfHost, toPuny } from "@/misc/convert-host.js"; +import { + DriveFiles, + Users, + UserLists, + UserListJoinings, +} from "@/models/index.js"; +import { genId } from "@/misc/gen-id.js"; +import type { DbUserImportJobData } from "@/queue/types.js"; import { IsNull } from "typeorm"; -import { queueLogger } from "../../logger.js"; const logger = queueLogger.createSubLogger("import-user-lists"); diff --git a/packages/backend/src/queue/processors/db/index.ts b/packages/backend/src/queue/processors/db/index.ts index 1245e08c7f..d20fc2c71a 100644 --- a/packages/backend/src/queue/processors/db/index.ts +++ b/packages/backend/src/queue/processors/db/index.ts @@ -1,21 +1,21 @@ -import type { DbJobData } from "@/queue/types.js"; import type Bull from "bull"; -import { deleteAccount } from "./delete-account.js"; +import type { DbJobData } from "@/queue/types.js"; import { deleteDriveFiles } from "./delete-drive-files.js"; -import { exportBlocking } from "./export-blocking.js"; import { exportCustomEmojis } from "./export-custom-emojis.js"; +import { exportNotes } from "./export-notes.js"; import { exportFollowing } from "./export-following.js"; import { exportMute } from "./export-mute.js"; -import { exportNotes } from "./export-notes.js"; +import { exportBlocking } from "./export-blocking.js"; import { exportUserLists } from "./export-user-lists.js"; -import { importBlocking } from "./import-blocking.js"; -import { importCustomEmojis } from "./import-custom-emojis.js"; -import { importCkPost } from "./import-firefish-post.js"; import { importFollowing } from "./import-following.js"; -import { importMastoPost } from "./import-masto-post.js"; +import { importUserLists } from "./import-user-lists.js"; +import { deleteAccount } from "./delete-account.js"; import { importMuting } from "./import-muting.js"; import { importPosts } from "./import-posts.js"; -import { importUserLists } from "./import-user-lists.js"; +import { importMastoPost } from "./import-masto-post.js"; +import { importCkPost } from "./import-firefish-post.js"; +import { importBlocking } from "./import-blocking.js"; +import { importCustomEmojis } from "./import-custom-emojis.js"; const jobs = { deleteDriveFiles, diff --git a/packages/backend/src/queue/processors/deliver.ts b/packages/backend/src/queue/processors/deliver.ts index 5d2a7e49af..65471a559f 100644 --- a/packages/backend/src/queue/processors/deliver.ts +++ b/packages/backend/src/queue/processors/deliver.ts @@ -1,18 +1,18 @@ import { URL } from "node:url"; -import { toPuny } from "@/misc/convert-host.js"; -import { StatusError } from "@/misc/fetch.js"; -import { shouldSkipInstance } from "@/misc/skipped-instances.js"; -import { Instances } from "@/models/index.js"; -import type { DeliverJobData } from "@/queue/types.js"; import request from "@/remote/activitypub/request.js"; +import { registerOrFetchInstanceDoc } from "@/services/register-or-fetch-instance-doc.js"; +import Logger from "@/services/logger.js"; +import { Instances } from "@/models/index.js"; import { apRequestChart, federationChart, instanceChart, } from "@/services/chart/index.js"; import { fetchInstanceMetadata } from "@/services/fetch-instance-metadata.js"; -import Logger from "@/services/logger.js"; -import { registerOrFetchInstanceDoc } from "@/services/register-or-fetch-instance-doc.js"; +import { toPuny } from "@/misc/convert-host.js"; +import { StatusError } from "@/misc/fetch.js"; +import { shouldSkipInstance } from "@/misc/skipped-instances.js"; +import type { DeliverJobData } from "@/queue/types.js"; import type Bull from "bull"; const logger = new Logger("deliver"); diff --git a/packages/backend/src/queue/processors/ended-poll-notification.ts b/packages/backend/src/queue/processors/ended-poll-notification.ts index 140b315e87..f93b067b8a 100644 --- a/packages/backend/src/queue/processors/ended-poll-notification.ts +++ b/packages/backend/src/queue/processors/ended-poll-notification.ts @@ -1,9 +1,9 @@ +import type Bull from "bull"; import { Notes, PollVotes } from "@/models/index.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"; -import type Bull from "bull"; // unused // const logger = queueLogger.createSubLogger("ended-poll-notification"); diff --git a/packages/backend/src/queue/processors/inbox.ts b/packages/backend/src/queue/processors/inbox.ts index 71cf7d458a..116f279ac3 100644 --- a/packages/backend/src/queue/processors/inbox.ts +++ b/packages/backend/src/queue/processors/inbox.ts @@ -1,28 +1,28 @@ import { URL } from "node:url"; -import { extractDbHost, toPuny } from "@/misc/convert-host.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import { StatusError } from "@/misc/fetch.js"; -import { shouldBlockInstance } from "@/misc/should-block-instance.js"; -import type { UserPublickey } from "@/models/entities/user-publickey.js"; -import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { Instances } from "@/models/index.js"; -import { verifySignature } from "@/remote/activitypub/check-fetch.js"; -import DbResolver from "@/remote/activitypub/db-resolver.js"; -import { LdSignature } from "@/remote/activitypub/misc/ld-signature.js"; -import { resolvePerson } from "@/remote/activitypub/models/person.js"; +import type Bull from "bull"; +import httpSignature from "@peertube/http-signature"; import perform from "@/remote/activitypub/perform.js"; -import { getApId } from "@/remote/activitypub/type.js"; +import Logger from "@/services/logger.js"; +import { registerOrFetchInstanceDoc } from "@/services/register-or-fetch-instance-doc.js"; +import { Instances } from "@/models/index.js"; import { apRequestChart, federationChart, instanceChart, } from "@/services/chart/index.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; +import { toPuny, extractDbHost } from "@/misc/convert-host.js"; +import { getApId } from "@/remote/activitypub/type.js"; import { fetchInstanceMetadata } from "@/services/fetch-instance-metadata.js"; -import Logger from "@/services/logger.js"; -import { registerOrFetchInstanceDoc } from "@/services/register-or-fetch-instance-doc.js"; -import httpSignature from "@peertube/http-signature"; -import type Bull from "bull"; import type { InboxJobData } from "../types.js"; +import DbResolver from "@/remote/activitypub/db-resolver.js"; +import { resolvePerson } from "@/remote/activitypub/models/person.js"; +import { LdSignature } from "@/remote/activitypub/misc/ld-signature.js"; +import { StatusError } from "@/misc/fetch.js"; +import type { CacheableRemoteUser } from "@/models/entities/user.js"; +import type { UserPublickey } from "@/models/entities/user-publickey.js"; +import { shouldBlockInstance } from "@/misc/should-block-instance.js"; +import { verifySignature } from "@/remote/activitypub/check-fetch.js"; const logger = new Logger("inbox"); diff --git a/packages/backend/src/queue/processors/object-storage/clean-remote-files.ts b/packages/backend/src/queue/processors/object-storage/clean-remote-files.ts index 6d9ef9557d..14ad1b1014 100644 --- a/packages/backend/src/queue/processors/object-storage/clean-remote-files.ts +++ b/packages/backend/src/queue/processors/object-storage/clean-remote-files.ts @@ -1,9 +1,9 @@ import type Bull from "bull"; -import { DriveFiles } from "@/models/index.js"; -import { deleteFileSync } from "@/services/drive/delete-file.js"; -import { IsNull, MoreThan, Not } from "typeorm"; import { queueLogger } from "../../logger.js"; +import { deleteFileSync } from "@/services/drive/delete-file.js"; +import { DriveFiles } from "@/models/index.js"; +import { MoreThan, Not, IsNull } from "typeorm"; const logger = queueLogger.createSubLogger("clean-remote-files"); diff --git a/packages/backend/src/queue/processors/object-storage/delete-file.ts b/packages/backend/src/queue/processors/object-storage/delete-file.ts index 761c83cab6..174aa1906c 100644 --- a/packages/backend/src/queue/processors/object-storage/delete-file.ts +++ b/packages/backend/src/queue/processors/object-storage/delete-file.ts @@ -1,6 +1,6 @@ import type { ObjectStorageFileJobData } from "@/queue/types.js"; -import { deleteObjectStorageFile } from "@/services/drive/delete-file.js"; import type Bull from "bull"; +import { deleteObjectStorageFile } from "@/services/drive/delete-file.js"; export default async (job: Bull.Job) => { const key: string = job.data.key; diff --git a/packages/backend/src/queue/processors/object-storage/index.ts b/packages/backend/src/queue/processors/object-storage/index.ts index 255ff9f251..5f90d4cd09 100644 --- a/packages/backend/src/queue/processors/object-storage/index.ts +++ b/packages/backend/src/queue/processors/object-storage/index.ts @@ -1,7 +1,7 @@ -import type { ObjectStorageJobData } from "@/queue/types.js"; import type Bull from "bull"; -import cleanRemoteFiles from "./clean-remote-files.js"; +import type { ObjectStorageJobData } from "@/queue/types.js"; import deleteFile from "./delete-file.js"; +import cleanRemoteFiles from "./clean-remote-files.js"; const jobs = { deleteFile, diff --git a/packages/backend/src/queue/processors/system/check-expired-mutings.ts b/packages/backend/src/queue/processors/system/check-expired-mutings.ts index 17715fb4e1..a482d0218a 100644 --- a/packages/backend/src/queue/processors/system/check-expired-mutings.ts +++ b/packages/backend/src/queue/processors/system/check-expired-mutings.ts @@ -1,8 +1,8 @@ -import { Mutings } from "@/models/index.js"; -import { publishUserEvent } from "@/services/stream.js"; import type Bull from "bull"; import { In } from "typeorm"; +import { Mutings } from "@/models/index.js"; import { queueLogger } from "../../logger.js"; +import { publishUserEvent } from "@/services/stream.js"; const logger = queueLogger.createSubLogger("check-expired-mutings"); diff --git a/packages/backend/src/queue/processors/system/clean-charts.ts b/packages/backend/src/queue/processors/system/clean-charts.ts index 318a0ead33..dde5d95fe3 100644 --- a/packages/backend/src/queue/processors/system/clean-charts.ts +++ b/packages/backend/src/queue/processors/system/clean-charts.ts @@ -1,8 +1,8 @@ import type Bull from "bull"; +import { queueLogger } from "../../logger.js"; import { activeUsersChart, - apRequestChart, driveChart, federationChart, hashtagChart, @@ -13,8 +13,8 @@ import { perUserNotesChart, perUserReactionsChart, usersChart, + apRequestChart, } from "@/services/chart/index.js"; -import { queueLogger } from "../../logger.js"; const logger = queueLogger.createSubLogger("clean-charts"); diff --git a/packages/backend/src/queue/processors/system/clean.ts b/packages/backend/src/queue/processors/system/clean.ts index 8f46c43f45..fbd45b0bb9 100644 --- a/packages/backend/src/queue/processors/system/clean.ts +++ b/packages/backend/src/queue/processors/system/clean.ts @@ -1,6 +1,6 @@ -import { UserIps } from "@/models/index.js"; import type Bull from "bull"; import { LessThan } from "typeorm"; +import { UserIps } from "@/models/index.js"; import { queueLogger } from "../../logger.js"; diff --git a/packages/backend/src/queue/processors/system/index.ts b/packages/backend/src/queue/processors/system/index.ts index 207a2ed6d1..697d24d067 100644 --- a/packages/backend/src/queue/processors/system/index.ts +++ b/packages/backend/src/queue/processors/system/index.ts @@ -1,10 +1,10 @@ import type Bull from "bull"; -import { checkExpiredMutings } from "./check-expired-mutings.js"; +import { tickCharts } from "./tick-charts.js"; +import { resyncCharts } from "./resync-charts.js"; import { cleanCharts } from "./clean-charts.js"; +import { checkExpiredMutings } from "./check-expired-mutings.js"; import { clean } from "./clean.js"; import { setLocalEmojiSizes } from "./local-emoji-size.js"; -import { resyncCharts } from "./resync-charts.js"; -import { tickCharts } from "./tick-charts.js"; import { verifyLinks } from "./verify-links.js"; const jobs = { diff --git a/packages/backend/src/queue/processors/system/local-emoji-size.ts b/packages/backend/src/queue/processors/system/local-emoji-size.ts index 94f1693e56..d696bbd863 100644 --- a/packages/backend/src/queue/processors/system/local-emoji-size.ts +++ b/packages/backend/src/queue/processors/system/local-emoji-size.ts @@ -1,9 +1,9 @@ -import { Emojis } from "@/models/index.js"; import type Bull from "bull"; import { IsNull } from "typeorm"; +import { Emojis } from "@/models/index.js"; -import { getEmojiSize } from "@/misc/emoji-meta.js"; import { queueLogger } from "../../logger.js"; +import { getEmojiSize } from "@/misc/emoji-meta.js"; const logger = queueLogger.createSubLogger("local-emoji-size"); diff --git a/packages/backend/src/queue/processors/system/resync-charts.ts b/packages/backend/src/queue/processors/system/resync-charts.ts index bba1472d48..dbea0df733 100644 --- a/packages/backend/src/queue/processors/system/resync-charts.ts +++ b/packages/backend/src/queue/processors/system/resync-charts.ts @@ -1,7 +1,7 @@ import type Bull from "bull"; -import { driveChart, notesChart, usersChart } from "@/services/chart/index.js"; import { queueLogger } from "../../logger.js"; +import { driveChart, notesChart, usersChart } from "@/services/chart/index.js"; const logger = queueLogger.createSubLogger("resync-charts"); diff --git a/packages/backend/src/queue/processors/system/tick-charts.ts b/packages/backend/src/queue/processors/system/tick-charts.ts index 901bda8881..33eed8a596 100644 --- a/packages/backend/src/queue/processors/system/tick-charts.ts +++ b/packages/backend/src/queue/processors/system/tick-charts.ts @@ -1,8 +1,8 @@ import type Bull from "bull"; +import { queueLogger } from "../../logger.js"; import { activeUsersChart, - apRequestChart, driveChart, federationChart, hashtagChart, @@ -13,8 +13,8 @@ import { perUserNotesChart, perUserReactionsChart, usersChart, + apRequestChart, } from "@/services/chart/index.js"; -import { queueLogger } from "../../logger.js"; const logger = queueLogger.createSubLogger("tick-charts"); diff --git a/packages/backend/src/queue/processors/system/verify-links.ts b/packages/backend/src/queue/processors/system/verify-links.ts index b2c1d65b82..4ee88c6310 100644 --- a/packages/backend/src/queue/processors/system/verify-links.ts +++ b/packages/backend/src/queue/processors/system/verify-links.ts @@ -1,9 +1,9 @@ import type Bull from "bull"; import { UserProfiles } from "@/models/index.js"; -import { verifyLink } from "@/services/fetch-rel-me.js"; import { Not } from "typeorm"; import { queueLogger } from "../../logger.js"; +import { verifyLink } from "@/services/fetch-rel-me.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 19f0aec3c5..12c9a05498 100644 --- a/packages/backend/src/queue/processors/webhook-deliver.ts +++ b/packages/backend/src/queue/processors/webhook-deliver.ts @@ -1,9 +1,9 @@ -import config from "@/config/index.js"; -import { StatusError, getResponse } from "@/misc/fetch.js"; -import { Webhooks } from "@/models/index.js"; -import Logger from "@/services/logger.js"; import type Bull from "bull"; +import Logger from "@/services/logger.js"; import type { WebhookDeliverJobData } from "../types.js"; +import { getResponse, StatusError } from "@/misc/fetch.js"; +import { Webhooks } from "@/models/index.js"; +import config from "@/config/index.js"; const logger = new Logger("webhook"); diff --git a/packages/backend/src/queue/queues.ts b/packages/backend/src/queue/queues.ts index 174a67af3c..6b0eb2de42 100644 --- a/packages/backend/src/queue/queues.ts +++ b/packages/backend/src/queue/queues.ts @@ -1,11 +1,11 @@ import config from "@/config/index.js"; import { initialize as initializeQueue } from "./initialize.js"; import type { - DbJobData, DeliverJobData, - EndedPollNotificationJobData, InboxJobData, + DbJobData, ObjectStorageJobData, + EndedPollNotificationJobData, WebhookDeliverJobData, } from "./types.js"; diff --git a/packages/backend/src/remote/activitypub/audience.ts b/packages/backend/src/remote/activitypub/audience.ts index 6a45581e66..9d840bc574 100644 --- a/packages/backend/src/remote/activitypub/audience.ts +++ b/packages/backend/src/remote/activitypub/audience.ts @@ -1,13 +1,13 @@ +import type { ApObject } from "./type.js"; +import { getApIds } from "./type.js"; +import type Resolver from "./resolver.js"; +import { resolvePerson } from "./models/person.js"; +import { unique, concat } from "@/prelude/array.js"; +import promiseLimit from "promise-limit"; import type { CacheableRemoteUser, CacheableUser, } from "@/models/entities/user.js"; -import { concat, unique } from "@/prelude/array.js"; -import promiseLimit from "promise-limit"; -import { resolvePerson } from "./models/person.js"; -import type Resolver from "./resolver.js"; -import type { ApObject } from "./type.js"; -import { getApIds } from "./type.js"; type Visibility = "public" | "home" | "followers" | "specified"; diff --git a/packages/backend/src/remote/activitypub/check-fetch.ts b/packages/backend/src/remote/activitypub/check-fetch.ts index 77ba795253..ab46d97f85 100644 --- a/packages/backend/src/remote/activitypub/check-fetch.ts +++ b/packages/backend/src/remote/activitypub/check-fetch.ts @@ -1,17 +1,17 @@ -import type { IncomingMessage } from "http"; -import { verify } from "node:crypto"; -import { createHash } from "node:crypto"; import { URL } from "url"; +import httpSignature, { IParsedSignature } from "@peertube/http-signature"; import config from "@/config/index.js"; -import { toPuny } from "@/misc/convert-host.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; -import { shouldBlockInstance } from "@/misc/should-block-instance.js"; -import type { UserPublickey } from "@/models/entities/user-publickey.js"; -import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { toSingle } from "@/prelude/array.js"; +import { toPuny } from "@/misc/convert-host.js"; import DbResolver from "@/remote/activitypub/db-resolver.js"; import { getApId } from "@/remote/activitypub/type.js"; -import httpSignature, { IParsedSignature } from "@peertube/http-signature"; +import { shouldBlockInstance } from "@/misc/should-block-instance.js"; +import type { IncomingMessage } from "http"; +import type { CacheableRemoteUser } from "@/models/entities/user.js"; +import type { UserPublickey } from "@/models/entities/user-publickey.js"; +import { verify } from "node:crypto"; +import { toSingle } from "@/prelude/array.js"; +import { createHash } from "node:crypto"; export async function hasSignature(req: IncomingMessage): Promise { const meta = await fetchMeta(); diff --git a/packages/backend/src/remote/activitypub/db-resolver.ts b/packages/backend/src/remote/activitypub/db-resolver.ts index a25662b672..a753606a14 100644 --- a/packages/backend/src/remote/activitypub/db-resolver.ts +++ b/packages/backend/src/remote/activitypub/db-resolver.ts @@ -1,23 +1,23 @@ +import escapeRegexp from "escape-regexp"; import config from "@/config/index.js"; -import { Cache } from "@/misc/cache.js"; -import type { MessagingMessage } from "@/models/entities/messaging-message.js"; import type { Note } from "@/models/entities/note.js"; -import type { UserPublickey } from "@/models/entities/user-publickey.js"; import type { CacheableRemoteUser, CacheableUser, } from "@/models/entities/user.js"; +import type { UserPublickey } from "@/models/entities/user-publickey.js"; +import type { MessagingMessage } from "@/models/entities/messaging-message.js"; import { - MessagingMessages, Notes, - UserPublickeys, Users, + UserPublickeys, + MessagingMessages, } from "@/models/index.js"; +import { Cache } from "@/misc/cache.js"; import { uriPersonCache, userByIdCache } from "@/services/user-cache.js"; -import escapeRegexp from "escape-regexp"; -import { resolvePerson, updatePerson } from "./models/person.js"; import type { IObject } from "./type.js"; import { getApId } from "./type.js"; +import { resolvePerson, updatePerson } from "./models/person.js"; const publicKeyCache = new Cache("publicKey", 60 * 30); const publicKeyByUserIdCache = new Cache( diff --git a/packages/backend/src/remote/activitypub/deliver-manager.ts b/packages/backend/src/remote/activitypub/deliver-manager.ts index 023a2774fa..c97d1c99ae 100644 --- a/packages/backend/src/remote/activitypub/deliver-manager.ts +++ b/packages/backend/src/remote/activitypub/deliver-manager.ts @@ -1,8 +1,8 @@ -import { skippedInstances } from "@/misc/skipped-instances.js"; -import type { ILocalUser, IRemoteUser, User } from "@/models/entities/user.js"; -import { Followings, Users } from "@/models/index.js"; -import { deliver } from "@/queue/index.js"; import { IsNull, Not } from "typeorm"; +import { Users, Followings } from "@/models/index.js"; +import type { ILocalUser, IRemoteUser, User } from "@/models/entities/user.js"; +import { deliver } from "@/queue/index.js"; +import { skippedInstances } from "@/misc/skipped-instances.js"; //#region types interface IRecipe { diff --git a/packages/backend/src/remote/activitypub/kernel/accept/follow.ts b/packages/backend/src/remote/activitypub/kernel/accept/follow.ts index fc9a475546..e430bbf576 100644 --- a/packages/backend/src/remote/activitypub/kernel/accept/follow.ts +++ b/packages/backend/src/remote/activitypub/kernel/accept/follow.ts @@ -1,8 +1,8 @@ import type { CacheableRemoteUser } from "@/models/entities/user.js"; import accept from "@/services/following/requests/accept.js"; -import { relayAccepted } from "@/services/relay.js"; -import DbResolver from "../../db-resolver.js"; import type { IFollow } from "../../type.js"; +import DbResolver from "../../db-resolver.js"; +import { relayAccepted } from "@/services/relay.js"; export default async ( actor: CacheableRemoteUser, diff --git a/packages/backend/src/remote/activitypub/kernel/accept/index.ts b/packages/backend/src/remote/activitypub/kernel/accept/index.ts index 42c4dcb3a0..5c73760ff3 100644 --- a/packages/backend/src/remote/activitypub/kernel/accept/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/accept/index.ts @@ -1,9 +1,9 @@ -import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { apLogger } from "../../logger.js"; import Resolver from "../../resolver.js"; -import type { IAccept } from "../../type.js"; -import { getApType, isFollow } from "../../type.js"; +import type { CacheableRemoteUser } from "@/models/entities/user.js"; import acceptFollow from "./follow.js"; +import type { IAccept } from "../../type.js"; +import { isFollow, getApType } from "../../type.js"; +import { apLogger } from "../../logger.js"; const logger = apLogger; diff --git a/packages/backend/src/remote/activitypub/kernel/add/index.ts b/packages/backend/src/remote/activitypub/kernel/add/index.ts index 1ef49ed77a..b3606e5d93 100644 --- a/packages/backend/src/remote/activitypub/kernel/add/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/add/index.ts @@ -1,7 +1,7 @@ import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { addPinned } from "@/services/i/pin.js"; -import { resolveNote } from "../../models/note.js"; import type { IAdd } from "../../type.js"; +import { resolveNote } from "../../models/note.js"; +import { addPinned } from "@/services/i/pin.js"; export default async ( actor: CacheableRemoteUser, diff --git a/packages/backend/src/remote/activitypub/kernel/announce/index.ts b/packages/backend/src/remote/activitypub/kernel/announce/index.ts index f3e85135d8..975e070f92 100644 --- a/packages/backend/src/remote/activitypub/kernel/announce/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/announce/index.ts @@ -1,9 +1,9 @@ -import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { apLogger } from "../../logger.js"; import Resolver from "../../resolver.js"; +import type { CacheableRemoteUser } from "@/models/entities/user.js"; +import announceNote from "./note.js"; import type { IAnnounce } from "../../type.js"; import { getApId } from "../../type.js"; -import announceNote from "./note.js"; +import { apLogger } from "../../logger.js"; const logger = apLogger; diff --git a/packages/backend/src/remote/activitypub/kernel/announce/note.ts b/packages/backend/src/remote/activitypub/kernel/announce/note.ts index e62cdd204d..50b59932cf 100644 --- a/packages/backend/src/remote/activitypub/kernel/announce/note.ts +++ b/packages/backend/src/remote/activitypub/kernel/announce/note.ts @@ -1,16 +1,16 @@ -import { getApLock } from "@/misc/app-lock.js"; -import { extractDbHost } from "@/misc/convert-host.js"; -import { StatusError } from "@/misc/fetch.js"; -import { shouldBlockInstance } from "@/misc/should-block-instance.js"; -import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { Notes } from "@/models/index.js"; -import post from "@/services/note/create.js"; -import { parseAudience } from "../../audience.js"; -import { apLogger } from "../../logger.js"; -import { fetchNote, resolveNote } from "../../models/note.js"; import type Resolver from "../../resolver.js"; +import post from "@/services/note/create.js"; +import type { CacheableRemoteUser } from "@/models/entities/user.js"; import type { IAnnounce } from "../../type.js"; import { getApId } from "../../type.js"; +import { fetchNote, resolveNote } from "../../models/note.js"; +import { apLogger } from "../../logger.js"; +import { extractDbHost } from "@/misc/convert-host.js"; +import { getApLock } from "@/misc/app-lock.js"; +import { parseAudience } from "../../audience.js"; +import { StatusError } from "@/misc/fetch.js"; +import { Notes } from "@/models/index.js"; +import { shouldBlockInstance } from "@/misc/should-block-instance.js"; const logger = apLogger; diff --git a/packages/backend/src/remote/activitypub/kernel/block/index.ts b/packages/backend/src/remote/activitypub/kernel/block/index.ts index 96d11c1a1a..4dc868ba10 100644 --- a/packages/backend/src/remote/activitypub/kernel/block/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/block/index.ts @@ -1,8 +1,8 @@ -import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { Users } from "@/models/index.js"; -import block from "@/services/blocking/create.js"; -import DbResolver from "../../db-resolver.js"; import type { IBlock } from "../../type.js"; +import block from "@/services/blocking/create.js"; +import type { CacheableRemoteUser } from "@/models/entities/user.js"; +import DbResolver from "../../db-resolver.js"; +import { Users } from "@/models/index.js"; export default async ( actor: CacheableRemoteUser, diff --git a/packages/backend/src/remote/activitypub/kernel/create/index.ts b/packages/backend/src/remote/activitypub/kernel/create/index.ts index 96dfd6761c..3dcf648247 100644 --- a/packages/backend/src/remote/activitypub/kernel/create/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/create/index.ts @@ -1,10 +1,10 @@ -import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { concat, toArray, unique } from "@/prelude/array.js"; -import { apLogger } from "../../logger.js"; import Resolver from "../../resolver.js"; -import type { ICreate } from "../../type.js"; -import { getApId, getApType, isPost } from "../../type.js"; +import type { CacheableRemoteUser } from "@/models/entities/user.js"; import createNote from "./note.js"; +import type { ICreate } from "../../type.js"; +import { getApId, isPost, getApType } from "../../type.js"; +import { apLogger } from "../../logger.js"; +import { toArray, concat, unique } from "@/prelude/array.js"; const logger = apLogger; diff --git a/packages/backend/src/remote/activitypub/kernel/create/note.ts b/packages/backend/src/remote/activitypub/kernel/create/note.ts index f0b3d177a7..92b0ffb1e0 100644 --- a/packages/backend/src/remote/activitypub/kernel/create/note.ts +++ b/packages/backend/src/remote/activitypub/kernel/create/note.ts @@ -1,11 +1,11 @@ +import type Resolver from "../../resolver.js"; +import type { CacheableRemoteUser } from "@/models/entities/user.js"; +import { createNote, fetchNote } from "../../models/note.js"; +import type { IObject, ICreate } from "../../type.js"; +import { getApId } from "../../type.js"; import { getApLock } from "@/misc/app-lock.js"; import { extractDbHost } from "@/misc/convert-host.js"; import { StatusError } from "@/misc/fetch.js"; -import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { createNote, fetchNote } from "../../models/note.js"; -import type Resolver from "../../resolver.js"; -import type { ICreate, IObject } from "../../type.js"; -import { getApId } from "../../type.js"; /** * Handle post creation activity diff --git a/packages/backend/src/remote/activitypub/kernel/delete/actor.ts b/packages/backend/src/remote/activitypub/kernel/delete/actor.ts index da8965415e..83c6442dde 100644 --- a/packages/backend/src/remote/activitypub/kernel/delete/actor.ts +++ b/packages/backend/src/remote/activitypub/kernel/delete/actor.ts @@ -1,7 +1,7 @@ +import { apLogger } from "../../logger.js"; +import { createDeleteAccountJob } from "@/queue/index.js"; import type { CacheableRemoteUser } from "@/models/entities/user.js"; import { Users } from "@/models/index.js"; -import { createDeleteAccountJob } from "@/queue/index.js"; -import { apLogger } from "../../logger.js"; const logger = apLogger; diff --git a/packages/backend/src/remote/activitypub/kernel/delete/index.ts b/packages/backend/src/remote/activitypub/kernel/delete/index.ts index 54cc691bdc..f9ad52de54 100644 --- a/packages/backend/src/remote/activitypub/kernel/delete/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/delete/index.ts @@ -1,9 +1,9 @@ import type { CacheableRemoteUser } from "@/models/entities/user.js"; import { toSingle } from "@/prelude/array.js"; -import { getApId, isTombstone, validActor, validPost } from "../../type.js"; -import type { IDelete, IObject } from "../../type.js"; -import { deleteActor } from "./actor.js"; +import { getApId, isTombstone, validPost, validActor } from "../../type.js"; import deleteNote from "./note.js"; +import { deleteActor } from "./actor.js"; +import type { IDelete, IObject } from "../../type.js"; /** * Handle delete activity diff --git a/packages/backend/src/remote/activitypub/kernel/delete/note.ts b/packages/backend/src/remote/activitypub/kernel/delete/note.ts index 273be837b8..4656480c2f 100644 --- a/packages/backend/src/remote/activitypub/kernel/delete/note.ts +++ b/packages/backend/src/remote/activitypub/kernel/delete/note.ts @@ -1,9 +1,9 @@ -import { getApLock } from "@/misc/app-lock.js"; import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { deleteMessage } from "@/services/messages/delete.js"; import deleteNode from "@/services/note/delete.js"; -import DbResolver from "../../db-resolver.js"; import { apLogger } from "../../logger.js"; +import DbResolver from "../../db-resolver.js"; +import { getApLock } from "@/misc/app-lock.js"; +import { deleteMessage } from "@/services/messages/delete.js"; const logger = apLogger; diff --git a/packages/backend/src/remote/activitypub/kernel/flag/index.ts b/packages/backend/src/remote/activitypub/kernel/flag/index.ts index 6e9452d01a..39ba8b3f4f 100644 --- a/packages/backend/src/remote/activitypub/kernel/flag/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/flag/index.ts @@ -1,10 +1,10 @@ -import config from "@/config/index.js"; -import { genId } from "@/misc/gen-id.js"; import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { AbuseUserReports, Users } from "@/models/index.js"; -import { In } from "typeorm"; +import config from "@/config/index.js"; import type { IFlag } from "../../type.js"; import { getApIds } from "../../type.js"; +import { AbuseUserReports, Users } from "@/models/index.js"; +import { In } from "typeorm"; +import { genId } from "@/misc/gen-id.js"; export default async ( actor: CacheableRemoteUser, diff --git a/packages/backend/src/remote/activitypub/kernel/follow.ts b/packages/backend/src/remote/activitypub/kernel/follow.ts index 610608b541..1c1ef36cfa 100644 --- a/packages/backend/src/remote/activitypub/kernel/follow.ts +++ b/packages/backend/src/remote/activitypub/kernel/follow.ts @@ -1,7 +1,7 @@ import type { CacheableRemoteUser } from "@/models/entities/user.js"; import follow from "@/services/following/create.js"; -import DbResolver from "../db-resolver.js"; import type { IFollow } from "../type.js"; +import DbResolver from "../db-resolver.js"; export default async ( actor: CacheableRemoteUser, diff --git a/packages/backend/src/remote/activitypub/kernel/index.ts b/packages/backend/src/remote/activitypub/kernel/index.ts index 225c57d4ff..a90ac02345 100644 --- a/packages/backend/src/remote/activitypub/kernel/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/index.ts @@ -1,45 +1,45 @@ -import { extractDbHost } from "@/misc/convert-host.js"; -import { shouldBlockInstance } from "@/misc/should-block-instance.js"; import type { CacheableRemoteUser } from "@/models/entities/user.js"; import { toArray } from "@/prelude/array.js"; -import { apLogger } from "../logger.js"; -import Resolver from "../resolver.js"; import { - getApId, - isAccept, - isAdd, - isAnnounce, - isBlock, - isCollection, - isCollectionOrOrderedCollection, isCreate, isDelete, - isFlag, - isFollow, - isLike, - isMove, - isRead, - isReject, - isRemove, - isUndo, isUpdate, + isRead, + isFollow, + isAccept, + isReject, + isAdd, + isRemove, + isAnnounce, + isLike, + isUndo, + isBlock, + isCollectionOrOrderedCollection, + isCollection, + isFlag, + isMove, + getApId, } from "../type.js"; -import type { IActivity, IObject } from "../type.js"; -import accept from "./accept/index.js"; -import add from "./add/index.js"; -import announce from "./announce/index.js"; -import block from "./block/index.js"; +import { apLogger } from "../logger.js"; +import Resolver from "../resolver.js"; import create from "./create/index.js"; import performDeleteActivity from "./delete/index.js"; -import flag from "./flag/index.js"; -import follow from "./follow.js"; -import like from "./like.js"; -import move from "./move/index.js"; -import { performReadActivity } from "./read.js"; -import reject from "./reject/index.js"; -import remove from "./remove/index.js"; -import undo from "./undo/index.js"; import performUpdateActivity from "./update/index.js"; +import { performReadActivity } from "./read.js"; +import follow from "./follow.js"; +import undo from "./undo/index.js"; +import like from "./like.js"; +import announce from "./announce/index.js"; +import accept from "./accept/index.js"; +import reject from "./reject/index.js"; +import add from "./add/index.js"; +import remove from "./remove/index.js"; +import block from "./block/index.js"; +import flag from "./flag/index.js"; +import move from "./move/index.js"; +import type { IObject, IActivity } from "../type.js"; +import { extractDbHost } from "@/misc/convert-host.js"; +import { shouldBlockInstance } from "@/misc/should-block-instance.js"; export async function performActivity( actor: CacheableRemoteUser, diff --git a/packages/backend/src/remote/activitypub/kernel/like.ts b/packages/backend/src/remote/activitypub/kernel/like.ts index e4dfe80eef..7b30d1cd54 100644 --- a/packages/backend/src/remote/activitypub/kernel/like.ts +++ b/packages/backend/src/remote/activitypub/kernel/like.ts @@ -1,8 +1,8 @@ import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import create from "@/services/note/reaction/create.js"; -import { extractEmojis, fetchNote } from "../models/note.js"; import type { ILike } from "../type.js"; import { getApId } from "../type.js"; +import create from "@/services/note/reaction/create.js"; +import { fetchNote, extractEmojis } from "../models/note.js"; export default async (actor: CacheableRemoteUser, activity: ILike) => { const targetUri = getApId(activity.object); diff --git a/packages/backend/src/remote/activitypub/kernel/read.ts b/packages/backend/src/remote/activitypub/kernel/read.ts index 91f3276ec7..53fa7fe63b 100644 --- a/packages/backend/src/remote/activitypub/kernel/read.ts +++ b/packages/backend/src/remote/activitypub/kernel/read.ts @@ -1,9 +1,9 @@ -import { extractDbHost, isSelfHost } from "@/misc/convert-host.js"; import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { MessagingMessages } from "@/models/index.js"; -import { readUserMessagingMessage } from "@/server/api/common/read-messaging-message.js"; 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"; export const performReadActivity = async ( actor: CacheableRemoteUser, diff --git a/packages/backend/src/remote/activitypub/kernel/reject/follow.ts b/packages/backend/src/remote/activitypub/kernel/reject/follow.ts index 9943844257..670c1556fd 100644 --- a/packages/backend/src/remote/activitypub/kernel/reject/follow.ts +++ b/packages/backend/src/remote/activitypub/kernel/reject/follow.ts @@ -1,9 +1,9 @@ import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { Users } from "@/models/index.js"; import { remoteReject } from "@/services/following/reject.js"; -import { relayRejected } from "@/services/relay.js"; -import DbResolver from "../../db-resolver.js"; import type { IFollow } from "../../type.js"; +import DbResolver from "../../db-resolver.js"; +import { relayRejected } from "@/services/relay.js"; +import { Users } from "@/models/index.js"; export default async ( actor: CacheableRemoteUser, diff --git a/packages/backend/src/remote/activitypub/kernel/reject/index.ts b/packages/backend/src/remote/activitypub/kernel/reject/index.ts index dd5465b0c6..10edb0f7a2 100644 --- a/packages/backend/src/remote/activitypub/kernel/reject/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/reject/index.ts @@ -1,9 +1,9 @@ -import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { apLogger } from "../../logger.js"; import Resolver from "../../resolver.js"; -import type { IReject } from "../../type.js"; -import { getApType, isFollow } from "../../type.js"; +import type { CacheableRemoteUser } from "@/models/entities/user.js"; import rejectFollow from "./follow.js"; +import type { IReject } from "../../type.js"; +import { isFollow, getApType } from "../../type.js"; +import { apLogger } from "../../logger.js"; const logger = apLogger; diff --git a/packages/backend/src/remote/activitypub/kernel/remove/index.ts b/packages/backend/src/remote/activitypub/kernel/remove/index.ts index f8478b7c72..0b4be6b5f2 100644 --- a/packages/backend/src/remote/activitypub/kernel/remove/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/remove/index.ts @@ -1,7 +1,7 @@ import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { removePinned } from "@/services/i/pin.js"; -import { resolveNote } from "../../models/note.js"; import type { IRemove } from "../../type.js"; +import { resolveNote } from "../../models/note.js"; +import { removePinned } from "@/services/i/pin.js"; export default 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 6e33661961..7cf457046a 100644 --- a/packages/backend/src/remote/activitypub/kernel/undo/accept.ts +++ b/packages/backend/src/remote/activitypub/kernel/undo/accept.ts @@ -1,8 +1,8 @@ +import unfollow from "@/services/following/delete.js"; +import type { IAccept } from "../../type.js"; import type { CacheableRemoteUser } from "@/models/entities/user.js"; import { Followings } from "@/models/index.js"; -import unfollow from "@/services/following/delete.js"; import DbResolver from "../../db-resolver.js"; -import type { IAccept } from "../../type.js"; export default async ( actor: CacheableRemoteUser, diff --git a/packages/backend/src/remote/activitypub/kernel/undo/announce.ts b/packages/backend/src/remote/activitypub/kernel/undo/announce.ts index 121e73ceb4..a6e9c88c61 100644 --- a/packages/backend/src/remote/activitypub/kernel/undo/announce.ts +++ b/packages/backend/src/remote/activitypub/kernel/undo/announce.ts @@ -1,8 +1,8 @@ -import type { CacheableRemoteUser } from "@/models/entities/user.js"; import { Notes } from "@/models/index.js"; -import deleteNote from "@/services/note/delete.js"; +import type { CacheableRemoteUser } from "@/models/entities/user.js"; import type { IAnnounce } from "../../type.js"; import { getApId } from "../../type.js"; +import deleteNote from "@/services/note/delete.js"; export const undoAnnounce = async ( actor: CacheableRemoteUser, diff --git a/packages/backend/src/remote/activitypub/kernel/undo/block.ts b/packages/backend/src/remote/activitypub/kernel/undo/block.ts index 302edbad9e..b4e1d8ee43 100644 --- a/packages/backend/src/remote/activitypub/kernel/undo/block.ts +++ b/packages/backend/src/remote/activitypub/kernel/undo/block.ts @@ -1,8 +1,8 @@ -import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { Users } from "@/models/index.js"; -import unblock from "@/services/blocking/delete.js"; -import DbResolver from "../../db-resolver.js"; import type { IBlock } from "../../type.js"; +import unblock from "@/services/blocking/delete.js"; +import type { CacheableRemoteUser } from "@/models/entities/user.js"; +import DbResolver from "../../db-resolver.js"; +import { Users } from "@/models/index.js"; export default async ( actor: CacheableRemoteUser, diff --git a/packages/backend/src/remote/activitypub/kernel/undo/follow.ts b/packages/backend/src/remote/activitypub/kernel/undo/follow.ts index 9bc7728679..1c4648cf90 100644 --- a/packages/backend/src/remote/activitypub/kernel/undo/follow.ts +++ b/packages/backend/src/remote/activitypub/kernel/undo/follow.ts @@ -1,9 +1,9 @@ -import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { FollowRequests, Followings } from "@/models/index.js"; import unfollow from "@/services/following/delete.js"; import cancelRequest from "@/services/following/requests/cancel.js"; -import DbResolver from "../../db-resolver.js"; import type { IFollow } from "../../type.js"; +import type { CacheableRemoteUser } from "@/models/entities/user.js"; +import { FollowRequests, Followings } from "@/models/index.js"; +import DbResolver from "../../db-resolver.js"; export default async ( actor: CacheableRemoteUser, diff --git a/packages/backend/src/remote/activitypub/kernel/undo/index.ts b/packages/backend/src/remote/activitypub/kernel/undo/index.ts index b8f1db9bdc..f0e2316fab 100644 --- a/packages/backend/src/remote/activitypub/kernel/undo/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/undo/index.ts @@ -1,20 +1,20 @@ import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { apLogger } from "../../logger.js"; -import Resolver from "../../resolver.js"; import type { IUndo } from "../../type.js"; import { + isFollow, + isBlock, + isLike, + isAnnounce, getApType, isAccept, - isAnnounce, - isBlock, - isFollow, - isLike, } from "../../type.js"; +import unfollow from "./follow.js"; +import unblock from "./block.js"; +import undoLike from "./like.js"; import undoAccept from "./accept.js"; import { undoAnnounce } from "./announce.js"; -import unblock from "./block.js"; -import unfollow from "./follow.js"; -import undoLike from "./like.js"; +import Resolver from "../../resolver.js"; +import { apLogger } from "../../logger.js"; const logger = apLogger; diff --git a/packages/backend/src/remote/activitypub/kernel/undo/like.ts b/packages/backend/src/remote/activitypub/kernel/undo/like.ts index b32983beeb..90220e203d 100644 --- a/packages/backend/src/remote/activitypub/kernel/undo/like.ts +++ b/packages/backend/src/remote/activitypub/kernel/undo/like.ts @@ -1,8 +1,8 @@ import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import deleteReaction from "@/services/note/reaction/delete.js"; -import { fetchNote } from "../../models/note.js"; import type { ILike } from "../../type.js"; import { getApId } from "../../type.js"; +import deleteReaction from "@/services/note/reaction/delete.js"; +import { fetchNote } from "../../models/note.js"; /** * Process Undo.Like activity diff --git a/packages/backend/src/remote/activitypub/kernel/update/index.ts b/packages/backend/src/remote/activitypub/kernel/update/index.ts index 7c0b2f602c..558a20ce0f 100644 --- a/packages/backend/src/remote/activitypub/kernel/update/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/update/index.ts @@ -1,10 +1,10 @@ import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { apLogger } from "../../logger.js"; -import { updateNote } from "../../models/note.js"; -import { updatePerson } from "../../models/person.js"; -import Resolver from "../../resolver.js"; import type { IUpdate } from "../../type.js"; import { getApType, isActor } from "../../type.js"; +import { apLogger } from "../../logger.js"; +import { updateNote } from "../../models/note.js"; +import Resolver from "../../resolver.js"; +import { updatePerson } from "../../models/person.js"; /** * Handler for the Update activity 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 2c04fca9d1..7521d12131 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 { toHtml } from "@/mfm/to-html.js"; -import type { Note } from "@/models/entities/note.js"; import * as mfm from "mfm-js"; +import type { Note } from "@/models/entities/note.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 80669fead8..f18958f70d 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 { fromHtml } from "@/mfm/from-html.js"; -import { extractApHashtagObjects } from "../models/tag.js"; import type { IObject } from "../type.js"; +import { extractApHashtagObjects } from "../models/tag.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/misc/ld-signature.ts b/packages/backend/src/remote/activitypub/misc/ld-signature.ts index f2ebfec175..62707624be 100644 --- a/packages/backend/src/remote/activitypub/misc/ld-signature.ts +++ b/packages/backend/src/remote/activitypub/misc/ld-signature.ts @@ -1,8 +1,8 @@ import * as crypto from "node:crypto"; -import { httpAgent, httpsAgent } from "@/misc/fetch.js"; import jsonld from "jsonld"; -import fetch from "node-fetch"; import { CONTEXTS } from "./contexts.js"; +import fetch from "node-fetch"; +import { httpAgent, httpsAgent } from "@/misc/fetch.js"; // RsaSignature2017 based from https://github.com/transmute-industries/RsaSignature2017 diff --git a/packages/backend/src/remote/activitypub/models/image.ts b/packages/backend/src/remote/activitypub/models/image.ts index 36eeda36c5..2cf0c6c152 100644 --- a/packages/backend/src/remote/activitypub/models/image.ts +++ b/packages/backend/src/remote/activitypub/models/image.ts @@ -1,12 +1,12 @@ -import { fetchMeta } from "@/misc/fetch-meta.js"; -import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; -import { truncate } from "@/misc/truncate.js"; -import type { DriveFile } from "@/models/entities/drive-file.js"; -import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { DriveFiles } from "@/models/index.js"; import { uploadFromUrl } from "@/services/drive/upload-from-url.js"; -import { apLogger } from "../logger.js"; +import type { CacheableRemoteUser } 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 } from "@/models/index.js"; +import { truncate } from "@/misc/truncate.js"; +import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; const logger = apLogger; diff --git a/packages/backend/src/remote/activitypub/models/mention.ts b/packages/backend/src/remote/activitypub/models/mention.ts index 4f7ff66903..e9f80bc43f 100644 --- a/packages/backend/src/remote/activitypub/models/mention.ts +++ b/packages/backend/src/remote/activitypub/models/mention.ts @@ -1,9 +1,9 @@ -import type { CacheableUser } from "@/models/entities/user.js"; -import { toArray, unique } from "@/prelude/array.js"; import promiseLimit from "promise-limit"; -import Resolver from "../resolver.js"; -import type { IApMention, IObject } from "../type.js"; +import { toArray, unique } from "@/prelude/array.js"; +import type { CacheableUser } from "@/models/entities/user.js"; +import type { IObject, IApMention } from "../type.js"; import { isMention } from "../type.js"; +import Resolver from "../resolver.js"; import { resolvePerson } from "./person.js"; export async function extractApMentions( diff --git a/packages/backend/src/remote/activitypub/models/note.ts b/packages/backend/src/remote/activitypub/models/note.ts index c70d1acfb7..d9eedb3058 100644 --- a/packages/backend/src/remote/activitypub/models/note.ts +++ b/packages/backend/src/remote/activitypub/models/note.ts @@ -1,55 +1,55 @@ +import promiseLimit from "promise-limit"; +import * as mfm from "mfm-js"; import config from "@/config/index.js"; -import { getApLock } from "@/misc/app-lock.js"; -import { extractDbHost, toPuny } from "@/misc/convert-host.js"; -import { type Size, getEmojiSize } from "@/misc/emoji-meta.js"; -import { extractHashtags } from "@/misc/extract-hashtags.js"; -import { StatusError } from "@/misc/fetch.js"; -import { genId } from "@/misc/gen-id.js"; -import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; -import { langmap } from "@/misc/langmap.js"; -import { shouldBlockInstance } from "@/misc/should-block-instance.js"; -import { truncate } from "@/misc/truncate.js"; -import { DriveFile } from "@/models/entities/drive-file.js"; -import type { Emoji } from "@/models/entities/emoji.js"; -import type { IMentionedRemoteUsers, Note } from "@/models/entities/note.js"; -import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { - DriveFiles, - Emojis, - MessagingMessages, - NoteEdits, - Notes, - Polls, -} from "@/models/index.js"; -import { UserProfiles } from "@/models/index.js"; -import { toArray, toSingle, unique } from "@/prelude/array.js"; -import { createMessage } from "@/services/messages/create.js"; +import Resolver from "../resolver.js"; import post from "@/services/note/create.js"; import { extractMentionedUsers } from "@/services/note/create.js"; -import vote from "@/services/note/polls/vote.js"; -import { publishNoteStream } from "@/services/stream.js"; -import * as mfm from "mfm-js"; -import promiseLimit from "promise-limit"; -import { In } from "typeorm"; -import { parseAudience } from "../audience.js"; -import DbResolver from "../db-resolver.js"; -import { apLogger } from "../logger.js"; +import { resolvePerson } from "./person.js"; +import { resolveImage } from "./image.js"; +import type { CacheableRemoteUser } from "@/models/entities/user.js"; import { htmlToMfm } from "../misc/html-to-mfm.js"; -import Resolver from "../resolver.js"; +import { extractApHashtags } from "./tag.js"; +import { unique, toArray, toSingle } from "@/prelude/array.js"; +import { extractPollFromQuestion } from "./question.js"; +import vote from "@/services/note/polls/vote.js"; +import { apLogger } from "../logger.js"; +import { DriveFile } from "@/models/entities/drive-file.js"; +import { extractDbHost, toPuny } from "@/misc/convert-host.js"; +import { + Emojis, + Polls, + MessagingMessages, + Notes, + NoteEdits, + DriveFiles, +} from "@/models/index.js"; +import type { IMentionedRemoteUsers, Note } from "@/models/entities/note.js"; import type { IObject, IPost } from "../type.js"; import { - getApId, - getApType, - getOneApHrefNullable, getOneApId, - isEmoji, + getApId, + getOneApHrefNullable, validPost, + isEmoji, + getApType, } from "../type.js"; -import { resolveImage } from "./image.js"; +import type { Emoji } from "@/models/entities/emoji.js"; +import { genId } from "@/misc/gen-id.js"; +import { getApLock } from "@/misc/app-lock.js"; +import { createMessage } from "@/services/messages/create.js"; +import { parseAudience } from "../audience.js"; import { extractApMentions } from "./mention.js"; -import { resolvePerson } from "./person.js"; -import { extractPollFromQuestion } from "./question.js"; -import { extractApHashtags } from "./tag.js"; +import DbResolver from "../db-resolver.js"; +import { StatusError } from "@/misc/fetch.js"; +import { shouldBlockInstance } from "@/misc/should-block-instance.js"; +import { publishNoteStream } from "@/services/stream.js"; +import { extractHashtags } from "@/misc/extract-hashtags.js"; +import { UserProfiles } from "@/models/index.js"; +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 { 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 4ae2f815fd..25a84f3f24 100644 --- a/packages/backend/src/remote/activitypub/models/person.ts +++ b/packages/backend/src/remote/activitypub/models/person.ts @@ -2,51 +2,51 @@ import { URL } from "node:url"; import promiseLimit from "promise-limit"; import config from "@/config/index.js"; -import { db } from "@/db/postgre.js"; -import { fromHtml } from "@/mfm/from-html.js"; -import { toPuny } from "@/misc/convert-host.js"; -import { StatusError } from "@/misc/fetch.js"; -import { genId } from "@/misc/gen-id.js"; -import { isDuplicateKeyValueError } from "@/misc/is-duplicate-key-value-error.js"; -import { normalizeForSearch } from "@/misc/normalize-for-search.js"; -import { truncate } from "@/misc/truncate.js"; -import type { Emoji } from "@/models/entities/emoji.js"; +import { registerOrFetchInstanceDoc } from "@/services/register-or-fetch-instance-doc.js"; import type { Note } from "@/models/entities/note.js"; -import { UserNotePining } from "@/models/entities/user-note-pining.js"; -import { UserProfile } from "@/models/entities/user-profile.js"; -import { UserPublickey } from "@/models/entities/user-publickey.js"; -import type { CacheableUser, IRemoteUser } from "@/models/entities/user.js"; -import { User } from "@/models/entities/user.js"; +import { updateUsertags } from "@/services/update-hashtag.js"; import { - Followings, + Users, Instances, + Followings, UserProfiles, UserPublickeys, - Users, } from "@/models/index.js"; -import { toArray } from "@/prelude/array.js"; +import type { IRemoteUser, CacheableUser } from "@/models/entities/user.js"; +import { User } from "@/models/entities/user.js"; +import type { Emoji } from "@/models/entities/emoji.js"; +import { UserNotePining } from "@/models/entities/user-note-pining.js"; +import { genId } from "@/misc/gen-id.js"; import { instanceChart, usersChart } from "@/services/chart/index.js"; +import { UserPublickey } from "@/models/entities/user-publickey.js"; +import { isDuplicateKeyValueError } from "@/misc/is-duplicate-key-value-error.js"; +import { toPuny } from "@/misc/convert-host.js"; +import { UserProfile } from "@/models/entities/user-profile.js"; +import { toArray } from "@/prelude/array.js"; import { fetchInstanceMetadata } from "@/services/fetch-instance-metadata.js"; -import { registerOrFetchInstanceDoc } from "@/services/register-or-fetch-instance-doc.js"; -import { publishInternalEvent } from "@/services/stream.js"; -import { updateUsertags } from "@/services/update-hashtag.js"; +import { normalizeForSearch } from "@/misc/normalize-for-search.js"; +import { truncate } from "@/misc/truncate.js"; +import { StatusError } from "@/misc/fetch.js"; import { uriPersonCache } from "@/services/user-cache.js"; +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 Resolver from "../resolver.js"; +import { fromHtml } from "@/mfm/from-html.js"; import type { IActor, IObject } from "../type.js"; import { - getApId, - getApType, - getOneApHrefNullable, - isActor, - isCollection, isCollectionOrOrderedCollection, + isCollection, + getApId, + getOneApHrefNullable, isPropertyValue, + getApType, + isActor, } from "../type.js"; -import { resolveImage } from "./image.js"; -import { extractEmojis, resolveNote } from "./note.js"; +import Resolver from "../resolver.js"; import { extractApHashtags } from "./tag.js"; +import { resolveNote, extractEmojis } from "./note.js"; +import { resolveImage } from "./image.js"; const logger = apLogger; @@ -475,10 +475,10 @@ export async function updatePerson( if (typeof person.followers === "string") { try { - const data = await fetch(person.followers, { + let data = await fetch(person.followers, { headers: { Accept: "application/json" }, }); - const json_data = JSON.parse(await data.text()); + let json_data = JSON.parse(await data.text()); followersCount = json_data.totalItems; } catch { @@ -490,10 +490,10 @@ export async function updatePerson( if (typeof person.following === "string") { try { - const data = await fetch(person.following, { + let data = await fetch(person.following, { headers: { Accept: "application/json" }, }); - const json_data = JSON.parse(await data.text()); + let json_data = JSON.parse(await data.text()); followingCount = json_data.totalItems; } catch { @@ -505,10 +505,10 @@ export async function updatePerson( if (typeof person.outbox === "string") { try { - const data = await fetch(person.outbox, { + let data = await fetch(person.outbox, { headers: { Accept: "application/json" }, }); - const json_data = JSON.parse(await data.text()); + let json_data = JSON.parse(await data.text()); notesCount = json_data.totalItems; } catch (e) { diff --git a/packages/backend/src/remote/activitypub/models/question.ts b/packages/backend/src/remote/activitypub/models/question.ts index 187b58d905..f5855c3e7c 100644 --- a/packages/backend/src/remote/activitypub/models/question.ts +++ b/packages/backend/src/remote/activitypub/models/question.ts @@ -1,10 +1,10 @@ import config from "@/config/index.js"; -import type { IPoll } from "@/models/entities/poll.js"; -import { Notes, Polls } from "@/models/index.js"; -import { apLogger } from "../logger.js"; import Resolver from "../resolver.js"; import type { IObject, IQuestion } from "../type.js"; import { getApId, isQuestion } from "../type.js"; +import { apLogger } from "../logger.js"; +import { Notes, Polls } from "@/models/index.js"; +import type { IPoll } from "@/models/entities/poll.js"; export async function extractPollFromQuestion( source: string | IObject, diff --git a/packages/backend/src/remote/activitypub/models/tag.ts b/packages/backend/src/remote/activitypub/models/tag.ts index 2a8cbef38f..537cdecbd5 100644 --- a/packages/backend/src/remote/activitypub/models/tag.ts +++ b/packages/backend/src/remote/activitypub/models/tag.ts @@ -1,5 +1,5 @@ import { toArray } from "@/prelude/array.js"; -import type { IApHashtag, IObject } from "../type.js"; +import type { IObject, IApHashtag } from "../type.js"; import { isHashtag } from "../type.js"; export function extractApHashtags( diff --git a/packages/backend/src/remote/activitypub/perform.ts b/packages/backend/src/remote/activitypub/perform.ts index 9bb231b96a..0d2cdb4a5e 100644 --- a/packages/backend/src/remote/activitypub/perform.ts +++ b/packages/backend/src/remote/activitypub/perform.ts @@ -1,7 +1,7 @@ +import type { IObject } from "./type.js"; import type { CacheableRemoteUser } from "@/models/entities/user.js"; import { performActivity } from "./kernel/index.js"; import { updatePerson } from "./models/person.js"; -import type { IObject } from "./type.js"; export default async ( actor: CacheableRemoteUser, diff --git a/packages/backend/src/remote/activitypub/renderer/follow-user.ts b/packages/backend/src/remote/activitypub/renderer/follow-user.ts index e99eb28393..22ee429ff6 100644 --- a/packages/backend/src/remote/activitypub/renderer/follow-user.ts +++ b/packages/backend/src/remote/activitypub/renderer/follow-user.ts @@ -1,6 +1,6 @@ import config from "@/config/index.js"; -import type { User } from "@/models/entities/user.js"; import { Users } from "@/models/index.js"; +import type { User } from "@/models/entities/user.js"; /** * Convert (local|remote)(Follower|Followee)ID to URL diff --git a/packages/backend/src/remote/activitypub/renderer/index.ts b/packages/backend/src/remote/activitypub/renderer/index.ts index 16d36bb911..c60a1f4cdb 100644 --- a/packages/backend/src/remote/activitypub/renderer/index.ts +++ b/packages/backend/src/remote/activitypub/renderer/index.ts @@ -1,7 +1,7 @@ +import { v4 as uuid } from "uuid"; import config from "@/config/index.js"; import { getUserKeypair } from "@/misc/keypair-store.js"; import type { User } from "@/models/entities/user.js"; -import { v4 as uuid } from "uuid"; import { LdSignature } from "../misc/ld-signature.js"; import type { IActivity } from "../type.js"; diff --git a/packages/backend/src/remote/activitypub/renderer/key.ts b/packages/backend/src/remote/activitypub/renderer/key.ts index 3a1b4794b2..084bb5361a 100644 --- a/packages/backend/src/remote/activitypub/renderer/key.ts +++ b/packages/backend/src/remote/activitypub/renderer/key.ts @@ -1,7 +1,7 @@ -import { createPublicKey } from "node:crypto"; import config from "@/config/index.js"; -import type { UserKeypair } from "@/models/entities/user-keypair.js"; import type { ILocalUser } from "@/models/entities/user.js"; +import type { UserKeypair } from "@/models/entities/user-keypair.js"; +import { createPublicKey } from "node:crypto"; export default (user: ILocalUser, key: UserKeypair, postfix?: string) => ({ id: `${config.url}/users/${user.id}${postfix || "/publickey"}`, diff --git a/packages/backend/src/remote/activitypub/renderer/like.ts b/packages/backend/src/remote/activitypub/renderer/like.ts index 4190ae3275..53c66c5c92 100644 --- a/packages/backend/src/remote/activitypub/renderer/like.ts +++ b/packages/backend/src/remote/activitypub/renderer/like.ts @@ -1,10 +1,10 @@ +import { IsNull } from "typeorm"; import config from "@/config/index.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; import type { NoteReaction } from "@/models/entities/note-reaction.js"; import type { Note } from "@/models/entities/note.js"; import { Emojis } from "@/models/index.js"; -import { IsNull } from "typeorm"; import renderEmoji from "./emoji.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; export const renderLike = async (noteReaction: NoteReaction, note: Note) => { const reaction = noteReaction.reaction; diff --git a/packages/backend/src/remote/activitypub/renderer/mention.ts b/packages/backend/src/remote/activitypub/renderer/mention.ts index a598b804ee..e7f0435c16 100644 --- a/packages/backend/src/remote/activitypub/renderer/mention.ts +++ b/packages/backend/src/remote/activitypub/renderer/mention.ts @@ -1,5 +1,5 @@ import config from "@/config/index.js"; -import type { ILocalUser, User } from "@/models/entities/user.js"; +import type { User, ILocalUser } from "@/models/entities/user.js"; import { Users } from "@/models/index.js"; export default (mention: User) => ({ diff --git a/packages/backend/src/remote/activitypub/renderer/note.ts b/packages/backend/src/remote/activitypub/renderer/note.ts index a63118ad4e..b840e2d6f1 100644 --- a/packages/backend/src/remote/activitypub/renderer/note.ts +++ b/packages/backend/src/remote/activitypub/renderer/note.ts @@ -1,16 +1,16 @@ -import config from "@/config/index.js"; -import detectLanguage from "@/misc/detect-language.js"; -import type { DriveFile } from "@/models/entities/drive-file.js"; -import type { Emoji } from "@/models/entities/emoji.js"; -import type { IMentionedRemoteUsers, Note } from "@/models/entities/note.js"; -import type { Poll } from "@/models/entities/poll.js"; -import { DriveFiles, Emojis, Notes, Polls, Users } from "@/models/index.js"; -import toHtml from "@/remote/activitypub/misc/get-note-html.js"; import { In, IsNull } from "typeorm"; -import renderDocument from "./document.js"; +import config from "@/config/index.js"; +import type { Note, IMentionedRemoteUsers } from "@/models/entities/note.js"; +import type { DriveFile } from "@/models/entities/drive-file.js"; +import { DriveFiles, Notes, Users, Emojis, Polls } from "@/models/index.js"; +import type { Emoji } from "@/models/entities/emoji.js"; +import type { Poll } from "@/models/entities/poll.js"; +import toHtml from "@/remote/activitypub/misc/get-note-html.js"; +import detectLanguage from "@/misc/detect-language.js"; import renderEmoji from "./emoji.js"; -import renderHashtag from "./hashtag.js"; import renderMention from "./mention.js"; +import renderHashtag from "./hashtag.js"; +import renderDocument from "./document.js"; export default async function renderNote( note: Note, diff --git a/packages/backend/src/remote/activitypub/renderer/person.ts b/packages/backend/src/remote/activitypub/renderer/person.ts index 637693e073..db176a0dde 100644 --- a/packages/backend/src/remote/activitypub/renderer/person.ts +++ b/packages/backend/src/remote/activitypub/renderer/person.ts @@ -1,16 +1,16 @@ import { URL } from "node:url"; +import * as mfm from "mfm-js"; import config from "@/config/index.js"; -import { getUserKeypair } from "@/misc/keypair-store.js"; import type { ILocalUser } from "@/models/entities/user.js"; import { DriveFiles, UserProfiles } from "@/models/index.js"; -import * as mfm from "mfm-js"; +import { getUserKeypair } from "@/misc/keypair-store.js"; import { toHtml } from "../../../mfm/to-html.js"; -import type { IIdentifier } from "../models/identifier.js"; -import renderEmoji from "./emoji.js"; -import renderHashtag from "./hashtag.js"; import renderImage from "./image.js"; import renderKey from "./key.js"; import { getEmojis } from "./note.js"; +import renderEmoji from "./emoji.js"; +import renderHashtag from "./hashtag.js"; +import type { IIdentifier } from "../models/identifier.js"; export async function renderPerson(user: ILocalUser) { const id = `${config.url}/users/${user.id}`; diff --git a/packages/backend/src/remote/activitypub/renderer/question.ts b/packages/backend/src/remote/activitypub/renderer/question.ts index 7ca995872a..cb89aa7583 100644 --- a/packages/backend/src/remote/activitypub/renderer/question.ts +++ b/packages/backend/src/remote/activitypub/renderer/question.ts @@ -1,7 +1,7 @@ import config from "@/config/index.js"; +import type { User } from "@/models/entities/user.js"; import type { Note } from "@/models/entities/note.js"; import type { Poll } from "@/models/entities/poll.js"; -import type { User } from "@/models/entities/user.js"; export default async function renderQuestion( user: { id: User["id"] }, diff --git a/packages/backend/src/remote/activitypub/renderer/read.ts b/packages/backend/src/remote/activitypub/renderer/read.ts index cc90ecc777..212e7e8ddf 100644 --- a/packages/backend/src/remote/activitypub/renderer/read.ts +++ b/packages/backend/src/remote/activitypub/renderer/read.ts @@ -1,6 +1,6 @@ import config from "@/config/index.js"; -import type { MessagingMessage } from "@/models/entities/messaging-message.js"; import type { User } from "@/models/entities/user.js"; +import type { MessagingMessage } from "@/models/entities/messaging-message.js"; export const renderReadActivity = ( user: { id: User["id"] }, diff --git a/packages/backend/src/remote/activitypub/renderer/vote.ts b/packages/backend/src/remote/activitypub/renderer/vote.ts index 491a8ffaf0..21234a112d 100644 --- a/packages/backend/src/remote/activitypub/renderer/vote.ts +++ b/packages/backend/src/remote/activitypub/renderer/vote.ts @@ -1,8 +1,8 @@ import config from "@/config/index.js"; import type { Note } from "@/models/entities/note.js"; +import type { IRemoteUser, User } from "@/models/entities/user.js"; import type { PollVote } from "@/models/entities/poll-vote.js"; import type { Poll } from "@/models/entities/poll.js"; -import type { IRemoteUser, User } from "@/models/entities/user.js"; export default async function renderVote( user: { id: User["id"] }, diff --git a/packages/backend/src/remote/activitypub/request.ts b/packages/backend/src/remote/activitypub/request.ts index 0dce4a21c7..69c97a445d 100644 --- a/packages/backend/src/remote/activitypub/request.ts +++ b/packages/backend/src/remote/activitypub/request.ts @@ -1,9 +1,9 @@ import config from "@/config/index.js"; import { getUserKeypair } from "@/misc/keypair-store.js"; import type { User } from "@/models/entities/user.js"; -import { apLogger } from "@/remote/activitypub/logger.js"; import { getResponse } from "../../misc/fetch.js"; -import { createSignedGet, createSignedPost } from "./ap-request.js"; +import { createSignedPost, createSignedGet } from "./ap-request.js"; +import { apLogger } from "@/remote/activitypub/logger.js"; export default async (user: { id: User["id"] }, url: string, object: any) => { const body = JSON.stringify(object); diff --git a/packages/backend/src/remote/activitypub/resolver.ts b/packages/backend/src/remote/activitypub/resolver.ts index e487f5ff97..c4bee109d2 100644 --- a/packages/backend/src/remote/activitypub/resolver.ts +++ b/packages/backend/src/remote/activitypub/resolver.ts @@ -1,23 +1,23 @@ import config from "@/config/index.js"; -import { extractDbHost, isSelfHost } from "@/misc/convert-host.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; import { getJson } from "@/misc/fetch.js"; -import { shouldBlockInstance } from "@/misc/should-block-instance.js"; import type { ILocalUser } from "@/models/entities/user.js"; -import { NoteReactions, Notes, Polls, Users } from "@/models/index.js"; -import { apLogger } from "@/remote/activitypub/logger.js"; -import renderCreate from "@/remote/activitypub/renderer/create.js"; -import renderFollow from "@/remote/activitypub/renderer/follow.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import { renderLike } from "@/remote/activitypub/renderer/like.js"; +import { getInstanceActor } from "@/services/instance-actor.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; +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 { 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"; import { renderPerson } from "@/remote/activitypub/renderer/person.js"; import renderQuestion from "@/remote/activitypub/renderer/question.js"; -import { getInstanceActor } from "@/services/instance-actor.js"; -import { parseUri } from "./db-resolver.js"; -import { signedGet } from "./request.js"; -import type { ICollection, IObject, IOrderedCollection } from "./type.js"; -import { getApId, isCollectionOrOrderedCollection } from "./type.js"; +import renderCreate from "@/remote/activitypub/renderer/create.js"; +import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import renderFollow from "@/remote/activitypub/renderer/follow.js"; +import { shouldBlockInstance } from "@/misc/should-block-instance.js"; +import { apLogger } from "@/remote/activitypub/logger.js"; export default class Resolver { private history: Set; diff --git a/packages/backend/src/remote/resolve-user.ts b/packages/backend/src/remote/resolve-user.ts index 4d74418c5e..a6c1e399a5 100644 --- a/packages/backend/src/remote/resolve-user.ts +++ b/packages/backend/src/remote/resolve-user.ts @@ -1,13 +1,13 @@ import { URL } from "node:url"; -import config from "@/config/index.js"; -import { toPuny } from "@/misc/convert-host.js"; -import type { IRemoteUser, User } from "@/models/entities/user.js"; -import { Users } from "@/models/index.js"; import chalk from "chalk"; import { IsNull } from "typeorm"; +import config from "@/config/index.js"; +import type { User, IRemoteUser } from "@/models/entities/user.js"; +import { Users } from "@/models/index.js"; +import { toPuny } from "@/misc/convert-host.js"; +import webFinger from "./webfinger.js"; import { createPerson, updatePerson } from "./activitypub/models/person.js"; import { remoteLogger } from "./logger.js"; -import webFinger from "./webfinger.js"; const logger = remoteLogger.createSubLogger("resolve-user"); diff --git a/packages/backend/src/server/activitypub.ts b/packages/backend/src/server/activitypub.ts index e8f32c772a..c9c05adacd 100644 --- a/packages/backend/src/server/activitypub.ts +++ b/packages/backend/src/server/activitypub.ts @@ -1,40 +1,40 @@ import Router from "@koa/router"; -import httpSignature from "@peertube/http-signature"; import bodyParser from "koa-bodyparser"; +import httpSignature from "@peertube/http-signature"; -import config from "@/config/index.js"; +import { In, IsNull, Not } from "typeorm"; +import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import renderNote from "@/remote/activitypub/renderer/note.js"; +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 } from "@/misc/convert-host.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import { getUserKeypair } from "@/misc/keypair-store.js"; -import type { ILocalUser, User } from "@/models/entities/user.js"; import { - Emojis, - FollowRequests, - NoteReactions, Notes, Users, + Emojis, + NoteReactions, + FollowRequests, } from "@/models/index.js"; -import { inbox as processInbox } from "@/queue/index.js"; +import type { ILocalUser, User } from "@/models/entities/user.js"; +import { renderLike } from "@/remote/activitypub/renderer/like.js"; +import { getUserKeypair } from "@/misc/keypair-store.js"; import { checkFetch, getSignatureUser, verifyDigest, } from "@/remote/activitypub/check-fetch.js"; -import renderEmoji from "@/remote/activitypub/renderer/emoji.js"; -import renderFollow from "@/remote/activitypub/renderer/follow.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import renderKey from "@/remote/activitypub/renderer/key.js"; -import { renderLike } from "@/remote/activitypub/renderer/like.js"; -import renderNote from "@/remote/activitypub/renderer/note.js"; -import { renderPerson } from "@/remote/activitypub/renderer/person.js"; import { getInstanceActor } from "@/services/instance-actor.js"; -import Koa from "koa"; -import { In, IsNull, Not } from "typeorm"; +import { fetchMeta } from "@/misc/fetch-meta.js"; +import renderFollow from "@/remote/activitypub/renderer/follow.js"; import Featured from "./activitypub/featured.js"; -import Followers from "./activitypub/followers.js"; import Following from "./activitypub/following.js"; +import Followers from "./activitypub/followers.js"; import Outbox, { packActivity } from "./activitypub/outbox.js"; import { serverLogger } from "./index.js"; +import config from "@/config/index.js"; +import Koa from "koa"; // Init router const router = new Router(); diff --git a/packages/backend/src/server/activitypub/featured.ts b/packages/backend/src/server/activitypub/featured.ts index b88e0d8b87..bd4923b7cb 100644 --- a/packages/backend/src/server/activitypub/featured.ts +++ b/packages/backend/src/server/activitypub/featured.ts @@ -1,13 +1,13 @@ -import config from "@/config/index.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import { Notes, UserNotePinings, Users } from "@/models/index.js"; -import { checkFetch } from "@/remote/activitypub/check-fetch.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import renderNote from "@/remote/activitypub/renderer/note.js"; -import renderOrderedCollection from "@/remote/activitypub/renderer/ordered-collection.js"; -import type Router from "@koa/router"; import { IsNull } from "typeorm"; +import config from "@/config/index.js"; +import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import renderOrderedCollection from "@/remote/activitypub/renderer/ordered-collection.js"; +import renderNote from "@/remote/activitypub/renderer/note.js"; +import { Users, Notes, UserNotePinings } from "@/models/index.js"; +import { checkFetch } from "@/remote/activitypub/check-fetch.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; import { setResponseType } from "../activitypub.js"; +import type Router from "@koa/router"; export default async (ctx: Router.RouterContext) => { const verify = await checkFetch(ctx.req); diff --git a/packages/backend/src/server/activitypub/followers.ts b/packages/backend/src/server/activitypub/followers.ts index ff5106efe0..146ca51928 100644 --- a/packages/backend/src/server/activitypub/followers.ts +++ b/packages/backend/src/server/activitypub/followers.ts @@ -1,17 +1,17 @@ -import config from "@/config/index.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import type { Following } from "@/models/entities/following.js"; -import { Followings, UserProfiles, Users } from "@/models/index.js"; -import * as url from "@/prelude/url.js"; -import { checkFetch } from "@/remote/activitypub/check-fetch.js"; -import renderFollowUser from "@/remote/activitypub/renderer/follow-user.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import renderOrderedCollectionPage from "@/remote/activitypub/renderer/ordered-collection-page.js"; -import renderOrderedCollection from "@/remote/activitypub/renderer/ordered-collection.js"; -import type Router from "@koa/router"; import { IsNull, LessThan } from "typeorm"; -import type { FindOptionsWhere } from "typeorm"; +import config from "@/config/index.js"; +import * as url from "@/prelude/url.js"; +import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import renderOrderedCollection from "@/remote/activitypub/renderer/ordered-collection.js"; +import renderOrderedCollectionPage from "@/remote/activitypub/renderer/ordered-collection-page.js"; +import renderFollowUser from "@/remote/activitypub/renderer/follow-user.js"; +import { Users, Followings, UserProfiles } from "@/models/index.js"; +import type { Following } from "@/models/entities/following.js"; +import { checkFetch } from "@/remote/activitypub/check-fetch.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; import { setResponseType } from "../activitypub.js"; +import type { FindOptionsWhere } from "typeorm"; +import type Router from "@koa/router"; export default async (ctx: Router.RouterContext) => { const verify = await checkFetch(ctx.req); diff --git a/packages/backend/src/server/activitypub/following.ts b/packages/backend/src/server/activitypub/following.ts index 542925d696..eab513ce64 100644 --- a/packages/backend/src/server/activitypub/following.ts +++ b/packages/backend/src/server/activitypub/following.ts @@ -1,17 +1,17 @@ +import { LessThan, IsNull } from "typeorm"; import config from "@/config/index.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import type { Following } from "@/models/entities/following.js"; -import { Followings, UserProfiles, Users } from "@/models/index.js"; import * as url from "@/prelude/url.js"; -import { checkFetch } from "@/remote/activitypub/check-fetch.js"; -import renderFollowUser from "@/remote/activitypub/renderer/follow-user.js"; import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import renderOrderedCollectionPage from "@/remote/activitypub/renderer/ordered-collection-page.js"; import renderOrderedCollection from "@/remote/activitypub/renderer/ordered-collection.js"; -import type Router from "@koa/router"; -import { IsNull, LessThan } from "typeorm"; -import type { FindOptionsWhere } from "typeorm"; +import renderOrderedCollectionPage from "@/remote/activitypub/renderer/ordered-collection-page.js"; +import renderFollowUser from "@/remote/activitypub/renderer/follow-user.js"; +import { Users, Followings, UserProfiles } from "@/models/index.js"; +import type { Following } from "@/models/entities/following.js"; +import { checkFetch } from "@/remote/activitypub/check-fetch.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; import { setResponseType } from "../activitypub.js"; +import type { FindOptionsWhere } from "typeorm"; +import type Router from "@koa/router"; export default async (ctx: Router.RouterContext) => { const verify = await checkFetch(ctx.req); diff --git a/packages/backend/src/server/activitypub/outbox.ts b/packages/backend/src/server/activitypub/outbox.ts index a0262e6141..e0a380ffb6 100644 --- a/packages/backend/src/server/activitypub/outbox.ts +++ b/packages/backend/src/server/activitypub/outbox.ts @@ -1,20 +1,20 @@ +import { Brackets, IsNull } from "typeorm"; import config from "@/config/index.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import type { Note } from "@/models/entities/note.js"; -import { Notes, Users } from "@/models/index.js"; +import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import renderOrderedCollection from "@/remote/activitypub/renderer/ordered-collection.js"; +import renderOrderedCollectionPage from "@/remote/activitypub/renderer/ordered-collection-page.js"; +import renderNote from "@/remote/activitypub/renderer/note.js"; +import renderCreate from "@/remote/activitypub/renderer/create.js"; +import renderAnnounce from "@/remote/activitypub/renderer/announce.js"; import { countIf } from "@/prelude/array.js"; import * as url from "@/prelude/url.js"; +import { Users, Notes } from "@/models/index.js"; +import type { Note } from "@/models/entities/note.js"; import { checkFetch } from "@/remote/activitypub/check-fetch.js"; -import renderAnnounce from "@/remote/activitypub/renderer/announce.js"; -import renderCreate from "@/remote/activitypub/renderer/create.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import renderNote from "@/remote/activitypub/renderer/note.js"; -import renderOrderedCollectionPage from "@/remote/activitypub/renderer/ordered-collection-page.js"; -import renderOrderedCollection from "@/remote/activitypub/renderer/ordered-collection.js"; -import type Router from "@koa/router"; -import { Brackets, IsNull } from "typeorm"; -import { setResponseType } from "../activitypub.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; import { makePaginationQuery } from "../api/common/make-pagination-query.js"; +import { setResponseType } from "../activitypub.js"; +import type Router from "@koa/router"; export default async (ctx: Router.RouterContext) => { const verify = await checkFetch(ctx.req); diff --git a/packages/backend/src/server/api/2fa.ts b/packages/backend/src/server/api/2fa.ts index 2fd2148c51..7318f0f433 100644 --- a/packages/backend/src/server/api/2fa.ts +++ b/packages/backend/src/server/api/2fa.ts @@ -1,6 +1,6 @@ import * as crypto from "node:crypto"; -import config from "@/config/index.js"; import * as jsrsasign from "jsrsasign"; +import config from "@/config/index.js"; const ECC_PRELUDE = Buffer.from([0x04]); const NULL_BYTE = Buffer.from([0]); diff --git a/packages/backend/src/server/api/api-handler.ts b/packages/backend/src/server/api/api-handler.ts index 5c64e6a15b..48a33dfc6e 100644 --- a/packages/backend/src/server/api/api-handler.ts +++ b/packages/backend/src/server/api/api-handler.ts @@ -1,11 +1,11 @@ import type Koa from "koa"; -import { fetchMeta } from "@/misc/fetch-meta.js"; import type { User } from "@/models/entities/user.js"; import { UserIps } from "@/models/index.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; +import type { IEndpoint } from "./endpoints.js"; import authenticate, { AuthenticationError } from "./authenticate.js"; import call from "./call.js"; -import type { IEndpoint } from "./endpoints.js"; import { ApiError } from "./error.js"; const userIpHistories = new Map>(); diff --git a/packages/backend/src/server/api/authenticate.ts b/packages/backend/src/server/api/authenticate.ts index 4267755c4b..460a0ce84b 100644 --- a/packages/backend/src/server/api/authenticate.ts +++ b/packages/backend/src/server/api/authenticate.ts @@ -1,13 +1,13 @@ -import { Cache } from "@/misc/cache.js"; -import type { AccessToken } from "@/models/entities/access-token.js"; -import type { App } from "@/models/entities/app.js"; +import isNativeToken from "./common/is-native-token.js"; import type { CacheableLocalUser, ILocalUser } from "@/models/entities/user.js"; -import { AccessTokens, Apps, Users } from "@/models/index.js"; +import { Users, AccessTokens, Apps } from "@/models/index.js"; +import type { AccessToken } from "@/models/entities/access-token.js"; +import { Cache } from "@/misc/cache.js"; +import type { App } from "@/models/entities/app.js"; import { localUserByIdCache, localUserByNativeTokenCache, } from "@/services/user-cache.js"; -import isNativeToken from "./common/is-native-token.js"; const appCache = new Cache("app", 60 * 30); diff --git a/packages/backend/src/server/api/call.ts b/packages/backend/src/server/api/call.ts index 5048e70af0..2132edd0f5 100644 --- a/packages/backend/src/server/api/call.ts +++ b/packages/backend/src/server/api/call.ts @@ -1,15 +1,15 @@ -import { fetchMeta } from "@/misc/fetch-meta.js"; -import { getIpHash } from "@/misc/get-ip-hash.js"; -import type { AccessToken } from "@/models/entities/access-token.js"; -import type { CacheableLocalUser } from "@/models/entities/user.js"; -import type Koa from "koa"; import { performance } from "perf_hooks"; -import compatibility from "./compatibility.js"; +import type Koa from "koa"; +import type { CacheableLocalUser } 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"; import type { IEndpointMeta } from "./endpoints.js"; import endpoints from "./endpoints.js"; +import compatibility from "./compatibility.js"; import { ApiError } from "./error.js"; -import { limiter } from "./limiter.js"; import { apiLogger } from "./logger.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; const accessDenied = { message: "Access denied.", diff --git a/packages/backend/src/server/api/common/generate-muted-user-query.ts b/packages/backend/src/server/api/common/generate-muted-user-query.ts index 78db2078b4..3538fbf0af 100644 --- a/packages/backend/src/server/api/common/generate-muted-user-query.ts +++ b/packages/backend/src/server/api/common/generate-muted-user-query.ts @@ -1,7 +1,7 @@ -import type { User } from "@/models/entities/user.js"; -import { Mutings, UserProfiles } from "@/models/index.js"; import type { SelectQueryBuilder } from "typeorm"; import { Brackets } from "typeorm"; +import type { User } from "@/models/entities/user.js"; +import { Mutings, UserProfiles } from "@/models/index.js"; export function generateMutedUserQuery( q: SelectQueryBuilder, diff --git a/packages/backend/src/server/api/common/generated-muted-renote-query.ts b/packages/backend/src/server/api/common/generated-muted-renote-query.ts index 3e26d4fa4d..3fcd9b28e8 100644 --- a/packages/backend/src/server/api/common/generated-muted-renote-query.ts +++ b/packages/backend/src/server/api/common/generated-muted-renote-query.ts @@ -1,6 +1,6 @@ +import { Brackets, SelectQueryBuilder } from "typeorm"; import { User } from "@/models/entities/user.js"; import { RenoteMutings } from "@/models/index.js"; -import { Brackets, SelectQueryBuilder } from "typeorm"; export function generateMutedUserRenotesQueryForNotes( q: SelectQueryBuilder, diff --git a/packages/backend/src/server/api/common/getters.ts b/packages/backend/src/server/api/common/getters.ts index 9849f7835b..fd7580775a 100644 --- a/packages/backend/src/server/api/common/getters.ts +++ b/packages/backend/src/server/api/common/getters.ts @@ -1,6 +1,6 @@ import { IdentifiableError } from "@/misc/identifiable-error.js"; -import type { Note } from "@/models/entities/note.js"; import type { User } from "@/models/entities/user.js"; +import type { Note } from "@/models/entities/note.js"; import { Notes, Users } from "@/models/index.js"; import { generateVisibilityQuery } from "./generate-visibility-query.js"; diff --git a/packages/backend/src/server/api/common/inject-featured.ts b/packages/backend/src/server/api/common/inject-featured.ts index 3d5b08ad7e..30ba3eca93 100644 --- a/packages/backend/src/server/api/common/inject-featured.ts +++ b/packages/backend/src/server/api/common/inject-featured.ts @@ -1,9 +1,9 @@ +import rndstr from "rndstr"; import type { Note } from "@/models/entities/note.js"; import type { User } from "@/models/entities/user.js"; -import { NoteReactions, Notes, UserProfiles } from "@/models/index.js"; -import rndstr from "rndstr"; -import { generateBlockedUserQuery } from "./generate-block-query.js"; +import { Notes, UserProfiles, NoteReactions } from "@/models/index.js"; import { generateMutedUserQuery } from "./generate-muted-user-query.js"; +import { generateBlockedUserQuery } from "./generate-block-query.js"; // TODO: リアクション、Renote、返信などをしたノートは除外する diff --git a/packages/backend/src/server/api/common/inject-promo.ts b/packages/backend/src/server/api/common/inject-promo.ts index 774542b968..dcc4e5f3fa 100644 --- a/packages/backend/src/server/api/common/inject-promo.ts +++ b/packages/backend/src/server/api/common/inject-promo.ts @@ -1,7 +1,7 @@ +import rndstr from "rndstr"; import type { Note } from "@/models/entities/note.js"; import type { User } from "@/models/entities/user.js"; -import { Notes, PromoNotes, PromoReads, Users } from "@/models/index.js"; -import rndstr from "rndstr"; +import { PromoReads, PromoNotes, Notes, Users } from "@/models/index.js"; export async function injectPromo(timeline: Note[], user?: User | null) { if (timeline.length < 5) return; diff --git a/packages/backend/src/server/api/common/read-messaging-message.ts b/packages/backend/src/server/api/common/read-messaging-message.ts index 47391867c8..fc22c843af 100644 --- a/packages/backend/src/server/api/common/read-messaging-message.ts +++ b/packages/backend/src/server/api/common/read-messaging-message.ts @@ -1,21 +1,21 @@ -import { IdentifiableError } from "@/misc/identifiable-error.js"; -import type { MessagingMessage } from "@/models/entities/messaging-message.js"; -import type { UserGroup } from "@/models/entities/user-group.js"; -import type { IRemoteUser, User } from "@/models/entities/user.js"; -import { MessagingMessages, UserGroupJoinings, Users } from "@/models/index.js"; -import { toArray } from "@/prelude/array.js"; -import { deliver } from "@/queue/index.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import orderedCollection from "@/remote/activitypub/renderer/ordered-collection.js"; -import { renderReadActivity } from "@/remote/activitypub/renderer/read.js"; -import { pushNotification } from "@/services/push-notification.js"; import { - publishGroupMessagingStream, publishMainStream, + publishGroupMessagingStream, } from "@/services/stream.js"; import { publishMessagingStream } from "@/services/stream.js"; import { publishMessagingIndexStream } from "@/services/stream.js"; +import { pushNotification } from "@/services/push-notification.js"; +import type { User, IRemoteUser } from "@/models/entities/user.js"; +import type { MessagingMessage } from "@/models/entities/messaging-message.js"; +import { MessagingMessages, UserGroupJoinings, Users } from "@/models/index.js"; import { In } from "typeorm"; +import { IdentifiableError } from "@/misc/identifiable-error.js"; +import type { UserGroup } from "@/models/entities/user-group.js"; +import { toArray } from "@/prelude/array.js"; +import { renderReadActivity } from "@/remote/activitypub/renderer/read.js"; +import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import { deliver } from "@/queue/index.js"; +import orderedCollection from "@/remote/activitypub/renderer/ordered-collection.js"; /** * Mark messages as read diff --git a/packages/backend/src/server/api/common/read-notification.ts b/packages/backend/src/server/api/common/read-notification.ts index ab30c5bbd4..1fb1d642fe 100644 --- a/packages/backend/src/server/api/common/read-notification.ts +++ b/packages/backend/src/server/api/common/read-notification.ts @@ -1,9 +1,9 @@ -import type { Notification } from "@/models/entities/notification.js"; -import type { User } from "@/models/entities/user.js"; -import { Notifications, Users } from "@/models/index.js"; -import { pushNotification } from "@/services/push-notification.js"; -import { publishMainStream } from "@/services/stream.js"; import { In } from "typeorm"; +import { publishMainStream } from "@/services/stream.js"; +import { pushNotification } from "@/services/push-notification.js"; +import type { User } from "@/models/entities/user.js"; +import type { Notification } from "@/models/entities/notification.js"; +import { Notifications, Users } from "@/models/index.js"; export async function readNotification( userId: User["id"], diff --git a/packages/backend/src/server/api/common/signin.ts b/packages/backend/src/server/api/common/signin.ts index 478407deb2..a8a435843f 100644 --- a/packages/backend/src/server/api/common/signin.ts +++ b/packages/backend/src/server/api/common/signin.ts @@ -1,9 +1,9 @@ import type Koa from "koa"; import config from "@/config/index.js"; -import { genId } from "@/misc/gen-id.js"; import type { ILocalUser } from "@/models/entities/user.js"; import { Signins } from "@/models/index.js"; +import { genId } from "@/misc/gen-id.js"; import { publishMainStream } from "@/services/stream.js"; export default function (ctx: Koa.Context, user: ILocalUser, redirect = false) { diff --git a/packages/backend/src/server/api/common/signup.ts b/packages/backend/src/server/api/common/signup.ts index 58b06efc57..6beae2c782 100644 --- a/packages/backend/src/server/api/common/signup.ts +++ b/packages/backend/src/server/api/common/signup.ts @@ -1,17 +1,17 @@ import { generateKeyPair } from "node:crypto"; -import config from "@/config/index.js"; -import { db } from "@/db/postgre.js"; -import { toPunyNullable } from "@/misc/convert-host.js"; -import { genId } from "@/misc/gen-id.js"; -import { hashPassword } from "@/misc/password.js"; -import { UsedUsername } from "@/models/entities/used-username.js"; -import { UserKeypair } from "@/models/entities/user-keypair.js"; -import { UserProfile } from "@/models/entities/user-profile.js"; -import { User } from "@/models/entities/user.js"; -import { UsedUsernames, Users } from "@/models/index.js"; -import { usersChart } from "@/services/chart/index.js"; -import { IsNull } from "typeorm"; import generateUserToken from "./generate-native-user-token.js"; +import { User } from "@/models/entities/user.js"; +import { Users, UsedUsernames } from "@/models/index.js"; +import { UserProfile } from "@/models/entities/user-profile.js"; +import { IsNull } from "typeorm"; +import { genId } from "@/misc/gen-id.js"; +import { toPunyNullable } from "@/misc/convert-host.js"; +import { UserKeypair } from "@/models/entities/user-keypair.js"; +import { usersChart } from "@/services/chart/index.js"; +import { UsedUsername } from "@/models/entities/used-username.js"; +import { db } from "@/db/postgre.js"; +import config from "@/config/index.js"; +import { hashPassword } from "@/misc/password.js"; export async function signup(opts: { username: User["username"]; diff --git a/packages/backend/src/server/api/define.ts b/packages/backend/src/server/api/define.ts index 83ba31c367..946f86a63f 100644 --- a/packages/backend/src/server/api/define.ts +++ b/packages/backend/src/server/api/define.ts @@ -1,8 +1,8 @@ import * as fs from "node:fs"; +import Ajv from "ajv"; +import type { CacheableLocalUser } from "@/models/entities/user.js"; import type { Schema, SchemaType } from "@/misc/schema.js"; import type { AccessToken } from "@/models/entities/access-token.js"; -import type { CacheableLocalUser } from "@/models/entities/user.js"; -import Ajv from "ajv"; import type { IEndpointMeta } from "./endpoints.js"; import { ApiError } from "./error.js"; diff --git a/packages/backend/src/server/api/endpoints.ts b/packages/backend/src/server/api/endpoints.ts index f79ad01ff2..8cc4fb2d77 100644 --- a/packages/backend/src/server/api/endpoints.ts +++ b/packages/backend/src/server/api/endpoints.ts @@ -1,5 +1,6 @@ import type { Schema } from "@/misc/schema.js"; +import * as ep___admin_meta from "./endpoints/admin/meta.js"; import * as ep___admin_abuseUserReports from "./endpoints/admin/abuse-user-reports.js"; import * as ep___admin_accounts_create from "./endpoints/admin/accounts/create.js"; import * as ep___admin_accounts_delete from "./endpoints/admin/accounts/delete.js"; @@ -12,11 +13,7 @@ import * as ep___admin_announcements_create from "./endpoints/admin/announcement import * as ep___admin_announcements_delete from "./endpoints/admin/announcements/delete.js"; import * as ep___admin_announcements_list from "./endpoints/admin/announcements/list.js"; import * as ep___admin_announcements_update from "./endpoints/admin/announcements/update.js"; -import * as ep___admin_delete2fa from "./endpoints/admin/delete-2fa.js"; -import * as ep___admin_deleteAccount from "./endpoints/admin/delete-account.js"; import * as ep___admin_deleteAllFilesOfAUser from "./endpoints/admin/delete-all-files-of-a-user.js"; -import * as ep___admin_deletePasskeys from "./endpoints/admin/delete-passkeys.js"; -import * as ep___admin_driveCapOverride from "./endpoints/admin/drive-capacity-override.js"; import * as ep___admin_drive_cleanRemoteFiles from "./endpoints/admin/drive/clean-remote-files.js"; import * as ep___admin_drive_cleanup from "./endpoints/admin/drive/cleanup.js"; import * as ep___admin_drive_files from "./endpoints/admin/drive/files.js"; @@ -42,7 +39,6 @@ import * as ep___admin_getIndexStats from "./endpoints/admin/get-index-stats.js" import * as ep___admin_getTableStats from "./endpoints/admin/get-table-stats.js"; import * as ep___admin_getUserIps from "./endpoints/admin/get-user-ips.js"; import * as ep___admin_invite from "./endpoints/admin/invite.js"; -import * as ep___admin_meta from "./endpoints/admin/meta.js"; import * as ep___admin_moderators_add from "./endpoints/admin/moderators/add.js"; import * as ep___admin_moderators_remove from "./endpoints/admin/moderators/remove.js"; import * as ep___admin_promo_create from "./endpoints/admin/promo/create.js"; @@ -67,8 +63,11 @@ import * as ep___admin_suspendUser from "./endpoints/admin/suspend-user.js"; import * as ep___admin_unsilenceUser from "./endpoints/admin/unsilence-user.js"; import * as ep___admin_unsuspendUser from "./endpoints/admin/unsuspend-user.js"; import * as ep___admin_updateMeta from "./endpoints/admin/update-meta.js"; -import * as ep___admin_updateUserNote from "./endpoints/admin/update-user-note.js"; import * as ep___admin_vacuum from "./endpoints/admin/vacuum.js"; +import * as ep___admin_deleteAccount from "./endpoints/admin/delete-account.js"; +import * as ep___admin_delete2fa from "./endpoints/admin/delete-2fa.js"; +import * as ep___admin_deletePasskeys from "./endpoints/admin/delete-passkeys.js"; +import * as ep___admin_updateUserNote from "./endpoints/admin/update-user-note.js"; import * as ep___announcements from "./endpoints/announcements.js"; import * as ep___antennas_create from "./endpoints/antennas/create.js"; import * as ep___antennas_delete from "./endpoints/antennas/delete.js"; @@ -111,20 +110,18 @@ import * as ep___charts_user_notes from "./endpoints/charts/user/notes.js"; import * as ep___charts_user_reactions from "./endpoints/charts/user/reactions.js"; import * as ep___charts_users from "./endpoints/charts/users.js"; import * as ep___clips_addNote from "./endpoints/clips/add-note.js"; +import * as ep___clips_removeNote from "./endpoints/clips/remove-note.js"; import * as ep___clips_create from "./endpoints/clips/create.js"; import * as ep___clips_delete from "./endpoints/clips/delete.js"; import * as ep___clips_list from "./endpoints/clips/list.js"; import * as ep___clips_notes from "./endpoints/clips/notes.js"; -import * as ep___clips_removeNote from "./endpoints/clips/remove-note.js"; import * as ep___clips_show from "./endpoints/clips/show.js"; import * as ep___clips_update from "./endpoints/clips/update.js"; -import * as ep___customMOTD from "./endpoints/custom-motd.js"; -import * as ep___customSplashIcons from "./endpoints/custom-splash-icons.js"; import * as ep___drive from "./endpoints/drive.js"; import * as ep___drive_files from "./endpoints/drive/files.js"; import * as ep___drive_files_attachedNotes from "./endpoints/drive/files/attached-notes.js"; -import * as ep___drive_files_captionImage from "./endpoints/drive/files/caption-image.js"; import * as ep___drive_files_checkExistence from "./endpoints/drive/files/check-existence.js"; +import * as ep___drive_files_captionImage from "./endpoints/drive/files/caption-image.js"; import * as ep___drive_files_create from "./endpoints/drive/files/create.js"; import * as ep___drive_files_delete from "./endpoints/drive/files/delete.js"; import * as ep___drive_files_findByHash from "./endpoints/drive/files/find-by-hash.js"; @@ -148,10 +145,9 @@ import * as ep___federation_followers from "./endpoints/federation/followers.js" import * as ep___federation_following from "./endpoints/federation/following.js"; import * as ep___federation_instances from "./endpoints/federation/instances.js"; import * as ep___federation_showInstance from "./endpoints/federation/show-instance.js"; -import * as ep___federation_stats from "./endpoints/federation/stats.js"; import * as ep___federation_updateRemoteUser from "./endpoints/federation/update-remote-user.js"; import * as ep___federation_users from "./endpoints/federation/users.js"; -import * as ep___fetchRss from "./endpoints/fetch-rss.js"; +import * as ep___federation_stats from "./endpoints/federation/stats.js"; import * as ep___following_create from "./endpoints/following/create.js"; import * as ep___following_delete from "./endpoints/following/delete.js"; import * as ep___following_invalidate from "./endpoints/following/invalidate.js"; @@ -169,7 +165,6 @@ import * as ep___gallery_posts_show from "./endpoints/gallery/posts/show.js"; import * as ep___gallery_posts_unlike from "./endpoints/gallery/posts/unlike.js"; import * as ep___gallery_posts_update from "./endpoints/gallery/posts/update.js"; import * as ep___getOnlineUsersCount from "./endpoints/get-online-users-count.js"; -import * as ep___sounds from "./endpoints/get-sounds.js"; import * as ep___hashtags_list from "./endpoints/hashtags/list.js"; import * as ep___hashtags_search from "./endpoints/hashtags/search.js"; import * as ep___hashtags_show from "./endpoints/hashtags/show.js"; @@ -181,9 +176,9 @@ import * as ep___i_2fa_keyDone from "./endpoints/i/2fa/key-done.js"; import * as ep___i_2fa_passwordLess from "./endpoints/i/2fa/password-less.js"; import * as ep___i_2fa_registerKey from "./endpoints/i/2fa/register-key.js"; import * as ep___i_2fa_register from "./endpoints/i/2fa/register.js"; +import * as ep___i_2fa_updateKey from "./endpoints/i/2fa/update-key.js"; import * as ep___i_2fa_removeKey from "./endpoints/i/2fa/remove-key.js"; import * as ep___i_2fa_unregister from "./endpoints/i/2fa/unregister.js"; -import * as ep___i_2fa_updateKey from "./endpoints/i/2fa/update-key.js"; import * as ep___i_apps from "./endpoints/i/apps.js"; import * as ep___i_authorizedApps from "./endpoints/i/authorized-apps.js"; import * as ep___i_changePassword from "./endpoints/i/change-password.js"; @@ -192,6 +187,7 @@ import * as ep___i_exportBlocking from "./endpoints/i/export-blocking.js"; import * as ep___i_exportFollowing from "./endpoints/i/export-following.js"; import * as ep___i_exportMute from "./endpoints/i/export-mute.js"; import * as ep___i_exportNotes from "./endpoints/i/export-notes.js"; +import * as ep___i_importPosts from "./endpoints/i/import-posts.js"; import * as ep___i_exportUserLists from "./endpoints/i/export-user-lists.js"; import * as ep___i_favorites from "./endpoints/i/favorites.js"; import * as ep___i_gallery_likes from "./endpoints/i/gallery/likes.js"; @@ -200,7 +196,6 @@ import * as ep___i_getWordMutedNotesCount from "./endpoints/i/get-word-muted-not import * as ep___i_importBlocking from "./endpoints/i/import-blocking.js"; import * as ep___i_importFollowing from "./endpoints/i/import-following.js"; import * as ep___i_importMuting from "./endpoints/i/import-muting.js"; -import * as ep___i_importPosts from "./endpoints/i/import-posts.js"; import * as ep___i_importUserLists from "./endpoints/i/import-user-lists.js"; import * as ep___i_notifications from "./endpoints/i/notifications.js"; import * as ep___i_pageLikes from "./endpoints/i/page-likes.js"; @@ -226,21 +221,24 @@ import * as ep___i_updateEmail from "./endpoints/i/update-email.js"; import * as ep___i_update from "./endpoints/i/update.js"; import * as ep___i_userGroupInvites from "./endpoints/i/user-group-invites.js"; import * as ep___i_webhooks_create from "./endpoints/i/webhooks/create.js"; -import * as ep___i_webhooks_delete from "./endpoints/i/webhooks/delete.js"; -import * as ep___i_webhooks_list from "./endpoints/i/webhooks/list.js"; import * as ep___i_webhooks_show from "./endpoints/i/webhooks/show.js"; +import * as ep___i_webhooks_list from "./endpoints/i/webhooks/list.js"; import * as ep___i_webhooks_update from "./endpoints/i/webhooks/update.js"; -import * as ep___latestVersion from "./endpoints/latest-version.js"; +import * as ep___i_webhooks_delete from "./endpoints/i/webhooks/delete.js"; import * as ep___messaging_history from "./endpoints/messaging/history.js"; import * as ep___messaging_messages from "./endpoints/messaging/messages.js"; import * as ep___messaging_messages_create from "./endpoints/messaging/messages/create.js"; import * as ep___messaging_messages_delete from "./endpoints/messaging/messages/delete.js"; import * as ep___messaging_messages_read from "./endpoints/messaging/messages/read.js"; import * as ep___meta from "./endpoints/meta.js"; +import * as ep___sounds from "./endpoints/get-sounds.js"; import * as ep___miauth_genToken from "./endpoints/miauth/gen-token.js"; import * as ep___mute_create from "./endpoints/mute/create.js"; import * as ep___mute_delete from "./endpoints/mute/delete.js"; import * as ep___mute_list from "./endpoints/mute/list.js"; +import * as ep___renote_mute_create from "./endpoints/renote-mute/create.js"; +import * as ep___renote_mute_delete from "./endpoints/renote-mute/delete.js"; +import * as ep___renote_mute_list from "./endpoints/renote-mute/list.js"; import * as ep___my_apps from "./endpoints/my/apps.js"; import * as ep___notes from "./endpoints/notes.js"; import * as ep___notes_children from "./endpoints/notes/children.js"; @@ -255,13 +253,13 @@ import * as ep___notes_featured from "./endpoints/notes/featured.js"; import * as ep___notes_globalTimeline from "./endpoints/notes/global-timeline.js"; import * as ep___notes_hybridTimeline from "./endpoints/notes/hybrid-timeline.js"; import * as ep___notes_localTimeline from "./endpoints/notes/local-timeline.js"; +import * as ep___notes_recommendedTimeline from "./endpoints/notes/recommended-timeline.js"; import * as ep___notes_mentions from "./endpoints/notes/mentions.js"; import * as ep___notes_polls_recommendation from "./endpoints/notes/polls/recommendation.js"; import * as ep___notes_polls_vote from "./endpoints/notes/polls/vote.js"; import * as ep___notes_reactions from "./endpoints/notes/reactions.js"; import * as ep___notes_reactions_create from "./endpoints/notes/reactions/create.js"; import * as ep___notes_reactions_delete from "./endpoints/notes/reactions/delete.js"; -import * as ep___notes_recommendedTimeline from "./endpoints/notes/recommended-timeline.js"; import * as ep___notes_renotes from "./endpoints/notes/renotes.js"; import * as ep___notes_replies from "./endpoints/notes/replies.js"; import * as ep___notes_searchByTag from "./endpoints/notes/search-by-tag.js"; @@ -287,24 +285,24 @@ import * as ep___pages_like from "./endpoints/pages/like.js"; import * as ep___pages_show from "./endpoints/pages/show.js"; import * as ep___pages_unlike from "./endpoints/pages/unlike.js"; import * as ep___pages_update from "./endpoints/pages/update.js"; -import * as ep___patrons from "./endpoints/patrons.js"; import * as ep___ping from "./endpoints/ping.js"; -import * as ep___pinnedUsers from "./endpoints/pinned-users.js"; -import * as ep___promo_read from "./endpoints/promo/read.js"; import * as ep___recommendedInstances from "./endpoints/recommended-instances.js"; +import * as ep___pinnedUsers from "./endpoints/pinned-users.js"; +import * as ep___customMOTD from "./endpoints/custom-motd.js"; +import * as ep___customSplashIcons from "./endpoints/custom-splash-icons.js"; +import * as ep___latestVersion from "./endpoints/latest-version.js"; +import * as ep___patrons from "./endpoints/patrons.js"; import * as ep___release from "./endpoints/release.js"; -import * as ep___renote_mute_create from "./endpoints/renote-mute/create.js"; -import * as ep___renote_mute_delete from "./endpoints/renote-mute/delete.js"; -import * as ep___renote_mute_list from "./endpoints/renote-mute/list.js"; +import * as ep___promo_read from "./endpoints/promo/read.js"; import * as ep___requestResetPassword from "./endpoints/request-reset-password.js"; import * as ep___resetDb from "./endpoints/reset-db.js"; import * as ep___resetPassword from "./endpoints/reset-password.js"; import * as ep___serverInfo from "./endpoints/server-info.js"; import * as ep___stats from "./endpoints/stats.js"; -import * as ep___sw_register from "./endpoints/sw/register.js"; import * as ep___sw_show_registration from "./endpoints/sw/show-registration.js"; -import * as ep___sw_unregister from "./endpoints/sw/unregister.js"; import * as ep___sw_update_registration from "./endpoints/sw/update-registration.js"; +import * as ep___sw_register from "./endpoints/sw/register.js"; +import * as ep___sw_unregister from "./endpoints/sw/unregister.js"; import * as ep___test from "./endpoints/test.js"; import * as ep___username_available from "./endpoints/username/available.js"; import * as ep___users from "./endpoints/users.js"; @@ -326,8 +324,8 @@ import * as ep___users_groups_show from "./endpoints/users/groups/show.js"; import * as ep___users_groups_transfer from "./endpoints/users/groups/transfer.js"; import * as ep___users_groups_update from "./endpoints/users/groups/update.js"; import * as ep___users_lists_create from "./endpoints/users/lists/create.js"; -import * as ep___users_lists_delete_all from "./endpoints/users/lists/delete-all.js"; import * as ep___users_lists_delete from "./endpoints/users/lists/delete.js"; +import * as ep___users_lists_delete_all from "./endpoints/users/lists/delete-all.js"; import * as ep___users_lists_list from "./endpoints/users/lists/list.js"; import * as ep___users_lists_pull from "./endpoints/users/lists/pull.js"; import * as ep___users_lists_push from "./endpoints/users/lists/push.js"; @@ -343,10 +341,12 @@ import * as ep___users_searchByUsernameAndHost from "./endpoints/users/search-by import * as ep___users_search from "./endpoints/users/search.js"; import * as ep___users_show from "./endpoints/users/show.js"; import * as ep___users_stats from "./endpoints/users/stats.js"; +import * as ep___fetchRss from "./endpoints/fetch-rss.js"; +import * as ep___admin_driveCapOverride from "./endpoints/admin/drive-capacity-override.js"; -import * as ep___i_known_as from "./endpoints/i/known-as.js"; //Firefish Move import * as ep___i_move from "./endpoints/i/move.js"; +import * as ep___i_known_as from "./endpoints/i/known-as.js"; const eps = [ ["admin/meta", ep___admin_meta], 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 c2ff716c98..78034917f0 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 "@/server/api/define.js"; import { AbuseUserReports } from "@/models/index.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import define from "@/server/api/define.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 a75c9b5f98..e5972173c9 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 "@/server/api/define.js"; import { Users } from "@/models/index.js"; import { signup } from "@/server/api/common/signup.js"; -import define from "@/server/api/define.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 b912ad6ade..4235180838 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts @@ -1,8 +1,8 @@ -import { Users } from "@/models/index.js"; -import { createDeleteAccountJob } from "@/queue/index.js"; import define from "@/server/api/define.js"; -import { publishUserEvent } from "@/services/stream.js"; +import { Users } from "@/models/index.js"; import { doPostSuspend } from "@/services/suspend-user.js"; +import { publishUserEvent } from "@/services/stream.js"; +import { createDeleteAccountJob } from "@/queue/index.js"; export const meta = { tags: ["admin"], 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 f698788645..601cd95003 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/hosted.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/hosted.ts @@ -1,8 +1,8 @@ import config from "@/config/index.js"; -import { db } from "@/db/postgre.js"; import { Meta } from "@/models/entities/meta.js"; -import define from "@/server/api/define.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; +import { db } from "@/db/postgre.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 cd23afd83b..bfe4d54461 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/create.ts @@ -1,6 +1,6 @@ -import { genId } from "@/misc/gen-id.js"; -import { Ads } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Ads } from "@/models/index.js"; +import { genId } from "@/misc/gen-id.js"; export const meta = { tags: ["admin"], 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 3ebb88041c..802eb5ef6b 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/delete.ts @@ -1,5 +1,5 @@ -import { Ads } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Ads } from "@/models/index.js"; import { ApiError } from "@/server/api/error.js"; export const meta = { 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 14c3f6ce68..1f39e73e5e 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 "@/server/api/define.js"; import { Ads } from "@/models/index.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import define from "@/server/api/define.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 d1c5bb3ba6..52f31a3ce0 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/update.ts @@ -1,5 +1,5 @@ -import { Ads } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Ads } from "@/models/index.js"; import { ApiError } from "@/server/api/error.js"; export const meta = { 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 611f7de6fc..8af778486c 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/create.ts @@ -1,6 +1,6 @@ -import { genId } from "@/misc/gen-id.js"; -import { Announcements } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Announcements } from "@/models/index.js"; +import { genId } from "@/misc/gen-id.js"; export const meta = { tags: ["admin"], 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 b847c246f3..8b2326cdaf 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts @@ -1,5 +1,5 @@ -import { Announcements } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Announcements } from "@/models/index.js"; import { ApiError } from "@/server/api/error.js"; export const meta = { 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 f1da1a3018..a13fabd602 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 { AnnouncementReads, Announcements } from "@/models/index.js"; -import { makePaginationQuery } from "@/server/api/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 32cef004ee..03af414737 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/update.ts @@ -1,5 +1,5 @@ -import { Announcements } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Announcements } from "@/models/index.js"; import { ApiError } from "@/server/api/error.js"; export const meta = { 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 38e8f0dcd1..1cf60d9c52 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 { UserProfiles, Users } from "@/models/index.js"; -import define from "@/server/api/define.js"; +import { Users, UserProfiles } from "@/models/index.js"; import { publishMainStream } from "@/services/stream.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 2decb30d54..1b6dc31a2c 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 define from "@/server/api/define.js"; import { deleteAccount } from "@/services/delete-account.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 0dd52068dd..b52f609804 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,6 +1,6 @@ -import { DriveFiles } from "@/models/index.js"; import define from "@/server/api/define.js"; import { deleteFile } from "@/services/drive/delete-file.js"; +import { DriveFiles } from "@/models/index.js"; export const meta = { tags: ["admin"], 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 773aa698bd..7a54f5d99f 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 { UserProfiles, UserSecurityKeys, Users } from "@/models/index.js"; -import define from "@/server/api/define.js"; +import { Users, UserProfiles, UserSecurityKeys } from "@/models/index.js"; import { publishMainStream } from "@/services/stream.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 2f7e2db0eb..d4bb3045c6 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,5 +1,5 @@ -import { Users } from "@/models/index.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"; export const meta = { 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 11fce08f25..84c04793e3 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,5 +1,5 @@ -import { createCleanRemoteFilesJob } from "@/queue/index.js"; import define from "@/server/api/define.js"; +import { createCleanRemoteFilesJob } from "@/queue/index.js"; export const meta = { tags: ["admin"], 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 8ba8ae29c5..e56c027ff2 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts @@ -1,7 +1,7 @@ -import { DriveFiles } from "@/models/index.js"; +import { IsNull } from "typeorm"; import define from "@/server/api/define.js"; import { deleteFile } from "@/services/drive/delete-file.js"; -import { IsNull } from "typeorm"; +import { DriveFiles } from "@/models/index.js"; export const meta = { tags: ["admin"], 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 861c7bc963..e068f1dc9b 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 { makePaginationQuery } from "@/server/api/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/emoji/add-aliases-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/add-aliases-bulk.ts index 1684a42b55..02b3877b87 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,7 @@ -import { db } from "@/db/postgre.js"; -import { Emojis } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Emojis } from "@/models/index.js"; import { In } from "typeorm"; +import { db } from "@/db/postgre.js"; export const meta = { tags: ["admin"], 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 2e84cd4d5a..8d156e6f71 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/add.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/add.ts @@ -1,12 +1,12 @@ +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 "@/server/api/error.js"; +import rndstr from "rndstr"; +import { publishBroadcastStream } from "@/services/stream.js"; import { db } from "@/db/postgre.js"; import { getEmojiSize } from "@/misc/emoji-meta.js"; -import { genId } from "@/misc/gen-id.js"; -import { DriveFiles, Emojis } from "@/models/index.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; -import { insertModerationLog } from "@/services/insert-moderation-log.js"; -import { publishBroadcastStream } from "@/services/stream.js"; -import rndstr from "rndstr"; export const meta = { tags: ["admin"], 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 80ffd5cdf9..29b1d82125 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts @@ -1,12 +1,12 @@ -import { db } from "@/db/postgre.js"; -import { getEmojiSize } from "@/misc/emoji-meta.js"; -import { genId } from "@/misc/gen-id.js"; -import type { DriveFile } from "@/models/entities/drive-file.js"; -import { Emojis } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Emojis } from "@/models/index.js"; +import { genId } from "@/misc/gen-id.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"; +import { db } from "@/db/postgre.js"; +import { getEmojiSize } from "@/misc/emoji-meta.js"; export const meta = { tags: ["admin"], 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 2c78fb67c5..a5c4c8bcc5 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,8 @@ -import { db } from "@/db/postgre.js"; -import { Emojis } from "@/models/index.js"; import define from "@/server/api/define.js"; -import { insertModerationLog } from "@/services/insert-moderation-log.js"; +import { Emojis } from "@/models/index.js"; import { In } from "typeorm"; +import { insertModerationLog } from "@/services/insert-moderation-log.js"; +import { db } from "@/db/postgre.js"; export const meta = { tags: ["admin"], 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 d717918227..726f90396b 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts @@ -1,8 +1,8 @@ -import { db } from "@/db/postgre.js"; -import { Emojis } from "@/models/index.js"; import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; +import { Emojis } from "@/models/index.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; +import { ApiError } from "@/server/api/error.js"; +import { db } from "@/db/postgre.js"; export const meta = { tags: ["admin"], 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 70d17c7dd3..4b49e45dd9 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,5 +1,5 @@ -import { createImportCustomEmojisJob } from "@/queue/index.js"; import define from "@/server/api/define.js"; +import { createImportCustomEmojisJob } from "@/queue/index.js"; export const meta = { secure: true, 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 3038650590..c6246c48c7 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,8 +1,8 @@ -import { toPuny } from "@/misc/convert-host.js"; -import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; -import { Emojis } from "@/models/index.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; import define from "@/server/api/define.js"; +import { Emojis } from "@/models/index.js"; +import { toPuny } from "@/misc/convert-host.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { tags: ["admin"], 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 3dcc20434a..12de0b1817 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/list.ts @@ -1,7 +1,7 @@ -import type { Emoji } from "@/models/entities/emoji.js"; -import { Emojis } from "@/models/index.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"; //import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { 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 41d56dfbac..49d31805f0 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,7 @@ -import { db } from "@/db/postgre.js"; -import { Emojis } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Emojis } from "@/models/index.js"; import { In } from "typeorm"; +import { db } from "@/db/postgre.js"; export const meta = { tags: ["admin"], 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 d292c50666..72d7fab804 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,7 @@ -import { db } from "@/db/postgre.js"; -import { Emojis } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Emojis } from "@/models/index.js"; import { In } from "typeorm"; +import { db } from "@/db/postgre.js"; export const meta = { tags: ["admin"], 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 de78bab8e4..89e68aa4c1 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,7 @@ -import { db } from "@/db/postgre.js"; -import { Emojis } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Emojis } from "@/models/index.js"; import { In } from "typeorm"; +import { db } from "@/db/postgre.js"; export const meta = { tags: ["admin"], 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 a8ebda961e..e4500e02a2 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,7 @@ -import { db } from "@/db/postgre.js"; -import { Emojis } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Emojis } from "@/models/index.js"; import { In } from "typeorm"; +import { db } from "@/db/postgre.js"; export const meta = { tags: ["admin"], 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 2d79918beb..6fedf86204 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/update.ts @@ -1,7 +1,7 @@ -import { db } from "@/db/postgre.js"; -import { Emojis } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Emojis } from "@/models/index.js"; import { ApiError } from "@/server/api/error.js"; +import { db } from "@/db/postgre.js"; export const meta = { tags: ["admin"], 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 714cbc46f0..d1a7fb6957 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,6 +1,6 @@ -import { DriveFiles } from "@/models/index.js"; import define from "@/server/api/define.js"; import { deleteFile } from "@/services/drive/delete-file.js"; +import { DriveFiles } from "@/models/index.js"; export const meta = { tags: ["admin"], 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 9127df49af..bf71cd2503 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,6 +1,6 @@ -import { toPuny } from "@/misc/convert-host.js"; -import { Instances } from "@/models/index.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"; export const meta = { 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 ffd8ec67fd..a2ce44bd5d 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,6 +1,6 @@ -import { Followings, Users } from "@/models/index.js"; import define from "@/server/api/define.js"; import deleteFollowing from "@/services/following/delete.js"; +import { Followings, Users } from "@/models/index.js"; export const meta = { tags: ["admin"], 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 7893cb403f..653d187c2d 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,6 +1,6 @@ -import { toPuny } from "@/misc/convert-host.js"; -import { Instances } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Instances } from "@/models/index.js"; +import { toPuny } from "@/misc/convert-host.js"; export const meta = { tags: ["admin"], 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 f50697a41f..98f1f024bc 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,5 +1,5 @@ -import { db } from "@/db/postgre.js"; import define from "@/server/api/define.js"; +import { db } from "@/db/postgre.js"; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/admin/invite.ts b/packages/backend/src/server/api/endpoints/admin/invite.ts index ce543719c3..ebc523d418 100644 --- a/packages/backend/src/server/api/endpoints/admin/invite.ts +++ b/packages/backend/src/server/api/endpoints/admin/invite.ts @@ -1,7 +1,7 @@ -import { genId } from "@/misc/gen-id.js"; -import { RegistrationTickets } from "@/models/index.js"; -import define from "@/server/api/define.js"; import rndstr from "rndstr"; +import define from "@/server/api/define.js"; +import { RegistrationTickets } from "@/models/index.js"; +import { genId } from "@/misc/gen-id.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index 64fd38eeb2..6f23ef181b 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -1,6 +1,6 @@ import config from "@/config/index.js"; -import { MAX_CAPTION_TEXT_LENGTH, MAX_NOTE_TEXT_LENGTH } from "@/const.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; +import { MAX_NOTE_TEXT_LENGTH, MAX_CAPTION_TEXT_LENGTH } from "@/const.js"; import define from "@/server/api/define.js"; export const 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 a4b90cacca..c8b53088cd 100644 --- a/packages/backend/src/server/api/endpoints/admin/moderators/add.ts +++ b/packages/backend/src/server/api/endpoints/admin/moderators/add.ts @@ -1,5 +1,5 @@ -import { Users } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Users } from "@/models/index.js"; import { publishInternalEvent } from "@/services/stream.js"; export const meta = { 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 6e4dadb9da..e2af1ca374 100644 --- a/packages/backend/src/server/api/endpoints/admin/moderators/remove.ts +++ b/packages/backend/src/server/api/endpoints/admin/moderators/remove.ts @@ -1,5 +1,5 @@ -import { Users } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Users } from "@/models/index.js"; import { publishInternalEvent } from "@/services/stream.js"; export const meta = { 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 e93c66599e..55038fc89b 100644 --- a/packages/backend/src/server/api/endpoints/admin/promo/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/promo/create.ts @@ -1,7 +1,7 @@ -import { PromoNotes } from "@/models/index.js"; -import { getNote } from "@/server/api/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 = { tags: ["admin"], 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 9d83eda460..9895f34b40 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/clear.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/clear.ts @@ -1,5 +1,5 @@ -import { destroy } from "@/queue/index.js"; import define from "@/server/api/define.js"; +import { destroy } from "@/queue/index.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; export const meta = { 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 8222b067b9..ea8c505695 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,5 +1,5 @@ -import { URL } from "node:url"; import { deliverQueue } from "@/queue/queues.js"; +import { URL } from "node:url"; import define from "@/server/api/define.js"; export const meta = { 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 bfa2bb08ce..d4f44e3072 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,6 +1,6 @@ import { URL } from "node:url"; -import { inboxQueue } from "@/queue/queues.js"; import define from "@/server/api/define.js"; +import { inboxQueue } from "@/queue/queues.js"; export const meta = { tags: ["admin"], 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 c8459d807f..f51c1e6d46 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/stats.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/stats.ts @@ -1,9 +1,9 @@ import { - backgroundQueue, - dbQueue, deliverQueue, inboxQueue, + dbQueue, objectStorageQueue, + backgroundQueue, } from "@/queue/queues.js"; import define from "@/server/api/define.js"; 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 16272e4a80..ac0084860c 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 "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; import { addRelay } from "@/services/relay.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["admin"], 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 245945dd42..5fbed130e6 100644 --- a/packages/backend/src/server/api/endpoints/admin/reset-password.ts +++ b/packages/backend/src/server/api/endpoints/admin/reset-password.ts @@ -1,8 +1,8 @@ -import { hashPassword } from "@/misc/password.js"; -import { UserProfiles, Users } from "@/models/index.js"; import define from "@/server/api/define.js"; // import bcrypt from "bcryptjs"; import rndstr from "rndstr"; +import { Users, UserProfiles } from "@/models/index.js"; +import { hashPassword } from "@/misc/password.js"; export const meta = { tags: ["admin"], 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 ae2b5c952d..a94687cf40 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,9 +1,9 @@ -import { AbuseUserReports, Users } from "@/models/index.js"; -import { deliver } from "@/queue/index.js"; -import { renderFlag } from "@/remote/activitypub/renderer/flag.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.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"; +import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import { renderFlag } from "@/remote/activitypub/renderer/flag.js"; export const meta = { tags: ["admin"], 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 065fa04b85..531428849b 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,5 +1,5 @@ -import { createIndexAllNotesJob } from "@/queue/index.js"; import define from "@/server/api/define.js"; +import { createIndexAllNotesJob } from "@/queue/index.js"; export const meta = { tags: ["admin"], 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 2c532af463..5dcbaf2e8d 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,9 +1,9 @@ -import { UserProfiles, Users } from "@/models/index.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; -import { createNotification } from "@/services/create-notification.js"; -import { sendEmail } from "@/services/send-email.js"; import sanitizeHtml from "sanitize-html"; +import define from "@/server/api/define.js"; +import { Users, UserProfiles } from "@/models/index.js"; +import { ApiError } from "@/server/api/error.js"; +import { sendEmail } from "@/services/send-email.js"; +import { createNotification } from "@/services/create-notification.js"; export const meta = { tags: ["users"], 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 002d590dd8..ff46919694 100644 --- a/packages/backend/src/server/api/endpoints/admin/server-info.ts +++ b/packages/backend/src/server/api/endpoints/admin/server-info.ts @@ -1,8 +1,8 @@ import * as os from "node:os"; -import { db } from "@/db/postgre.js"; -import { redisClient } from "@/db/redis.js"; -import define from "@/server/api/define.js"; import si from "systeminformation"; +import define from "@/server/api/define.js"; +import { redisClient } from "@/db/redis.js"; +import { db } from "@/db/postgre.js"; export const meta = { requireCredential: true, 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 ed8c67617f..adceda4162 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 "@/server/api/define.js"; import { ModerationLogs } from "@/models/index.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-query.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 9997db04ae..1e6ebeda93 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-users.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-users.ts @@ -1,6 +1,6 @@ -import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; import { Users } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { tags: ["admin"], 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 758fa8034e..8d9dcac681 100644 --- a/packages/backend/src/server/api/endpoints/admin/silence-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/silence-user.ts @@ -1,5 +1,5 @@ -import { Users } from "@/models/index.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 600fe08563..c6d6f47bc6 100644 --- a/packages/backend/src/server/api/endpoints/admin/suspend-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/suspend-user.ts @@ -1,10 +1,10 @@ -import type { User } from "@/models/entities/user.js"; -import { Followings, Notifications, Users } from "@/models/index.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"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; -import { publishUserEvent } from "@/services/stream.js"; import { doPostSuspend } from "@/services/suspend-user.js"; +import { publishUserEvent } from "@/services/stream.js"; export const meta = { tags: ["admin"], 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 0e6ea19f0f..6592bf443c 100644 --- a/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts @@ -1,5 +1,5 @@ -import { Users } from "@/models/index.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 bf0a709a3f..3289fb570c 100644 --- a/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts @@ -1,5 +1,5 @@ -import { Users } from "@/models/index.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 47786bae2f..422cf49f74 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 { db } from "@/db/postgre.js"; import { Meta } from "@/models/entities/meta.js"; -import define from "@/server/api/define.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; +import { db } from "@/db/postgre.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 3a3ba35226..d5b086bb4b 100644 --- a/packages/backend/src/server/api/endpoints/admin/vacuum.ts +++ b/packages/backend/src/server/api/endpoints/admin/vacuum.ts @@ -1,6 +1,6 @@ -import { db } from "@/db/postgre.js"; import define from "@/server/api/define.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; +import { db } from "@/db/postgre.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/announcements.ts b/packages/backend/src/server/api/endpoints/announcements.ts index bc2f197b77..504eb30e23 100644 --- a/packages/backend/src/server/api/endpoints/announcements.ts +++ b/packages/backend/src/server/api/endpoints/announcements.ts @@ -1,6 +1,6 @@ -import { AnnouncementReads, Announcements } from "@/models/index.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { Announcements, AnnouncementReads } from "@/models/index.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 52ed628257..46df3aa813 100644 --- a/packages/backend/src/server/api/endpoints/antennas/create.ts +++ b/packages/backend/src/server/api/endpoints/antennas/create.ts @@ -1,6 +1,6 @@ -import { genId } from "@/misc/gen-id.js"; -import { Antennas, UserGroupJoinings, UserLists } from "@/models/index.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 "@/server/api/error.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/antennas/delete.ts b/packages/backend/src/server/api/endpoints/antennas/delete.ts index e2380f23b3..e5a372f193 100644 --- a/packages/backend/src/server/api/endpoints/antennas/delete.ts +++ b/packages/backend/src/server/api/endpoints/antennas/delete.ts @@ -1,6 +1,6 @@ -import { Antennas } from "@/models/index.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"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/antennas/list.ts b/packages/backend/src/server/api/endpoints/antennas/list.ts index 91ef9942b8..2726ecc8f7 100644 --- a/packages/backend/src/server/api/endpoints/antennas/list.ts +++ b/packages/backend/src/server/api/endpoints/antennas/list.ts @@ -1,5 +1,5 @@ -import { Antennas } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Antennas } from "@/models/index.js"; export const meta = { tags: ["antennas", "account"], diff --git a/packages/backend/src/server/api/endpoints/antennas/markread.ts b/packages/backend/src/server/api/endpoints/antennas/markread.ts index f552f3450c..bb5b5b77fe 100644 --- a/packages/backend/src/server/api/endpoints/antennas/markread.ts +++ b/packages/backend/src/server/api/endpoints/antennas/markread.ts @@ -1,5 +1,5 @@ -import { Antennas } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Antennas } from "@/models/index.js"; 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 d57534681a..1512cb9281 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 "@/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 { getTimestamp } from "@/misc/gen-id.js"; -import { Antennas, Notes } from "@/models/index.js"; -import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; -import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; -import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-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 { ApiError } from "@/server/api/error.js"; -import readNote from "@/services/note/read.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 c7f8e99cd3..3700052f5a 100644 --- a/packages/backend/src/server/api/endpoints/antennas/show.ts +++ b/packages/backend/src/server/api/endpoints/antennas/show.ts @@ -1,6 +1,6 @@ -import { Antennas } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; +import { Antennas } from "@/models/index.js"; export const meta = { tags: ["antennas", "account"], diff --git a/packages/backend/src/server/api/endpoints/antennas/update.ts b/packages/backend/src/server/api/endpoints/antennas/update.ts index a946076179..9a71a8f9ff 100644 --- a/packages/backend/src/server/api/endpoints/antennas/update.ts +++ b/packages/backend/src/server/api/endpoints/antennas/update.ts @@ -1,6 +1,6 @@ -import { Antennas, UserGroupJoinings, UserLists } from "@/models/index.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"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/ap/get.ts b/packages/backend/src/server/api/endpoints/ap/get.ts index 3d2cceb4b0..5159ce3b4a 100644 --- a/packages/backend/src/server/api/endpoints/ap/get.ts +++ b/packages/backend/src/server/api/endpoints/ap/get.ts @@ -1,6 +1,6 @@ -import { HOUR } from "@/const.js"; -import Resolver from "@/remote/activitypub/resolver.js"; import define from "@/server/api/define.js"; +import Resolver from "@/remote/activitypub/resolver.js"; +import { HOUR } from "@/const.js"; export const meta = { tags: ["federation"], diff --git a/packages/backend/src/server/api/endpoints/ap/show.ts b/packages/backend/src/server/api/endpoints/ap/show.ts index e3ffc7fa2b..50eb7e9c6c 100644 --- a/packages/backend/src/server/api/endpoints/ap/show.ts +++ b/packages/backend/src/server/api/endpoints/ap/show.ts @@ -1,20 +1,20 @@ -import { MINUTE } from "@/const.js"; -import { redisClient } from "@/db/redis.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 "@/server/api/error.js"; import { extractDbHost } from "@/misc/convert-host.js"; -import type { SchemaType } from "@/misc/schema.js"; -import { shouldBlockInstance } from "@/misc/should-block-instance.js"; +import { Users, Notes } from "@/models/index.js"; import type { Note } from "@/models/entities/note.js"; import type { CacheableLocalUser, User } from "@/models/entities/user.js"; -import { Notes, Users } from "@/models/index.js"; -import { populatePoll } from "@/models/repositories/note.js"; -import DbResolver from "@/remote/activitypub/db-resolver.js"; -import { createNote } from "@/remote/activitypub/models/note.js"; -import { createPerson } from "@/remote/activitypub/models/person.js"; +import { isActor, isPost, getApId } from "@/remote/activitypub/type.js"; +import type { SchemaType } from "@/misc/schema.js"; +import { MINUTE } from "@/const.js"; +import { shouldBlockInstance } from "@/misc/should-block-instance.js"; import { updateQuestion } from "@/remote/activitypub/models/question.js"; -import Resolver from "@/remote/activitypub/resolver.js"; -import { getApId, isActor, isPost } from "@/remote/activitypub/type.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; +import { populatePoll } from "@/models/repositories/note.js"; +import { redisClient } from "@/db/redis.js"; export const meta = { tags: ["federation"], diff --git a/packages/backend/src/server/api/endpoints/app/create.ts b/packages/backend/src/server/api/endpoints/app/create.ts index 82e0375403..e32edf1293 100644 --- a/packages/backend/src/server/api/endpoints/app/create.ts +++ b/packages/backend/src/server/api/endpoints/app/create.ts @@ -1,8 +1,8 @@ -import { genId } from "@/misc/gen-id.js"; -import { secureRndstr } from "@/misc/secure-rndstr.js"; -import { Apps } from "@/models/index.js"; -import { unique } from "@/prelude/array.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"; +import { secureRndstr } from "@/misc/secure-rndstr.js"; export const meta = { tags: ["app"], diff --git a/packages/backend/src/server/api/endpoints/app/show.ts b/packages/backend/src/server/api/endpoints/app/show.ts index 5cd17cb409..d6f38428c1 100644 --- a/packages/backend/src/server/api/endpoints/app/show.ts +++ b/packages/backend/src/server/api/endpoints/app/show.ts @@ -1,6 +1,6 @@ -import { Apps } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; +import { Apps } from "@/models/index.js"; export const meta = { tags: ["app"], diff --git a/packages/backend/src/server/api/endpoints/auth/accept.ts b/packages/backend/src/server/api/endpoints/auth/accept.ts index 40b9841aaf..088de7863b 100644 --- a/packages/backend/src/server/api/endpoints/auth/accept.ts +++ b/packages/backend/src/server/api/endpoints/auth/accept.ts @@ -1,9 +1,9 @@ import * as crypto from "node:crypto"; -import { genId } from "@/misc/gen-id.js"; -import { secureRndstr } from "@/misc/secure-rndstr.js"; -import { AccessTokens, Apps, AuthSessions } from "@/models/index.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"; export const meta = { tags: ["auth"], 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 b95256eba8..bd17211044 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/generate.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/generate.ts @@ -1,9 +1,9 @@ +import { v4 as uuid } from "uuid"; import config from "@/config/index.js"; -import { genId } from "@/misc/gen-id.js"; -import { Apps, AuthSessions } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { v4 as uuid } from "uuid"; +import { Apps, AuthSessions } from "@/models/index.js"; +import { genId } from "@/misc/gen-id.js"; export const meta = { tags: ["auth"], 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 4e511d50d6..70c6d54cd2 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/show.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/show.ts @@ -1,6 +1,6 @@ -import { AuthSessions } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; +import { AuthSessions } from "@/models/index.js"; export const meta = { tags: ["auth"], 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 ab17f78224..394681516b 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/userkey.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/userkey.ts @@ -1,6 +1,6 @@ -import { AccessTokens, Apps, AuthSessions, Users } from "@/models/index.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 = { tags: ["auth"], diff --git a/packages/backend/src/server/api/endpoints/blocking/create.ts b/packages/backend/src/server/api/endpoints/blocking/create.ts index bbf941aea4..50154dd6cc 100644 --- a/packages/backend/src/server/api/endpoints/blocking/create.ts +++ b/packages/backend/src/server/api/endpoints/blocking/create.ts @@ -1,9 +1,9 @@ -import { HOUR } from "@/const.js"; -import { Blockings, NoteWatchings, Users } from "@/models/index.js"; -import { getUser } from "@/server/api/common/getters.js"; +import create from "@/services/blocking/create.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import create from "@/services/blocking/create.js"; +import { getUser } from "@/server/api/common/getters.js"; +import { Blockings, NoteWatchings, Users } from "@/models/index.js"; +import { HOUR } from "@/const.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/blocking/delete.ts b/packages/backend/src/server/api/endpoints/blocking/delete.ts index 6f23bba2ce..addf4bbd19 100644 --- a/packages/backend/src/server/api/endpoints/blocking/delete.ts +++ b/packages/backend/src/server/api/endpoints/blocking/delete.ts @@ -1,9 +1,9 @@ -import { HOUR } from "@/const.js"; -import { Blockings, Users } from "@/models/index.js"; -import { getUser } from "@/server/api/common/getters.js"; +import deleteBlocking from "@/services/blocking/delete.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import deleteBlocking from "@/services/blocking/delete.js"; +import { getUser } from "@/server/api/common/getters.js"; +import { Blockings, Users } from "@/models/index.js"; +import { HOUR } from "@/const.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/blocking/list.ts b/packages/backend/src/server/api/endpoints/blocking/list.ts index cd04b20eac..6f51a6458d 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 "@/server/api/define.js"; import { Blockings } from "@/models/index.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import define from "@/server/api/define.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 18630846ee..177492ed29 100644 --- a/packages/backend/src/server/api/endpoints/channels/create.ts +++ b/packages/backend/src/server/api/endpoints/channels/create.ts @@ -1,8 +1,8 @@ -import { genId } from "@/misc/gen-id.js"; -import type { Channel } from "@/models/entities/channel.js"; -import { Channels, DriveFiles } from "@/models/index.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"; export const meta = { tags: ["channels"], diff --git a/packages/backend/src/server/api/endpoints/channels/featured.ts b/packages/backend/src/server/api/endpoints/channels/featured.ts index b5fb5e20da..e0575af262 100644 --- a/packages/backend/src/server/api/endpoints/channels/featured.ts +++ b/packages/backend/src/server/api/endpoints/channels/featured.ts @@ -1,5 +1,5 @@ -import { Channels } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Channels } from "@/models/index.js"; export const meta = { tags: ["channels"], diff --git a/packages/backend/src/server/api/endpoints/channels/follow.ts b/packages/backend/src/server/api/endpoints/channels/follow.ts index 4debfb0817..878339827a 100644 --- a/packages/backend/src/server/api/endpoints/channels/follow.ts +++ b/packages/backend/src/server/api/endpoints/channels/follow.ts @@ -1,7 +1,7 @@ -import { genId } from "@/misc/gen-id.js"; -import { ChannelFollowings, Channels } from "@/models/index.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"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/channels/followed.ts b/packages/backend/src/server/api/endpoints/channels/followed.ts index 524952c61e..94374f6be0 100644 --- a/packages/backend/src/server/api/endpoints/channels/followed.ts +++ b/packages/backend/src/server/api/endpoints/channels/followed.ts @@ -1,5 +1,5 @@ -import { ChannelFollowings, Channels } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Channels, ChannelFollowings } from "@/models/index.js"; export const meta = { tags: ["channels", "account"], diff --git a/packages/backend/src/server/api/endpoints/channels/owned.ts b/packages/backend/src/server/api/endpoints/channels/owned.ts index c1e969df81..23607b024c 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 "@/server/api/define.js"; import { Channels } from "@/models/index.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import define from "@/server/api/define.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 f6e0f4d271..b2fab701c5 100644 --- a/packages/backend/src/server/api/endpoints/channels/search.ts +++ b/packages/backend/src/server/api/endpoints/channels/search.ts @@ -1,8 +1,8 @@ -import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; -import { Channels } from "@/models/index.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; import define from "@/server/api/define.js"; import { Brackets } from "typeorm"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { Channels } from "@/models/index.js"; +import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { tags: ["channels"], diff --git a/packages/backend/src/server/api/endpoints/channels/show.ts b/packages/backend/src/server/api/endpoints/channels/show.ts index cf1d32adaa..c5c1b65773 100644 --- a/packages/backend/src/server/api/endpoints/channels/show.ts +++ b/packages/backend/src/server/api/endpoints/channels/show.ts @@ -1,6 +1,6 @@ -import { Channels } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; +import { Channels } from "@/models/index.js"; export const meta = { tags: ["channels"], diff --git a/packages/backend/src/server/api/endpoints/channels/timeline.ts b/packages/backend/src/server/api/endpoints/channels/timeline.ts index 93c28be22d..f061acab02 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 { Channels, Notes } from "@/models/index.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-query.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 "@/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 4a7a8f0739..3371000394 100644 --- a/packages/backend/src/server/api/endpoints/channels/unfollow.ts +++ b/packages/backend/src/server/api/endpoints/channels/unfollow.ts @@ -1,6 +1,6 @@ -import { ChannelFollowings, Channels } from "@/models/index.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"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/channels/update.ts b/packages/backend/src/server/api/endpoints/channels/update.ts index bdd29488db..0de7a837a1 100644 --- a/packages/backend/src/server/api/endpoints/channels/update.ts +++ b/packages/backend/src/server/api/endpoints/channels/update.ts @@ -1,6 +1,6 @@ -import { Channels, DriveFiles } from "@/models/index.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 = { tags: ["channels"], 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 7e705d24b7..d5c3c4eb83 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 define from "@/server/api/define.js"; import { getJsonSchema } from "@/services/chart/core.js"; import { activeUsersChart } from "@/services/chart/index.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 c4450d54d7..bbf72030a4 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 define from "@/server/api/define.js"; import { getJsonSchema } from "@/services/chart/core.js"; import { apRequestChart } from "@/services/chart/index.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 0d772fc543..0a5354743c 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 define from "@/server/api/define.js"; import { getJsonSchema } from "@/services/chart/core.js"; import { driveChart } from "@/services/chart/index.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 29ba32160e..f9c75d5ecb 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 define from "@/server/api/define.js"; import { getJsonSchema } from "@/services/chart/core.js"; import { federationChart } from "@/services/chart/index.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 28826e187f..bbd1b70b07 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 define from "@/server/api/define.js"; import { getJsonSchema } from "@/services/chart/core.js"; import { hashtagChart } from "@/services/chart/index.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 da3cc71866..4d746ec0b5 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 define from "@/server/api/define.js"; import { getJsonSchema } from "@/services/chart/core.js"; import { instanceChart } from "@/services/chart/index.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 ca8cd2a971..b2a1b93fd9 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 define from "@/server/api/define.js"; import { getJsonSchema } from "@/services/chart/core.js"; import { notesChart } from "@/services/chart/index.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 a1796f6995..c2745c860c 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 define from "@/server/api/define.js"; import { getJsonSchema } from "@/services/chart/core.js"; import { perUserDriveChart } from "@/services/chart/index.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/notes.ts b/packages/backend/src/server/api/endpoints/charts/user/notes.ts index bffd38a1e6..4a398d4dd6 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 define from "@/server/api/define.js"; import { getJsonSchema } from "@/services/chart/core.js"; import { perUserNotesChart } from "@/services/chart/index.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 a99952cdc9..fc75d40baf 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 define from "@/server/api/define.js"; import { getJsonSchema } from "@/services/chart/core.js"; import { perUserReactionsChart } from "@/services/chart/index.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 882579455c..0dc5f3580a 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 define from "@/server/api/define.js"; import { getJsonSchema } from "@/services/chart/core.js"; import { usersChart } from "@/services/chart/index.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 22d40bca5c..887c8af083 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 { genId } from "@/misc/gen-id.js"; -import { ClipNotes, Clips } from "@/models/index.js"; -import { getNote } from "@/server/api/common/getters.js"; import define from "@/server/api/define.js"; +import { ClipNotes, Clips } from "@/models/index.js"; import { ApiError } from "@/server/api/error.js"; +import { genId } from "@/misc/gen-id.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 92860944d4..df03b87b04 100644 --- a/packages/backend/src/server/api/endpoints/clips/create.ts +++ b/packages/backend/src/server/api/endpoints/clips/create.ts @@ -1,6 +1,6 @@ +import define from "@/server/api/define.js"; import { genId } from "@/misc/gen-id.js"; import { Clips } from "@/models/index.js"; -import define from "@/server/api/define.js"; export const meta = { tags: ["clips"], diff --git a/packages/backend/src/server/api/endpoints/clips/delete.ts b/packages/backend/src/server/api/endpoints/clips/delete.ts index 7455a2362f..02d95b315e 100644 --- a/packages/backend/src/server/api/endpoints/clips/delete.ts +++ b/packages/backend/src/server/api/endpoints/clips/delete.ts @@ -1,6 +1,6 @@ -import { Clips } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; +import { Clips } from "@/models/index.js"; export const meta = { tags: ["clips"], diff --git a/packages/backend/src/server/api/endpoints/clips/list.ts b/packages/backend/src/server/api/endpoints/clips/list.ts index f77b50612e..d276224366 100644 --- a/packages/backend/src/server/api/endpoints/clips/list.ts +++ b/packages/backend/src/server/api/endpoints/clips/list.ts @@ -1,5 +1,5 @@ -import { Clips } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Clips } from "@/models/index.js"; export const meta = { tags: ["clips", "account"], diff --git a/packages/backend/src/server/api/endpoints/clips/notes.ts b/packages/backend/src/server/api/endpoints/clips/notes.ts index 741c89edc6..13d8310e62 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 { ClipNotes, Clips, Notes } from "@/models/index.js"; -import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; -import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; -import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; import define from "@/server/api/define.js"; +import { ClipNotes, Clips, Notes } from "@/models/index.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 70eb23b79d..c081a87abd 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 { ClipNotes, Clips } from "@/models/index.js"; -import { getNote } from "@/server/api/common/getters.js"; import define from "@/server/api/define.js"; +import { ClipNotes, Clips } from "@/models/index.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 51ed8b81a7..8218a4fb75 100644 --- a/packages/backend/src/server/api/endpoints/clips/show.ts +++ b/packages/backend/src/server/api/endpoints/clips/show.ts @@ -1,6 +1,6 @@ -import { Clips } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; +import { Clips } from "@/models/index.js"; export const meta = { tags: ["clips", "account"], diff --git a/packages/backend/src/server/api/endpoints/clips/update.ts b/packages/backend/src/server/api/endpoints/clips/update.ts index f2666a4213..fc88548b95 100644 --- a/packages/backend/src/server/api/endpoints/clips/update.ts +++ b/packages/backend/src/server/api/endpoints/clips/update.ts @@ -1,6 +1,6 @@ -import { Clips } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; +import { Clips } from "@/models/index.js"; export const meta = { tags: ["clips"], 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 62fa842950..f6c5573af7 100644 --- a/packages/backend/src/server/api/endpoints/compatibility/custom-emojis.ts +++ b/packages/backend/src/server/api/endpoints/compatibility/custom-emojis.ts @@ -1,8 +1,8 @@ -import { FILE_TYPE_BROWSERSAFE } from "@/const.js"; -import type { Emoji } from "@/models/entities/emoji.js"; 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 "@/server/api/define.js"; -import { In, IsNull } from "typeorm"; export const meta = { requireCredential: false, diff --git a/packages/backend/src/server/api/endpoints/drive/files.ts b/packages/backend/src/server/api/endpoints/drive/files.ts index aa318fafda..d5dae8767e 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 "@/server/api/define.js"; import { DriveFiles } from "@/models/index.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import define from "@/server/api/define.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 8c15e55862..5f821fa72a 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,6 +1,6 @@ -import { DriveFiles, Notes } from "@/models/index.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 = { tags: ["drive", "notes"], 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 0711ade02c..2ce9fa4700 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,5 +1,5 @@ -import { DriveFiles } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { DriveFiles } from "@/models/index.js"; export const meta = { tags: ["drive"], 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 0e20ab6315..54ca5f8d1b 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/create.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/create.ts @@ -1,12 +1,12 @@ -import { MINUTE } from "@/const.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; +import { addFile } from "@/services/drive/add-file.js"; +import { DriveFiles } from "@/models/index.js"; import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; import { IdentifiableError } from "@/misc/identifiable-error.js"; -import { DriveFiles } from "@/models/index.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; +import { MINUTE } from "@/const.js"; import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; import { apiLogger } from "@/server/api/logger.js"; -import { addFile } from "@/services/drive/add-file.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 245c380ec6..062b69b9c5 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 { DriveFiles } from "@/models/index.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; import { deleteFile } from "@/services/drive/delete-file.js"; import { publishDriveStream } from "@/services/stream.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.ts b/packages/backend/src/server/api/endpoints/drive/files/find.ts index 80b2f6addd..5a243de89b 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/find.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/find.ts @@ -1,5 +1,5 @@ -import { DriveFiles } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { DriveFiles } from "@/models/index.js"; import { IsNull } from "typeorm"; export const meta = { 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 1a14cc53d3..bde81e007e 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 { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; +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 "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { publishDriveStream } from "@/services/stream.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 172182f1cf..cdfcb03089 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,8 +1,8 @@ -import { HOUR } from "@/const.js"; -import { DriveFiles } from "@/models/index.js"; -import define from "@/server/api/define.js"; import { uploadFromUrl } from "@/services/drive/upload-from-url.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"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/drive/folders.ts b/packages/backend/src/server/api/endpoints/drive/folders.ts index c587f80405..d02b4fac66 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 "@/server/api/define.js"; import { DriveFolders } from "@/models/index.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import define from "@/server/api/define.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 0df87debb0..554e61ec97 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/create.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/create.ts @@ -1,8 +1,8 @@ -import { genId } from "@/misc/gen-id.js"; -import { DriveFolders } from "@/models/index.js"; +import { publishDriveStream } from "@/services/stream.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { publishDriveStream } from "@/services/stream.js"; +import { DriveFolders } from "@/models/index.js"; +import { genId } from "@/misc/gen-id.js"; export const meta = { tags: ["drive"], 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 e5372bb54c..1954b43361 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/delete.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/delete.ts @@ -1,7 +1,7 @@ -import { DriveFiles, DriveFolders } from "@/models/index.js"; import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; import { publishDriveStream } from "@/services/stream.js"; +import { ApiError } from "@/server/api/error.js"; +import { DriveFolders, DriveFiles } from "@/models/index.js"; export const meta = { tags: ["drive"], 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 46f741d9f8..d29015e785 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/find.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/find.ts @@ -1,5 +1,5 @@ -import { DriveFolders } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { DriveFolders } from "@/models/index.js"; import { IsNull } from "typeorm"; export const meta = { 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 2968e61d06..611724ae44 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/show.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/show.ts @@ -1,6 +1,6 @@ -import { DriveFolders } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; +import { DriveFolders } from "@/models/index.js"; export const meta = { tags: ["drive"], 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 04b37c595a..5bd880da84 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/update.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/update.ts @@ -1,7 +1,7 @@ -import { DriveFolders } from "@/models/index.js"; +import { publishDriveStream } from "@/services/stream.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { publishDriveStream } from "@/services/stream.js"; +import { DriveFolders } from "@/models/index.js"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/drive/stream.ts b/packages/backend/src/server/api/endpoints/drive/stream.ts index 1c92e30c7b..cbd7860175 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 "@/server/api/define.js"; import { DriveFiles } from "@/models/index.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import define from "@/server/api/define.js"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/emoji.ts b/packages/backend/src/server/api/endpoints/emoji.ts index 384c38452f..2675ba7bdc 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 "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { IsNull } from "typeorm"; export const meta = { tags: ["meta"], 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 d1e1d9dc49..ca013314e1 100644 --- a/packages/backend/src/server/api/endpoints/export-custom-emojis.ts +++ b/packages/backend/src/server/api/endpoints/export-custom-emojis.ts @@ -1,6 +1,6 @@ -import { HOUR } from "@/const.js"; import { createExportCustomEmojisJob } from "@/queue/index.js"; import define from "@/server/api/define.js"; +import { HOUR } from "@/const.js"; export const meta = { secure: true, diff --git a/packages/backend/src/server/api/endpoints/federation/followers.ts b/packages/backend/src/server/api/endpoints/federation/followers.ts index e7117349ea..2a88d27ae5 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 "@/server/api/define.js"; import { Followings } from "@/models/index.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import define from "@/server/api/define.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 3d177b925c..c13ee8b199 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 "@/server/api/define.js"; import { Followings } from "@/models/index.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import define from "@/server/api/define.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 6f9b6c9bdd..27a6dabb49 100644 --- a/packages/backend/src/server/api/endpoints/federation/instances.ts +++ b/packages/backend/src/server/api/endpoints/federation/instances.ts @@ -1,7 +1,7 @@ +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"; -import { Instances } from "@/models/index.js"; -import define from "@/server/api/define.js"; export const meta = { tags: ["federation"], 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 7d90a4f5af..c4a6304d05 100644 --- a/packages/backend/src/server/api/endpoints/federation/show-instance.ts +++ b/packages/backend/src/server/api/endpoints/federation/show-instance.ts @@ -1,6 +1,6 @@ -import { toPuny } from "@/misc/convert-host.js"; -import { Instances } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Instances } from "@/models/index.js"; +import { toPuny } from "@/misc/convert-host.js"; export const meta = { tags: ["federation"], diff --git a/packages/backend/src/server/api/endpoints/federation/stats.ts b/packages/backend/src/server/api/endpoints/federation/stats.ts index 9d9b86b424..6702eeff5f 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 "@/server/api/define.js"; -import { IsNull, MoreThan, Not } from "typeorm"; 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 cecd1109bb..e8ada9e622 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,6 +1,6 @@ -import { updatePerson } from "@/remote/activitypub/models/person.js"; -import { getRemoteUser } from "@/server/api/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 = { tags: ["federation"], diff --git a/packages/backend/src/server/api/endpoints/federation/users.ts b/packages/backend/src/server/api/endpoints/federation/users.ts index 7960f4dd34..4e925a29e2 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 "@/server/api/define.js"; import { Users } from "@/models/index.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import define from "@/server/api/define.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 0e7f9a378e..bda3c455d1 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 config from "@/config/index.js"; -import { getResponse } from "@/misc/fetch.js"; -import define from "@/server/api/define.js"; import Parser from "rss-parser"; +import { getResponse } from "@/misc/fetch.js"; +import config from "@/config/index.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 764331068d..f6e341ad73 100644 --- a/packages/backend/src/server/api/endpoints/following/create.ts +++ b/packages/backend/src/server/api/endpoints/following/create.ts @@ -1,10 +1,10 @@ -import { HOUR } from "@/const.js"; -import { IdentifiableError } from "@/misc/identifiable-error.js"; -import { Followings, Users } from "@/models/index.js"; -import { getUser } from "@/server/api/common/getters.js"; +import create from "@/services/following/create.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import create from "@/services/following/create.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"; export const meta = { tags: ["following", "users"], diff --git a/packages/backend/src/server/api/endpoints/following/delete.ts b/packages/backend/src/server/api/endpoints/following/delete.ts index d382f1a90f..3ef031eb20 100644 --- a/packages/backend/src/server/api/endpoints/following/delete.ts +++ b/packages/backend/src/server/api/endpoints/following/delete.ts @@ -1,9 +1,9 @@ -import { HOUR } from "@/const.js"; -import { Followings, Users } from "@/models/index.js"; -import { getUser } from "@/server/api/common/getters.js"; +import deleteFollowing from "@/services/following/delete.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import deleteFollowing from "@/services/following/delete.js"; +import { getUser } from "@/server/api/common/getters.js"; +import { Followings, Users } from "@/models/index.js"; +import { HOUR } from "@/const.js"; export const meta = { tags: ["following", "users"], diff --git a/packages/backend/src/server/api/endpoints/following/invalidate.ts b/packages/backend/src/server/api/endpoints/following/invalidate.ts index 63d55e8bdb..7559062c0f 100644 --- a/packages/backend/src/server/api/endpoints/following/invalidate.ts +++ b/packages/backend/src/server/api/endpoints/following/invalidate.ts @@ -1,9 +1,9 @@ -import { HOUR } from "@/const.js"; -import { Followings, Users } from "@/models/index.js"; -import { getUser } from "@/server/api/common/getters.js"; +import deleteFollowing from "@/services/following/delete.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import deleteFollowing from "@/services/following/delete.js"; +import { getUser } from "@/server/api/common/getters.js"; +import { Followings, Users } from "@/models/index.js"; +import { HOUR } from "@/const.js"; export const meta = { tags: ["following", "users"], 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 1296384d3e..cb6b010726 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 { getUser } from "@/server/api/common/getters.js"; +import acceptFollowRequest from "@/services/following/requests/accept.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import acceptFollowRequest from "@/services/following/requests/accept.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 b3e469483a..7acb0f948b 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/cancel.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/cancel.ts @@ -1,9 +1,9 @@ -import { IdentifiableError } from "@/misc/identifiable-error.js"; -import { Users } from "@/models/index.js"; -import { getUser } from "@/server/api/common/getters.js"; +import cancelFollowRequest from "@/services/following/requests/cancel.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import cancelFollowRequest from "@/services/following/requests/cancel.js"; +import { getUser } from "@/server/api/common/getters.js"; +import { Users } from "@/models/index.js"; +import { IdentifiableError } from "@/misc/identifiable-error.js"; export const meta = { tags: ["following", "account"], 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 c6021cafdc..97f52d4ac2 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/list.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/list.ts @@ -1,5 +1,5 @@ -import { FollowRequests } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { FollowRequests } from "@/models/index.js"; export const meta = { tags: ["following", "account"], 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 f374c93270..37e7bc0abc 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 { getUser } from "@/server/api/common/getters.js"; +import { rejectFollowRequest } from "@/services/following/reject.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { rejectFollowRequest } from "@/services/following/reject.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 6fb706498e..e20e4ab20b 100644 --- a/packages/backend/src/server/api/endpoints/gallery/featured.ts +++ b/packages/backend/src/server/api/endpoints/gallery/featured.ts @@ -1,5 +1,5 @@ -import { GalleryPosts } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { GalleryPosts } from "@/models/index.js"; export const meta = { tags: ["gallery"], diff --git a/packages/backend/src/server/api/endpoints/gallery/popular.ts b/packages/backend/src/server/api/endpoints/gallery/popular.ts index 69333e8de8..805307e459 100644 --- a/packages/backend/src/server/api/endpoints/gallery/popular.ts +++ b/packages/backend/src/server/api/endpoints/gallery/popular.ts @@ -1,5 +1,5 @@ -import { GalleryPosts } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { GalleryPosts } from "@/models/index.js"; export const meta = { tags: ["gallery"], diff --git a/packages/backend/src/server/api/endpoints/gallery/posts.ts b/packages/backend/src/server/api/endpoints/gallery/posts.ts index 69f9929d59..0dd02b930d 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts.ts @@ -1,6 +1,6 @@ -import { GalleryPosts } from "@/models/index.js"; -import { makePaginationQuery } from "@/server/api/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 = { tags: ["gallery"], 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 dad880cf86..a74f2165c2 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/create.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/create.ts @@ -1,9 +1,9 @@ -import { HOUR } from "@/const.js"; -import type { DriveFile } from "@/models/entities/drive-file.js"; -import { GalleryPost } from "@/models/entities/gallery-post.js"; +import define from "@/server/api/define.js"; import { DriveFiles, GalleryPosts } from "@/models/index.js"; import { genId } from "@/server/api/../../misc/gen-id.js"; -import define from "@/server/api/define.js"; +import { GalleryPost } from "@/models/entities/gallery-post.js"; +import type { DriveFile } from "@/models/entities/drive-file.js"; +import { HOUR } from "@/const.js"; export const meta = { tags: ["gallery"], 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 8969082872..360ca8c5ad 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts @@ -1,6 +1,6 @@ -import { GalleryPosts } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; +import { GalleryPosts } from "@/models/index.js"; export const meta = { tags: ["gallery"], 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 d3d0add75f..f5ccc5bc68 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/like.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/like.ts @@ -1,7 +1,7 @@ -import { genId } from "@/misc/gen-id.js"; -import { GalleryLikes, GalleryPosts } from "@/models/index.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"; export const meta = { tags: ["gallery"], 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 00c0bdd549..7e172da45e 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/show.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/show.ts @@ -1,6 +1,6 @@ -import { GalleryPosts } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; +import { GalleryPosts } from "@/models/index.js"; export const meta = { tags: ["gallery"], 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 bfc4432ee0..f37456a626 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts @@ -1,6 +1,6 @@ -import { GalleryLikes, GalleryPosts } from "@/models/index.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 = { tags: ["gallery"], 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 0493d02d1f..16c629706c 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,7 @@ -import { HOUR } from "@/const.js"; -import type { DriveFile } from "@/models/entities/drive-file.js"; -import { DriveFiles, GalleryPosts } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { DriveFiles, GalleryPosts } from "@/models/index.js"; +import type { DriveFile } from "@/models/entities/drive-file.js"; +import { HOUR } from "@/const.js"; export const meta = { tags: ["gallery"], 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 030ca14102..633e75335a 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 "@/server/api/define.js"; -import { MoreThan } from "typeorm"; 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 119ca16795..4fd1498bd8 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 define from "@/server/api/define.js"; import { readdir } from "fs/promises"; +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 a19ccfa1c8..6e8016f64b 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/list.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/list.ts @@ -1,5 +1,5 @@ -import { Hashtags } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Hashtags } from "@/models/index.js"; export const meta = { tags: ["hashtags"], diff --git a/packages/backend/src/server/api/endpoints/hashtags/search.ts b/packages/backend/src/server/api/endpoints/hashtags/search.ts index 4709ccc7a8..1dc1fb4922 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/search.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/search.ts @@ -1,6 +1,6 @@ -import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; -import { Hashtags } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Hashtags } from "@/models/index.js"; +import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { tags: ["hashtags"], diff --git a/packages/backend/src/server/api/endpoints/hashtags/show.ts b/packages/backend/src/server/api/endpoints/hashtags/show.ts index 136f358040..09849dbd36 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/show.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/show.ts @@ -1,7 +1,7 @@ -import { normalizeForSearch } from "@/misc/normalize-for-search.js"; -import { Hashtags } from "@/models/index.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"; export const meta = { tags: ["hashtags"], diff --git a/packages/backend/src/server/api/endpoints/hashtags/trend.ts b/packages/backend/src/server/api/endpoints/hashtags/trend.ts index 6c41f8b828..fe8bba95fd 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/trend.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/trend.ts @@ -1,10 +1,10 @@ -import { fetchMeta } from "@/misc/fetch-meta.js"; -import { normalizeForSearch } from "@/misc/normalize-for-search.js"; -import { safeForSql } from "@/misc/safe-for-sql.js"; -import type { Note } from "@/models/entities/note.js"; -import { Notes } from "@/models/index.js"; -import define from "@/server/api/define.js"; import { Brackets } from "typeorm"; +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"; +import { safeForSql } from "@/misc/safe-for-sql.js"; +import { normalizeForSearch } from "@/misc/normalize-for-search.js"; /* トレンドに載るためには「『直近a分間のユニーク投稿数が今からa分前~今からb分前の間のユニーク投稿数のn倍以上』のハッシュタグの上位5位以内に入る」ことが必要 diff --git a/packages/backend/src/server/api/endpoints/hashtags/users.ts b/packages/backend/src/server/api/endpoints/hashtags/users.ts index 1513703239..ccb70a0596 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/users.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/users.ts @@ -1,6 +1,6 @@ -import { normalizeForSearch } from "@/misc/normalize-for-search.js"; -import { Users } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Users } from "@/models/index.js"; +import { normalizeForSearch } from "@/misc/normalize-for-search.js"; export const meta = { requireCredential: false, 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 f10b74efec..c1a7b16a84 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/done.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/done.ts @@ -1,7 +1,7 @@ -import { UserProfiles, Users } from "@/models/index.js"; -import define from "@/server/api/define.js"; import { publishMainStream } from "@/services/stream.js"; import * as OTPAuth from "otpauth"; +import define from "@/server/api/define.js"; +import { Users, UserProfiles } from "@/models/index.js"; export const meta = { requireCredential: true, 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 99f6994ea1..b8104e318f 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,15 +1,15 @@ -import config from "@/config/index.js"; -import { comparePassword } from "@/misc/password.js"; +import { decode } from "cbor-x"; +import define from "@/server/api/define.js"; import { - AttestationChallenges, UserProfiles, UserSecurityKeys, + AttestationChallenges, Users, } from "@/models/index.js"; -import { hash, procedures } from "@/server/api/2fa.js"; -import define from "@/server/api/define.js"; +import config from "@/config/index.js"; +import { procedures, hash } from "@/server/api/2fa.js"; import { publishMainStream } from "@/services/stream.js"; -import { decode } from "cbor-x"; +import { comparePassword } from "@/misc/password.js"; const rpIdHashReal = hash(Buffer.from(config.hostname, "utf-8")); @@ -79,7 +79,7 @@ export default define(meta, paramDef, async (ps, user) => { const credentialIdLength = authData.readUInt16BE(53); const credentialId = authData.slice(55, 55 + credentialIdLength); const publicKeyData = authData.slice(55 + credentialIdLength); - const publicKey: Map = new Map( + const publicKey: Map = new Map( Object.entries(decode(publicKeyData)).map(([key, value]) => [ Number(key), value, 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 aee935eb54..8125f817a0 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 { UserProfiles, UserSecurityKeys, Users } from "@/models/index.js"; import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; +import { Users, UserProfiles, UserSecurityKeys } from "@/models/index.js"; import { publishMainStream } from "@/services/stream.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 f6d58c2788..8080c9390f 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,10 +1,10 @@ -import * as crypto from "node:crypto"; -import { promisify } from "node:util"; -import { genId } from "@/misc/gen-id.js"; -import { comparePassword } from "@/misc/password.js"; -import { AttestationChallenges, UserProfiles } from "@/models/index.js"; -import { hash } from "@/server/api/2fa.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 "@/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 ba0220b104..52e1df39f4 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/register.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/register.ts @@ -1,9 +1,9 @@ -import config from "@/config/index.js"; -import { comparePassword } from "@/misc/password.js"; -import { UserProfiles } from "@/models/index.js"; -import define from "@/server/api/define.js"; 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 "@/server/api/define.js"; +import { comparePassword } from "@/misc/password.js"; export const meta = { requireCredential: true, 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 cba8b431a3..b3bc5bdfac 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,6 +1,6 @@ import { comparePassword } from "@/misc/password.js"; -import { UserProfiles, UserSecurityKeys, Users } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { UserProfiles, UserSecurityKeys, Users } from "@/models/index.js"; import { publishMainStream } from "@/services/stream.js"; export const meta = { 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 3923504233..c4e78eecb5 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts @@ -1,7 +1,7 @@ -import { comparePassword } from "@/misc/password.js"; -import { UserProfiles, Users } from "@/models/index.js"; -import define from "@/server/api/define.js"; import { publishMainStream } from "@/services/stream.js"; +import define from "@/server/api/define.js"; +import { Users, UserProfiles } from "@/models/index.js"; +import { comparePassword } from "@/misc/password.js"; export const meta = { requireCredential: true, 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 0a55937dd4..d77ecc88e8 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 { UserSecurityKeys, Users } from "@/models/index.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; import { publishMainStream } from "@/services/stream.js"; +import define from "@/server/api/define.js"; +import { Users, UserSecurityKeys } from "@/models/index.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 9669d22c6b..7e7574ec91 100644 --- a/packages/backend/src/server/api/endpoints/i/apps.ts +++ b/packages/backend/src/server/api/endpoints/i/apps.ts @@ -1,5 +1,5 @@ -import { AccessTokens } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { AccessTokens } from "@/models/index.js"; export const meta = { requireCredential: true, 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 145052289c..ad66fe1fd3 100644 --- a/packages/backend/src/server/api/endpoints/i/authorized-apps.ts +++ b/packages/backend/src/server/api/endpoints/i/authorized-apps.ts @@ -1,5 +1,5 @@ -import { AccessTokens, Apps } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { AccessTokens, Apps } from "@/models/index.js"; export const meta = { requireCredential: true, 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 cef86a6bb5..b0dc8bba60 100644 --- a/packages/backend/src/server/api/endpoints/i/change-password.ts +++ b/packages/backend/src/server/api/endpoints/i/change-password.ts @@ -1,6 +1,6 @@ -import { comparePassword, hashPassword } from "@/misc/password.js"; -import { UserProfiles } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { UserProfiles } from "@/models/index.js"; +import { hashPassword, comparePassword } from "@/misc/password.js"; export const meta = { requireCredential: true, 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 9e6ce15cd9..606cde82e1 100644 --- a/packages/backend/src/server/api/endpoints/i/delete-account.ts +++ b/packages/backend/src/server/api/endpoints/i/delete-account.ts @@ -1,7 +1,7 @@ -import { comparePassword } from "@/misc/password.js"; import { UserProfiles, Users } from "@/models/index.js"; -import define from "@/server/api/define.js"; import { deleteAccount } from "@/services/delete-account.js"; +import define from "@/server/api/define.js"; +import { comparePassword } from "@/misc/password.js"; export const meta = { requireCredential: true, 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 664689d005..30e74ab2f5 100644 --- a/packages/backend/src/server/api/endpoints/i/export-blocking.ts +++ b/packages/backend/src/server/api/endpoints/i/export-blocking.ts @@ -1,6 +1,6 @@ -import { HOUR } from "@/const.js"; -import { createExportBlockingJob } from "@/queue/index.js"; import define from "@/server/api/define.js"; +import { createExportBlockingJob } from "@/queue/index.js"; +import { HOUR } from "@/const.js"; export const meta = { secure: true, 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 6f574f8bff..07d2997a18 100644 --- a/packages/backend/src/server/api/endpoints/i/export-following.ts +++ b/packages/backend/src/server/api/endpoints/i/export-following.ts @@ -1,6 +1,6 @@ -import { HOUR } from "@/const.js"; -import { createExportFollowingJob } from "@/queue/index.js"; import define from "@/server/api/define.js"; +import { createExportFollowingJob } from "@/queue/index.js"; +import { HOUR } from "@/const.js"; export const meta = { secure: true, 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 e572297840..7d22a073e6 100644 --- a/packages/backend/src/server/api/endpoints/i/export-mute.ts +++ b/packages/backend/src/server/api/endpoints/i/export-mute.ts @@ -1,6 +1,6 @@ -import { HOUR } from "@/const.js"; -import { createExportMuteJob } from "@/queue/index.js"; import define from "@/server/api/define.js"; +import { createExportMuteJob } from "@/queue/index.js"; +import { HOUR } from "@/const.js"; export const meta = { secure: true, 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 393ab01eb3..f167bb83cb 100644 --- a/packages/backend/src/server/api/endpoints/i/export-notes.ts +++ b/packages/backend/src/server/api/endpoints/i/export-notes.ts @@ -1,6 +1,6 @@ -import { DAY } from "@/const.js"; -import { createExportNotesJob } from "@/queue/index.js"; import define from "@/server/api/define.js"; +import { createExportNotesJob } from "@/queue/index.js"; +import { DAY } from "@/const.js"; export const meta = { secure: true, 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 c77e46878a..b68d889dcd 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,6 +1,6 @@ -import { MINUTE } from "@/const.js"; -import { createExportUserListsJob } from "@/queue/index.js"; import define from "@/server/api/define.js"; +import { createExportUserListsJob } from "@/queue/index.js"; +import { MINUTE } from "@/const.js"; export const meta = { secure: true, diff --git a/packages/backend/src/server/api/endpoints/i/favorites.ts b/packages/backend/src/server/api/endpoints/i/favorites.ts index 1e34f13705..f0961ea236 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 "@/server/api/define.js"; import { NoteFavorites } from "@/models/index.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import define from "@/server/api/define.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 42fd9ad8c4..80c90e684d 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 "@/server/api/define.js"; import { GalleryLikes } from "@/models/index.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import define from "@/server/api/define.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 c654bfc316..054784842d 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 { makePaginationQuery } from "@/server/api/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 f987a58ace..39cc45e822 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,5 +1,5 @@ -import { MutedNotes } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { MutedNotes } from "@/models/index.js"; export const meta = { tags: ["account"], 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 9672663e1c..58314aced3 100644 --- a/packages/backend/src/server/api/endpoints/i/import-blocking.ts +++ b/packages/backend/src/server/api/endpoints/i/import-blocking.ts @@ -1,8 +1,8 @@ -import { HOUR } from "@/const.js"; -import { DriveFiles } from "@/models/index.js"; -import { createImportBlockingJob } from "@/queue/index.js"; import define from "@/server/api/define.js"; +import { createImportBlockingJob } from "@/queue/index.js"; import { ApiError } from "@/server/api/error.js"; +import { DriveFiles } from "@/models/index.js"; +import { HOUR } from "@/const.js"; export const meta = { secure: true, 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 a40b010c01..b7c475698c 100644 --- a/packages/backend/src/server/api/endpoints/i/import-following.ts +++ b/packages/backend/src/server/api/endpoints/i/import-following.ts @@ -1,8 +1,8 @@ -import { HOUR } from "@/const.js"; -import { DriveFiles } from "@/models/index.js"; -import { createImportFollowingJob } from "@/queue/index.js"; import define from "@/server/api/define.js"; +import { createImportFollowingJob } from "@/queue/index.js"; import { ApiError } from "@/server/api/error.js"; +import { DriveFiles } from "@/models/index.js"; +import { HOUR } from "@/const.js"; export const meta = { secure: true, 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 750d23ec7c..494fb0d420 100644 --- a/packages/backend/src/server/api/endpoints/i/import-muting.ts +++ b/packages/backend/src/server/api/endpoints/i/import-muting.ts @@ -1,8 +1,8 @@ -import { HOUR } from "@/const.js"; -import { DriveFiles } from "@/models/index.js"; -import { createImportMutingJob } from "@/queue/index.js"; import define from "@/server/api/define.js"; +import { createImportMutingJob } from "@/queue/index.js"; import { ApiError } from "@/server/api/error.js"; +import { DriveFiles } from "@/models/index.js"; +import { HOUR } from "@/const.js"; export const meta = { secure: true, 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 582807aa08..b8b52be98f 100644 --- a/packages/backend/src/server/api/endpoints/i/import-posts.ts +++ b/packages/backend/src/server/api/endpoints/i/import-posts.ts @@ -1,9 +1,9 @@ +import define from "@/server/api/define.js"; +import { createImportPostsJob } from "@/queue/index.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"; -import { DriveFiles } from "@/models/index.js"; -import { createImportPostsJob } from "@/queue/index.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; export const meta = { secure: true, 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 10ce72e758..ed82a96054 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,8 +1,8 @@ -import { HOUR } from "@/const.js"; -import { DriveFiles } from "@/models/index.js"; -import { createImportUserListsJob } from "@/queue/index.js"; import define from "@/server/api/define.js"; +import { createImportUserListsJob } from "@/queue/index.js"; import { ApiError } from "@/server/api/error.js"; +import { DriveFiles } from "@/models/index.js"; +import { HOUR } from "@/const.js"; export const meta = { secure: true, 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 d6d44bf948..39bf6fff83 100644 --- a/packages/backend/src/server/api/endpoints/i/known-as.ts +++ b/packages/backend/src/server/api/endpoints/i/known-as.ts @@ -1,14 +1,14 @@ -import { DAY } from "@/const.js"; -import { parse } from "@/misc/acct.js"; import type { User } from "@/models/entities/user.js"; import { Users } from "@/models/index.js"; import { resolveUser } from "@/remote/resolve-user.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; -import { apiLogger } from "@/server/api/logger.js"; 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 "@/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 = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/i/move.ts b/packages/backend/src/server/api/endpoints/i/move.ts index db0d3dfc2f..c6d1205f98 100644 --- a/packages/backend/src/server/api/endpoints/i/move.ts +++ b/packages/backend/src/server/api/endpoints/i/move.ts @@ -1,18 +1,18 @@ -import config from "@/config/index.js"; -import { DAY } from "@/const.js"; -import { parse } from "@/misc/acct.js"; import type { User } from "@/models/entities/user.js"; -import { Followings, Users } from "@/models/index.js"; +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 { resolveUser } from "@/remote/resolve-user.js"; -import { getUser } from "@/server/api/common/getters.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; import { apiLogger } from "@/server/api/logger.js"; -import create from "@/services/following/create.js"; import deleteFollowing from "@/services/following/delete.js"; +import create from "@/services/following/create.js"; +import { getUser } from "@/server/api/common/getters.js"; +import { Followings, Users } from "@/models/index.js"; +import config from "@/config/index.js"; import { publishMainStream } from "@/services/stream.js"; +import { parse } from "@/misc/acct.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/i/notifications.ts b/packages/backend/src/server/api/endpoints/i/notifications.ts index 2f9043f162..b07247dd83 100644 --- a/packages/backend/src/server/api/endpoints/i/notifications.ts +++ b/packages/backend/src/server/api/endpoints/i/notifications.ts @@ -1,16 +1,16 @@ +import { Brackets } from "typeorm"; import { + Notifications, Followings, Mutings, - Notifications, - UserProfiles, Users, + UserProfiles, } from "@/models/index.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { notificationTypes } from "@/types.js"; +import read from "@/services/note/read.js"; import { readNotification } from "@/server/api/common/read-notification.js"; import define from "@/server/api/define.js"; -import read from "@/services/note/read.js"; -import { notificationTypes } from "@/types.js"; -import { Brackets } from "typeorm"; +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 6cf7a8c066..289d072670 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 { makePaginationQuery } from "@/server/api/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 f2912a6c98..1177d2e664 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 { makePaginationQuery } from "@/server/api/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 106342b6df..4291541ea2 100644 --- a/packages/backend/src/server/api/endpoints/i/pin.ts +++ b/packages/backend/src/server/api/endpoints/i/pin.ts @@ -1,7 +1,7 @@ -import { Users } from "@/models/index.js"; +import { addPinned } from "@/services/i/pin.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { addPinned } from "@/services/i/pin.js"; +import { Users } from "@/models/index.js"; export const meta = { tags: ["account", "notes"], 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 0dcd89fa89..505c424edb 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,6 +1,6 @@ -import { MessagingMessages, UserGroupJoinings } from "@/models/index.js"; -import define from "@/server/api/define.js"; import { publishMainStream } from "@/services/stream.js"; +import define from "@/server/api/define.js"; +import { MessagingMessages, UserGroupJoinings } from "@/models/index.js"; export const meta = { tags: ["account", "messaging"], 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 32439f544b..6f70e55a1a 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,6 +1,6 @@ -import { NoteUnreads } from "@/models/index.js"; -import define from "@/server/api/define.js"; import { publishMainStream } from "@/services/stream.js"; +import define from "@/server/api/define.js"; +import { NoteUnreads } from "@/models/index.js"; export const meta = { tags: ["account"], 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 98da5576b9..a59d15b994 100644 --- a/packages/backend/src/server/api/endpoints/i/read-announcement.ts +++ b/packages/backend/src/server/api/endpoints/i/read-announcement.ts @@ -1,7 +1,7 @@ -import { genId } from "@/misc/gen-id.js"; -import { AnnouncementReads, Announcements, Users } from "@/models/index.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"; export const meta = { 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 348167aeaf..c1b4325adb 100644 --- a/packages/backend/src/server/api/endpoints/i/regenerate-token.ts +++ b/packages/backend/src/server/api/endpoints/i/regenerate-token.ts @@ -1,12 +1,12 @@ -import { comparePassword } from "@/misc/password.js"; -import { UserProfiles, Users } from "@/models/index.js"; -import generateUserToken from "@/server/api/common/generate-native-user-token.js"; -import define from "@/server/api/define.js"; import { publishInternalEvent, publishMainStream, publishUserEvent, } from "@/services/stream.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"; export const meta = { requireCredential: true, 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 b3edd0f959..c267bb144e 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,5 +1,5 @@ -import { RegistryItems } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { RegistryItems } from "@/models/index.js"; export const meta = { requireCredential: true, 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 d7f269ec2e..57db3c7144 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,5 +1,5 @@ -import { RegistryItems } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { RegistryItems } from "@/models/index.js"; import { ApiError } from "@/server/api/error.js"; export const meta = { 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 dd2ef8c9d8..ac37beea54 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,6 +1,6 @@ -import { RegistryItems } from "@/models/index.js"; -import define from "@/server/api/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 = { requireCredential: true, 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 96ae834d19..d25047e009 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get.ts @@ -1,5 +1,5 @@ -import { RegistryItems } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { RegistryItems } from "@/models/index.js"; import { ApiError } from "@/server/api/error.js"; export const meta = { 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 e261f8eedd..f691552bce 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,5 +1,5 @@ -import { RegistryItems } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { RegistryItems } from "@/models/index.js"; export const meta = { requireCredential: true, 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 bc89e33a38..186e744bd1 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/keys.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/keys.ts @@ -1,5 +1,5 @@ -import { RegistryItems } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { RegistryItems } from "@/models/index.js"; export const meta = { requireCredential: true, 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 bef2d7b2b8..aa459952ee 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/remove.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/remove.ts @@ -1,5 +1,5 @@ -import { RegistryItems } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { RegistryItems } from "@/models/index.js"; import { ApiError } from "@/server/api/error.js"; export const meta = { 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 53d8113c05..e235ef67f0 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/scopes.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/scopes.ts @@ -1,5 +1,5 @@ -import { RegistryItems } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { RegistryItems } from "@/models/index.js"; export const meta = { requireCredential: true, 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 0e61ef78c0..7a1f8ab5f7 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/set.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/set.ts @@ -1,7 +1,7 @@ -import { genId } from "@/misc/gen-id.js"; -import { RegistryItems } from "@/models/index.js"; -import define from "@/server/api/define.js"; import { publishMainStream } from "@/services/stream.js"; +import define from "@/server/api/define.js"; +import { RegistryItems } from "@/models/index.js"; +import { genId } from "@/misc/gen-id.js"; export const meta = { requireCredential: true, 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 4a86b86135..f3e8116944 100644 --- a/packages/backend/src/server/api/endpoints/i/revoke-token.ts +++ b/packages/backend/src/server/api/endpoints/i/revoke-token.ts @@ -1,5 +1,5 @@ -import { AccessTokens } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { AccessTokens } from "@/models/index.js"; import { publishUserEvent } from "@/services/stream.js"; export const meta = { 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 17802b7455..14d303089e 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 "@/server/api/define.js"; import { Signins } from "@/models/index.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import define from "@/server/api/define.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 bba01786cd..9aee1dfea8 100644 --- a/packages/backend/src/server/api/endpoints/i/unpin.ts +++ b/packages/backend/src/server/api/endpoints/i/unpin.ts @@ -1,7 +1,7 @@ -import { Users } from "@/models/index.js"; +import { removePinned } from "@/services/i/pin.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { removePinned } from "@/services/i/pin.js"; +import { Users } from "@/models/index.js"; export const meta = { tags: ["account", "notes"], 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 494f35ddab..a48252ed1a 100644 --- a/packages/backend/src/server/api/endpoints/i/update-email.ts +++ b/packages/backend/src/server/api/endpoints/i/update-email.ts @@ -1,13 +1,13 @@ +import { publishMainStream } from "@/services/stream.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 "@/server/api/error.js"; +import { validateEmailForAccount } from "@/services/validate-email-for-account.js"; import { HOUR } from "@/const.js"; import { comparePassword } from "@/misc/password.js"; -import { UserProfiles, Users } from "@/models/index.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; -import { sendEmail } from "@/services/send-email.js"; -import { publishMainStream } from "@/services/stream.js"; -import { validateEmailForAccount } from "@/services/validate-email-for-account.js"; -import rndstr from "rndstr"; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index d352db7241..082108383e 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -1,20 +1,20 @@ -import { extractCustomEmojisFromMfm } from "@/misc/extract-custom-emojis-from-mfm.js"; -import { extractHashtags } from "@/misc/extract-hashtags.js"; -import { langmap } from "@/misc/langmap.js"; -import { normalizeForSearch } from "@/misc/normalize-for-search.js"; -import type { UserProfile } from "@/models/entities/user-profile.js"; -import type { User } from "@/models/entities/user.js"; -import { DriveFiles, Pages, UserProfiles, Users } from "@/models/index.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; -import { verifyLink } from "@/services/fetch-rel-me.js"; +import RE2 from "re2"; +import * as mfm from "mfm-js"; +import { publishMainStream, publishUserEvent } from "@/services/stream.js"; import acceptAllFollowRequests from "@/services/following/requests/accept-all.js"; import { publishToFollowers } from "@/services/i/update.js"; -import { publishMainStream, publishUserEvent } from "@/services/stream.js"; +import { extractCustomEmojisFromMfm } from "@/misc/extract-custom-emojis-from-mfm.js"; +import { extractHashtags } from "@/misc/extract-hashtags.js"; import { updateUsertags } from "@/services/update-hashtag.js"; +import { Users, DriveFiles, UserProfiles, Pages } from "@/models/index.js"; +import type { User } from "@/models/entities/user.js"; +import type { UserProfile } from "@/models/entities/user-profile.js"; import { notificationTypes } from "@/types.js"; -import * as mfm from "mfm-js"; -import RE2 from "re2"; +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 "@/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 19cab832ca..99e8209a37 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 "@/server/api/define.js"; import { UserGroupInvitations } from "@/models/index.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import define from "@/server/api/define.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 161a4a0564..ee38b76372 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/create.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/create.ts @@ -1,8 +1,8 @@ -import { genId } from "@/misc/gen-id.js"; -import { webhookEventTypes } from "@/models/entities/webhook.js"; -import { Webhooks } from "@/models/index.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"; +import { webhookEventTypes } from "@/models/entities/webhook.js"; export const meta = { tags: ["webhooks"], 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 a9df7a94d4..a92ed179d0 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts @@ -1,6 +1,6 @@ -import { Webhooks } from "@/models/index.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"; export const meta = { 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 da98cb81d2..f937e560c5 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/list.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/list.ts @@ -1,5 +1,5 @@ -import { Webhooks } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Webhooks } from "@/models/index.js"; export const meta = { tags: ["webhooks", "account"], 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 158d71b00a..b24850f5e5 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/show.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/show.ts @@ -1,6 +1,6 @@ -import { Webhooks } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; +import { Webhooks } from "@/models/index.js"; export const meta = { tags: ["webhooks"], 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 f2656bbf9e..4a211b915f 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/update.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/update.ts @@ -1,8 +1,8 @@ -import { webhookEventTypes } from "@/models/entities/webhook.js"; -import { Webhooks } from "@/models/index.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"; export const meta = { tags: ["webhooks"], diff --git a/packages/backend/src/server/api/endpoints/messaging/history.ts b/packages/backend/src/server/api/endpoints/messaging/history.ts index f9e00aa79f..25418a17a6 100644 --- a/packages/backend/src/server/api/endpoints/messaging/history.ts +++ b/packages/backend/src/server/api/endpoints/messaging/history.ts @@ -1,3 +1,4 @@ +import { Brackets } from "typeorm"; import type { MessagingMessage } from "@/models/entities/messaging-message.js"; import { MessagingMessages, @@ -5,7 +6,6 @@ import { UserGroupJoinings, } from "@/models/index.js"; import define from "@/server/api/define.js"; -import { Brackets } from "typeorm"; 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 dde4c9a0d0..01f7028673 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 { - MessagingMessages, - UserGroupJoinings, - UserGroups, - Users, -} from "@/models/index.js"; -import { getUser } from "@/server/api/common/getters.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import { - deliverReadActivity, - readGroupMessagingMessage, - readUserMessagingMessage, -} from "@/server/api/common/read-messaging-message.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 "@/server/api/common/make-pagination-query.js"; import { Brackets } from "typeorm"; +import { + readUserMessagingMessage, + readGroupMessagingMessage, + deliverReadActivity, +} 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 654bd75f93..6fd38eff79 100644 --- a/packages/backend/src/server/api/endpoints/messaging/messages/create.ts +++ b/packages/backend/src/server/api/endpoints/messaging/messages/create.ts @@ -1,14 +1,14 @@ -import type { UserGroup } from "@/models/entities/user-group.js"; -import type { User } from "@/models/entities/user.js"; -import { - Blockings, - DriveFiles, - UserGroupJoinings, - UserGroups, -} from "@/models/index.js"; -import { getUser } from "@/server/api/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 { + DriveFiles, + UserGroups, + UserGroupJoinings, + Blockings, +} from "@/models/index.js"; +import type { User } from "@/models/entities/user.js"; +import type { UserGroup } from "@/models/entities/user-group.js"; import { createMessage } from "@/services/messages/create.js"; export const meta = { 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 dd8471aeec..76691dd34d 100644 --- a/packages/backend/src/server/api/endpoints/messaging/messages/delete.ts +++ b/packages/backend/src/server/api/endpoints/messaging/messages/delete.ts @@ -1,8 +1,8 @@ -import { HOUR, SECOND } from "@/const.js"; -import { MessagingMessages } from "@/models/index.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"; export const meta = { tags: ["messaging"], 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 1b4cc4d706..5aa50155ca 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 { MessagingMessages } from "@/models/index.js"; -import { - readGroupMessagingMessage, - readUserMessagingMessage, -} from "@/server/api/common/read-messaging-message.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 "@/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 0cb137b8d1..9dffad780f 100644 --- a/packages/backend/src/server/api/endpoints/meta.ts +++ b/packages/backend/src/server/api/endpoints/meta.ts @@ -1,10 +1,10 @@ -import config from "@/config/index.js"; -import { MAX_CAPTION_TEXT_LENGTH, MAX_NOTE_TEXT_LENGTH } from "@/const.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import { Ads, Emojis, Users } from "@/models/index.js"; -import define from "@/server/api/define.js"; import JSON5 from "json5"; import { IsNull, MoreThan } from "typeorm"; +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 "@/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 35f18c0e47..bca09d3f07 100644 --- a/packages/backend/src/server/api/endpoints/miauth/gen-token.ts +++ b/packages/backend/src/server/api/endpoints/miauth/gen-token.ts @@ -1,7 +1,7 @@ +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"; -import { AccessTokens } from "@/models/index.js"; -import define from "@/server/api/define.js"; export const meta = { tags: ["auth"], diff --git a/packages/backend/src/server/api/endpoints/mute/create.ts b/packages/backend/src/server/api/endpoints/mute/create.ts index 0ff1721d69..2eb935198e 100644 --- a/packages/backend/src/server/api/endpoints/mute/create.ts +++ b/packages/backend/src/server/api/endpoints/mute/create.ts @@ -1,9 +1,9 @@ -import { genId } from "@/misc/gen-id.js"; -import type { Muting } from "@/models/entities/muting.js"; -import { Mutings, NoteWatchings } from "@/models/index.js"; -import { getUser } from "@/server/api/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"; import { publishUserEvent } from "@/services/stream.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/mute/delete.ts b/packages/backend/src/server/api/endpoints/mute/delete.ts index 104bc49450..8058e9a612 100644 --- a/packages/backend/src/server/api/endpoints/mute/delete.ts +++ b/packages/backend/src/server/api/endpoints/mute/delete.ts @@ -1,7 +1,7 @@ -import { Mutings } from "@/models/index.js"; -import { getUser } from "@/server/api/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"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/mute/list.ts b/packages/backend/src/server/api/endpoints/mute/list.ts index a0126468e6..9619457cd7 100644 --- a/packages/backend/src/server/api/endpoints/mute/list.ts +++ b/packages/backend/src/server/api/endpoints/mute/list.ts @@ -1,6 +1,6 @@ -import { Mutings } from "@/models/index.js"; -import { makePaginationQuery } from "@/server/api/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 = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/my/apps.ts b/packages/backend/src/server/api/endpoints/my/apps.ts index 1147c22fab..bc75b38e58 100644 --- a/packages/backend/src/server/api/endpoints/my/apps.ts +++ b/packages/backend/src/server/api/endpoints/my/apps.ts @@ -1,5 +1,5 @@ -import { Apps } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { Apps } from "@/models/index.js"; export const meta = { tags: ["account", "app"], diff --git a/packages/backend/src/server/api/endpoints/notes.ts b/packages/backend/src/server/api/endpoints/notes.ts index a63f597fa5..6e2d3b4f3b 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 { makePaginationQuery } from "@/server/api/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 afdd9c414f..d76771c34c 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 { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; -import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; -import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-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 f649ae4599..430ed02ec6 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 { ClipNotes, Clips } from "@/models/index.js"; -import { getNote } from "@/server/api/common/getters.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; import { In } from "typeorm"; +import { ClipNotes, Clips } from "@/models/index.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 fdb45430a4..9939740874 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 { getNote } from "@/server/api/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 426b6904a0..0465d09ec4 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -1,22 +1,22 @@ -import { MAX_NOTE_TEXT_LENGTH } from "@/const.js"; -import { HOUR } from "@/const.js"; -import type { Channel } from "@/models/entities/channel.js"; -import type { DriveFile } from "@/models/entities/drive-file.js"; -import type { Note } from "@/models/entities/note.js"; +import { In } from "typeorm"; +import create from "@/services/note/create.js"; import type { User } from "@/models/entities/user.js"; import { - Blockings, - Channels, + Users, DriveFiles, Notes, - Users, + Channels, + Blockings, } from "@/models/index.js"; -import { getNote } from "@/server/api/common/getters.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; -import create from "@/services/note/create.js"; +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 { In } from "typeorm"; +import { ApiError } from "@/server/api/error.js"; +import define from "@/server/api/define.js"; +import { HOUR } from "@/const.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 32a64661de..54aad1ebad 100644 --- a/packages/backend/src/server/api/endpoints/notes/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/delete.ts @@ -1,9 +1,9 @@ -import { HOUR, SECOND } from "@/const.js"; -import { Users } from "@/models/index.js"; -import { getNote } from "@/server/api/common/getters.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; import deleteNote from "@/services/note/delete.js"; +import { Users } from "@/models/index.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 = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/edit.ts b/packages/backend/src/server/api/endpoints/notes/edit.ts index 9e9fdd9e5b..a0869e4104 100644 --- a/packages/backend/src/server/api/endpoints/notes/edit.ts +++ b/packages/backend/src/server/api/endpoints/notes/edit.ts @@ -1,41 +1,41 @@ -import { MAX_NOTE_TEXT_LENGTH } from "@/const.js"; -import { HOUR } from "@/const.js"; -import detectLanguage from "@/misc/detect-language.js"; -import { extractCustomEmojisFromMfm } from "@/misc/extract-custom-emojis-from-mfm.js"; -import { extractHashtags } from "@/misc/extract-hashtags.js"; -import { genId } from "@/misc/gen-id.js"; -// import { deliverQuestionUpdate } from "@/services/note/polls/update.js"; -import { langmap } from "@/misc/langmap.js"; -import type { Channel } from "@/models/entities/channel.js"; -import type { DriveFile } from "@/models/entities/drive-file.js"; -import type { IMentionedRemoteUsers, Note } from "@/models/entities/note.js"; -import { Poll } from "@/models/entities/poll.js"; +import { In } from "typeorm"; +import { index } from "@/services/note/create.js"; import type { IRemoteUser, User } from "@/models/entities/user.js"; import { - Blockings, - Channels, - DriveFiles, - NoteEdits, - Notes, - Polls, - UserProfiles, Users, + DriveFiles, + Notes, + Channels, + Blockings, + UserProfiles, + Polls, + NoteEdits, } from "@/models/index.js"; +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 "@/server/api/error.js"; +import define from "@/server/api/define.js"; +import { HOUR } from "@/const.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"; +import { extractHashtags } from "@/misc/extract-hashtags.js"; +import { extractCustomEmojisFromMfm } from "@/misc/extract-custom-emojis-from-mfm.js"; +import { extractMentionedUsers } from "@/services/note/create.js"; +import { genId } from "@/misc/gen-id.js"; +import { publishNoteStream } from "@/services/stream.js"; import DeliverManager from "@/remote/activitypub/deliver-manager.js"; import { renderActivity } from "@/remote/activitypub/renderer/index.js"; import renderNote from "@/remote/activitypub/renderer/note.js"; import renderUpdate from "@/remote/activitypub/renderer/update.js"; -import { getNote } from "@/server/api/common/getters.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; -import { index } from "@/services/note/create.js"; -import { extractMentionedUsers } from "@/services/note/create.js"; import { deliverToRelays } from "@/services/relay.js"; -import { publishNoteStream } from "@/services/stream.js"; -import { noteVisibilities } from "@/types.js"; -import * as mfm from "mfm-js"; -import { In } from "typeorm"; +// import { deliverQuestionUpdate } from "@/services/note/polls/update.js"; +import { langmap } from "@/misc/langmap.js"; +import detectLanguage from "@/misc/detect-language.js"; export const meta = { tags: ["notes"], 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 16cf51c279..8b2c7ad3a4 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 { genId } from "@/misc/gen-id.js"; import { NoteFavorites } from "@/models/index.js"; -import { getNote } from "@/server/api/common/getters.js"; +import { genId } from "@/misc/gen-id.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 b2b0ad6b0f..018ef91bca 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 { getNote } from "@/server/api/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 3c15d70502..4f90145ec3 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 { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; -import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-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 d8e49f06e0..fee660ddb2 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 { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; -import { generateMutedNoteQuery } from "@/server/api/common/generate-muted-note-query.js"; -import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; -import { generateRepliesQuery } from "@/server/api/common/generate-replies-query.js"; -import { generateMutedUserRenotesQueryForNotes } from "@/server/api/common/generated-muted-renote-query.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { activeUsersChart } from "@/services/chart/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { activeUsersChart } from "@/services/chart/index.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 4639b97ec3..c573a0c865 100644 --- a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts @@ -1,17 +1,17 @@ +import { Brackets } from "typeorm"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { Followings, Notes } from "@/models/index.js"; -import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; -import { generateChannelQuery } from "@/server/api/common/generate-channel-query.js"; -import { generateMutedNoteQuery } from "@/server/api/common/generate-muted-note-query.js"; -import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; -import { generateRepliesQuery } from "@/server/api/common/generate-replies-query.js"; -import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; -import { generateMutedUserRenotesQueryForNotes } from "@/server/api/common/generated-muted-renote-query.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { activeUsersChart } from "@/services/chart/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { activeUsersChart } from "@/services/chart/index.js"; -import { Brackets } from "typeorm"; +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 5deaeb00ae..c89b8f8710 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 } from "@/models/index.js"; -import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; -import { generateChannelQuery } from "@/server/api/common/generate-channel-query.js"; -import { generateMutedNoteQuery } from "@/server/api/common/generate-muted-note-query.js"; -import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; -import { generateRepliesQuery } from "@/server/api/common/generate-replies-query.js"; -import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; -import { generateMutedUserRenotesQueryForNotes } from "@/server/api/common/generated-muted-renote-query.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { activeUsersChart } from "@/services/chart/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { activeUsersChart } from "@/services/chart/index.js"; -import { Brackets } from "typeorm"; +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 1b606087f5..44ee90938b 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 { Followings, Notes } from "@/models/index.js"; +import { Brackets } from "typeorm"; +import read from "@/services/note/read.js"; +import { Notes, Followings } from "@/models/index.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"; -import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; -import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import define from "@/server/api/define.js"; -import read from "@/services/note/read.js"; -import { Brackets } from "typeorm"; 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 a792b75e9a..ca0d0f03dd 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 { Mutings, Notes, PollVotes, Polls } from "@/models/index.js"; -import define from "@/server/api/define.js"; import { Brackets, In } from "typeorm"; +import { Polls, Mutings, Notes, PollVotes } from "@/models/index.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 45916e721e..1680eca640 100644 --- a/packages/backend/src/server/api/endpoints/notes/polls/vote.ts +++ b/packages/backend/src/server/api/endpoints/notes/polls/vote.ts @@ -1,21 +1,21 @@ -import { genId } from "@/misc/gen-id.js"; -import type { IRemoteUser } from "@/models/entities/user.js"; -import { - Blockings, - NoteWatchings, - PollVotes, - Polls, - Users, -} from "@/models/index.js"; +import { Not } from "typeorm"; +import { publishNoteStream } from "@/services/stream.js"; +import { createNotification } from "@/services/create-notification.js"; import { deliver } from "@/queue/index.js"; import { renderActivity } from "@/remote/activitypub/renderer/index.js"; import renderVote from "@/remote/activitypub/renderer/vote.js"; +import { + PollVotes, + NoteWatchings, + Users, + Polls, + Blockings, +} from "@/models/index.js"; +import type { IRemoteUser } from "@/models/entities/user.js"; +import { genId } from "@/misc/gen-id.js"; import { getNote } from "@/server/api/common/getters.js"; -import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { createNotification } from "@/services/create-notification.js"; -import { publishNoteStream } from "@/services/stream.js"; -import { Not } from "typeorm"; +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 ed38b1af14..386a3a08df 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions.ts @@ -1,9 +1,9 @@ -import type { NoteReaction } from "@/models/entities/note-reaction.js"; +import type { FindOptionsWhere } from "typeorm"; import { NoteReactions } from "@/models/index.js"; -import { getNote } from "@/server/api/common/getters.js"; +import type { NoteReaction } from "@/models/entities/note-reaction.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import type { FindOptionsWhere } from "typeorm"; +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 36c70c34dd..c49a957da1 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 { getNote } from "@/server/api/common/getters.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; import createReaction from "@/services/note/reaction/create.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 503015fda4..f135bd7ffa 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts @@ -1,8 +1,8 @@ -import { HOUR, SECOND } from "@/const.js"; -import { getNote } from "@/server/api/common/getters.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; import deleteReaction from "@/services/note/reaction/delete.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 = { tags: ["reactions", "notes"], 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 ae8c8bd000..53ac1288a8 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -1,17 +1,17 @@ +import { Brackets } from "typeorm"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { Notes } from "@/models/index.js"; -import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; -import { generateChannelQuery } from "@/server/api/common/generate-channel-query.js"; -import { generateMutedNoteQuery } from "@/server/api/common/generate-muted-note-query.js"; -import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; -import { generateRepliesQuery } from "@/server/api/common/generate-replies-query.js"; -import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; -import { generateMutedUserRenotesQueryForNotes } from "@/server/api/common/generated-muted-renote-query.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { activeUsersChart } from "@/services/chart/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { activeUsersChart } from "@/services/chart/index.js"; -import { Brackets } from "typeorm"; +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 7b7d88cda6..683004ebe8 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 { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; -import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; -import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; -import { getNote } from "@/server/api/common/getters.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-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"], @@ -53,7 +53,7 @@ export default define(meta, paramDef, async (ps, user) => { throw err; }); - const query = makePaginationQuery( + let query = makePaginationQuery( Notes.createQueryBuilder("note"), ps.sinceId, ps.untilId, diff --git a/packages/backend/src/server/api/endpoints/notes/replies.ts b/packages/backend/src/server/api/endpoints/notes/replies.ts index 8da59ea850..e4341ebce0 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 { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; -import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; -import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-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 6ede52a181..e87725e342 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 @@ -1,12 +1,12 @@ -import { normalizeForSearch } from "@/misc/normalize-for-search.js"; -import { safeForSql } from "@/misc/safe-for-sql.js"; +import { Brackets } from "typeorm"; import { Notes } from "@/models/index.js"; -import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; +import { safeForSql } from "@/misc/safe-for-sql.js"; +import { normalizeForSearch } from "@/misc/normalize-for-search.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 { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import define from "@/server/api/define.js"; -import { Brackets } from "typeorm"; +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 9bd33c1603..4ddcf11abf 100644 --- a/packages/backend/src/server/api/endpoints/notes/search.ts +++ b/packages/backend/src/server/api/endpoints/notes/search.ts @@ -1,16 +1,16 @@ +import { FindManyOptions, In } from "typeorm"; +import { Notes } from "@/models/index.js"; +import { Note } from "@/models/entities/note.js"; import config from "@/config/index.js"; import es from "@/db/elasticsearch.js"; -import meilisearch, { MeilisearchNote } from "@/db/meilisearch.js"; import sonic from "@/db/sonic.js"; -import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; -import { Note } from "@/models/entities/note.js"; -import { Notes } from "@/models/index.js"; -import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; -import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; -import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import meilisearch, { MeilisearchNote } from "@/db/meilisearch.js"; import define from "@/server/api/define.js"; -import { FindManyOptions, In } from "typeorm"; +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 = { tags: ["notes"], @@ -243,7 +243,7 @@ export default define(meta, paramDef, async (ps, me) => { while (found.length < ps.limit && start < noteIDs.length) { const chunk = noteIDs.slice(start, start + chunkSize); - const query: FindManyOptions = { + let query: FindManyOptions = { where: { id: In(chunk), }, diff --git a/packages/backend/src/server/api/endpoints/notes/show.ts b/packages/backend/src/server/api/endpoints/notes/show.ts index 7cbb6b3f6f..1319e47d93 100644 --- a/packages/backend/src/server/api/endpoints/notes/show.ts +++ b/packages/backend/src/server/api/endpoints/notes/show.ts @@ -1,6 +1,6 @@ import { Notes } from "@/models/index.js"; -import { getNote } from "@/server/api/common/getters.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 = { 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 9dd3c53a04..7c40a45923 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 { NoteThreadMutings, Notes } from "@/models/index.js"; -import { getNote } from "@/server/api/common/getters.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; import readNote from "@/services/note/read.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 dc18876584..62766bedc6 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,6 +1,6 @@ import { NoteThreadMutings } from "@/models/index.js"; -import { getNote } from "@/server/api/common/getters.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 = { diff --git a/packages/backend/src/server/api/endpoints/notes/timeline.ts b/packages/backend/src/server/api/endpoints/notes/timeline.ts index 8512149ec1..0f8da62e2d 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 { Followings, Notes } from "@/models/index.js"; -import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; -import { generateChannelQuery } from "@/server/api/common/generate-channel-query.js"; -import { generateMutedNoteQuery } from "@/server/api/common/generate-muted-note-query.js"; +import { Brackets } from "typeorm"; +import { Notes, Followings } from "@/models/index.js"; +import { activeUsersChart } from "@/services/chart/index.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 { generateVisibilityQuery } from "@/server/api/common/generate-visibility-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 { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { activeUsersChart } from "@/services/chart/index.js"; -import { Brackets } from "typeorm"; 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 61f7041d1e..d1de399936 100644 --- a/packages/backend/src/server/api/endpoints/notes/translate.ts +++ b/packages/backend/src/server/api/endpoints/notes/translate.ts @@ -1,12 +1,12 @@ import { URLSearchParams } from "node:url"; +import fetch from "node-fetch"; import config from "@/config/index.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; +import { Converter } from "opencc-js"; import { getAgentByUrl } from "@/misc/fetch.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; +import { ApiError } from "@/server/api/error.js"; import { getNote } from "@/server/api/common/getters.js"; import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; -import fetch from "node-fetch"; -import { Converter } from "opencc-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 18e49574f3..4a3966123e 100644 --- a/packages/backend/src/server/api/endpoints/notes/unrenote.ts +++ b/packages/backend/src/server/api/endpoints/notes/unrenote.ts @@ -1,9 +1,9 @@ -import { HOUR, SECOND } from "@/const.js"; -import { Notes, Users } from "@/models/index.js"; -import { getNote } from "@/server/api/common/getters.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; import deleteNote from "@/services/note/delete.js"; +import { Notes, Users } from "@/models/index.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 = { tags: ["notes"], 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 d52f10ad09..3a87ed647c 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 { Notes, UserListJoinings, UserLists } from "@/models/index.js"; -import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { Brackets } from "typeorm"; +import { UserLists, UserListJoinings, Notes } from "@/models/index.js"; +import { activeUsersChart } from "@/services/chart/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { activeUsersChart } from "@/services/chart/index.js"; -import { Brackets } from "typeorm"; +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 f5faf5adac..ec13f5aa2a 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 { getNote } from "@/server/api/common/getters.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; import watch from "@/services/note/watch.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 f4bea44108..18994fa80c 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 { getNote } from "@/server/api/common/getters.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; import unwatch from "@/services/note/unwatch.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 f29a30ac36..2077cceba4 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 define from "@/server/api/define.js"; import { createNotification } from "@/services/create-notification.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 06539dd155..568036380a 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 "@/server/api/define.js"; -import { pushNotification } from "@/services/push-notification.js"; -import { publishMainStream } from "@/services/stream.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 534d3f78ed..358ca062fe 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 { readNotification } from "@/server/api/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 194129e438..1f87372d61 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 { Pages, Users } from "@/models/index.js"; +import { publishMainStream } from "@/services/stream.js"; +import { Users, Pages } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { publishMainStream } from "@/services/stream.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 cac0fd3b18..ea0f8ba83e 100644 --- a/packages/backend/src/server/api/endpoints/pages/create.ts +++ b/packages/backend/src/server/api/endpoints/pages/create.ts @@ -1,9 +1,9 @@ -import { HOUR } from "@/const.js"; +import { Pages, DriveFiles } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import { Page } from "@/models/entities/page.js"; -import { DriveFiles, Pages } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; +import { HOUR } from "@/const.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 4a396786db..ab64b9b93e 100644 --- a/packages/backend/src/server/api/endpoints/pages/like.ts +++ b/packages/backend/src/server/api/endpoints/pages/like.ts @@ -1,5 +1,5 @@ +import { Pages, PageLikes } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; -import { PageLikes, Pages } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; diff --git a/packages/backend/src/server/api/endpoints/pages/show.ts b/packages/backend/src/server/api/endpoints/pages/show.ts index 54b6b3ccc8..ac347cf139 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 type { Page } from "@/models/entities/page.js"; +import { IsNull } from "typeorm"; import { Pages, Users } from "@/models/index.js"; +import type { Page } from "@/models/entities/page.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { IsNull } from "typeorm"; 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 3b020709ed..428f984582 100644 --- a/packages/backend/src/server/api/endpoints/pages/unlike.ts +++ b/packages/backend/src/server/api/endpoints/pages/unlike.ts @@ -1,4 +1,4 @@ -import { PageLikes, Pages } from "@/models/index.js"; +import { Pages, PageLikes } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; diff --git a/packages/backend/src/server/api/endpoints/pages/update.ts b/packages/backend/src/server/api/endpoints/pages/update.ts index 3189c140ab..5f434d02e1 100644 --- a/packages/backend/src/server/api/endpoints/pages/update.ts +++ b/packages/backend/src/server/api/endpoints/pages/update.ts @@ -1,8 +1,8 @@ -import { HOUR } from "@/const.js"; -import { DriveFiles, Pages } from "@/models/index.js"; +import { Not } from "typeorm"; +import { Pages, DriveFiles } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { Not } from "typeorm"; +import { HOUR } from "@/const.js"; export const meta = { tags: ["pages"], diff --git a/packages/backend/src/server/api/endpoints/patrons.ts b/packages/backend/src/server/api/endpoints/patrons.ts index cb939caa51..12a41742b0 100644 --- a/packages/backend/src/server/api/endpoints/patrons.ts +++ b/packages/backend/src/server/api/endpoints/patrons.ts @@ -1,8 +1,8 @@ -import * as fs from "node:fs"; -import { dirname } from "node:path"; -import { fileURLToPath } from "node:url"; -import { redisClient } from "@/db/redis.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"; +import { dirname } from "node:path"; const _filename = fileURLToPath(import.meta.url); const _dirname = dirname(_filename); diff --git a/packages/backend/src/server/api/endpoints/pinned-users.ts b/packages/backend/src/server/api/endpoints/pinned-users.ts index b75eb3f215..b327378700 100644 --- a/packages/backend/src/server/api/endpoints/pinned-users.ts +++ b/packages/backend/src/server/api/endpoints/pinned-users.ts @@ -1,9 +1,9 @@ -import * as Acct from "@/misc/acct.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import type { User } from "@/models/entities/user.js"; -import { Users } from "@/models/index.js"; -import define from "@/server/api/define.js"; import { IsNull } from "typeorm"; +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 "@/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 eb1cc12854..4b41467906 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 { genId } from "@/misc/gen-id.js"; import { PromoReads } from "@/models/index.js"; -import { getNote } from "@/server/api/common/getters.js"; +import { genId } from "@/misc/gen-id.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/renote-mute/create.ts b/packages/backend/src/server/api/endpoints/renote-mute/create.ts index 6b020c2a2c..afe23f38da 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 { RenoteMuting } from "@/models/entities/renote-muting.js"; import { RenoteMutings } from "@/models/index.js"; -import { getUser } from "@/server/api/common/getters.js"; +import { RenoteMuting } from "@/models/entities/renote-muting.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 436ff8a8e5..6a824881b0 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 { getUser } from "@/server/api/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 9dbea92416..b19452714d 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 { makePaginationQuery } from "@/server/api/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 802b882edc..3c78058af2 100644 --- a/packages/backend/src/server/api/endpoints/request-reset-password.ts +++ b/packages/backend/src/server/api/endpoints/request-reset-password.ts @@ -1,11 +1,11 @@ -import config from "@/config/index.js"; -import { HOUR } from "@/const.js"; -import { genId } from "@/misc/gen-id.js"; -import { PasswordResetRequests, UserProfiles, Users } from "@/models/index.js"; -import define from "@/server/api/define.js"; -import { sendEmail } from "@/services/send-email.js"; import rndstr from "rndstr"; import { IsNull } from "typeorm"; +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 define from "@/server/api/define.js"; +import { HOUR } from "@/const.js"; export const meta = { tags: ["reset password"], diff --git a/packages/backend/src/server/api/endpoints/reset-password.ts b/packages/backend/src/server/api/endpoints/reset-password.ts index 8f642f8845..ff5c8d987f 100644 --- a/packages/backend/src/server/api/endpoints/reset-password.ts +++ b/packages/backend/src/server/api/endpoints/reset-password.ts @@ -1,6 +1,6 @@ -import { hashPassword } from "@/misc/password.js"; -import { PasswordResetRequests, UserProfiles } from "@/models/index.js"; +import { UserProfiles, PasswordResetRequests } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { hashPassword } from "@/misc/password.js"; export const meta = { tags: ["reset password"], diff --git a/packages/backend/src/server/api/endpoints/server-info.ts b/packages/backend/src/server/api/endpoints/server-info.ts index dd9ff1627e..ff3bfcd100 100644 --- a/packages/backend/src/server/api/endpoints/server-info.ts +++ b/packages/backend/src/server/api/endpoints/server-info.ts @@ -1,8 +1,8 @@ import * as os from "node:os"; +import si from "systeminformation"; +import define from "@/server/api/define.js"; import meilisearch from "@/db/meilisearch.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; -import define from "@/server/api/define.js"; -import si from "systeminformation"; export const meta = { requireCredential: false, diff --git a/packages/backend/src/server/api/endpoints/username/available.ts b/packages/backend/src/server/api/endpoints/username/available.ts index 88c5964bce..cd634a798a 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 config from "@/config/index.js"; -import { UsedUsernames, Users } from "@/models/index.js"; -import define from "@/server/api/define.js"; import { IsNull } from "typeorm"; +import { Users, UsedUsernames } from "@/models/index.js"; +import config from "@/config/index.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 f8a24c2901..20371fce9f 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 { generateBlockQueryForUsers } from "@/server/api/common/generate-block-query.js"; -import { generateMutedUserQueryForUsers } from "@/server/api/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 { 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 f57c3cfd1a..132e190bb6 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 { makePaginationQuery } from "@/server/api/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 05847a10aa..f57983d4b9 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 { Followings, UserProfiles, Users } from "@/models/index.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { IsNull } from "typeorm"; +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 12f4e794b7..84eb7cccc5 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 { Followings, UserProfiles, Users } from "@/models/index.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { IsNull } from "typeorm"; +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 dad29f4357..e2edbee86a 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 "@/server/api/define.js"; import { GalleryPosts } from "@/models/index.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import define from "@/server/api/define.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 3a4caf9833..0694bd6632 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 { Notes, Users } from "@/models/index.js"; +import { Not, In, IsNull } from "typeorm"; import { maximum } from "@/prelude/array.js"; -import { getUser } from "@/server/api/common/getters.js"; +import { Notes, Users } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { In, IsNull, Not } from "typeorm"; +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 797906e798..1cfb223013 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/create.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/create.ts @@ -1,7 +1,7 @@ +import { UserGroups, UserGroupJoinings } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; -import type { UserGroupJoining } from "@/models/entities/user-group-joining.js"; import type { UserGroup } from "@/models/entities/user-group.js"; -import { UserGroupJoinings, UserGroups } from "@/models/index.js"; +import type { UserGroupJoining } from "@/models/entities/user-group-joining.js"; import define from "@/server/api/define.js"; export const meta = { 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 dc739da5d1..a483ccd184 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 { UserGroupInvitations, UserGroupJoinings } from "@/models/index.js"; -import define from "@/server/api/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/invite.ts b/packages/backend/src/server/api/endpoints/users/groups/invite.ts index bdc5f2a8e5..8a1e6b31ed 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/invite.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/invite.ts @@ -1,14 +1,14 @@ +import { + UserGroups, + UserGroupJoinings, + UserGroupInvitations, +} from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import type { UserGroupInvitation } from "@/models/entities/user-group-invitation.js"; -import { - UserGroupInvitations, - UserGroupJoinings, - UserGroups, -} from "@/models/index.js"; -import { getUser } from "@/server/api/common/getters.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; import { createNotification } from "@/services/create-notification.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 aa9df7f917..5d50b5e33c 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 { UserGroupJoinings, UserGroups } from "@/models/index.js"; +import { Not, In } from "typeorm"; +import { UserGroups, UserGroupJoinings } from "@/models/index.js"; import define from "@/server/api/define.js"; -import { In, Not } from "typeorm"; 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 e01b8e1686..8165b1d988 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/leave.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/leave.ts @@ -1,4 +1,4 @@ -import { UserGroupJoinings, UserGroups } from "@/models/index.js"; +import { UserGroups, UserGroupJoinings } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; 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 a20ac7331a..5e7f91d70a 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 { UserGroupJoinings, UserGroups } from "@/models/index.js"; -import { getUser } from "@/server/api/common/getters.js"; +import { UserGroups, UserGroupJoinings } from "@/models/index.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 20c7f0e877..0cd5a92331 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/show.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/show.ts @@ -1,4 +1,4 @@ -import { UserGroupJoinings, UserGroups } from "@/models/index.js"; +import { UserGroups, UserGroupJoinings } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; 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 e742365c0c..b58ea57b7f 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 { UserGroupJoinings, UserGroups } from "@/models/index.js"; -import { getUser } from "@/server/api/common/getters.js"; +import { UserGroups, UserGroupJoinings } from "@/models/index.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/lists/create.ts b/packages/backend/src/server/api/endpoints/users/lists/create.ts index d506b49afc..c23e8f6f53 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/create.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/create.ts @@ -1,6 +1,6 @@ +import { UserLists } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import type { UserList } from "@/models/entities/user-list.js"; -import { UserLists } from "@/models/index.js"; import define from "@/server/api/define.js"; export const meta = { 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 69dc272706..ffca5b205a 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 { UserListJoinings, UserLists, Users } from "@/models/index.js"; -import { getUser } from "@/server/api/common/getters.js"; +import { publishUserListStream } from "@/services/stream.js"; +import { UserLists, UserListJoinings, Users } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { publishUserListStream } from "@/services/stream.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 2aa8c425e7..8dd4442d00 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 { Blockings, UserListJoinings, UserLists } from "@/models/index.js"; -import { getUser } from "@/server/api/common/getters.js"; +import { pushUserToUserList } from "@/services/user-list/push.js"; +import { UserLists, UserListJoinings, Blockings } from "@/models/index.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { pushUserToUserList } from "@/services/user-list/push.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/notes.ts b/packages/backend/src/server/api/endpoints/users/notes.ts index 63a74276bc..1485dfa6c5 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 { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; -import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; -import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; -import { getUser } from "@/server/api/common/getters.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; import define from "@/server/api/define.js"; import { ApiError } from "@/server/api/error.js"; -import { Brackets } from "typeorm"; +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 774e48716b..1af50e78a9 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 { makePaginationQuery } from "@/server/api/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 3a41c671b5..483a78865f 100644 --- a/packages/backend/src/server/api/endpoints/users/reactions.ts +++ b/packages/backend/src/server/api/endpoints/users/reactions.ts @@ -1,7 +1,7 @@ import { NoteReactions, UserProfiles } from "@/models/index.js"; -import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-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 { ApiError } from "@/server/api/error.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/users/recommendation.ts b/packages/backend/src/server/api/endpoints/users/recommendation.ts index 6b65d92e3c..4ea0d618ed 100644 --- a/packages/backend/src/server/api/endpoints/users/recommendation.ts +++ b/packages/backend/src/server/api/endpoints/users/recommendation.ts @@ -1,11 +1,11 @@ -import { DAY } from "@/const.js"; -import { Followings, Users } from "@/models/index.js"; -import { - generateBlockQueryForUsers, - generateBlockedUserQuery, -} from "@/server/api/common/generate-block-query.js"; -import { generateMutedUserQueryForUsers } from "@/server/api/common/generate-muted-user-query.js"; +import { Users, Followings } from "@/models/index.js"; import define from "@/server/api/define.js"; +import { generateMutedUserQueryForUsers } from "@/server/api/common/generate-muted-user-query.js"; +import { + generateBlockedUserQuery, + generateBlockQueryForUsers, +} from "@/server/api/common/generate-block-query.js"; +import { DAY } from "@/const.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 988dfa9dab..7e9ba7238c 100644 --- a/packages/backend/src/server/api/endpoints/users/report-abuse.ts +++ b/packages/backend/src/server/api/endpoints/users/report-abuse.ts @@ -1,14 +1,14 @@ -import { toHtml } from "@/mfm/to-html.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import { genId } from "@/misc/gen-id.js"; -import { AbuseUserReports, UserProfiles, Users } from "@/models/index.js"; -import { getUser } from "@/server/api/common/getters.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; -import { sendEmail } from "@/services/send-email.js"; -import { publishAdminStream } from "@/services/stream.js"; import * as mfm from "mfm-js"; import sanitizeHtml from "sanitize-html"; +import { publishAdminStream } from "@/services/stream.js"; +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 "@/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 = { tags: ["users"], 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 44a10ec681..517ef615b1 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,8 @@ -import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; -import type { User } from "@/models/entities/user.js"; -import { Followings, Users } from "@/models/index.js"; -import define from "@/server/api/define.js"; import { Brackets } from "typeorm"; +import { Followings, Users } from "@/models/index.js"; +import type { User } from "@/models/entities/user.js"; +import define from "@/server/api/define.js"; +import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/users/search.ts b/packages/backend/src/server/api/endpoints/users/search.ts index bfb1560a7e..3aef6dc901 100644 --- a/packages/backend/src/server/api/endpoints/users/search.ts +++ b/packages/backend/src/server/api/endpoints/users/search.ts @@ -1,8 +1,8 @@ -import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; -import type { User } from "@/models/entities/user.js"; -import { UserProfiles, Users } from "@/models/index.js"; -import define from "@/server/api/define.js"; import { Brackets } from "typeorm"; +import { UserProfiles, Users } from "@/models/index.js"; +import type { User } from "@/models/entities/user.js"; +import define from "@/server/api/define.js"; +import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/users/show.ts b/packages/backend/src/server/api/endpoints/users/show.ts index a7704a85be..61812a0189 100644 --- a/packages/backend/src/server/api/endpoints/users/show.ts +++ b/packages/backend/src/server/api/endpoints/users/show.ts @@ -1,11 +1,11 @@ -import type { User } from "@/models/entities/user.js"; -import { Users } from "@/models/index.js"; -import { resolveUser } from "@/remote/resolve-user.js"; -import define from "@/server/api/define.js"; -import { ApiError } from "@/server/api/error.js"; -import { apiLogger } from "@/server/api/logger.js"; import type { FindOptionsWhere } from "typeorm"; 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 "@/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/index.ts b/packages/backend/src/server/api/index.ts index edce9be2be..a5970d5843 100644 --- a/packages/backend/src/server/api/index.ts +++ b/packages/backend/src/server/api/index.ts @@ -2,31 +2,31 @@ * API Server */ -import config from "@/config/index.js"; -import { AccessTokens, Users } from "@/models/index.js"; -import cors from "@koa/cors"; -import multer from "@koa/multer"; -import Router from "@koa/router"; import Koa from "koa"; -import { koaBody } from "koa-body"; +import Router from "@koa/router"; +import multer from "@koa/multer"; import bodyParser from "koa-bodyparser"; -import handler from "./api-handler.js"; -import compatibility from "./compatibility.js"; -import endpoints from "./endpoints.js"; +import cors from "@koa/cors"; import { apiMastodonCompatible, getClient, } from "./mastodon/ApiMastodonCompatibleService.js"; -import { convertAttachment } from "./mastodon/converters.js"; +import { AccessTokens, Users } from "@/models/index.js"; +import config from "@/config/index.js"; +import endpoints from "./endpoints.js"; +import compatibility from "./compatibility.js"; +import handler from "./api-handler.js"; +import signup from "./private/signup.js"; import signin from "./private/signin.js"; import signupPending from "./private/signup-pending.js"; -import signup from "./private/signup.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 { - IdConvertType as IdType, convertId, + IdConvertType as IdType, } from "native-utils/built/index.js"; // re-export native rust id conversion (function and enum) diff --git a/packages/backend/src/server/api/limiter.ts b/packages/backend/src/server/api/limiter.ts index edaed8f2d8..f03f8754cf 100644 --- a/packages/backend/src/server/api/limiter.ts +++ b/packages/backend/src/server/api/limiter.ts @@ -1,8 +1,8 @@ -import { redisClient } from "@/db/redis.js"; -import { convertMilliseconds } from "@/misc/convert-milliseconds.js"; -import Logger from "@/services/logger.js"; import Limiter from "ratelimiter"; +import Logger from "@/services/logger.js"; +import { redisClient } from "@/db/redis.js"; import type { IEndpointMeta } from "./endpoints.js"; +import { convertMilliseconds } from "@/misc/convert-milliseconds.js"; const logger = new Logger("limiter"); diff --git a/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts b/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts index c58709eac0..e029bc604e 100644 --- a/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts +++ b/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts @@ -1,21 +1,21 @@ -import { Users } from "@/models/index.js"; -import { IdType, convertId } from "@/server/api/index.js"; import Router from "@koa/router"; import megalodon, { MegalodonInterface } from "megalodon"; -import { IsNull } from "typeorm"; +import { apiAuthMastodon } from "./endpoints/auth.js"; +import { apiAccountMastodon } from "./endpoints/account.js"; +import { apiStatusMastodon } from "./endpoints/status.js"; +import { apiFilterMastodon } from "./endpoints/filter.js"; +import { apiTimelineMastodon } from "./endpoints/timeline.js"; +import { apiNotificationsMastodon } from "./endpoints/notifications.js"; +import { apiSearchMastodon } from "./endpoints/search.js"; +import { getInstance } from "./endpoints/meta.js"; import { convertAccount, convertAnnouncement, convertFilter, } from "./converters.js"; -import { apiAccountMastodon } from "./endpoints/account.js"; -import { apiAuthMastodon } from "./endpoints/auth.js"; -import { apiFilterMastodon } from "./endpoints/filter.js"; -import { getInstance } from "./endpoints/meta.js"; -import { apiNotificationsMastodon } from "./endpoints/notifications.js"; -import { apiSearchMastodon } from "./endpoints/search.js"; -import { apiStatusMastodon } from "./endpoints/status.js"; -import { apiTimelineMastodon } from "./endpoints/timeline.js"; +import { convertId, IdType } from "@/server/api/index.js"; +import { Users } from "@/models/index.js"; +import { IsNull } from "typeorm"; export function getClient( BASE_URL: string, diff --git a/packages/backend/src/server/api/mastodon/converters.ts b/packages/backend/src/server/api/mastodon/converters.ts index 03217d800d..30506d9c51 100644 --- a/packages/backend/src/server/api/mastodon/converters.ts +++ b/packages/backend/src/server/api/mastodon/converters.ts @@ -1,5 +1,5 @@ -import { IdType, convertId } from "@/server/api/index.js"; import { Entity } from "megalodon"; +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 9d9c2c54fa..76c3af378d 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/account.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/account.ts @@ -1,6 +1,7 @@ -import { IdType, convertId } from "@/server/api/index.js"; import Router from "@koa/router"; import { getClient } from "../ApiMastodonCompatibleService.js"; +import { argsToBools, convertTimelinesArgsId, limitToInt } from "./timeline.js"; +import { convertId, IdType } from "@/server/api/index.js"; import { convertAccount, convertFeaturedTag, @@ -8,7 +9,6 @@ import { convertRelationship, convertStatus, } from "../converters.js"; -import { argsToBools, convertTimelinesArgsId, limitToInt } from "./timeline.js"; const relationshipModel = { id: "", @@ -34,7 +34,7 @@ export function apiAccountMastodon(router: Router): void { const client = getClient(BASE_URL, accessTokens); try { const data = await client.verifyAccountCredentials(); - const acct = data.data; + let acct = data.data; acct.id = convertId(acct.id, IdType.MastodonId); acct.display_name = acct.display_name || acct.username; acct.url = `${BASE_URL}/@${acct.url}`; @@ -109,7 +109,7 @@ export function apiAccountMastodon(router: Router): void { return; } - const reqIds = []; + let reqIds = []; for (let i = 0; i < ids.length; i++) { reqIds.push(convertId(ids[i], IdType.FirefishId)); } @@ -120,7 +120,7 @@ export function apiAccountMastodon(router: Router): void { ); } catch (e: any) { console.error(e); - const data = e.response.data; + let data = e.response.data; data.users = users; console.error(data); ctx.status = 401; @@ -250,7 +250,7 @@ export function apiAccountMastodon(router: Router): void { const data = await client.followAccount( convertId(ctx.params.id, IdType.FirefishId), ); - const acct = convertRelationship(data.data); + let acct = convertRelationship(data.data); acct.following = true; ctx.body = acct; } catch (e: any) { @@ -271,7 +271,7 @@ export function apiAccountMastodon(router: Router): void { const data = await client.unfollowAccount( convertId(ctx.params.id, IdType.FirefishId), ); - const acct = convertRelationship(data.data); + let acct = convertRelationship(data.data); acct.following = false; ctx.body = acct; } catch (e: any) { diff --git a/packages/backend/src/server/api/mastodon/endpoints/filter.ts b/packages/backend/src/server/api/mastodon/endpoints/filter.ts index a3a6c33c36..6524fd2f6e 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/filter.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/filter.ts @@ -1,6 +1,6 @@ -import { IdType, convertId } from "@/server/api/index.js"; import Router from "@koa/router"; import { getClient } from "../ApiMastodonCompatibleService.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/meta.ts b/packages/backend/src/server/api/mastodon/endpoints/meta.ts index 52e43ff8c3..c458798d5f 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/meta.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/meta.ts @@ -1,7 +1,7 @@ -import config from "@/config/index.js"; -import { FILE_TYPE_BROWSERSAFE, MAX_NOTE_TEXT_LENGTH } from "@/const.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; import { Entity } from "megalodon"; +import config from "@/config/index.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; +import { MAX_NOTE_TEXT_LENGTH, FILE_TYPE_BROWSERSAFE } from "@/const.js"; export async function getInstance( response: Entity.Instance, diff --git a/packages/backend/src/server/api/mastodon/endpoints/notifications.ts b/packages/backend/src/server/api/mastodon/endpoints/notifications.ts index da59004673..9628eccdde 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/notifications.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/notifications.ts @@ -1,8 +1,8 @@ -import { IdType, convertId } from "@/server/api/index.js"; import Router from "@koa/router"; +import { convertId, IdType } from "@/server/api/index.js"; import { getClient } from "../ApiMastodonCompatibleService.js"; -import { convertNotification } from "../converters.js"; import { convertTimelinesArgsId } from "./timeline.js"; +import { convertNotification } from "../converters.js"; function toLimitToInt(q: any) { if (q.limit) if (typeof q.limit === "string") q.limit = parseInt(q.limit, 10); return q; diff --git a/packages/backend/src/server/api/mastodon/endpoints/search.ts b/packages/backend/src/server/api/mastodon/endpoints/search.ts index d6ef388b64..c9bbab0a4f 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/search.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/search.ts @@ -1,9 +1,9 @@ import Router from "@koa/router"; +import { getClient } from "../ApiMastodonCompatibleService.js"; import axios from "axios"; import { Converter } from "megalodon"; -import { getClient } from "../ApiMastodonCompatibleService.js"; -import { convertAccount, convertStatus } from "../converters.js"; import { convertTimelinesArgsId, limitToInt } from "./timeline.js"; +import { convertAccount, convertStatus } from "../converters.js"; export function apiSearchMastodon(router: Router): void { router.get("/v1/search", async (ctx) => { diff --git a/packages/backend/src/server/api/mastodon/endpoints/status.ts b/packages/backend/src/server/api/mastodon/endpoints/status.ts index 6c6c0211cc..ac1cbe602d 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/status.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/status.ts @@ -1,17 +1,17 @@ -import querystring from "node:querystring"; -import { emojiRegexAtStartToEnd } from "@/misc/emoji-regex.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import { IdType, convertId } from "@/server/api/index.js"; import Router from "@koa/router"; -import qs from "qs"; import { getClient } from "../ApiMastodonCompatibleService.js"; +import { emojiRegexAtStartToEnd } from "@/misc/emoji-regex.js"; +import querystring from "node:querystring"; +import qs from "qs"; +import { convertTimelinesArgsId, limitToInt } from "./timeline.js"; +import { convertId, IdType } from "@/server/api/index.js"; import { convertAccount, convertAttachment, convertPoll, convertStatus, } from "../converters.js"; -import { convertTimelinesArgsId, limitToInt } from "./timeline.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; function normalizeQuery(data: any) { const str = querystring.stringify(data); diff --git a/packages/backend/src/server/api/mastodon/endpoints/timeline.ts b/packages/backend/src/server/api/mastodon/endpoints/timeline.ts index 747afc089a..05741c4cef 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/timeline.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/timeline.ts @@ -1,16 +1,16 @@ -import { ParsedUrlQuery } from "querystring"; -import { IdType, convertId } from "@/server/api/index.js"; import Router from "@koa/router"; import { getClient } from "../ApiMastodonCompatibleService.js"; +import { ParsedUrlQuery } from "querystring"; import { convertAccount, convertConversation, convertList, convertStatus, } from "../converters.js"; +import { convertId, IdType } from "@/server/api/index.js"; export function limitToInt(q: ParsedUrlQuery) { - const object: any = q; + let object: any = q; if (q.limit) if (typeof q.limit === "string") object.limit = parseInt(q.limit, 10); if (q.offset) @@ -27,7 +27,7 @@ export function argsToBools(q: ParsedUrlQuery) { // - https://docs.joinmastodon.org/methods/accounts/#statuses // - https://docs.joinmastodon.org/methods/timelines/#public // - https://docs.joinmastodon.org/methods/timelines/#tag - const object: any = q; + let object: any = q; if (q.only_media) if (typeof q.only_media === "string") object.only_media = toBoolean(q.only_media); diff --git a/packages/backend/src/server/api/openapi/gen-spec.ts b/packages/backend/src/server/api/openapi/gen-spec.ts index 02164e87fc..ec8c1ca036 100644 --- a/packages/backend/src/server/api/openapi/gen-spec.ts +++ b/packages/backend/src/server/api/openapi/gen-spec.ts @@ -1,7 +1,7 @@ -import config from "@/config/index.js"; import endpoints from "@/server/api/endpoints.js"; +import config from "@/config/index.js"; import { errors as basicErrors } from "./errors.js"; -import { convertSchemaToOpenApiSchema, schemas } from "./schemas.js"; +import { schemas, convertSchemaToOpenApiSchema } from "./schemas.js"; export function genOpenapiSpec() { const spec = { diff --git a/packages/backend/src/server/api/private/signin.ts b/packages/backend/src/server/api/private/signin.ts index 8db5c95fff..3e70d80fe2 100644 --- a/packages/backend/src/server/api/private/signin.ts +++ b/packages/backend/src/server/api/private/signin.ts @@ -1,26 +1,26 @@ -import { randomBytes } from "node:crypto"; +import type Koa from "koa"; +import * as OTPAuth from "otpauth"; +import signin from "@/server/api/common/signin.js"; import config from "@/config/index.js"; +import { + Users, + Signins, + UserProfiles, + UserSecurityKeys, + AttestationChallenges, +} from "@/models/index.js"; +import type { ILocalUser } from "@/models/entities/user.js"; import { genId } from "@/misc/gen-id.js"; -import { getIpHash } from "@/misc/get-ip-hash.js"; import { comparePassword, hashPassword, isOldAlgorithm, } from "@/misc/password.js"; -import type { ILocalUser } from "@/models/entities/user.js"; -import { - AttestationChallenges, - Signins, - UserProfiles, - UserSecurityKeys, - Users, -} from "@/models/index.js"; -import { hash, verifyLogin } from "@/server/api/2fa.js"; -import signin from "@/server/api/common/signin.js"; -import { limiter } from "@/server/api/limiter.js"; -import type Koa from "koa"; -import * as OTPAuth from "otpauth"; +import { verifyLogin, hash } from "@/server/api/2fa.js"; +import { randomBytes } from "node:crypto"; import { IsNull } from "typeorm"; +import { limiter } from "@/server/api/limiter.js"; +import { getIpHash } from "@/misc/get-ip-hash.js"; export default async (ctx: Koa.Context) => { ctx.set("Access-Control-Allow-Origin", config.url); diff --git a/packages/backend/src/server/api/private/signup-pending.ts b/packages/backend/src/server/api/private/signup-pending.ts index 3a422c91c4..b92fb90b37 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 { UserPendings, UserProfiles } from "@/models/index.js"; -import signin from "@/server/api/common/signin.js"; -import { signup } from "@/server/api/common/signup.js"; import type Koa from "koa"; +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 511c34ff32..d60e5a1910 100644 --- a/packages/backend/src/server/api/private/signup.ts +++ b/packages/backend/src/server/api/private/signup.ts @@ -1,14 +1,14 @@ -import config from "@/config/index.js"; -import { verifyHcaptcha, verifyRecaptcha } from "@/misc/captcha.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import { genId } from "@/misc/gen-id.js"; -import { hashPassword } from "@/misc/password.js"; -import { RegistrationTickets, UserPendings, Users } from "@/models/index.js"; -import { signup } from "@/server/api/common/signup.js"; -import { sendEmail } from "@/services/send-email.js"; -import { validateEmailForAccount } from "@/services/validate-email-for-account.js"; import type Koa from "koa"; 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 "@/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"; +import { validateEmailForAccount } from "@/services/validate-email-for-account.js"; +import { hashPassword } from "@/misc/password.js"; export default async (ctx: Koa.Context) => { const body = ctx.request.body; diff --git a/packages/backend/src/server/api/private/verify-email.ts b/packages/backend/src/server/api/private/verify-email.ts index b480b38785..e6c8295d18 100644 --- a/packages/backend/src/server/api/private/verify-email.ts +++ b/packages/backend/src/server/api/private/verify-email.ts @@ -1,6 +1,6 @@ -import { UserProfiles, Users } from "@/models/index.js"; -import { publishMainStream } from "@/services/stream.js"; import type Koa from "koa"; +import { Users, UserProfiles } from "@/models/index.js"; +import { publishMainStream } from "@/services/stream.js"; export default async (ctx: Koa.Context) => { const body = ctx.request.body; diff --git a/packages/backend/src/server/api/stream/channel.ts b/packages/backend/src/server/api/stream/channel.ts index 67681b993e..fc8e0ce35e 100644 --- a/packages/backend/src/server/api/stream/channel.ts +++ b/packages/backend/src/server/api/stream/channel.ts @@ -1,8 +1,8 @@ -import { IdentifiableError } from "@/misc/identifiable-error.js"; -import type { Packed } from "@/misc/schema.js"; +import type Connection from "."; import type { Note } from "@/models/entities/note.js"; import { Notes } from "@/models/index.js"; -import type Connection from "."; +import type { Packed } from "@/misc/schema.js"; +import { IdentifiableError } from "@/misc/identifiable-error.js"; /** * Stream channel diff --git a/packages/backend/src/server/api/stream/channels/antenna.ts b/packages/backend/src/server/api/stream/channels/antenna.ts index 6aae49d150..ec5a8b175f 100644 --- a/packages/backend/src/server/api/stream/channels/antenna.ts +++ b/packages/backend/src/server/api/stream/channels/antenna.ts @@ -1,8 +1,8 @@ -import { IdentifiableError } from "@/misc/identifiable-error.js"; -import { isUserRelated } from "@/misc/is-user-related.js"; -import { Notes } from "@/models/index.js"; import Channel from "../channel.js"; +import { Notes } from "@/models/index.js"; +import { isUserRelated } from "@/misc/is-user-related.js"; import type { StreamMessages } from "../types.js"; +import { IdentifiableError } from "@/misc/identifiable-error.js"; export default class extends Channel { public readonly chName = "antenna"; diff --git a/packages/backend/src/server/api/stream/channels/channel.ts b/packages/backend/src/server/api/stream/channels/channel.ts index b668544b84..2ff4e08209 100644 --- a/packages/backend/src/server/api/stream/channels/channel.ts +++ b/packages/backend/src/server/api/stream/channels/channel.ts @@ -1,9 +1,9 @@ -import { isUserRelated } from "@/misc/is-user-related.js"; -import type { Packed } from "@/misc/schema.js"; -import type { User } from "@/models/entities/user.js"; -import { Users } from "@/models/index.js"; import Channel from "../channel.js"; +import { Users } from "@/models/index.js"; +import { isUserRelated } from "@/misc/is-user-related.js"; +import type { User } from "@/models/entities/user.js"; import type { StreamMessages } from "../types.js"; +import type { Packed } from "@/misc/schema.js"; export default class extends Channel { public readonly chName = "channel"; diff --git a/packages/backend/src/server/api/stream/channels/global-timeline.ts b/packages/backend/src/server/api/stream/channels/global-timeline.ts index a5af7038d0..e750ac92b1 100644 --- a/packages/backend/src/server/api/stream/channels/global-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/global-timeline.ts @@ -1,9 +1,9 @@ -import { getWordHardMute } from "@/misc/check-word-mute.js"; +import Channel from "../channel.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; +import { getWordHardMute } from "@/misc/check-word-mute.js"; import { isInstanceMuted } from "@/misc/is-instance-muted.js"; import { isUserRelated } from "@/misc/is-user-related.js"; import type { Packed } from "@/misc/schema.js"; -import Channel from "../channel.js"; export default class extends Channel { public readonly chName = "globalTimeline"; diff --git a/packages/backend/src/server/api/stream/channels/hashtag.ts b/packages/backend/src/server/api/stream/channels/hashtag.ts index d44fef1105..011bb0889d 100644 --- a/packages/backend/src/server/api/stream/channels/hashtag.ts +++ b/packages/backend/src/server/api/stream/channels/hashtag.ts @@ -1,7 +1,7 @@ -import { isUserRelated } from "@/misc/is-user-related.js"; -import { normalizeForSearch } from "@/misc/normalize-for-search.js"; -import type { Packed } from "@/misc/schema.js"; import Channel from "../channel.js"; +import { normalizeForSearch } from "@/misc/normalize-for-search.js"; +import { isUserRelated } from "@/misc/is-user-related.js"; +import type { Packed } from "@/misc/schema.js"; export default class extends Channel { public readonly chName = "hashtag"; diff --git a/packages/backend/src/server/api/stream/channels/home-timeline.ts b/packages/backend/src/server/api/stream/channels/home-timeline.ts index 0136d3e7ae..5aafe865b3 100644 --- a/packages/backend/src/server/api/stream/channels/home-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/home-timeline.ts @@ -1,8 +1,8 @@ -import { getWordHardMute } from "@/misc/check-word-mute.js"; -import { isInstanceMuted } from "@/misc/is-instance-muted.js"; -import { isUserRelated } from "@/misc/is-user-related.js"; -import type { Packed } from "@/misc/schema.js"; import Channel from "../channel.js"; +import { getWordHardMute } from "@/misc/check-word-mute.js"; +import { isUserRelated } from "@/misc/is-user-related.js"; +import { isInstanceMuted } from "@/misc/is-instance-muted.js"; +import type { Packed } from "@/misc/schema.js"; export default class extends Channel { public readonly chName = "homeTimeline"; diff --git a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts index cfca4cec53..2ec53a3fa9 100644 --- a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts @@ -1,9 +1,9 @@ -import { getWordHardMute } from "@/misc/check-word-mute.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import { isInstanceMuted } from "@/misc/is-instance-muted.js"; -import { isUserRelated } from "@/misc/is-user-related.js"; -import type { Packed } from "@/misc/schema.js"; import Channel from "../channel.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; +import { getWordHardMute } from "@/misc/check-word-mute.js"; +import { isUserRelated } from "@/misc/is-user-related.js"; +import { isInstanceMuted } from "@/misc/is-instance-muted.js"; +import type { Packed } from "@/misc/schema.js"; export default class extends Channel { public readonly chName = "hybridTimeline"; diff --git a/packages/backend/src/server/api/stream/channels/index.ts b/packages/backend/src/server/api/stream/channels/index.ts index 60d703e52c..d1127be47c 100644 --- a/packages/backend/src/server/api/stream/channels/index.ts +++ b/packages/backend/src/server/api/stream/channels/index.ts @@ -1,19 +1,19 @@ -import admin from "./admin.js"; -import antenna from "./antenna.js"; -import channel from "./channel.js"; -import drive from "./drive.js"; -import globalTimeline from "./global-timeline.js"; -import hashtag from "./hashtag.js"; -import homeTimeline from "./home-timeline.js"; -import hybridTimeline from "./hybrid-timeline.js"; -import localTimeline from "./local-timeline.js"; import main from "./main.js"; -import messagingIndex from "./messaging-index.js"; -import messaging from "./messaging.js"; -import queueStats from "./queue-stats.js"; +import homeTimeline from "./home-timeline.js"; +import localTimeline from "./local-timeline.js"; +import hybridTimeline from "./hybrid-timeline.js"; import recommendedTimeline from "./recommended-timeline.js"; +import globalTimeline from "./global-timeline.js"; import serverStats from "./server-stats.js"; +import queueStats from "./queue-stats.js"; import userList from "./user-list.js"; +import antenna from "./antenna.js"; +import messaging from "./messaging.js"; +import messagingIndex from "./messaging-index.js"; +import drive from "./drive.js"; +import hashtag from "./hashtag.js"; +import channel from "./channel.js"; +import admin from "./admin.js"; export default { main, diff --git a/packages/backend/src/server/api/stream/channels/local-timeline.ts b/packages/backend/src/server/api/stream/channels/local-timeline.ts index 3cbac3b88e..40e38c24f0 100644 --- a/packages/backend/src/server/api/stream/channels/local-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/local-timeline.ts @@ -1,8 +1,8 @@ -import { getWordHardMute } from "@/misc/check-word-mute.js"; +import Channel from "../channel.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; +import { getWordHardMute } from "@/misc/check-word-mute.js"; import { isUserRelated } from "@/misc/is-user-related.js"; import type { Packed } from "@/misc/schema.js"; -import Channel from "../channel.js"; export default class extends Channel { public readonly chName = "localTimeline"; diff --git a/packages/backend/src/server/api/stream/channels/main.ts b/packages/backend/src/server/api/stream/channels/main.ts index 2eb1d02a26..b8c72442ff 100644 --- a/packages/backend/src/server/api/stream/channels/main.ts +++ b/packages/backend/src/server/api/stream/channels/main.ts @@ -1,8 +1,8 @@ +import Channel from "../channel.js"; import { isInstanceMuted, isUserFromMutedInstance, } from "@/misc/is-instance-muted.js"; -import Channel from "../channel.js"; export default class extends Channel { public readonly chName = "main"; diff --git a/packages/backend/src/server/api/stream/channels/messaging.ts b/packages/backend/src/server/api/stream/channels/messaging.ts index f7746fe78c..a650db8b9b 100644 --- a/packages/backend/src/server/api/stream/channels/messaging.ts +++ b/packages/backend/src/server/api/stream/channels/messaging.ts @@ -1,12 +1,12 @@ -import type { UserGroup } from "@/models/entities/user-group.js"; -import type { ILocalUser, IRemoteUser, User } from "@/models/entities/user.js"; -import { MessagingMessages, UserGroupJoinings, Users } from "@/models/index.js"; import { - deliverReadActivity, - readGroupMessagingMessage, readUserMessagingMessage, + readGroupMessagingMessage, + deliverReadActivity, } 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"; +import type { UserGroup } from "@/models/entities/user-group.js"; import type { StreamMessages } from "../types.js"; export default class extends Channel { diff --git a/packages/backend/src/server/api/stream/channels/recommended-timeline.ts b/packages/backend/src/server/api/stream/channels/recommended-timeline.ts index 1b1a618f01..bbbc4e7a9a 100644 --- a/packages/backend/src/server/api/stream/channels/recommended-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/recommended-timeline.ts @@ -1,9 +1,9 @@ -import { getWordHardMute } from "@/misc/check-word-mute.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import { isInstanceMuted } from "@/misc/is-instance-muted.js"; -import { isUserRelated } from "@/misc/is-user-related.js"; -import type { Packed } from "@/misc/schema.js"; import Channel from "../channel.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; +import { getWordHardMute } from "@/misc/check-word-mute.js"; +import { isUserRelated } from "@/misc/is-user-related.js"; +import { isInstanceMuted } from "@/misc/is-instance-muted.js"; +import type { Packed } from "@/misc/schema.js"; export default class extends Channel { public readonly chName = "recommendedTimeline"; diff --git a/packages/backend/src/server/api/stream/channels/user-list.ts b/packages/backend/src/server/api/stream/channels/user-list.ts index 752dfa258d..d140319503 100644 --- a/packages/backend/src/server/api/stream/channels/user-list.ts +++ b/packages/backend/src/server/api/stream/channels/user-list.ts @@ -1,8 +1,8 @@ +import Channel from "../channel.js"; +import { UserListJoinings, UserLists } from "@/models/index.js"; +import type { User } from "@/models/entities/user.js"; import { isUserRelated } from "@/misc/is-user-related.js"; import type { Packed } from "@/misc/schema.js"; -import type { User } from "@/models/entities/user.js"; -import { UserListJoinings, UserLists } from "@/models/index.js"; -import Channel from "../channel.js"; export default class extends Channel { public readonly chName = "userList"; diff --git a/packages/backend/src/server/api/stream/index.ts b/packages/backend/src/server/api/stream/index.ts index 750a7ae9f9..86408a03d0 100644 --- a/packages/backend/src/server/api/stream/index.ts +++ b/packages/backend/src/server/api/stream/index.ts @@ -1,32 +1,32 @@ import type { EventEmitter } from "events"; -import type { Packed } from "@/misc/schema.js"; -import type { AccessToken } from "@/models/entities/access-token.js"; -import type { Channel as ChannelModel } from "@/models/entities/channel.js"; -import type { UserGroup } from "@/models/entities/user-group.js"; -import type { UserProfile } from "@/models/entities/user-profile.js"; +import type * as websocket from "websocket"; +import readNote from "@/services/note/read.js"; import type { User } from "@/models/entities/user.js"; +import type { Channel as ChannelModel } from "@/models/entities/channel.js"; import { - Blockings, - ChannelFollowings, + Users, Followings, Mutings, RenoteMutings, UserProfiles, - Users, + ChannelFollowings, + Blockings, } from "@/models/index.js"; -import { readNotification } from "@/server/api/common/read-notification.js"; -import { getClient } from "@/server/api/mastodon/ApiMastodonCompatibleService.js"; -import readNote from "@/services/note/read.js"; +import type { AccessToken } from "@/models/entities/access-token.js"; +import type { UserProfile } from "@/models/entities/user-profile.js"; import { publishChannelStream, publishGroupMessagingStream, publishMessagingStream, } from "@/services/stream.js"; -import { Converter } from "megalodon"; -import type * as websocket from "websocket"; -import type Channel from "./channel.js"; +import type { UserGroup } from "@/models/entities/user-group.js"; +import type { Packed } from "@/misc/schema.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 "@/server/api/mastodon/ApiMastodonCompatibleService.js"; /** * Main stream connection @@ -159,7 +159,7 @@ export default class Connection { // is Mastodon Compatible this.isMastodonCompatible = true; if (simpleObj.type === "subscribe") { - const forSubscribe = []; + let forSubscribe = []; if (simpleObj.stream === "user") { this.currentSubscribe.push(["user"]); objs = [ diff --git a/packages/backend/src/server/api/stream/types.ts b/packages/backend/src/server/api/stream/types.ts index 07c9202a6c..91095a46d3 100644 --- a/packages/backend/src/server/api/stream/types.ts +++ b/packages/backend/src/server/api/stream/types.ts @@ -1,20 +1,20 @@ import type { EventEmitter } from "events"; -import type { Packed } from "@/misc/schema.js"; -import type { AbuseUserReport } from "@/models/entities/abuse-user-report.js"; -import type { Antenna } from "@/models/entities/antenna.js"; +import type Emitter from "strict-event-emitter-types"; import type { Channel } from "@/models/entities/channel.js"; +import type { User } from "@/models/entities/user.js"; +import type { UserProfile } from "@/models/entities/user-profile.js"; +import type { Note } from "@/models/entities/note.js"; +import type { Antenna } from "@/models/entities/antenna.js"; import type { DriveFile } from "@/models/entities/drive-file.js"; import type { DriveFolder } from "@/models/entities/drive-folder.js"; -import type { MessagingMessage } from "@/models/entities/messaging-message.js"; -import type { Note } from "@/models/entities/note.js"; -import type { Page } from "@/models/entities/page.js"; -import type { Signin } from "@/models/entities/signin.js"; -import type { UserGroup } from "@/models/entities/user-group.js"; import type { UserList } from "@/models/entities/user-list.js"; -import type { UserProfile } from "@/models/entities/user-profile.js"; -import type { User } from "@/models/entities/user.js"; +import type { MessagingMessage } from "@/models/entities/messaging-message.js"; +import type { UserGroup } from "@/models/entities/user-group.js"; +import type { AbuseUserReport } from "@/models/entities/abuse-user-report.js"; +import type { Signin } from "@/models/entities/signin.js"; +import type { Page } from "@/models/entities/page.js"; +import type { Packed } from "@/misc/schema.js"; import type { Webhook } from "@/models/entities/webhook"; -import type Emitter from "strict-event-emitter-types"; //#region Stream type-body definitions export interface InternalStreamTypes { diff --git a/packages/backend/src/server/api/streaming.ts b/packages/backend/src/server/api/streaming.ts index 96ee49ce1b..14e07b7487 100644 --- a/packages/backend/src/server/api/streaming.ts +++ b/packages/backend/src/server/api/streaming.ts @@ -1,12 +1,12 @@ -import { EventEmitter } from "events"; import type * as http from "node:http"; +import { EventEmitter } from "events"; import type { ParsedUrlQuery } from "querystring"; import * as websocket from "websocket"; import { subscriber as redisClient } from "@/db/redis.js"; import { Users } from "@/models/index.js"; -import authenticate from "./authenticate.js"; import MainStreamConnection from "./stream/index.js"; +import authenticate from "./authenticate.js"; export const initializeStreamingServer = (server: http.Server) => { // Init websocket server diff --git a/packages/backend/src/server/file/byte-range-readable.ts b/packages/backend/src/server/file/byte-range-readable.ts index 04d9b4ee65..96dcbc4a52 100644 --- a/packages/backend/src/server/file/byte-range-readable.ts +++ b/packages/backend/src/server/file/byte-range-readable.ts @@ -1,6 +1,6 @@ +import { Readable, ReadableOptions } from "node:stream"; import { Buffer } from "node:buffer"; import * as fs from "node:fs"; -import { Readable, ReadableOptions } from "node:stream"; interface ByteRange { start: bigint; @@ -82,7 +82,7 @@ function extractRanges( } function createBoundary(len: number): string { - const chars = []; + let chars = []; for (let i = 0; i < len; i = i + 1) { chars[i] = BOUNDARY_CHARS.charAt( Math.floor(Math.random() * BOUNDARY_CHARS.length), diff --git a/packages/backend/src/server/file/index.ts b/packages/backend/src/server/file/index.ts index 1b1e81a21e..26df1de51d 100644 --- a/packages/backend/src/server/file/index.ts +++ b/packages/backend/src/server/file/index.ts @@ -3,11 +3,11 @@ */ import * as fs from "node:fs"; -import { dirname } from "node:path"; import { fileURLToPath } from "node:url"; +import { dirname } from "node:path"; +import Koa from "koa"; import cors from "@koa/cors"; import Router from "@koa/router"; -import Koa from "koa"; import sendDriveFile from "./send-drive-file.js"; const _filename = fileURLToPath(import.meta.url); diff --git a/packages/backend/src/server/file/send-drive-file.ts b/packages/backend/src/server/file/send-drive-file.ts index 704bb394b6..cb29934911 100644 --- a/packages/backend/src/server/file/send-drive-file.ts +++ b/packages/backend/src/server/file/send-drive-file.ts @@ -1,21 +1,21 @@ import * as fs from "node:fs"; -import { dirname } from "node:path"; import { fileURLToPath } from "node:url"; -import { FILE_TYPE_BROWSERSAFE } from "@/const.js"; -import { contentDisposition } from "@/misc/content-disposition.js"; -import { createTemp } from "@/misc/create-temp.js"; -import { downloadUrl } from "@/misc/download-url.js"; -import { StatusError } from "@/misc/fetch.js"; -import { detectType } from "@/misc/get-file-info.js"; -import { DriveFiles } from "@/models/index.js"; -import { GenerateVideoThumbnail } from "@/services/drive/generate-video-thumbnail.js"; -import { convertToWebp } from "@/services/drive/image-processor.js"; -import { InternalStorage } from "@/services/drive/internal-storage.js"; +import { dirname } from "node:path"; import type Koa from "koa"; import send from "koa-send"; import rename from "rename"; import { serverLogger } from "../index.js"; +import { contentDisposition } from "@/misc/content-disposition.js"; +import { DriveFiles } from "@/models/index.js"; +import { InternalStorage } from "@/services/drive/internal-storage.js"; +import { createTemp } from "@/misc/create-temp.js"; +import { downloadUrl } from "@/misc/download-url.js"; +import { detectType } from "@/misc/get-file-info.js"; +import { convertToWebp } from "@/services/drive/image-processor.js"; +import { GenerateVideoThumbnail } from "@/services/drive/generate-video-thumbnail.js"; +import { StatusError } from "@/misc/fetch.js"; import { ByteRangeReadable } from "./byte-range-readable.js"; +import { FILE_TYPE_BROWSERSAFE } from "@/const.js"; const _filename = fileURLToPath(import.meta.url); const _dirname = dirname(_filename); diff --git a/packages/backend/src/server/index.ts b/packages/backend/src/server/index.ts index 883314d778..3a9f62f337 100644 --- a/packages/backend/src/server/index.ts +++ b/packages/backend/src/server/index.ts @@ -5,34 +5,34 @@ import cluster from "node:cluster"; import * as fs from "node:fs"; import * as http from "node:http"; -import cors from "@koa/cors"; -import Router from "@koa/router"; import Koa from "koa"; -import koaLogger from "koa-logger"; +import Router from "@koa/router"; +import cors from "@koa/cors"; import mount from "koa-mount"; +import koaLogger from "koa-logger"; import * as slow from "koa-slow"; +import { IsNull } from "typeorm"; import config from "@/config/index.js"; -import { envOption } from "@/env.js"; -import * as Acct from "@/misc/acct.js"; -import { createTemp } from "@/misc/create-temp.js"; +import Logger from "@/services/logger.js"; +import { Users } from "@/models/index.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { genIdenticon } from "@/misc/gen-identicon.js"; -import { Users } from "@/models/index.js"; -import Logger from "@/services/logger.js"; -import { koaBody } from "koa-body"; -import removeTrailingSlash from "koa-remove-trailing-slashes"; +import { createTemp } from "@/misc/create-temp.js"; +import * as Acct from "@/misc/acct.js"; +import { envOption } from "@/env.js"; import megalodon, { MegalodonInterface } from "megalodon"; -import { IsNull } from "typeorm"; -import { v4 as uuid } from "uuid"; import activityPub from "./activitypub.js"; -import apiServer from "./api/index.js"; -import { initializeStreamingServer } from "./api/streaming.js"; -import fileServer from "./file/index.js"; import nodeinfo from "./nodeinfo.js"; +import wellKnown from "./well-known.js"; +import apiServer from "./api/index.js"; +import fileServer from "./file/index.js"; import proxyServer from "./proxy/index.js"; import webServer from "./web/index.js"; -import wellKnown from "./well-known.js"; +import { initializeStreamingServer } from "./api/streaming.js"; +import { koaBody } from "koa-body"; +import removeTrailingSlash from "koa-remove-trailing-slashes"; +import { v4 as uuid } from "uuid"; export const serverLogger = new Logger("server", "gray", false); diff --git a/packages/backend/src/server/nodeinfo.ts b/packages/backend/src/server/nodeinfo.ts index 665636dc97..a1d519f3e2 100644 --- a/packages/backend/src/server/nodeinfo.ts +++ b/packages/backend/src/server/nodeinfo.ts @@ -1,10 +1,10 @@ -import config from "@/config/index.js"; -import { MAX_CAPTION_TEXT_LENGTH, MAX_NOTE_TEXT_LENGTH } from "@/const.js"; -import { Cache } from "@/misc/cache.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import { Notes, Users } from "@/models/index.js"; import Router from "@koa/router"; +import config from "@/config/index.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; +import { Users, Notes } from "@/models/index.js"; import { IsNull, MoreThan } from "typeorm"; +import { MAX_NOTE_TEXT_LENGTH, MAX_CAPTION_TEXT_LENGTH } from "@/const.js"; +import { Cache } from "@/misc/cache.js"; const router = new Router(); diff --git a/packages/backend/src/server/proxy/index.ts b/packages/backend/src/server/proxy/index.ts index 4cc656916e..004b3779fb 100644 --- a/packages/backend/src/server/proxy/index.ts +++ b/packages/backend/src/server/proxy/index.ts @@ -2,9 +2,9 @@ * Media Proxy */ +import Koa from "koa"; import cors from "@koa/cors"; import Router from "@koa/router"; -import Koa from "koa"; import { proxyMedia } from "./proxy-media.js"; // Init app diff --git a/packages/backend/src/server/proxy/proxy-media.ts b/packages/backend/src/server/proxy/proxy-media.ts index 1a8626bbcf..ed607daa0e 100644 --- a/packages/backend/src/server/proxy/proxy-media.ts +++ b/packages/backend/src/server/proxy/proxy-media.ts @@ -1,17 +1,17 @@ -import { promises } from "node:dns"; import * as fs from "node:fs"; import net from "node:net"; -import { FILE_TYPE_BROWSERSAFE } from "@/const.js"; -import { createTemp } from "@/misc/create-temp.js"; -import { downloadUrl } from "@/misc/download-url.js"; -import { StatusError } from "@/misc/fetch.js"; -import { detectType } from "@/misc/get-file-info.js"; -import { isMimeImage } from "@/misc/is-mime-image.js"; -import type { IImage } from "@/services/drive/image-processor.js"; -import { convertToWebp } from "@/services/drive/image-processor.js"; +import { promises } from "node:dns"; import type Koa from "koa"; import sharp from "sharp"; +import type { IImage } from "@/services/drive/image-processor.js"; +import { convertToWebp } from "@/services/drive/image-processor.js"; +import { createTemp } from "@/misc/create-temp.js"; +import { downloadUrl } from "@/misc/download-url.js"; +import { detectType } from "@/misc/get-file-info.js"; +import { StatusError } from "@/misc/fetch.js"; +import { FILE_TYPE_BROWSERSAFE } from "@/const.js"; import { serverLogger } from "../index.js"; +import { isMimeImage } from "@/misc/is-mime-image.js"; export async function proxyMedia(ctx: Koa.Context) { let url = "url" in ctx.query ? ctx.query.url : `https://${ctx.params.url}`; diff --git a/packages/backend/src/server/web/feed.ts b/packages/backend/src/server/web/feed.ts index e29528d267..50e6bfc325 100644 --- a/packages/backend/src/server/web/feed.ts +++ b/packages/backend/src/server/web/feed.ts @@ -1,8 +1,8 @@ -import config from "@/config/index.js"; -import type { User } from "@/models/entities/user.js"; -import { DriveFiles, Notes, UserProfiles, Users } from "@/models/index.js"; import { Feed } from "feed"; import { In, IsNull } from "typeorm"; +import config from "@/config/index.js"; +import type { User } from "@/models/entities/user.js"; +import { Notes, DriveFiles, UserProfiles, Users } from "@/models/index.js"; export default async function ( user: User, diff --git a/packages/backend/src/server/web/index.ts b/packages/backend/src/server/web/index.ts index 12119ef3c3..90e40eec7c 100644 --- a/packages/backend/src/server/web/index.ts +++ b/packages/backend/src/server/web/index.ts @@ -2,39 +2,39 @@ * Web Client Server */ -import { readFileSync } from "node:fs"; import { dirname } from "node:path"; import { fileURLToPath } from "node:url"; +import { readFileSync } from "node:fs"; +import Koa from "koa"; +import Router from "@koa/router"; +import send from "koa-send"; +import favicon from "koa-favicon"; +import views from "@ladjs/koa-views"; +import sharp from "sharp"; import { createBullBoard } from "@bull-board/api"; import { BullAdapter } from "@bull-board/api/bullAdapter.js"; import { KoaAdapter } from "@bull-board/koa"; -import Router from "@koa/router"; -import views from "@ladjs/koa-views"; -import Koa from "koa"; -import favicon from "koa-favicon"; -import send from "koa-send"; -import sharp from "sharp"; -import config from "@/config/index.js"; -import { DAY, MINUTE } from "@/const.js"; -import * as Acct from "@/misc/acct.js"; +import { In, IsNull } from "typeorm"; import { fetchMeta, metaToPugArgs } from "@/misc/fetch-meta.js"; -import { getNoteSummary } from "@/misc/get-note-summary.js"; +import config from "@/config/index.js"; import { + Users, + Notes, + UserProfiles, + Pages, Channels, Clips, GalleryPosts, - Notes, - Pages, - UserProfiles, - Users, } from "@/models/index.js"; +import * as Acct from "@/misc/acct.js"; +import { getNoteSummary } from "@/misc/get-note-summary.js"; import { queues } from "@/queue/queues.js"; -import { In, IsNull } from "typeorm"; import { genOpenapiSpec } from "../api/openapi/gen-spec.js"; -import packFeed from "./feed.js"; -import { manifestHandler } from "./manifest.js"; import { urlPreviewHandler } from "./url-preview.js"; +import { manifestHandler } from "./manifest.js"; +import packFeed from "./feed.js"; +import { MINUTE, DAY } from "@/const.js"; const _filename = fileURLToPath(import.meta.url); const _dirname = dirname(_filename); diff --git a/packages/backend/src/server/web/manifest.ts b/packages/backend/src/server/web/manifest.ts index 38cb6755f2..bbcf639ffe 100644 --- a/packages/backend/src/server/web/manifest.ts +++ b/packages/backend/src/server/web/manifest.ts @@ -1,6 +1,6 @@ -import config from "@/config/index.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; import type Koa from "koa"; +import { fetchMeta } from "@/misc/fetch-meta.js"; +import config from "@/config/index.js"; import manifest from "./manifest.json" assert { type: "json" }; export const manifestHandler = async (ctx: Koa.Context) => { diff --git a/packages/backend/src/server/web/url-preview.ts b/packages/backend/src/server/web/url-preview.ts index e8362670ec..c9f3b6cac9 100644 --- a/packages/backend/src/server/web/url-preview.ts +++ b/packages/backend/src/server/web/url-preview.ts @@ -1,10 +1,10 @@ -import config from "@/config/index.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import { getJson } from "@/misc/fetch.js"; -import { query } from "@/prelude/url.js"; -import Logger from "@/services/logger.js"; import type Koa from "koa"; import summaly from "summaly"; +import { fetchMeta } from "@/misc/fetch-meta.js"; +import Logger from "@/services/logger.js"; +import config from "@/config/index.js"; +import { query } from "@/prelude/url.js"; +import { getJson } from "@/misc/fetch.js"; const logger = new Logger("url-preview"); diff --git a/packages/backend/src/server/well-known.ts b/packages/backend/src/server/well-known.ts index c70861c6ce..5af3b2c84b 100644 --- a/packages/backend/src/server/well-known.ts +++ b/packages/backend/src/server/well-known.ts @@ -2,12 +2,12 @@ import Router from "@koa/router"; import config from "@/config/index.js"; import * as Acct from "@/misc/acct.js"; -import type { User } from "@/models/entities/user.js"; -import { Users } from "@/models/index.js"; +import { links } from "./nodeinfo.js"; import { escapeAttribute, escapeValue } from "@/prelude/xml.js"; +import { Users } from "@/models/index.js"; +import type { User } from "@/models/entities/user.js"; import type { FindOptionsWhere } from "typeorm"; import { IsNull } from "typeorm"; -import { links } from "./nodeinfo.js"; // Init router const router = new Router(); diff --git a/packages/backend/src/services/add-note-to-antenna.ts b/packages/backend/src/services/add-note-to-antenna.ts index b9c40e1d2b..499418000d 100644 --- a/packages/backend/src/services/add-note-to-antenna.ts +++ b/packages/backend/src/services/add-note-to-antenna.ts @@ -1,9 +1,9 @@ -import { redisClient } from "@/db/redis.js"; -import { getTimestamp } from "@/misc/gen-id.js"; 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 { getTimestamp } from "@/misc/gen-id.js"; +import { redisClient } from "@/db/redis.js"; import { publishAntennaStream } from "@/services/stream.js"; +import type { User } from "@/models/entities/user.js"; export async function addNoteToAntenna( antenna: Antenna, diff --git a/packages/backend/src/services/blocking/create.ts b/packages/backend/src/services/blocking/create.ts index 0ed96e5c6f..321f5c8ea5 100644 --- a/packages/backend/src/services/blocking/create.ts +++ b/packages/backend/src/services/blocking/create.ts @@ -1,24 +1,24 @@ -import { genId } from "@/misc/gen-id.js"; -import { getActiveWebhooks } from "@/misc/webhook-cache.js"; +import { publishMainStream, publishUserEvent } from "@/services/stream.js"; +import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import renderFollow from "@/remote/activitypub/renderer/follow.js"; +import renderUndo from "@/remote/activitypub/renderer/undo.js"; +import { renderBlock } from "@/remote/activitypub/renderer/block.js"; +import { deliver } from "@/queue/index.js"; +import renderReject from "@/remote/activitypub/renderer/reject.js"; import type { Blocking } from "@/models/entities/blocking.js"; import type { User } from "@/models/entities/user.js"; import { Blockings, + Users, FollowRequests, Followings, UserListJoinings, UserLists, - Users, } from "@/models/index.js"; -import { deliver } from "@/queue/index.js"; -import { webhookDeliver } from "@/queue/index.js"; -import { renderBlock } from "@/remote/activitypub/renderer/block.js"; -import renderFollow from "@/remote/activitypub/renderer/follow.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import renderReject from "@/remote/activitypub/renderer/reject.js"; -import renderUndo from "@/remote/activitypub/renderer/undo.js"; import { perUserFollowingChart } from "@/services/chart/index.js"; -import { publishMainStream, publishUserEvent } from "@/services/stream.js"; +import { genId } from "@/misc/gen-id.js"; +import { getActiveWebhooks } from "@/misc/webhook-cache.js"; +import { webhookDeliver } from "@/queue/index.js"; export default async function (blocker: User, blockee: User) { await Promise.all([ diff --git a/packages/backend/src/services/blocking/delete.ts b/packages/backend/src/services/blocking/delete.ts index 2e57525a61..271883fe89 100644 --- a/packages/backend/src/services/blocking/delete.ts +++ b/packages/backend/src/services/blocking/delete.ts @@ -1,10 +1,10 @@ +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 "@/services/logger.js"; import type { CacheableUser } from "@/models/entities/user.js"; import { Blockings, Users } from "@/models/index.js"; -import { deliver } from "@/queue/index.js"; -import { renderBlock } from "@/remote/activitypub/renderer/block.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import renderUndo from "@/remote/activitypub/renderer/undo.js"; -import Logger from "@/services/logger.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 a9e4cab57f..b88fc22828 100644 --- a/packages/backend/src/services/chart/charts/active-users.ts +++ b/packages/backend/src/services/chart/charts/active-users.ts @@ -1,6 +1,6 @@ -import type { User } from "@/models/entities/user.js"; import type { KVs } from "../core.js"; import Chart from "../core.js"; +import type { User } from "@/models/entities/user.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 0c69049468..d94c8cce71 100644 --- a/packages/backend/src/services/chart/charts/drive.ts +++ b/packages/backend/src/services/chart/charts/drive.ts @@ -1,6 +1,6 @@ -import type { DriveFile } from "@/models/entities/drive-file.js"; import type { KVs } from "../core.js"; import Chart from "../core.js"; +import type { DriveFile } from "@/models/entities/drive-file.js"; import { name, schema } from "./entities/drive.js"; /** diff --git a/packages/backend/src/services/chart/charts/federation.ts b/packages/backend/src/services/chart/charts/federation.ts index 6d62979f38..1a03d574df 100644 --- a/packages/backend/src/services/chart/charts/federation.ts +++ b/packages/backend/src/services/chart/charts/federation.ts @@ -1,8 +1,8 @@ -import { fetchMeta } from "@/misc/fetch-meta.js"; -import { Followings, Instances } from "@/models/index.js"; import type { KVs } from "../core.js"; import Chart from "../core.js"; +import { Followings, Instances } from "@/models/index.js"; import { name, schema } from "./entities/federation.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; /** * フェデレーションに関するチャート diff --git a/packages/backend/src/services/chart/charts/hashtag.ts b/packages/backend/src/services/chart/charts/hashtag.ts index d1079d1ccd..0211df857f 100644 --- a/packages/backend/src/services/chart/charts/hashtag.ts +++ b/packages/backend/src/services/chart/charts/hashtag.ts @@ -1,7 +1,7 @@ -import type { User } from "@/models/entities/user.js"; -import { Users } from "@/models/index.js"; 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/hashtag.js"; /** diff --git a/packages/backend/src/services/chart/charts/instance.ts b/packages/backend/src/services/chart/charts/instance.ts index fc3d2139fc..d6e3483d8e 100644 --- a/packages/backend/src/services/chart/charts/instance.ts +++ b/packages/backend/src/services/chart/charts/instance.ts @@ -1,9 +1,9 @@ -import { toPuny } from "@/misc/convert-host.js"; -import type { DriveFile } from "@/models/entities/drive-file.js"; -import type { Note } from "@/models/entities/note.js"; -import { DriveFiles, Followings, Notes, Users } from "@/models/index.js"; import type { KVs } from "../core.js"; import Chart from "../core.js"; +import { DriveFiles, Followings, Users, Notes } from "@/models/index.js"; +import type { DriveFile } from "@/models/entities/drive-file.js"; +import type { Note } from "@/models/entities/note.js"; +import { toPuny } from "@/misc/convert-host.js"; import { name, schema } from "./entities/instance.js"; /** diff --git a/packages/backend/src/services/chart/charts/notes.ts b/packages/backend/src/services/chart/charts/notes.ts index 8ade08cda2..42db60d0cf 100644 --- a/packages/backend/src/services/chart/charts/notes.ts +++ b/packages/backend/src/services/chart/charts/notes.ts @@ -1,8 +1,8 @@ -import type { Note } from "@/models/entities/note.js"; -import { Notes } from "@/models/index.js"; -import { IsNull, Not } from "typeorm"; import type { KVs } from "../core.js"; import Chart from "../core.js"; +import { Notes } from "@/models/index.js"; +import { Not, IsNull } from "typeorm"; +import type { Note } from "@/models/entities/note.js"; import { name, schema } from "./entities/notes.js"; /** diff --git a/packages/backend/src/services/chart/charts/per-user-drive.ts b/packages/backend/src/services/chart/charts/per-user-drive.ts index c1f6197ccb..18589bb84a 100644 --- a/packages/backend/src/services/chart/charts/per-user-drive.ts +++ b/packages/backend/src/services/chart/charts/per-user-drive.ts @@ -1,7 +1,7 @@ -import type { DriveFile } from "@/models/entities/drive-file.js"; -import { DriveFiles } from "@/models/index.js"; import type { KVs } from "../core.js"; import Chart from "../core.js"; +import { DriveFiles } from "@/models/index.js"; +import type { DriveFile } from "@/models/entities/drive-file.js"; import { name, schema } from "./entities/per-user-drive.js"; /** diff --git a/packages/backend/src/services/chart/charts/per-user-following.ts b/packages/backend/src/services/chart/charts/per-user-following.ts index 017b9fa4da..3e8b576f20 100644 --- a/packages/backend/src/services/chart/charts/per-user-following.ts +++ b/packages/backend/src/services/chart/charts/per-user-following.ts @@ -1,8 +1,8 @@ -import type { User } from "@/models/entities/user.js"; -import { Followings, Users } from "@/models/index.js"; -import { IsNull, Not } from "typeorm"; import type { KVs } from "../core.js"; import Chart from "../core.js"; +import { Followings, Users } from "@/models/index.js"; +import { Not, IsNull } from "typeorm"; +import type { User } from "@/models/entities/user.js"; import { name, schema } from "./entities/per-user-following.js"; /** diff --git a/packages/backend/src/services/chart/charts/per-user-notes.ts b/packages/backend/src/services/chart/charts/per-user-notes.ts index 6b25d8ee69..22f3fddb77 100644 --- a/packages/backend/src/services/chart/charts/per-user-notes.ts +++ b/packages/backend/src/services/chart/charts/per-user-notes.ts @@ -1,8 +1,8 @@ -import type { Note } from "@/models/entities/note.js"; -import type { User } from "@/models/entities/user.js"; -import { Notes } from "@/models/index.js"; import type { KVs } from "../core.js"; import Chart from "../core.js"; +import type { User } from "@/models/entities/user.js"; +import { Notes } from "@/models/index.js"; +import type { Note } from "@/models/entities/note.js"; import { name, schema } from "./entities/per-user-notes.js"; /** diff --git a/packages/backend/src/services/chart/charts/per-user-reactions.ts b/packages/backend/src/services/chart/charts/per-user-reactions.ts index 093660bd5c..75def3de04 100644 --- a/packages/backend/src/services/chart/charts/per-user-reactions.ts +++ b/packages/backend/src/services/chart/charts/per-user-reactions.ts @@ -1,8 +1,8 @@ -import type { Note } from "@/models/entities/note.js"; -import type { User } from "@/models/entities/user.js"; -import { Users } from "@/models/index.js"; import type { KVs } from "../core.js"; import Chart from "../core.js"; +import type { User } from "@/models/entities/user.js"; +import type { Note } from "@/models/entities/note.js"; +import { Users } from "@/models/index.js"; import { name, schema } from "./entities/per-user-reactions.js"; /** diff --git a/packages/backend/src/services/chart/charts/users.ts b/packages/backend/src/services/chart/charts/users.ts index 0c8ea58314..6fef9ecf7b 100644 --- a/packages/backend/src/services/chart/charts/users.ts +++ b/packages/backend/src/services/chart/charts/users.ts @@ -1,8 +1,8 @@ -import type { User } from "@/models/entities/user.js"; -import { Users } from "@/models/index.js"; -import { IsNull, Not } from "typeorm"; import type { KVs } from "../core.js"; import Chart from "../core.js"; +import { Users } from "@/models/index.js"; +import { Not, IsNull } from "typeorm"; +import type { User } from "@/models/entities/user.js"; import { name, schema } from "./entities/users.js"; /** diff --git a/packages/backend/src/services/chart/core.ts b/packages/backend/src/services/chart/core.ts index d14ef1792e..d7a524d488 100644 --- a/packages/backend/src/services/chart/core.ts +++ b/packages/backend/src/services/chart/core.ts @@ -4,20 +4,20 @@ * Tests located in test/chart */ -import { db } from "@/db/postgre.js"; -import { getChartInsertLock } from "@/misc/app-lock.js"; -import { - addTime, - dateUTC, - isTimeBefore, - isTimeSame, - subtractTime, -} from "@/prelude/time.js"; import * as nestedProperty from "nested-property"; -import promiseLimit from "promise-limit"; -import type { Repository } from "typeorm"; -import { Between, EntitySchema, LessThan } from "typeorm"; import Logger from "../logger.js"; +import type { Repository } from "typeorm"; +import { EntitySchema, LessThan, Between } from "typeorm"; +import { + dateUTC, + isTimeSame, + isTimeBefore, + subtractTime, + addTime, +} from "@/prelude/time.js"; +import { getChartInsertLock } from "@/misc/app-lock.js"; +import { db } from "@/db/postgre.js"; +import promiseLimit from "promise-limit"; const logger = new Logger("chart", "white", process.env.NODE_ENV !== "test"); diff --git a/packages/backend/src/services/chart/entities.ts b/packages/backend/src/services/chart/entities.ts index e67d1abc2d..e203dffdff 100644 --- a/packages/backend/src/services/chart/entities.ts +++ b/packages/backend/src/services/chart/entities.ts @@ -1,20 +1,20 @@ -import { entity as ActiveUsersChart } from "./charts/entities/active-users.js"; -import { entity as ApRequestChart } from "./charts/entities/ap-request.js"; -import { entity as DriveChart } from "./charts/entities/drive.js"; import { entity as FederationChart } from "./charts/entities/federation.js"; -import { entity as HashtagChart } from "./charts/entities/hashtag.js"; -import { entity as InstanceChart } from "./charts/entities/instance.js"; import { entity as NotesChart } from "./charts/entities/notes.js"; -import { entity as PerUserDriveChart } from "./charts/entities/per-user-drive.js"; -import { entity as PerUserFollowingChart } from "./charts/entities/per-user-following.js"; -import { entity as PerUserNotesChart } from "./charts/entities/per-user-notes.js"; -import { entity as PerUserReactionsChart } from "./charts/entities/per-user-reactions.js"; import { entity as UsersChart } from "./charts/entities/users.js"; +import { entity as ActiveUsersChart } from "./charts/entities/active-users.js"; +import { entity as InstanceChart } from "./charts/entities/instance.js"; +import { entity as PerUserNotesChart } from "./charts/entities/per-user-notes.js"; +import { entity as DriveChart } from "./charts/entities/drive.js"; +import { entity as PerUserReactionsChart } from "./charts/entities/per-user-reactions.js"; +import { entity as HashtagChart } from "./charts/entities/hashtag.js"; +import { entity as PerUserFollowingChart } from "./charts/entities/per-user-following.js"; +import { entity as PerUserDriveChart } from "./charts/entities/per-user-drive.js"; +import { entity as ApRequestChart } from "./charts/entities/ap-request.js"; -import { entity as TestGroupedChart } from "./charts/entities/test-grouped.js"; -import { entity as TestIntersectionChart } from "./charts/entities/test-intersection.js"; -import { entity as TestUniqueChart } from "./charts/entities/test-unique.js"; import { entity as TestChart } from "./charts/entities/test.js"; +import { entity as TestGroupedChart } from "./charts/entities/test-grouped.js"; +import { entity as TestUniqueChart } from "./charts/entities/test-unique.js"; +import { entity as TestIntersectionChart } from "./charts/entities/test-intersection.js"; export const entities = [ FederationChart.hour, diff --git a/packages/backend/src/services/chart/index.ts b/packages/backend/src/services/chart/index.ts index e45a113bb1..969cdab6d7 100644 --- a/packages/backend/src/services/chart/index.ts +++ b/packages/backend/src/services/chart/index.ts @@ -1,17 +1,17 @@ import { beforeShutdown } from "@/misc/before-shutdown.js"; -import ActiveUsersChart from "./charts/active-users.js"; -import ApRequestChart from "./charts/ap-request.js"; -import DriveChart from "./charts/drive.js"; import FederationChart from "./charts/federation.js"; -import HashtagChart from "./charts/hashtag.js"; -import InstanceChart from "./charts/instance.js"; import NotesChart from "./charts/notes.js"; -import PerUserDriveChart from "./charts/per-user-drive.js"; -import PerUserFollowingChart from "./charts/per-user-following.js"; -import PerUserNotesChart from "./charts/per-user-notes.js"; -import PerUserReactionsChart from "./charts/per-user-reactions.js"; import UsersChart from "./charts/users.js"; +import ActiveUsersChart from "./charts/active-users.js"; +import InstanceChart from "./charts/instance.js"; +import PerUserNotesChart from "./charts/per-user-notes.js"; +import DriveChart from "./charts/drive.js"; +import PerUserReactionsChart from "./charts/per-user-reactions.js"; +import HashtagChart from "./charts/hashtag.js"; +import PerUserFollowingChart from "./charts/per-user-following.js"; +import PerUserDriveChart from "./charts/per-user-drive.js"; +import ApRequestChart from "./charts/ap-request.js"; export const federationChart = new FederationChart(); export const notesChart = new NotesChart(); diff --git a/packages/backend/src/services/create-notification.ts b/packages/backend/src/services/create-notification.ts index d537fcd799..9bfd1a7bfa 100644 --- a/packages/backend/src/services/create-notification.ts +++ b/packages/backend/src/services/create-notification.ts @@ -1,18 +1,18 @@ -import { genId } from "@/misc/gen-id.js"; -import { shouldSilenceInstance } from "@/misc/should-block-instance.js"; -import type { Notification } from "@/models/entities/notification.js"; -import type { User } from "@/models/entities/user.js"; +import { publishMainStream } from "@/services/stream.js"; +import { pushNotification } from "@/services/push-notification.js"; import { - Followings, + Notifications, Mutings, NoteThreadMutings, - Notifications, UserProfiles, Users, + Followings, } from "@/models/index.js"; -import { pushNotification } from "@/services/push-notification.js"; -import { publishMainStream } from "@/services/stream.js"; +import { genId } from "@/misc/gen-id.js"; +import type { User } from "@/models/entities/user.js"; +import type { Notification } from "@/models/entities/notification.js"; import { sendEmailNotification } from "./send-email-notification.js"; +import { shouldSilenceInstance } from "@/misc/should-block-instance.js"; export async function createNotification( notifieeId: User["id"], diff --git a/packages/backend/src/services/create-system-user.ts b/packages/backend/src/services/create-system-user.ts index 6ed53535d4..0ebd1142f1 100644 --- a/packages/backend/src/services/create-system-user.ts +++ b/packages/backend/src/services/create-system-user.ts @@ -1,14 +1,14 @@ -import { db } from "@/db/postgre.js"; -import { genId } from "@/misc/gen-id.js"; -import { genRsaKeyPair } from "@/misc/gen-key-pair.js"; -import { hashPassword } from "@/misc/password.js"; -import { UsedUsername } from "@/models/entities/used-username.js"; -import { UserKeypair } from "@/models/entities/user-keypair.js"; -import { UserProfile } from "@/models/entities/user-profile.js"; -import { User } from "@/models/entities/user.js"; -import generateNativeUserToken from "@/server/api/common/generate-native-user-token.js"; -import { IsNull } from "typeorm"; import { v4 as uuid } from "uuid"; +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"; +import { IsNull } from "typeorm"; +import { genId } from "@/misc/gen-id.js"; +import { UserKeypair } from "@/models/entities/user-keypair.js"; +import { UsedUsername } from "@/models/entities/used-username.js"; +import { db } from "@/db/postgre.js"; +import { hashPassword } from "@/misc/password.js"; export async function createSystemUser(username: string) { const password = uuid(); diff --git a/packages/backend/src/services/detect-sensitive.ts b/packages/backend/src/services/detect-sensitive.ts index 289e2dfcff..df695e86da 100644 --- a/packages/backend/src/services/detect-sensitive.ts +++ b/packages/backend/src/services/detect-sensitive.ts @@ -1,6 +1,6 @@ import * as fs from "node:fs"; -import { dirname } from "node:path"; import { fileURLToPath } from "node:url"; +import { dirname } from "node:path"; import * as nsfw from "nsfwjs"; import si from "systeminformation"; diff --git a/packages/backend/src/services/drive/add-file.ts b/packages/backend/src/services/drive/add-file.ts index faab329107..2f3d3c6e1e 100644 --- a/packages/backend/src/services/drive/add-file.ts +++ b/packages/backend/src/services/drive/add-file.ts @@ -2,37 +2,37 @@ import * as fs from "node:fs"; import { v4 as uuid } from "uuid"; -import { FILE_TYPE_BROWSERSAFE } from "@/const.js"; -import { contentDisposition } from "@/misc/content-disposition.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import { genId } from "@/misc/gen-id.js"; -import { getFileInfo } from "@/misc/get-file-info.js"; -import { IdentifiableError } from "@/misc/identifiable-error.js"; -import { isDuplicateKeyValueError } from "@/misc/is-duplicate-key-value-error.js"; -import { DriveFile } from "@/models/entities/drive-file.js"; -import type { IRemoteUser, User } from "@/models/entities/user.js"; -import { - DriveFiles, - DriveFolders, - UserProfiles, - Users, -} from "@/models/index.js"; -import { - driveChart, - instanceChart, - perUserDriveChart, -} from "@/services/chart/index.js"; -import { publishDriveStream, publishMainStream } from "@/services/stream.js"; import type S3 from "aws-sdk/clients/s3.js"; // TODO: migrate to SDK v3 import sharp from "sharp"; import { IsNull } from "typeorm"; -import { deleteFile } from "./delete-file.js"; -import { GenerateVideoThumbnail } from "./generate-video-thumbnail.js"; +import { publishMainStream, publishDriveStream } from "@/services/stream.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; +import { contentDisposition } from "@/misc/content-disposition.js"; +import { getFileInfo } from "@/misc/get-file-info.js"; +import { + DriveFiles, + DriveFolders, + Users, + UserProfiles, +} from "@/models/index.js"; +import { DriveFile } from "@/models/entities/drive-file.js"; +import type { IRemoteUser, User } from "@/models/entities/user.js"; +import { + driveChart, + perUserDriveChart, + instanceChart, +} from "@/services/chart/index.js"; +import { genId } from "@/misc/gen-id.js"; +import { isDuplicateKeyValueError } from "@/misc/is-duplicate-key-value-error.js"; +import { FILE_TYPE_BROWSERSAFE } from "@/const.js"; +import { IdentifiableError } from "@/misc/identifiable-error.js"; +import { getS3 } from "./s3.js"; +import { InternalStorage } from "./internal-storage.js"; import type { IImage } from "./image-processor.js"; import { convertSharpToWebp } from "./image-processor.js"; -import { InternalStorage } from "./internal-storage.js"; import { driveLogger } from "./logger.js"; -import { getS3 } from "./s3.js"; +import { GenerateVideoThumbnail } from "./generate-video-thumbnail.js"; +import { deleteFile } from "./delete-file.js"; const logger = driveLogger.createSubLogger("register", "yellow"); diff --git a/packages/backend/src/services/drive/delete-file.ts b/packages/backend/src/services/drive/delete-file.ts index 101933e508..515c1d1c65 100644 --- a/packages/backend/src/services/drive/delete-file.ts +++ b/packages/backend/src/services/drive/delete-file.ts @@ -1,15 +1,15 @@ -import { fetchMeta } from "@/misc/fetch-meta.js"; import type { DriveFile } from "@/models/entities/drive-file.js"; +import { InternalStorage } from "./internal-storage.js"; import { DriveFiles } from "@/models/index.js"; -import { createDeleteObjectStorageFileJob } from "@/queue/index.js"; import { driveChart, - instanceChart, perUserDriveChart, + instanceChart, } from "@/services/chart/index.js"; -import { v4 as uuid } from "uuid"; -import { InternalStorage } from "./internal-storage.js"; +import { createDeleteObjectStorageFileJob } from "@/queue/index.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; import { getS3 } from "./s3.js"; +import { v4 as uuid } from "uuid"; export async function deleteFile(file: DriveFile, isExpired = false) { if (file.storedInternal) { diff --git a/packages/backend/src/services/drive/generate-video-thumbnail.ts b/packages/backend/src/services/drive/generate-video-thumbnail.ts index 694a79656a..0e3f0db58e 100644 --- a/packages/backend/src/services/drive/generate-video-thumbnail.ts +++ b/packages/backend/src/services/drive/generate-video-thumbnail.ts @@ -1,7 +1,7 @@ import { createTempDir } from "@/misc/create-temp.js"; -import FFmpeg from "fluent-ffmpeg"; import type { IImage } from "./image-processor.js"; import { convertToWebp } from "./image-processor.js"; +import FFmpeg from "fluent-ffmpeg"; export async function GenerateVideoThumbnail(source: string): Promise { const [dir, cleanup] = await createTempDir(); diff --git a/packages/backend/src/services/drive/internal-storage.ts b/packages/backend/src/services/drive/internal-storage.ts index 560c272dfd..b2a663b3ea 100644 --- a/packages/backend/src/services/drive/internal-storage.ts +++ b/packages/backend/src/services/drive/internal-storage.ts @@ -1,8 +1,8 @@ import * as fs from "node:fs"; import * as fsPromises from "node:fs/promises"; import * as Path from "node:path"; -import { dirname } from "node:path"; import { fileURLToPath } from "node:url"; +import { dirname } from "node:path"; import config from "@/config/index.js"; const _filename = fileURLToPath(import.meta.url); diff --git a/packages/backend/src/services/drive/s3.ts b/packages/backend/src/services/drive/s3.ts index f7a4a57ee5..d01f89cbbf 100644 --- a/packages/backend/src/services/drive/s3.ts +++ b/packages/backend/src/services/drive/s3.ts @@ -1,7 +1,7 @@ import { URL } from "node:url"; -import { getAgentByUrl } from "@/misc/fetch.js"; -import type { Meta } from "@/models/entities/meta.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"; export function getS3(meta: Meta) { const u = diff --git a/packages/backend/src/services/drive/upload-from-url.ts b/packages/backend/src/services/drive/upload-from-url.ts index 2afa1458b0..0638bcab89 100644 --- a/packages/backend/src/services/drive/upload-from-url.ts +++ b/packages/backend/src/services/drive/upload-from-url.ts @@ -1,12 +1,12 @@ import { URL } from "node:url"; +import type { User } from "@/models/entities/user.js"; import { createTemp } from "@/misc/create-temp.js"; import { downloadUrl, isPrivateIp } from "@/misc/download-url.js"; -import type { DriveFile } from "@/models/entities/drive-file.js"; import type { DriveFolder } from "@/models/entities/drive-folder.js"; -import type { User } from "@/models/entities/user.js"; +import type { DriveFile } from "@/models/entities/drive-file.js"; import { DriveFiles } from "@/models/index.js"; -import { addFile } from "./add-file.js"; import { driveLogger } from "./logger.js"; +import { addFile } from "./add-file.js"; const logger = driveLogger.createSubLogger("downloader"); diff --git a/packages/backend/src/services/fetch-instance-metadata.ts b/packages/backend/src/services/fetch-instance-metadata.ts index b399df24ad..a4cc33bca5 100644 --- a/packages/backend/src/services/fetch-instance-metadata.ts +++ b/packages/backend/src/services/fetch-instance-metadata.ts @@ -1,12 +1,12 @@ import { URL } from "node:url"; -import { getFetchInstanceMetadataLock } from "@/misc/app-lock.js"; -import { getAgentByUrl, getJson } from "@/misc/fetch.js"; -import type { Instance } from "@/models/entities/instance.js"; -import { Instances } from "@/models/index.js"; -import Logger from "@/services/logger.js"; import { Window } from "happy-dom"; import fetch from "node-fetch"; import tinycolor from "tinycolor2"; +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 "@/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 0bb340db45..c9a37d1c88 100644 --- a/packages/backend/src/services/fetch-rel-me.ts +++ b/packages/backend/src/services/fetch-rel-me.ts @@ -1,5 +1,5 @@ -import config from "@/config/index.js"; import { Window } from "happy-dom"; +import config from "@/config/index.js"; async function getRelMeLinks(url: string): Promise { try { diff --git a/packages/backend/src/services/following/create.ts b/packages/backend/src/services/following/create.ts index 562867e19d..934b235bbc 100644 --- a/packages/backend/src/services/following/create.ts +++ b/packages/backend/src/services/following/create.ts @@ -1,33 +1,33 @@ -import { genId } from "@/misc/gen-id.js"; +import { publishMainStream, publishUserEvent } from "@/services/stream.js"; +import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import renderFollow from "@/remote/activitypub/renderer/follow.js"; +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 "@/services/register-or-fetch-instance-doc.js"; +import Logger from "../logger.js"; import { IdentifiableError } from "@/misc/identifiable-error.js"; -import { isDuplicateKeyValueError } from "@/misc/is-duplicate-key-value-error.js"; -import type { Packed } from "@/misc/schema.js"; -import { shouldSilenceInstance } from "@/misc/should-block-instance.js"; -import { getActiveWebhooks } from "@/misc/webhook-cache.js"; import type { User } from "@/models/entities/user.js"; import { - Blockings, - FollowRequests, Followings, + Users, + FollowRequests, + Blockings, Instances, UserProfiles, - Users, } from "@/models/index.js"; -import { deliver } from "@/queue/index.js"; -import { webhookDeliver } from "@/queue/index.js"; -import renderAccept from "@/remote/activitypub/renderer/accept.js"; -import renderFollow from "@/remote/activitypub/renderer/follow.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import renderReject from "@/remote/activitypub/renderer/reject.js"; import { instanceChart, perUserFollowingChart, } from "@/services/chart/index.js"; +import { genId } from "@/misc/gen-id.js"; import { createNotification } from "@/services/create-notification.js"; -import { registerOrFetchInstanceDoc } from "@/services/register-or-fetch-instance-doc.js"; -import { publishMainStream, publishUserEvent } from "@/services/stream.js"; -import Logger from "../logger.js"; -import createFollowRequest from "./requests/create.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"; +import { webhookDeliver } from "@/queue/index.js"; +import { shouldSilenceInstance } from "@/misc/should-block-instance.js"; const logger = new Logger("following/create"); diff --git a/packages/backend/src/services/following/delete.ts b/packages/backend/src/services/following/delete.ts index 55cd1fc810..8a07244da5 100644 --- a/packages/backend/src/services/following/delete.ts +++ b/packages/backend/src/services/following/delete.ts @@ -1,18 +1,18 @@ -import { getActiveWebhooks } from "@/misc/webhook-cache.js"; -import type { User } from "@/models/entities/user.js"; -import { Followings, Instances, Users } from "@/models/index.js"; -import { deliver, webhookDeliver } from "@/queue/index.js"; -import renderFollow from "@/remote/activitypub/renderer/follow.js"; +import { publishMainStream, publishUserEvent } from "@/services/stream.js"; import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import renderReject from "@/remote/activitypub/renderer/reject.js"; +import renderFollow from "@/remote/activitypub/renderer/follow.js"; 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 "@/services/register-or-fetch-instance-doc.js"; +import type { User } from "@/models/entities/user.js"; +import { Followings, Users, Instances } from "@/models/index.js"; import { instanceChart, perUserFollowingChart, } from "@/services/chart/index.js"; -import { registerOrFetchInstanceDoc } from "@/services/register-or-fetch-instance-doc.js"; -import { publishMainStream, publishUserEvent } from "@/services/stream.js"; -import Logger from "../logger.js"; +import { getActiveWebhooks } from "@/misc/webhook-cache.js"; const logger = new Logger("following/delete"); diff --git a/packages/backend/src/services/following/reject.ts b/packages/backend/src/services/following/reject.ts index 16e46b1578..3f461268dd 100644 --- a/packages/backend/src/services/following/reject.ts +++ b/packages/backend/src/services/following/reject.ts @@ -1,12 +1,12 @@ -import { getActiveWebhooks } from "@/misc/webhook-cache.js"; -import type { ILocalUser, IRemoteUser } from "@/models/entities/user.js"; -import { FollowRequests, Followings, Users } from "@/models/index.js"; -import { deliver, webhookDeliver } from "@/queue/index.js"; -import renderFollow from "@/remote/activitypub/renderer/follow.js"; import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import renderFollow from "@/remote/activitypub/renderer/follow.js"; 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 { Users, FollowRequests, Followings } from "@/models/index.js"; import { decrementFollowing } from "./delete.js"; +import { getActiveWebhooks } from "@/misc/webhook-cache.js"; type Local = | ILocalUser diff --git a/packages/backend/src/services/following/requests/accept-all.ts b/packages/backend/src/services/following/requests/accept-all.ts index 1808bff2bc..2692433799 100644 --- a/packages/backend/src/services/following/requests/accept-all.ts +++ b/packages/backend/src/services/following/requests/accept-all.ts @@ -1,6 +1,6 @@ +import accept from "./accept.js"; import type { User } from "@/models/entities/user.js"; import { FollowRequests, Users } from "@/models/index.js"; -import accept from "./accept.js"; /** * Approve all follow requests for the specified user diff --git a/packages/backend/src/services/following/requests/accept.ts b/packages/backend/src/services/following/requests/accept.ts index 2a7c03ba19..1bc10f6082 100644 --- a/packages/backend/src/services/following/requests/accept.ts +++ b/packages/backend/src/services/following/requests/accept.ts @@ -1,12 +1,12 @@ -import { IdentifiableError } from "@/misc/identifiable-error.js"; -import type { CacheableUser, User } from "@/models/entities/user.js"; -import { FollowRequests, Users } from "@/models/index.js"; -import { deliver } from "@/queue/index.js"; -import renderAccept from "@/remote/activitypub/renderer/accept.js"; -import renderFollow from "@/remote/activitypub/renderer/follow.js"; import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import renderFollow from "@/remote/activitypub/renderer/follow.js"; +import renderAccept from "@/remote/activitypub/renderer/accept.js"; +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 { FollowRequests, Users } from "@/models/index.js"; +import { IdentifiableError } from "@/misc/identifiable-error.js"; export default async function ( followee: { diff --git a/packages/backend/src/services/following/requests/cancel.ts b/packages/backend/src/services/following/requests/cancel.ts index 1b9758c5bd..45b8ee0639 100644 --- a/packages/backend/src/services/following/requests/cancel.ts +++ b/packages/backend/src/services/following/requests/cancel.ts @@ -1,11 +1,11 @@ +import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import renderFollow from "@/remote/activitypub/renderer/follow.js"; +import renderUndo from "@/remote/activitypub/renderer/undo.js"; +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 { FollowRequests, Users } from "@/models/index.js"; -import { deliver } from "@/queue/index.js"; -import renderFollow from "@/remote/activitypub/renderer/follow.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import renderUndo from "@/remote/activitypub/renderer/undo.js"; -import { publishMainStream } from "@/services/stream.js"; +import { Users, FollowRequests } from "@/models/index.js"; export default async function ( followee: { diff --git a/packages/backend/src/services/following/requests/create.ts b/packages/backend/src/services/following/requests/create.ts index a3ed22f83c..12dfddf302 100644 --- a/packages/backend/src/services/following/requests/create.ts +++ b/packages/backend/src/services/following/requests/create.ts @@ -1,12 +1,12 @@ -import config from "@/config/index.js"; -import { genId } from "@/misc/gen-id.js"; +import { publishMainStream } from "@/services/stream.js"; +import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import renderFollow from "@/remote/activitypub/renderer/follow.js"; +import { deliver } from "@/queue/index.js"; import type { User } from "@/models/entities/user.js"; import { Blockings, FollowRequests, Users } from "@/models/index.js"; -import { deliver } from "@/queue/index.js"; -import renderFollow from "@/remote/activitypub/renderer/follow.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import { genId } from "@/misc/gen-id.js"; import { createNotification } from "@/services/create-notification.js"; -import { publishMainStream } from "@/services/stream.js"; +import config from "@/config/index.js"; export default async function ( follower: { diff --git a/packages/backend/src/services/i/pin.ts b/packages/backend/src/services/i/pin.ts index 3926f72302..6102df2fa0 100644 --- a/packages/backend/src/services/i/pin.ts +++ b/packages/backend/src/services/i/pin.ts @@ -1,14 +1,14 @@ import config from "@/config/index.js"; -import { genId } from "@/misc/gen-id.js"; -import { IdentifiableError } from "@/misc/identifiable-error.js"; -import type { Note } from "@/models/entities/note.js"; -import type { UserNotePining } from "@/models/entities/user-note-pining.js"; -import type { User } from "@/models/entities/user.js"; -import { Notes, UserNotePinings, Users } from "@/models/index.js"; -import { deliverToFollowers } from "@/remote/activitypub/deliver-manager.js"; import renderAdd from "@/remote/activitypub/renderer/add.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.js"; import renderRemove from "@/remote/activitypub/renderer/remove.js"; +import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import { IdentifiableError } from "@/misc/identifiable-error.js"; +import type { User } from "@/models/entities/user.js"; +import type { Note } from "@/models/entities/note.js"; +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 "@/services/relay.js"; /** diff --git a/packages/backend/src/services/i/update.ts b/packages/backend/src/services/i/update.ts index ec22907bf5..21b03d9821 100644 --- a/packages/backend/src/services/i/update.ts +++ b/packages/backend/src/services/i/update.ts @@ -1,9 +1,9 @@ -import type { User } from "@/models/entities/user.js"; -import { Users } from "@/models/index.js"; -import { deliverToFollowers } from "@/remote/activitypub/deliver-manager.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import { renderPerson } from "@/remote/activitypub/renderer/person.js"; import renderUpdate from "@/remote/activitypub/renderer/update.js"; +import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +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 "@/services/relay.js"; export async function publishToFollowers(userId: User["id"]) { diff --git a/packages/backend/src/services/insert-moderation-log.ts b/packages/backend/src/services/insert-moderation-log.ts index 9e45ece682..8e2c5b78a1 100644 --- a/packages/backend/src/services/insert-moderation-log.ts +++ b/packages/backend/src/services/insert-moderation-log.ts @@ -1,6 +1,6 @@ +import { ModerationLogs } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import type { User } from "@/models/entities/user.js"; -import { ModerationLogs } from "@/models/index.js"; export async function insertModerationLog( moderator: { id: User["id"] }, diff --git a/packages/backend/src/services/instance-actor.ts b/packages/backend/src/services/instance-actor.ts index 6f21107eb3..a8b34ea57b 100644 --- a/packages/backend/src/services/instance-actor.ts +++ b/packages/backend/src/services/instance-actor.ts @@ -1,8 +1,8 @@ -import { Cache } from "@/misc/cache.js"; +import { createSystemUser } from "./create-system-user.js"; import type { ILocalUser } from "@/models/entities/user.js"; import { Users } from "@/models/index.js"; +import { Cache } from "@/misc/cache.js"; import { IsNull } from "typeorm"; -import { createSystemUser } from "./create-system-user.js"; const ACTOR_USERNAME = "instance.actor" as const; diff --git a/packages/backend/src/services/logger.ts b/packages/backend/src/services/logger.ts index 54a0440d45..df4c2e3564 100644 --- a/packages/backend/src/services/logger.ts +++ b/packages/backend/src/services/logger.ts @@ -1,9 +1,9 @@ import cluster from "node:cluster"; -import config from "@/config/index.js"; -import { envOption } from "@/env.js"; import chalk from "chalk"; import { default as convertColor } from "color-convert"; import { format as dateFormat } from "date-fns"; +import { envOption } from "@/env.js"; +import config from "@/config/index.js"; import * as SyslogPro from "syslog-pro"; diff --git a/packages/backend/src/services/messages/create.ts b/packages/backend/src/services/messages/create.ts index ed5e014945..506f299966 100644 --- a/packages/backend/src/services/messages/create.ts +++ b/packages/backend/src/services/messages/create.ts @@ -1,27 +1,27 @@ -import { genId } from "@/misc/gen-id.js"; -import type { DriveFile } from "@/models/entities/drive-file.js"; -import type { MessagingMessage } from "@/models/entities/messaging-message.js"; -import type { Note } from "@/models/entities/note.js"; -import type { UserGroup } from "@/models/entities/user-group.js"; import type { CacheableUser, User } from "@/models/entities/user.js"; +import type { UserGroup } from "@/models/entities/user-group.js"; +import type { DriveFile } from "@/models/entities/drive-file.js"; import { MessagingMessages, - Mutings, UserGroupJoinings, + Mutings, Users, } from "@/models/index.js"; -import { deliver } from "@/queue/index.js"; +import { genId } from "@/misc/gen-id.js"; +import type { MessagingMessage } from "@/models/entities/messaging-message.js"; +import { + publishMessagingStream, + publishMessagingIndexStream, + publishMainStream, + publishGroupMessagingStream, +} from "@/services/stream.js"; +import { pushNotification } from "@/services/push-notification.js"; +import { Not } from "typeorm"; +import type { Note } from "@/models/entities/note.js"; +import renderNote from "@/remote/activitypub/renderer/note.js"; import renderCreate from "@/remote/activitypub/renderer/create.js"; import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import renderNote from "@/remote/activitypub/renderer/note.js"; -import { pushNotification } from "@/services/push-notification.js"; -import { - publishGroupMessagingStream, - publishMainStream, - publishMessagingIndexStream, - publishMessagingStream, -} from "@/services/stream.js"; -import { Not } from "typeorm"; +import { deliver } from "@/queue/index.js"; export async function createMessage( user: { id: User["id"]; host: User["host"] }, diff --git a/packages/backend/src/services/messages/delete.ts b/packages/backend/src/services/messages/delete.ts index adc3652239..77caba80ce 100644 --- a/packages/backend/src/services/messages/delete.ts +++ b/packages/backend/src/services/messages/delete.ts @@ -1,14 +1,14 @@ import config from "@/config/index.js"; -import type { MessagingMessage } from "@/models/entities/messaging-message.js"; import { MessagingMessages, Users } from "@/models/index.js"; -import { deliver } from "@/queue/index.js"; -import renderDelete from "@/remote/activitypub/renderer/delete.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import renderTombstone from "@/remote/activitypub/renderer/tombstone.js"; +import type { MessagingMessage } from "@/models/entities/messaging-message.js"; import { publishGroupMessagingStream, publishMessagingStream, } from "@/services/stream.js"; +import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import renderDelete from "@/remote/activitypub/renderer/delete.js"; +import renderTombstone from "@/remote/activitypub/renderer/tombstone.js"; +import { deliver } from "@/queue/index.js"; export async function deleteMessage(message: MessagingMessage) { await MessagingMessages.delete(message.id); diff --git a/packages/backend/src/services/note/create.ts b/packages/backend/src/services/note/create.ts index ed6ab932c1..bff0968f99 100644 --- a/packages/backend/src/services/note/create.ts +++ b/packages/backend/src/services/note/create.ts @@ -1,74 +1,74 @@ -import config from "@/config/index.js"; +import * as mfm from "mfm-js"; import es from "@/db/elasticsearch.js"; -import meilisearch from "@/db/meilisearch.js"; -import { db } from "@/db/postgre.js"; -import { redisClient } from "@/db/redis.js"; import sonic from "@/db/sonic.js"; -import { getAntennas } from "@/misc/antenna-cache.js"; -import { Cache } from "@/misc/cache.js"; -import { checkHitAntenna } from "@/misc/check-hit-antenna.js"; -import { getWordHardMute } from "@/misc/check-word-mute.js"; -import { countSameRenotes } from "@/misc/count-same-renotes.js"; -import detectLanguage from "@/misc/detect-language.js"; -import { extractCustomEmojisFromMfm } from "@/misc/extract-custom-emojis-from-mfm.js"; -import { extractHashtags } from "@/misc/extract-hashtags.js"; -import { extractMentions } from "@/misc/extract-mentions.js"; -import { genId } from "@/misc/gen-id.js"; -import { isDuplicateKeyValueError } from "@/misc/is-duplicate-key-value-error.js"; -import { langmap } from "@/misc/langmap.js"; -import { normalizeForSearch } from "@/misc/normalize-for-search.js"; -import { shouldSilenceInstance } from "@/misc/should-block-instance.js"; -import { getActiveWebhooks } from "@/misc/webhook-cache.js"; -import type { App } from "@/models/entities/app.js"; -import type { Channel } from "@/models/entities/channel.js"; -import type { DriveFile } from "@/models/entities/drive-file.js"; -import type { IMentionedRemoteUsers } from "@/models/entities/note.js"; -import { Note } from "@/models/entities/note.js"; -import type { IPoll } from "@/models/entities/poll.js"; -import { Poll } from "@/models/entities/poll.js"; -import type { UserProfile } from "@/models/entities/user-profile.js"; -import type { ILocalUser, IRemoteUser, User } from "@/models/entities/user.js"; -import { - ChannelFollowings, - Channels, - Instances, - MutedNotes, - Mutings, - NoteThreadMutings, - NoteWatchings, - Notes, - UserProfiles, - Users, -} from "@/models/index.js"; -import { concat } from "@/prelude/array.js"; -import { webhookDeliver } from "@/queue/index.js"; -import { endedPollNotificationQueue } from "@/queue/queues.js"; -import DeliverManager from "@/remote/activitypub/deliver-manager.js"; -import renderAnnounce from "@/remote/activitypub/renderer/announce.js"; -import renderCreate from "@/remote/activitypub/renderer/create.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import renderNote from "@/remote/activitypub/renderer/note.js"; -import { resolveUser } from "@/remote/resolve-user.js"; -import { addNoteToAntenna } from "@/services/add-note-to-antenna.js"; -import { - activeUsersChart, - instanceChart, - notesChart, - perUserNotesChart, -} from "@/services/chart/index.js"; -import { createNotification } from "@/services/create-notification.js"; -import { insertNoteUnread } from "@/services/note/unread.js"; -import { registerOrFetchInstanceDoc } from "@/services/register-or-fetch-instance-doc.js"; import { publishMainStream, - publishNoteStream, publishNotesStream, + publishNoteStream, } from "@/services/stream.js"; +import DeliverManager from "@/remote/activitypub/deliver-manager.js"; +import renderNote from "@/remote/activitypub/renderer/note.js"; +import renderCreate from "@/remote/activitypub/renderer/create.js"; +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 "@/services/update-hashtag.js"; -import * as mfm from "mfm-js"; -import { Mutex } from "redis-semaphore"; -import { In, Not } from "typeorm"; +import { concat } from "@/prelude/array.js"; +import { insertNoteUnread } from "@/services/note/unread.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"; +import type { IMentionedRemoteUsers } from "@/models/entities/note.js"; +import { Note } from "@/models/entities/note.js"; +import { + Mutings, + Users, + NoteWatchings, + Notes, + Instances, + UserProfiles, + MutedNotes, + Channels, + ChannelFollowings, + NoteThreadMutings, +} from "@/models/index.js"; +import type { DriveFile } from "@/models/entities/drive-file.js"; +import type { App } from "@/models/entities/app.js"; +import { Not, In } from "typeorm"; +import type { User, ILocalUser, IRemoteUser } from "@/models/entities/user.js"; +import { genId } from "@/misc/gen-id.js"; +import { + notesChart, + perUserNotesChart, + activeUsersChart, + instanceChart, +} from "@/services/chart/index.js"; +import type { IPoll } from "@/models/entities/poll.js"; +import { Poll } from "@/models/entities/poll.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 "@/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"; +import { normalizeForSearch } from "@/misc/normalize-for-search.js"; +import { getAntennas } from "@/misc/antenna-cache.js"; +import { endedPollNotificationQueue } from "@/queue/queues.js"; +import { webhookDeliver } from "@/queue/index.js"; +import { Cache } from "@/misc/cache.js"; +import type { UserProfile } from "@/models/entities/user-profile.js"; +import { db } from "@/db/postgre.js"; +import { getActiveWebhooks } from "@/misc/webhook-cache.js"; +import { shouldSilenceInstance } from "@/misc/should-block-instance.js"; +import meilisearch from "@/db/meilisearch.js"; +import { redisClient } from "@/db/redis.js"; +import { Mutex } from "redis-semaphore"; +import { langmap } from "@/misc/langmap.js"; +import detectLanguage from "@/misc/detect-language.js"; const mutedWordsCache = new Cache< { userId: UserProfile["userId"]; mutedWords: UserProfile["mutedWords"] }[] diff --git a/packages/backend/src/services/note/delete.ts b/packages/backend/src/services/note/delete.ts index 0ec818a290..8a75825809 100644 --- a/packages/backend/src/services/note/delete.ts +++ b/packages/backend/src/services/note/delete.ts @@ -1,27 +1,27 @@ +import { Brackets, In } from "typeorm"; +import { publishNoteStream } from "@/services/stream.js"; +import renderDelete from "@/remote/activitypub/renderer/delete.js"; +import renderAnnounce from "@/remote/activitypub/renderer/announce.js"; +import renderUndo from "@/remote/activitypub/renderer/undo.js"; +import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import renderTombstone from "@/remote/activitypub/renderer/tombstone.js"; import config from "@/config/index.js"; -import meilisearch from "@/db/meilisearch.js"; -import { countSameRenotes } from "@/misc/count-same-renotes.js"; -import type { IMentionedRemoteUsers, Note } from "@/models/entities/note.js"; -import type { ILocalUser, IRemoteUser, User } from "@/models/entities/user.js"; -import { Instances, Notes, Users } from "@/models/index.js"; +import type { User, ILocalUser, IRemoteUser } from "@/models/entities/user.js"; +import type { Note, IMentionedRemoteUsers } from "@/models/entities/note.js"; +import { Notes, Users, Instances } from "@/models/index.js"; +import { + notesChart, + perUserNotesChart, + instanceChart, +} from "@/services/chart/index.js"; import { deliverToFollowers, deliverToUser, } from "@/remote/activitypub/deliver-manager.js"; -import renderAnnounce from "@/remote/activitypub/renderer/announce.js"; -import renderDelete from "@/remote/activitypub/renderer/delete.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import renderTombstone from "@/remote/activitypub/renderer/tombstone.js"; -import renderUndo from "@/remote/activitypub/renderer/undo.js"; -import { - instanceChart, - notesChart, - perUserNotesChart, -} from "@/services/chart/index.js"; +import { countSameRenotes } from "@/misc/count-same-renotes.js"; import { registerOrFetchInstanceDoc } from "@/services/register-or-fetch-instance-doc.js"; import { deliverToRelays } from "@/services/relay.js"; -import { publishNoteStream } from "@/services/stream.js"; -import { Brackets, In } from "typeorm"; +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 073980226c..270b4d9bf2 100644 --- a/packages/backend/src/services/note/polls/update.ts +++ b/packages/backend/src/services/note/polls/update.ts @@ -1,9 +1,9 @@ -import type { Note } from "@/models/entities/note.js"; -import { Notes, Users } from "@/models/index.js"; -import { deliverToFollowers } from "@/remote/activitypub/deliver-manager.js"; +import renderUpdate from "@/remote/activitypub/renderer/update.js"; import { renderActivity } from "@/remote/activitypub/renderer/index.js"; import renderNote from "@/remote/activitypub/renderer/note.js"; -import renderUpdate from "@/remote/activitypub/renderer/update.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 "@/services/relay.js"; export async function deliverQuestionUpdate(noteId: Note["id"]) { diff --git a/packages/backend/src/services/note/polls/vote.ts b/packages/backend/src/services/note/polls/vote.ts index ebffed0d9d..6ade899726 100644 --- a/packages/backend/src/services/note/polls/vote.ts +++ b/packages/backend/src/services/note/polls/vote.ts @@ -1,10 +1,10 @@ -import { genId } from "@/misc/gen-id.js"; -import type { Note } from "@/models/entities/note.js"; -import type { CacheableUser } from "@/models/entities/user.js"; -import { Blockings, NoteWatchings, PollVotes, Polls } from "@/models/index.js"; -import { createNotification } from "@/services/create-notification.js"; import { publishNoteStream } from "@/services/stream.js"; +import type { CacheableUser } 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 "@/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 ed265be8af..123356515d 100644 --- a/packages/backend/src/services/note/reaction/create.ts +++ b/packages/backend/src/services/note/reaction/create.ts @@ -1,26 +1,26 @@ -import { genId } from "@/misc/gen-id.js"; -import { IdentifiableError } from "@/misc/identifiable-error.js"; -import { isDuplicateKeyValueError } from "@/misc/is-duplicate-key-value-error.js"; -import { decodeReaction, toDbReaction } from "@/misc/reaction-lib.js"; -import type { NoteReaction } from "@/models/entities/note-reaction.js"; -import type { Note } from "@/models/entities/note.js"; -import type { IRemoteUser, User } from "@/models/entities/user.js"; -import { - Blockings, - Emojis, - NoteReactions, - NoteWatchings, - Notes, - Users, -} from "@/models/index.js"; +import { publishNoteStream } from "@/services/stream.js"; +import { renderLike } from "@/remote/activitypub/renderer/like.js"; import DeliverManager from "@/remote/activitypub/deliver-manager.js"; import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import { renderLike } from "@/remote/activitypub/renderer/like.js"; -import { perUserReactionsChart } from "@/services/chart/index.js"; -import { createNotification } from "@/services/create-notification.js"; -import { publishNoteStream } from "@/services/stream.js"; +import { toDbReaction, decodeReaction } from "@/misc/reaction-lib.js"; +import type { User, IRemoteUser } from "@/models/entities/user.js"; +import type { Note } from "@/models/entities/note.js"; +import { + NoteReactions, + Users, + NoteWatchings, + Notes, + Emojis, + Blockings, +} from "@/models/index.js"; import { IsNull, Not } from "typeorm"; +import { perUserReactionsChart } from "@/services/chart/index.js"; +import { genId } from "@/misc/gen-id.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"; +import { IdentifiableError } from "@/misc/identifiable-error.js"; export default async ( user: { id: User["id"]; host: User["host"] }, diff --git a/packages/backend/src/services/note/reaction/delete.ts b/packages/backend/src/services/note/reaction/delete.ts index 159d86f4a8..15c6d1cf62 100644 --- a/packages/backend/src/services/note/reaction/delete.ts +++ b/packages/backend/src/services/note/reaction/delete.ts @@ -1,13 +1,13 @@ -import { IdentifiableError } from "@/misc/identifiable-error.js"; -import { decodeReaction } from "@/misc/reaction-lib.js"; -import type { Note } from "@/models/entities/note.js"; -import type { IRemoteUser, User } from "@/models/entities/user.js"; -import { NoteReactions, Notes, Users } from "@/models/index.js"; -import DeliverManager from "@/remote/activitypub/deliver-manager.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import { publishNoteStream } from "@/services/stream.js"; import { renderLike } from "@/remote/activitypub/renderer/like.js"; import renderUndo from "@/remote/activitypub/renderer/undo.js"; -import { publishNoteStream } from "@/services/stream.js"; +import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import DeliverManager from "@/remote/activitypub/deliver-manager.js"; +import { IdentifiableError } from "@/misc/identifiable-error.js"; +import type { User, IRemoteUser } from "@/models/entities/user.js"; +import type { Note } from "@/models/entities/note.js"; +import { NoteReactions, Users, Notes } from "@/models/index.js"; +import { decodeReaction } from "@/misc/reaction-lib.js"; export default async ( user: { id: User["id"]; host: User["host"] }, diff --git a/packages/backend/src/services/note/read.ts b/packages/backend/src/services/note/read.ts index b127e88369..07d277d84f 100644 --- a/packages/backend/src/services/note/read.ts +++ b/packages/backend/src/services/note/read.ts @@ -1,16 +1,16 @@ -import type { Packed } from "@/misc/schema.js"; -import type { Channel } from "@/models/entities/channel.js"; +import { publishMainStream } from "@/services/stream.js"; import type { Note } from "@/models/entities/note.js"; import type { User } from "@/models/entities/user.js"; import { - ChannelFollowings, - Followings, NoteUnreads, Users, + Followings, + ChannelFollowings, } from "@/models/index.js"; +import { Not, IsNull, In } from "typeorm"; +import type { Channel } from "@/models/entities/channel.js"; import { readNotificationByQuery } from "@/server/api/common/read-notification.js"; -import { publishMainStream } from "@/services/stream.js"; -import { In, IsNull, Not } from "typeorm"; +import type { Packed } from "@/misc/schema.js"; /** * Mark notes as read diff --git a/packages/backend/src/services/note/unread.ts b/packages/backend/src/services/note/unread.ts index 6825ee7c96..cb87abe0e6 100644 --- a/packages/backend/src/services/note/unread.ts +++ b/packages/backend/src/services/note/unread.ts @@ -1,8 +1,8 @@ -import { genId } from "@/misc/gen-id.js"; import type { Note } from "@/models/entities/note.js"; +import { publishMainStream } from "@/services/stream.js"; import type { User } from "@/models/entities/user.js"; import { Mutings, NoteThreadMutings, NoteUnreads } from "@/models/index.js"; -import { publishMainStream } from "@/services/stream.js"; +import { genId } from "@/misc/gen-id.js"; export async function insertNoteUnread( userId: User["id"], diff --git a/packages/backend/src/services/note/unwatch.ts b/packages/backend/src/services/note/unwatch.ts index 0b2e42281a..b4da5e86da 100644 --- a/packages/backend/src/services/note/unwatch.ts +++ b/packages/backend/src/services/note/unwatch.ts @@ -1,6 +1,6 @@ -import type { Note } from "@/models/entities/note.js"; import type { User } from "@/models/entities/user.js"; import { NoteWatchings } from "@/models/index.js"; +import type { Note } from "@/models/entities/note.js"; export default async (me: User["id"], note: Note) => { await NoteWatchings.delete({ diff --git a/packages/backend/src/services/note/watch.ts b/packages/backend/src/services/note/watch.ts index c69efe68a3..2a99dd6949 100644 --- a/packages/backend/src/services/note/watch.ts +++ b/packages/backend/src/services/note/watch.ts @@ -1,8 +1,8 @@ +import type { User } from "@/models/entities/user.js"; +import type { Note } from "@/models/entities/note.js"; +import { NoteWatchings } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import type { NoteWatching } from "@/models/entities/note-watching.js"; -import type { Note } from "@/models/entities/note.js"; -import type { User } from "@/models/entities/user.js"; -import { NoteWatchings } from "@/models/index.js"; export default async (me: User["id"], note: Note) => { // 自分の投稿はwatchできない diff --git a/packages/backend/src/services/push-notification.ts b/packages/backend/src/services/push-notification.ts index 1e0486ff38..a207fae391 100644 --- a/packages/backend/src/services/push-notification.ts +++ b/packages/backend/src/services/push-notification.ts @@ -1,9 +1,9 @@ -import config from "@/config/index.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; -import { getNoteSummary } from "@/misc/get-note-summary.js"; -import type { Packed } from "@/misc/schema.js"; -import { SwSubscriptions } from "@/models/index.js"; import push from "web-push"; +import config from "@/config/index.js"; +import { SwSubscriptions } from "@/models/index.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; +import type { Packed } from "@/misc/schema.js"; +import { getNoteSummary } from "@/misc/get-note-summary.js"; // Defined also packages/sw/types.ts#L14-L21 type pushNotificationsTypes = { diff --git a/packages/backend/src/services/register-or-fetch-instance-doc.ts b/packages/backend/src/services/register-or-fetch-instance-doc.ts index c56e609e53..c0ead08190 100644 --- a/packages/backend/src/services/register-or-fetch-instance-doc.ts +++ b/packages/backend/src/services/register-or-fetch-instance-doc.ts @@ -1,8 +1,8 @@ -import { Cache } from "@/misc/cache.js"; -import { toPuny } from "@/misc/convert-host.js"; -import { genId } from "@/misc/gen-id.js"; import type { Instance } from "@/models/entities/instance.js"; import { Instances } from "@/models/index.js"; +import { genId } from "@/misc/gen-id.js"; +import { toPuny } from "@/misc/convert-host.js"; +import { Cache } from "@/misc/cache.js"; const cache = new Cache("registerOrFetchInstanceDoc", 60 * 60); diff --git a/packages/backend/src/services/relay.ts b/packages/backend/src/services/relay.ts index 20d9380868..fdc42616ea 100644 --- a/packages/backend/src/services/relay.ts +++ b/packages/backend/src/services/relay.ts @@ -1,17 +1,17 @@ -import { Cache } from "@/misc/cache.js"; -import { genId } from "@/misc/gen-id.js"; -import type { Relay } from "@/models/entities/relay.js"; -import type { ILocalUser, User } from "@/models/entities/user.js"; -import { Relays, Users } from "@/models/index.js"; -import { deliver } from "@/queue/index.js"; +import { IsNull } from "typeorm"; import { renderFollowRelay } from "@/remote/activitypub/renderer/follow-relay.js"; import { - attachLdSignature, renderActivity, + attachLdSignature, } from "@/remote/activitypub/renderer/index.js"; import renderUndo from "@/remote/activitypub/renderer/undo.js"; +import { deliver } from "@/queue/index.js"; +import type { ILocalUser, User } from "@/models/entities/user.js"; +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 "@/services/create-system-user.js"; -import { IsNull } from "typeorm"; const ACTOR_USERNAME = "relay.actor" as const; diff --git a/packages/backend/src/services/send-email.ts b/packages/backend/src/services/send-email.ts index 7874af136f..ccc6b365d9 100644 --- a/packages/backend/src/services/send-email.ts +++ b/packages/backend/src/services/send-email.ts @@ -1,7 +1,7 @@ -import config from "@/config/index.js"; +import * as nodemailer from "nodemailer"; import { fetchMeta } from "@/misc/fetch-meta.js"; import Logger from "@/services/logger.js"; -import * as nodemailer from "nodemailer"; +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 518f35359b..f59674ad6a 100644 --- a/packages/backend/src/services/stream.ts +++ b/packages/backend/src/services/stream.ts @@ -1,12 +1,13 @@ -import config from "@/config/index.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"; +import type { UserGroup } from "@/models/entities/user-group.js"; +import config from "@/config/index.js"; import type { Antenna } from "@/models/entities/antenna.js"; import type { Channel } from "@/models/entities/channel.js"; -import type { Note } from "@/models/entities/note.js"; -import type { UserGroup } from "@/models/entities/user-group.js"; -import type { UserList } from "@/models/entities/user-list.js"; -import type { User } from "@/models/entities/user.js"; import type { + StreamChannels, AdminStreamTypes, AntennaStreamTypes, BroadcastTypes, @@ -18,7 +19,6 @@ import type { MessagingIndexStreamTypes, MessagingStreamTypes, NoteStreamTypes, - StreamChannels, UserListStreamTypes, UserStreamTypes, } from "@/server/api/stream/types.js"; diff --git a/packages/backend/src/services/suspend-user.ts b/packages/backend/src/services/suspend-user.ts index 919f6d0abe..f72b8ffcb1 100644 --- a/packages/backend/src/services/suspend-user.ts +++ b/packages/backend/src/services/suspend-user.ts @@ -1,11 +1,11 @@ -import config from "@/config/index.js"; -import type { User } from "@/models/entities/user.js"; -import { Followings, Users } from "@/models/index.js"; -import { deliver } from "@/queue/index.js"; import renderDelete from "@/remote/activitypub/renderer/delete.js"; import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import { deliver } from "@/queue/index.js"; +import config from "@/config/index.js"; +import type { User } from "@/models/entities/user.js"; +import { Users, Followings } from "@/models/index.js"; +import { Not, IsNull } from "typeorm"; import { publishInternalEvent } from "@/services/stream.js"; -import { IsNull, Not } from "typeorm"; export async function doPostSuspend(user: { id: User["id"]; diff --git a/packages/backend/src/services/unsuspend-user.ts b/packages/backend/src/services/unsuspend-user.ts index 944ef18bed..69447a4a26 100644 --- a/packages/backend/src/services/unsuspend-user.ts +++ b/packages/backend/src/services/unsuspend-user.ts @@ -1,12 +1,12 @@ +import renderDelete from "@/remote/activitypub/renderer/delete.js"; +import renderUndo from "@/remote/activitypub/renderer/undo.js"; +import { renderActivity } from "@/remote/activitypub/renderer/index.js"; +import { deliver } from "@/queue/index.js"; import config from "@/config/index.js"; import type { User } from "@/models/entities/user.js"; -import { Followings, Users } from "@/models/index.js"; -import { deliver } from "@/queue/index.js"; -import renderDelete from "@/remote/activitypub/renderer/delete.js"; -import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import renderUndo from "@/remote/activitypub/renderer/undo.js"; +import { Users, Followings } from "@/models/index.js"; +import { Not, IsNull } from "typeorm"; import { publishInternalEvent } from "@/services/stream.js"; -import { IsNull, Not } from "typeorm"; export async function doPostUnsuspend(user: User) { publishInternalEvent("userChangeSuspendedState", { diff --git a/packages/backend/src/services/update-hashtag.ts b/packages/backend/src/services/update-hashtag.ts index db08bd1485..0c65b08f0a 100644 --- a/packages/backend/src/services/update-hashtag.ts +++ b/packages/backend/src/services/update-hashtag.ts @@ -1,9 +1,9 @@ -import { genId } from "@/misc/gen-id.js"; -import { normalizeForSearch } from "@/misc/normalize-for-search.js"; -import type { Hashtag } from "@/models/entities/hashtag.js"; import type { User } from "@/models/entities/user.js"; import { Hashtags, Users } from "@/models/index.js"; import { hashtagChart } from "@/services/chart/index.js"; +import { genId } from "@/misc/gen-id.js"; +import type { Hashtag } from "@/models/entities/hashtag.js"; +import { normalizeForSearch } from "@/misc/normalize-for-search.js"; export async function updateHashtags( user: { id: User["id"]; host: User["host"] }, diff --git a/packages/backend/src/services/user-cache.ts b/packages/backend/src/services/user-cache.ts index 699d5edde1..ed700185df 100644 --- a/packages/backend/src/services/user-cache.ts +++ b/packages/backend/src/services/user-cache.ts @@ -1,11 +1,11 @@ -import { redisClient, subscriber } from "@/db/redis.js"; -import { Cache } from "@/misc/cache.js"; import type { CacheableLocalUser, CacheableUser, ILocalUser, } from "@/models/entities/user.js"; import { Users } from "@/models/index.js"; +import { Cache } from "@/misc/cache.js"; +import { redisClient, subscriber } from "@/db/redis.js"; export const userByIdCache = new Cache("userById", 60 * 30); export const localUserByNativeTokenCache = new Cache( diff --git a/packages/backend/src/services/user-list/push.ts b/packages/backend/src/services/user-list/push.ts index 77181bf7b4..db01b0a900 100644 --- a/packages/backend/src/services/user-list/push.ts +++ b/packages/backend/src/services/user-list/push.ts @@ -1,11 +1,11 @@ -import { fetchProxyAccount } from "@/misc/fetch-proxy-account.js"; -import { genId } from "@/misc/gen-id.js"; -import type { UserListJoining } from "@/models/entities/user-list-joining.js"; -import type { UserList } from "@/models/entities/user-list.js"; -import type { User } from "@/models/entities/user.js"; -import { UserListJoinings, Users } from "@/models/index.js"; -import createFollowing from "@/services/following/create.js"; import { publishUserListStream } from "@/services/stream.js"; +import type { User } from "@/models/entities/user.js"; +import type { UserList } from "@/models/entities/user-list.js"; +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 "@/services/following/create.js"; export async function pushUserToUserList(target: User, list: UserList) { await UserListJoinings.insert({ diff --git a/packages/backend/src/services/validate-email-for-account.ts b/packages/backend/src/services/validate-email-for-account.ts index 419203f536..2bb5e93e7e 100644 --- a/packages/backend/src/services/validate-email-for-account.ts +++ b/packages/backend/src/services/validate-email-for-account.ts @@ -1,6 +1,6 @@ -import { fetchMeta } from "@/misc/fetch-meta.js"; -import { UserProfiles } from "@/models/index.js"; import { validate as validateEmail } from "deep-email-validator"; +import { UserProfiles } from "@/models/index.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; export async function validateEmailForAccount(emailAddress: string): Promise<{ available: boolean; From 452f29bcb385c89052f70c225b3468f395969a82 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Mon, 4 Dec 2023 23:12:33 -0800 Subject: [PATCH 4/6] Revert "chore: :rotating_light: lint" This reverts commit f7ce60cd9f6a6f92aed1f5bc4d0893105c272708. --- packages/client/src/account.ts | 6 +++--- packages/client/src/i18n.ts | 2 +- packages/client/src/init.ts | 2 +- packages/client/src/navbar.ts | 2 +- packages/client/src/nirax.ts | 4 ++-- packages/client/src/os.ts | 14 +++++++------- packages/client/src/pizzax.ts | 2 +- packages/client/src/plugin.ts | 2 +- packages/client/src/reactiveAccount.ts | 2 +- packages/client/src/router.ts | 4 ++-- packages/client/src/stream.ts | 4 ++-- packages/client/src/theme-store.ts | 2 +- packages/firefish-js/src/api.types.ts | 10 +++++----- packages/firefish-js/src/index.ts | 4 ++-- packages/firefish-js/src/streaming.ts | 6 +++--- packages/megalodon/src/index.ts | 16 ++++++++-------- packages/megalodon/src/megalodon.ts | 10 +++++----- packages/megalodon/src/misskey.ts | 20 ++++++++++---------- 18 files changed, 56 insertions(+), 56 deletions(-) diff --git a/packages/client/src/account.ts b/packages/client/src/account.ts index d89dd2499e..562a9e5422 100644 --- a/packages/client/src/account.ts +++ b/packages/client/src/account.ts @@ -1,12 +1,12 @@ +import type * as firefish from "firefish-js"; +import { defineAsyncComponent } from "vue"; +import { i18n } from "./i18n"; import { apiUrl } from "@/config"; import { alert, api, popup, popupMenu, waiting } from "@/os"; import { $i } from "@/reactiveAccount"; import icon from "@/scripts/icon"; import { del, get, set } from "@/scripts/idb-proxy"; import { reloadChannel, unisonReload } from "@/scripts/unison-reload"; -import type * as firefish from "firefish-js"; -import { defineAsyncComponent } from "vue"; -import { i18n } from "./i18n"; // TODO: 他のタブと永続化されたstateを同期 diff --git a/packages/client/src/i18n.ts b/packages/client/src/i18n.ts index 31a6686f1a..5b0a7f9ed8 100644 --- a/packages/client/src/i18n.ts +++ b/packages/client/src/i18n.ts @@ -1,6 +1,6 @@ +import { markRaw } from "vue"; import { locale } from "@/config"; import { I18n } from "@/scripts/i18n"; -import { markRaw } from "vue"; export const i18n = markRaw(new I18n(locale)); diff --git a/packages/client/src/init.ts b/packages/client/src/init.ts index be93c75fba..b758b4c99e 100644 --- a/packages/client/src/init.ts +++ b/packages/client/src/init.ts @@ -22,7 +22,6 @@ if (accounts) { } // #endregion -import { set } from "@/scripts/idb-proxy"; import { compareVersions } from "compare-versions"; import { computed, @@ -32,6 +31,7 @@ import { version as vueVersion, watch, } from "vue"; +import { set } from "@/scripts/idb-proxy"; import { login, refreshAccount, signout, updateAccount } from "@/account"; import components from "@/components"; diff --git a/packages/client/src/navbar.ts b/packages/client/src/navbar.ts index 7a120c5208..55cfab5bba 100644 --- a/packages/client/src/navbar.ts +++ b/packages/client/src/navbar.ts @@ -1,3 +1,4 @@ +import { computed, reactive } from "vue"; import { ui } from "@/config"; import { i18n } from "@/i18n"; import * as os from "@/os"; @@ -5,7 +6,6 @@ import { $i } from "@/reactiveAccount"; import icon from "@/scripts/icon"; import { search } from "@/scripts/search"; import { unisonReload } from "@/scripts/unison-reload"; -import { computed, reactive } from "vue"; export const navbarItemDef = reactive({ notifications: { diff --git a/packages/client/src/nirax.ts b/packages/client/src/nirax.ts index ed1a57bbf4..800d47042c 100644 --- a/packages/client/src/nirax.ts +++ b/packages/client/src/nirax.ts @@ -1,10 +1,10 @@ // NIRAX --- A lightweight router -import { pleaseLogin } from "@/scripts/please-login"; -import { safeURIDecode } from "@/scripts/safe-uri-decode"; import { EventEmitter } from "eventemitter3"; import type { Component, ShallowRef } from "vue"; import { shallowRef } from "vue"; +import { safeURIDecode } from "@/scripts/safe-uri-decode"; +import { pleaseLogin } from "@/scripts/please-login"; interface RouteDef { path: string; diff --git a/packages/client/src/os.ts b/packages/client/src/os.ts index 022cd1bd81..d367dc2fc9 100644 --- a/packages/client/src/os.ts +++ b/packages/client/src/os.ts @@ -1,18 +1,18 @@ // TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する -import MkDialog from "@/components/MkDialog.vue"; -import MkPostFormDialog from "@/components/MkPostFormDialog.vue"; -import MkToast from "@/components/MkToast.vue"; -import MkWaitingDialog from "@/components/MkWaitingDialog.vue"; -import { url, apiUrl } from "@/config"; -import { $i } from "@/reactiveAccount"; -import type { MenuItem } from "@/types/menu"; import { EventEmitter } from "eventemitter3"; import * as firefish from "firefish-js"; import insertTextAtCursor from "insert-text-at-cursor"; import type { Component, Ref } from "vue"; import { defineAsyncComponent, markRaw, ref } from "vue"; import { i18n } from "./i18n"; +import MkDialog from "@/components/MkDialog.vue"; +import MkPostFormDialog from "@/components/MkPostFormDialog.vue"; +import MkToast from "@/components/MkToast.vue"; +import MkWaitingDialog from "@/components/MkWaitingDialog.vue"; +import { apiUrl, url } from "@/config"; +import { $i } from "@/reactiveAccount"; +import type { MenuItem } from "@/types/menu"; export const pendingApiRequestsCount = ref(0); diff --git a/packages/client/src/pizzax.ts b/packages/client/src/pizzax.ts index 489a740ef9..a16c8067f6 100644 --- a/packages/client/src/pizzax.ts +++ b/packages/client/src/pizzax.ts @@ -1,10 +1,10 @@ // PIZZAX --- A lightweight store -import { $i } from "@/reactiveAccount"; import type { Ref } from "vue"; import { onUnmounted, ref, watch } from "vue"; import { api } from "./os"; import { stream } from "./stream"; +import { $i } from "@/reactiveAccount"; type StateDef = Record< string, diff --git a/packages/client/src/plugin.ts b/packages/client/src/plugin.ts index 2789cc7937..c38aaa365a 100644 --- a/packages/client/src/plugin.ts +++ b/packages/client/src/plugin.ts @@ -1,3 +1,4 @@ +import { Interpreter, Parser, utils, values } from "@syuilo/aiscript"; import { inputText } from "@/os"; import { createAiScriptEnv } from "@/scripts/aiscript/api"; import { @@ -7,7 +8,6 @@ import { postFormActions, userActions, } from "@/store"; -import { Interpreter, Parser, utils, values } from "@syuilo/aiscript"; const parser = new Parser(); const pluginContexts = new Map(); diff --git a/packages/client/src/reactiveAccount.ts b/packages/client/src/reactiveAccount.ts index c192cdb7c3..46ff249926 100644 --- a/packages/client/src/reactiveAccount.ts +++ b/packages/client/src/reactiveAccount.ts @@ -1,5 +1,5 @@ -import type { Account } from "@/account"; import { reactive } from "vue"; +import type { Account } from "@/account"; const accountData = localStorage.getItem("account"); diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index c1aaeb5b91..5dff5a4ba8 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -1,10 +1,10 @@ +import type { AsyncComponentLoader } from "vue"; +import { defineAsyncComponent, inject } from "vue"; import { iAmModerator } from "@/account"; import { Router } from "@/nirax"; import MkError from "@/pages/_error_.vue"; import MkLoading from "@/pages/_loading_.vue"; import { $i } from "@/reactiveAccount"; -import type { AsyncComponentLoader } from "vue"; -import { defineAsyncComponent, inject } from "vue"; // import { api } from "@/os"; // function getGuestTimelineStatus() { diff --git a/packages/client/src/stream.ts b/packages/client/src/stream.ts index a1a9fbf78d..f0dd1879a2 100644 --- a/packages/client/src/stream.ts +++ b/packages/client/src/stream.ts @@ -1,7 +1,7 @@ -import { url } from "@/config"; -import { $i } from "@/reactiveAccount"; import * as firefish from "firefish-js"; import { markRaw } from "vue"; +import { url } from "@/config"; +import { $i } from "@/reactiveAccount"; export const stream = markRaw( new firefish.Stream( diff --git a/packages/client/src/theme-store.ts b/packages/client/src/theme-store.ts index a60d8e8c69..866ba064c4 100644 --- a/packages/client/src/theme-store.ts +++ b/packages/client/src/theme-store.ts @@ -1,6 +1,6 @@ +import type { Theme } from "./scripts/theme"; import { api } from "@/os"; import { $i } from "@/reactiveAccount"; -import type { Theme } from "./scripts/theme"; const lsCacheKey = $i ? `themes:${$i.id}` : ""; diff --git a/packages/firefish-js/src/api.types.ts b/packages/firefish-js/src/api.types.ts index c2344991d8..626bdaad02 100644 --- a/packages/firefish-js/src/api.types.ts +++ b/packages/firefish-js/src/api.types.ts @@ -11,30 +11,30 @@ import { DetailedInstanceMetadata, DriveFile, DriveFolder, - FollowRequest, Following, FollowingFolloweePopulated, FollowingFollowerPopulated, + FollowRequest, GalleryPost, Instance, InstanceMetadata, LiteInstanceMetadata, MeDetailed, - MessagingMessage, Note, NoteFavorite, - NoteReaction, - Notification, OriginType, Page, ServerInfo, - Signin, Stats, User, UserDetailed, UserGroup, UserList, UserSorting, + Notification, + NoteReaction, + Signin, + MessagingMessage, } from "./entities"; type TODO = Record | null; diff --git a/packages/firefish-js/src/index.ts b/packages/firefish-js/src/index.ts index c0212f8501..128ed8c535 100644 --- a/packages/firefish-js/src/index.ts +++ b/packages/firefish-js/src/index.ts @@ -1,8 +1,8 @@ -import { Acct } from "./acct"; import { Endpoints } from "./api.types"; -import * as consts from "./consts"; import Stream, { Connection } from "./streaming"; import { Channels } from "./streaming.types"; +import { Acct } from "./acct"; +import * as consts from "./consts"; export { Endpoints, Stream, Connection as ChannelConnection, Channels, Acct }; diff --git a/packages/firefish-js/src/streaming.ts b/packages/firefish-js/src/streaming.ts index b3c2819d4f..4697acabd7 100644 --- a/packages/firefish-js/src/streaming.ts +++ b/packages/firefish-js/src/streaming.ts @@ -27,9 +27,9 @@ export function urlQuery( const params = Object.entries(obj) .filter(([, v]) => (Array.isArray(v) ? v.length : v !== undefined)) .reduce( - // biome-ignore lint/suspicious/noAssignInExpressions: - // biome-ignore lint/style/noNonNullAssertion: <> - // biome-ignore lint/style/noCommaOperator: <> + // rome-ignore lint/suspicious/noAssignInExpressions: + // rome-ignore lint/style/noNonNullAssertion: <> + // rome-ignore lint/style/noCommaOperator: <> (a, [k, v]) => ((a[k] = v!), a), {} as Record, ); diff --git a/packages/megalodon/src/index.ts b/packages/megalodon/src/index.ts index c205988721..758d3a46ad 100644 --- a/packages/megalodon/src/index.ts +++ b/packages/megalodon/src/index.ts @@ -1,17 +1,17 @@ -import { RequestCanceledError, isCancel } from "./cancel"; -import Converter from "./converter"; -import Entity from "./entity"; -import FilterContext from "./filter_context"; +import Response from "./response"; +import OAuth from "./oauth"; +import { isCancel, RequestCanceledError } from "./cancel"; +import { ProxyConfig } from "./proxy_config"; import generator, { + detector, MegalodonInterface, WebSocketInterface, - detector, } from "./megalodon"; import Misskey from "./misskey"; +import Entity from "./entity"; import NotificationType from "./notification"; -import OAuth from "./oauth"; -import { ProxyConfig } from "./proxy_config"; -import Response from "./response"; +import FilterContext from "./filter_context"; +import Converter from "./converter"; export { Response, diff --git a/packages/megalodon/src/megalodon.ts b/packages/megalodon/src/megalodon.ts index 0b760fe87d..33a5790f67 100644 --- a/packages/megalodon/src/megalodon.ts +++ b/packages/megalodon/src/megalodon.ts @@ -1,10 +1,10 @@ -import axios, { AxiosRequestConfig } from "axios"; -import { DEFAULT_UA } from "./default"; -import Entity from "./entity"; -import Misskey from "./misskey"; +import Response from "./response"; import OAuth from "./oauth"; import proxyAgent, { ProxyConfig } from "./proxy_config"; -import Response from "./response"; +import Entity from "./entity"; +import axios, { AxiosRequestConfig } from "axios"; +import Misskey from "./misskey"; +import { DEFAULT_UA } from "./default"; export interface WebSocketInterface { start(): void; diff --git a/packages/megalodon/src/misskey.ts b/packages/megalodon/src/misskey.ts index 1c2c2ad6db..25922a2ffc 100644 --- a/packages/megalodon/src/misskey.ts +++ b/packages/megalodon/src/misskey.ts @@ -1,22 +1,22 @@ -import AsyncLock from "async-lock"; import FormData from "form-data"; +import AsyncLock from "async-lock"; -import fs from "node:fs"; -import MegalodonEntity from "@/entity"; +import MisskeyAPI from "./misskey/api_client"; import { DEFAULT_UA } from "./default"; +import { ProxyConfig } from "./proxy_config"; +import OAuth from "./oauth"; +import Response from "./response"; import Entity from "./entity"; import { - ArgumentError, MegalodonInterface, - NoImplementedError, - UnexpectedError, WebSocketInterface, + NoImplementedError, + ArgumentError, + UnexpectedError, } from "./megalodon"; -import MisskeyAPI from "./misskey/api_client"; +import MegalodonEntity from "@/entity"; +import fs from "node:fs"; import MisskeyNotificationType from "./misskey/notification"; -import OAuth from "./oauth"; -import { ProxyConfig } from "./proxy_config"; -import Response from "./response"; type AccountCache = { locks: AsyncLock; From 7ec84615a07d4df9a36183b2116496750cc4f953 Mon Sep 17 00:00:00 2001 From: naskya Date: Tue, 5 Dec 2023 08:58:57 +0000 Subject: [PATCH 5/6] chore (locale, minor): update ja-JP.yml --- locales/ja-JP.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 1854163812..71f3c94351 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -994,8 +994,8 @@ addRe: "閲覧注意の投稿への返信で、注釈の先頭に\"re:\"を追 languageForTranslation: "投稿翻訳に使用する言語" detectPostLanguage: "投稿の言語を自動検出し、外国語の投稿に翻訳ボタンを表示する" iconSet: "アイコンのスタイル" -useEmojiCdn: "CDN から Twemoji を使用する" -useEmojiCdnDescription: "サーバーのアセットではなく、JSDelivr CDN から Twemoji を使用してください。" +useEmojiCdn: "CDNのTwemojiを利用する" +useEmojiCdnDescription: "サーバー上に保存されているTwemojiのアセットの代わりに、JSDelivr CDNから配信されたものを用います。" _sensitiveMediaDetection: description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てられます。サーバーの負荷が少し増えます。" From e3f4936f697d348697293013cc955baa188f49d5 Mon Sep 17 00:00:00 2001 From: Mizunashi Mana Date: Tue, 5 Dec 2023 19:19:37 +0000 Subject: [PATCH 6/6] Move typescript of megalodon from deps to dev-deps --- packages/megalodon/package.json | 4 +- pnpm-lock.yaml | 151 ++++++++------------------------ 2 files changed, 38 insertions(+), 117 deletions(-) diff --git a/packages/megalodon/package.json b/packages/megalodon/package.json index 3403b94b47..fc368340ab 100644 --- a/packages/megalodon/package.json +++ b/packages/megalodon/package.json @@ -45,7 +45,6 @@ "object-assign-deep": "^0.4.0", "parse-link-header": "^2.0.0", "socks-proxy-agent": "^7.0.0", - "typescript": "4.9.4", "uuid": "^9.0.0", "ws": "8.12.0", "async-lock": "1.4.0" @@ -74,7 +73,8 @@ "lodash": "^4.17.14", "prettier": "^2.8.3", "ts-jest": "^29.0.5", - "typedoc": "^0.23.24" + "typedoc": "^0.23.24", + "typescript": "4.9.4" }, "directories": { "lib": "lib", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7bb21266fb..39a65a4089 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -152,7 +152,7 @@ importers: version: 2.1498.0 axios: specifier: ^1.6.2 - version: 1.6.2 + version: 1.6.2(debug@4.3.4) bcryptjs: specifier: 2.4.3 version: 2.4.3 @@ -841,7 +841,7 @@ importers: version: 9.0.1 vite: specifier: 5.0.0 - version: 5.0.0(sass@1.69.5) + version: 5.0.0(@types/node@20.9.0)(sass@1.69.5) vite-plugin-compression: specifier: ^0.5.1 version: 0.5.1(vite@5.0.0) @@ -946,9 +946,6 @@ importers: socks-proxy-agent: specifier: ^7.0.0 version: 7.0.0 - typescript: - specifier: 4.9.4 - version: 4.9.4 uuid: specifier: ^9.0.0 version: 9.0.0 @@ -1028,6 +1025,9 @@ importers: typedoc: specifier: ^0.23.24 version: 0.23.28(typescript@4.9.4) + typescript: + specifier: 4.9.4 + version: 4.9.4 packages/sw: optionalDependencies: @@ -1129,7 +1129,7 @@ packages: '@babel/traverse': 7.23.2 '@babel/types': 7.23.0 convert-source-map: 2.0.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -1585,7 +1585,7 @@ packages: '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.23.0 '@babel/types': 7.23.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -4531,7 +4531,7 @@ packages: '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/type-utils': 5.62.0(eslint@8.53.0)(typescript@5.2.2) '@typescript-eslint/utils': 5.62.0(eslint@8.53.0)(typescript@5.2.2) - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.53.0 graphemer: 1.4.0 ignore: 5.2.4 @@ -4560,7 +4560,7 @@ packages: '@typescript-eslint/type-utils': 6.11.0(eslint@8.53.0)(typescript@5.2.2) '@typescript-eslint/utils': 6.11.0(eslint@8.53.0)(typescript@5.2.2) '@typescript-eslint/visitor-keys': 6.11.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.53.0 graphemer: 1.4.0 ignore: 5.2.4 @@ -4605,7 +4605,7 @@ packages: '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.53.0 typescript: 5.2.2 transitivePeerDependencies: @@ -4626,7 +4626,7 @@ packages: '@typescript-eslint/types': 6.11.0 '@typescript-eslint/typescript-estree': 6.11.0(typescript@5.2.2) '@typescript-eslint/visitor-keys': 6.11.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.53.0 typescript: 5.2.2 transitivePeerDependencies: @@ -4681,7 +4681,7 @@ packages: dependencies: '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) '@typescript-eslint/utils': 5.62.0(eslint@8.53.0)(typescript@5.2.2) - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.53.0 tsutils: 3.21.0(typescript@5.2.2) typescript: 5.2.2 @@ -4701,7 +4701,7 @@ packages: dependencies: '@typescript-eslint/typescript-estree': 6.11.0(typescript@5.2.2) '@typescript-eslint/utils': 6.11.0(eslint@8.53.0)(typescript@5.2.2) - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.53.0 ts-api-utils: 1.0.1(typescript@5.2.2) typescript: 5.2.2 @@ -4751,7 +4751,7 @@ packages: dependencies: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 @@ -4772,7 +4772,7 @@ packages: dependencies: '@typescript-eslint/types': 6.11.0 '@typescript-eslint/visitor-keys': 6.11.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 @@ -4868,7 +4868,7 @@ packages: vite: ^4.0.0 || ^5.0.0 vue: ^3.2.25 dependencies: - vite: 5.0.0(sass@1.69.5) + vite: 5.0.0(@types/node@20.9.0)(sass@1.69.5) vue: 3.3.8(typescript@5.2.2) dev: true @@ -5785,7 +5785,7 @@ packages: /axios@0.24.0: resolution: {integrity: sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==} dependencies: - follow-redirects: 1.15.2 + follow-redirects: 1.15.2(debug@4.3.4) transitivePeerDependencies: - debug dev: false @@ -5800,16 +5800,6 @@ packages: - debug dev: false - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.2 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: false - /axios@1.6.2(debug@4.3.4): resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} dependencies: @@ -5818,7 +5808,6 @@ packages: proxy-from-env: 1.1.0 transitivePeerDependencies: - debug - dev: true /b4a@1.6.4: resolution: {integrity: sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==} @@ -7556,16 +7545,6 @@ packages: dependencies: ms: 2.0.0 - /debug@3.2.7: - resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.3 - /debug@3.2.7(supports-color@8.1.1): resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} peerDependencies: @@ -7576,7 +7555,6 @@ packages: dependencies: ms: 2.1.3 supports-color: 8.1.1 - dev: true /debug@4.3.3: resolution: {integrity: sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==} @@ -7590,18 +7568,6 @@ packages: ms: 2.1.2 dev: false - /debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.2 - dev: true - /debug@4.3.4(supports-color@8.1.1): resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -8379,7 +8345,7 @@ packages: /eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} dependencies: - debug: 3.2.7 + debug: 3.2.7(supports-color@8.1.1) is-core-module: 2.13.0 resolve: 1.22.4 transitivePeerDependencies: @@ -8437,7 +8403,7 @@ packages: optional: true dependencies: '@typescript-eslint/parser': 5.62.0(eslint@8.53.0)(typescript@5.2.2) - debug: 3.2.7 + debug: 3.2.7(supports-color@8.1.1) eslint: 8.53.0 eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: @@ -8466,7 +8432,7 @@ packages: optional: true dependencies: '@typescript-eslint/parser': 6.11.0(eslint@8.53.0)(typescript@5.2.2) - debug: 3.2.7 + debug: 3.2.7(supports-color@8.1.1) eslint: 8.53.0 eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: @@ -8584,7 +8550,7 @@ packages: array.prototype.findlastindex: 1.2.2 array.prototype.flat: 1.3.1 array.prototype.flatmap: 1.3.1 - debug: 3.2.7 + debug: 3.2.7(supports-color@8.1.1) doctrine: 2.1.0 eslint: 8.53.0 eslint-import-resolver-node: 0.3.9 @@ -8620,7 +8586,7 @@ packages: array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 array.prototype.flatmap: 1.3.2 - debug: 3.2.7 + debug: 3.2.7(supports-color@8.1.1) doctrine: 2.1.0 eslint: 8.53.0 eslint-import-resolver-node: 0.3.9 @@ -8649,7 +8615,7 @@ packages: '@es-joy/jsdoccomment': 0.41.0 are-docs-informative: 0.0.2 comment-parser: 1.4.1 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) escape-string-regexp: 4.0.0 eslint: 8.53.0 esquery: 1.5.0 @@ -8980,7 +8946,7 @@ packages: peerDependencies: eslint: '>=6.0.0' dependencies: - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.53.0 eslint-compat-utils: 0.1.2(eslint@8.53.0) lodash: 4.17.21 @@ -8996,7 +8962,7 @@ packages: peerDependencies: eslint: '>=6.0.0' dependencies: - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.53.0 lodash: 4.17.21 natural-compare: 1.4.0 @@ -9769,16 +9735,6 @@ packages: tabbable: 6.2.0 dev: true - /follow-redirects@1.15.2: - resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: false - /follow-redirects@1.15.2(debug@4.3.4): resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} engines: {node: '>=4.0'} @@ -10751,7 +10707,7 @@ packages: requiresBuild: true dependencies: agent-base: 4.3.0 - debug: 3.2.7 + debug: 3.2.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color dev: false @@ -12530,7 +12486,7 @@ packages: resolution: {integrity: sha512-UqyYyH5YEXaJrf9S8E23GoJFQZXkBVJ9zYYMPGz919MSX1KuvAcycIuS0ci150HCoPf4XQVhQ84Qf8xRPWxFaQ==} engines: {node: '>= 7.6.0'} dependencies: - debug: 3.2.7 + debug: 3.2.7(supports-color@8.1.1) koa-send: 5.0.1 transitivePeerDependencies: - supports-color @@ -13205,7 +13161,7 @@ packages: /micromark@2.11.4: resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==} dependencies: - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) parse-entities: 2.0.0 transitivePeerDependencies: - supports-color @@ -13638,7 +13594,7 @@ packages: engines: {node: '>= 4.4.x'} hasBin: true dependencies: - debug: 3.2.7 + debug: 3.2.7(supports-color@8.1.1) iconv-lite: 0.4.24 sax: 1.2.4 transitivePeerDependencies: @@ -14927,7 +14883,7 @@ packages: resolution: {integrity: sha512-8I7Cd8sxiEITIp32xBK4K/Aj1ukX6vuWnx8oY/oAH35NfQI4OZaY5nd68Yx8HeN5S49uhQ6DL0rNk0ZBu/TaLg==} engines: {node: ^8.10.0 || ^10.13.0 || ^11.10.1 || >=12.13.0} dependencies: - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) fast-diff: 1.3.0 lodash.sortedlastindex: 4.1.0 postcss: 8.4.27 @@ -16786,7 +16742,7 @@ packages: hasBin: true dependencies: css: 3.0.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) glob: 7.2.3 safer-buffer: 2.1.2 sax: 1.2.4 @@ -17688,6 +17644,7 @@ packages: resolution: {integrity: sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==} engines: {node: '>=4.2.0'} hasBin: true + dev: true /typescript@5.2.2: resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} @@ -18046,9 +18003,9 @@ packages: vite: '>=2.0.0' dependencies: chalk: 4.1.2 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) fs-extra: 10.1.0 - vite: 5.0.0(sass@1.69.5) + vite: 5.0.0(@types/node@20.9.0)(sass@1.69.5) transitivePeerDependencies: - supports-color dev: true @@ -18090,42 +18047,6 @@ packages: fsevents: 2.3.3 dev: true - /vite@5.0.0(sass@1.69.5): - resolution: {integrity: sha512-ESJVM59mdyGpsiNAeHQOR/0fqNoOyWPYesFto8FFZugfmhdHx8Fzd8sF3Q/xkVhZsyOxHfdM7ieiVAorI9RjFw==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - peerDependencies: - '@types/node': ^18.0.0 || >=20.0.0 - less: '*' - lightningcss: ^1.21.0 - sass: '*' - stylus: '*' - sugarss: '*' - terser: ^5.4.0 - peerDependenciesMeta: - '@types/node': - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - dependencies: - esbuild: 0.19.5 - postcss: 8.4.31 - rollup: 4.4.1 - sass: 1.69.5 - optionalDependencies: - fsevents: 2.3.3 - dev: true - /void-elements@3.1.0: resolution: {integrity: sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==} engines: {node: '>=0.10.0'} @@ -18156,7 +18077,7 @@ packages: peerDependencies: eslint: '>=6.0.0' dependencies: - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.53.0 eslint-scope: 7.2.2 eslint-visitor-keys: 3.4.2 @@ -18174,7 +18095,7 @@ packages: peerDependencies: eslint: '>=6.0.0' dependencies: - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.53.0 eslint-scope: 7.2.2 eslint-visitor-keys: 3.4.3