From b98707c37ba07492c7d22300cfa1576a2865e261 Mon Sep 17 00:00:00 2001 From: naskya Date: Fri, 17 Nov 2023 06:01:31 +0900 Subject: [PATCH] Firefish v1.0.5-dev21 --- locales/en-US.yml | 8 ++-- locales/fr-FR.yml | 15 +++++- locales/id-ID.yml | 10 ++-- locales/it-IT.yml | 10 ++-- locales/ja-JP.yml | 6 +-- locales/ru-RU.yml | 11 +++++ neko/UPSTREAM_COMMIT_ID | 2 +- package.json | 2 +- packages/backend/package.json | 9 ++-- packages/backend/src/boot/master.ts | 5 +- packages/backend/src/boot/worker.ts | 3 +- packages/backend/src/daemons/queue-stats.ts | 2 +- packages/backend/src/daemons/server-stats.ts | 2 +- packages/backend/src/db/postgre.ts | 3 +- packages/backend/src/misc/app-lock.ts | 2 +- packages/backend/src/misc/captcha.ts | 2 +- .../backend/src/misc/check-hit-antenna.ts | 6 +-- .../src/models/entities/note-thread-muting.ts | 1 - .../backend/src/models/entities/user-ip.ts | 11 +---- packages/backend/src/models/index.ts | 2 - .../src/models/repositories/drive-file.ts | 4 +- .../src/models/repositories/notification.ts | 3 +- .../backend/src/models/repositories/user.ts | 1 - .../processors/background/index-all-notes.ts | 2 +- .../processors/db/export-custom-emojis.ts | 2 - .../queue/processors/db/import-blocking.ts | 2 +- .../queue/processors/db/import-masto-post.ts | 1 - .../processors/ended-poll-notification.ts | 5 +- .../queue/processors/system/verify-links.ts | 1 - .../src/queue/processors/webhook-deliver.ts | 1 - .../src/remote/activitypub/audience.ts | 1 - .../src/remote/activitypub/kernel/read.ts | 2 +- .../remote/activitypub/kernel/undo/accept.ts | 1 - .../remote/activitypub/misc/get-note-html.ts | 2 +- .../remote/activitypub/misc/html-to-mfm.ts | 2 +- .../src/remote/activitypub/models/image.ts | 3 +- .../src/remote/activitypub/models/mention.ts | 1 - .../src/remote/activitypub/models/note.ts | 6 +-- .../src/remote/activitypub/models/person.ts | 9 ++-- .../src/remote/activitypub/renderer/flag.ts | 3 -- .../src/remote/activitypub/renderer/index.ts | 1 + .../src/remote/activitypub/renderer/person.ts | 1 + .../src/remote/activitypub/renderer/undo.ts | 1 - .../src/remote/activitypub/resolver.ts | 8 +--- .../backend/src/remote/activitypub/type.ts | 1 + packages/backend/src/server/activitypub.ts | 3 +- packages/backend/src/server/api/call.ts | 2 - packages/backend/src/server/api/define.ts | 1 - .../api/endpoints/admin/abuse-user-reports.ts | 4 +- .../api/endpoints/admin/accounts/create.ts | 4 +- .../api/endpoints/admin/accounts/delete.ts | 2 +- .../api/endpoints/admin/accounts/hosted.ts | 2 +- .../server/api/endpoints/admin/ad/create.ts | 2 +- .../server/api/endpoints/admin/ad/delete.ts | 4 +- .../src/server/api/endpoints/admin/ad/list.ts | 4 +- .../server/api/endpoints/admin/ad/update.ts | 4 +- .../endpoints/admin/announcements/create.ts | 2 +- .../endpoints/admin/announcements/delete.ts | 4 +- .../api/endpoints/admin/announcements/list.ts | 4 +- .../endpoints/admin/announcements/update.ts | 4 +- .../server/api/endpoints/admin/delete-2fa.ts | 2 +- .../api/endpoints/admin/delete-account.ts | 2 +- .../admin/delete-all-files-of-a-user.ts | 2 +- .../api/endpoints/admin/delete-passkeys.ts | 2 +- .../admin/drive-capacity-override.ts | 2 +- .../admin/drive/clean-remote-files.ts | 2 +- .../api/endpoints/admin/drive/cleanup.ts | 2 +- .../server/api/endpoints/admin/drive/files.ts | 4 +- .../api/endpoints/admin/drive/show-file.ts | 4 +- .../endpoints/admin/emoji/add-aliases-bulk.ts | 3 +- .../server/api/endpoints/admin/emoji/add.ts | 4 +- .../server/api/endpoints/admin/emoji/copy.ts | 4 +- .../api/endpoints/admin/emoji/delete-bulk.ts | 3 +- .../api/endpoints/admin/emoji/delete.ts | 4 +- .../api/endpoints/admin/emoji/import-zip.ts | 2 +- .../api/endpoints/admin/emoji/list-remote.ts | 4 +- .../server/api/endpoints/admin/emoji/list.ts | 2 +- .../admin/emoji/remove-aliases-bulk.ts | 3 +- .../endpoints/admin/emoji/set-aliases-bulk.ts | 3 +- .../admin/emoji/set-category-bulk.ts | 3 +- .../endpoints/admin/emoji/set-license-bulk.ts | 3 +- .../api/endpoints/admin/emoji/update.ts | 4 +- .../admin/federation/delete-all-files.ts | 2 +- .../refresh-remote-instance-metadata.ts | 2 +- .../admin/federation/remove-all-following.ts | 2 +- .../admin/federation/update-instance.ts | 2 +- .../api/endpoints/admin/get-index-stats.ts | 2 +- .../api/endpoints/admin/get-table-stats.ts | 2 +- .../api/endpoints/admin/get-user-ips.ts | 2 +- .../src/server/api/endpoints/admin/invite.ts | 2 +- .../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 | 6 +-- .../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 | 2 +- .../server/api/endpoints/admin/relays/add.ts | 4 +- .../server/api/endpoints/admin/relays/list.ts | 2 +- .../api/endpoints/admin/relays/remove.ts | 2 +- .../api/endpoints/admin/reset-password.ts | 2 +- .../admin/resolve-abuse-user-report.ts | 2 +- .../api/endpoints/admin/search/index-all.ts | 2 +- .../server/api/endpoints/admin/send-email.ts | 2 +- .../api/endpoints/admin/send-mod-mail.ts | 4 +- .../server/api/endpoints/admin/server-info.ts | 4 +- .../endpoints/admin/show-moderation-logs.ts | 4 +- .../server/api/endpoints/admin/show-user.ts | 2 +- .../server/api/endpoints/admin/show-users.ts | 2 +- .../api/endpoints/admin/silence-user.ts | 2 +- .../api/endpoints/admin/suspend-user.ts | 2 +- .../api/endpoints/admin/unsilence-user.ts | 2 +- .../api/endpoints/admin/unsuspend-user.ts | 2 +- .../api/endpoints/admin/update-user-note.ts | 2 +- .../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 | 4 +- .../src/server/api/endpoints/antennas/list.ts | 2 +- .../server/api/endpoints/antennas/markread.ts | 3 +- .../server/api/endpoints/antennas/notes.ts | 14 +++--- .../src/server/api/endpoints/antennas/show.ts | 4 +- .../server/api/endpoints/antennas/update.ts | 4 +- .../src/server/api/endpoints/ap/get.ts | 2 +- .../src/server/api/endpoints/ap/show.ts | 4 +- .../src/server/api/endpoints/app/create.ts | 2 +- .../src/server/api/endpoints/app/show.ts | 4 +- .../src/server/api/endpoints/auth/accept.ts | 4 +- .../api/endpoints/auth/session/generate.ts | 4 +- .../server/api/endpoints/auth/session/show.ts | 4 +- .../api/endpoints/auth/session/userkey.ts | 4 +- .../server/api/endpoints/blocking/create.ts | 6 +-- .../server/api/endpoints/blocking/delete.ts | 6 +-- .../src/server/api/endpoints/blocking/list.ts | 4 +- .../server/api/endpoints/channels/create.ts | 4 +- .../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 | 4 +- .../server/api/endpoints/channels/search.ts | 4 +- .../src/server/api/endpoints/channels/show.ts | 4 +- .../server/api/endpoints/channels/timeline.ts | 6 +-- .../server/api/endpoints/channels/unfollow.ts | 4 +- .../server/api/endpoints/channels/update.ts | 4 +- .../api/endpoints/charts/active-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 | 4 +- .../src/server/api/endpoints/clips/list.ts | 2 +- .../src/server/api/endpoints/clips/notes.ts | 12 ++--- .../server/api/endpoints/clips/remove-note.ts | 6 +-- .../src/server/api/endpoints/clips/show.ts | 4 +- .../src/server/api/endpoints/clips/update.ts | 4 +- .../endpoints/compatibility/custom-emojis.ts | 2 +- .../api/endpoints/compatibility/peers.ts | 2 +- .../src/server/api/endpoints/custom-motd.ts | 2 +- .../api/endpoints/custom-splash-icons.ts | 2 +- .../backend/src/server/api/endpoints/drive.ts | 2 +- .../src/server/api/endpoints/drive/files.ts | 4 +- .../endpoints/drive/files/attached-notes.ts | 4 +- .../endpoints/drive/files/caption-image.ts | 2 +- .../endpoints/drive/files/check-existence.ts | 2 +- .../api/endpoints/drive/files/create.ts | 6 +-- .../api/endpoints/drive/files/delete.ts | 6 +-- .../api/endpoints/drive/files/find-by-hash.ts | 2 +- .../server/api/endpoints/drive/files/find.ts | 2 +- .../server/api/endpoints/drive/files/show.ts | 6 +-- .../api/endpoints/drive/files/update.ts | 4 +- .../endpoints/drive/files/upload-from-url.ts | 2 +- .../src/server/api/endpoints/drive/folders.ts | 4 +- .../api/endpoints/drive/folders/create.ts | 4 +- .../api/endpoints/drive/folders/delete.ts | 4 +- .../api/endpoints/drive/folders/find.ts | 2 +- .../api/endpoints/drive/folders/show.ts | 4 +- .../api/endpoints/drive/folders/update.ts | 4 +- .../src/server/api/endpoints/drive/stream.ts | 4 +- .../api/endpoints/email-address/available.ts | 2 +- .../backend/src/server/api/endpoints/emoji.ts | 4 +- .../src/server/api/endpoints/endpoint.ts | 4 +- .../src/server/api/endpoints/endpoints.ts | 4 +- .../api/endpoints/export-custom-emojis.ts | 2 +- .../api/endpoints/federation/followers.ts | 4 +- .../api/endpoints/federation/following.ts | 4 +- .../api/endpoints/federation/instances.ts | 3 +- .../api/endpoints/federation/show-instance.ts | 2 +- .../server/api/endpoints/federation/stats.ts | 2 +- .../federation/update-remote-user.ts | 4 +- .../server/api/endpoints/federation/users.ts | 4 +- .../src/server/api/endpoints/fetch-rss.ts | 2 +- .../server/api/endpoints/following/create.ts | 6 +-- .../server/api/endpoints/following/delete.ts | 6 +-- .../api/endpoints/following/invalidate.ts | 6 +-- .../endpoints/following/requests/accept.ts | 6 +-- .../endpoints/following/requests/cancel.ts | 6 +-- .../api/endpoints/following/requests/list.ts | 2 +- .../endpoints/following/requests/reject.ts | 6 +-- .../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 | 5 +- .../api/endpoints/gallery/posts/delete.ts | 4 +- .../api/endpoints/gallery/posts/like.ts | 4 +- .../api/endpoints/gallery/posts/show.ts | 4 +- .../api/endpoints/gallery/posts/unlike.ts | 4 +- .../api/endpoints/gallery/posts/update.ts | 4 +- .../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 | 2 +- .../src/server/api/endpoints/hashtags/show.ts | 4 +- .../server/api/endpoints/hashtags/trend.ts | 2 +- .../server/api/endpoints/hashtags/users.ts | 2 +- .../backend/src/server/api/endpoints/i.ts | 2 +- .../src/server/api/endpoints/i/2fa/done.ts | 2 +- .../server/api/endpoints/i/2fa/key-done.ts | 4 +- .../api/endpoints/i/2fa/password-less.ts | 4 +- .../api/endpoints/i/2fa/register-key.ts | 4 +- .../server/api/endpoints/i/2fa/register.ts | 2 +- .../server/api/endpoints/i/2fa/remove-key.ts | 2 +- .../server/api/endpoints/i/2fa/unregister.ts | 2 +- .../server/api/endpoints/i/2fa/update-key.ts | 4 +- .../src/server/api/endpoints/i/apps.ts | 2 +- .../server/api/endpoints/i/authorized-apps.ts | 2 +- .../server/api/endpoints/i/change-password.ts | 2 +- .../server/api/endpoints/i/delete-account.ts | 2 +- .../server/api/endpoints/i/export-blocking.ts | 2 +- .../api/endpoints/i/export-following.ts | 2 +- .../src/server/api/endpoints/i/export-mute.ts | 2 +- .../server/api/endpoints/i/export-notes.ts | 2 +- .../api/endpoints/i/export-user-lists.ts | 2 +- .../src/server/api/endpoints/i/favorites.ts | 4 +- .../server/api/endpoints/i/gallery/likes.ts | 4 +- .../server/api/endpoints/i/gallery/posts.ts | 4 +- .../endpoints/i/get-word-muted-notes-count.ts | 2 +- .../server/api/endpoints/i/import-blocking.ts | 4 +- .../api/endpoints/i/import-following.ts | 4 +- .../server/api/endpoints/i/import-muting.ts | 4 +- .../server/api/endpoints/i/import-posts.ts | 4 +- .../api/endpoints/i/import-user-lists.ts | 4 +- .../src/server/api/endpoints/i/known-as.ts | 6 +-- .../src/server/api/endpoints/i/move.ts | 6 +-- .../server/api/endpoints/i/notifications.ts | 6 +-- .../src/server/api/endpoints/i/page-likes.ts | 4 +- .../src/server/api/endpoints/i/pages.ts | 4 +- .../backend/src/server/api/endpoints/i/pin.ts | 4 +- .../i/read-all-messaging-messages.ts | 2 +- .../api/endpoints/i/read-all-unread-notes.ts | 2 +- .../api/endpoints/i/read-announcement.ts | 4 +- .../api/endpoints/i/regenerate-token.ts | 4 +- .../api/endpoints/i/registry/get-all.ts | 2 +- .../api/endpoints/i/registry/get-detail.ts | 4 +- .../api/endpoints/i/registry/get-unsecure.ts | 4 +- .../server/api/endpoints/i/registry/get.ts | 4 +- .../endpoints/i/registry/keys-with-type.ts | 2 +- .../server/api/endpoints/i/registry/keys.ts | 2 +- .../server/api/endpoints/i/registry/remove.ts | 4 +- .../server/api/endpoints/i/registry/scopes.ts | 2 +- .../server/api/endpoints/i/registry/set.ts | 2 +- .../server/api/endpoints/i/revoke-token.ts | 2 +- .../server/api/endpoints/i/signin-history.ts | 4 +- .../src/server/api/endpoints/i/unpin.ts | 4 +- .../server/api/endpoints/i/update-email.ts | 4 +- .../src/server/api/endpoints/i/update.ts | 5 +- .../api/endpoints/i/user-group-invites.ts | 4 +- .../server/api/endpoints/i/webhooks/create.ts | 2 +- .../server/api/endpoints/i/webhooks/delete.ts | 4 +- .../server/api/endpoints/i/webhooks/list.ts | 2 +- .../server/api/endpoints/i/webhooks/show.ts | 4 +- .../server/api/endpoints/i/webhooks/update.ts | 4 +- .../server/api/endpoints/latest-version.ts | 2 +- .../server/api/endpoints/messaging/history.ts | 2 +- .../api/endpoints/messaging/messages.ts | 10 ++-- .../endpoints/messaging/messages/create.ts | 7 ++- .../endpoints/messaging/messages/delete.ts | 4 +- .../api/endpoints/messaging/messages/read.ts | 6 +-- .../backend/src/server/api/endpoints/meta.ts | 2 +- .../server/api/endpoints/miauth/gen-token.ts | 2 +- .../src/server/api/endpoints/mute/create.ts | 6 +-- .../src/server/api/endpoints/mute/delete.ts | 6 +-- .../src/server/api/endpoints/mute/list.ts | 4 +- .../src/server/api/endpoints/my/apps.ts | 2 +- .../backend/src/server/api/endpoints/notes.ts | 4 +- .../server/api/endpoints/notes/children.ts | 10 ++-- .../src/server/api/endpoints/notes/clips.ts | 6 +-- .../api/endpoints/notes/conversation.ts | 6 +-- .../src/server/api/endpoints/notes/create.ts | 8 ++-- .../src/server/api/endpoints/notes/delete.ts | 6 +-- .../src/server/api/endpoints/notes/edit.ts | 11 ++--- .../api/endpoints/notes/favorites/create.ts | 6 +-- .../api/endpoints/notes/favorites/delete.ts | 6 +-- .../server/api/endpoints/notes/featured.ts | 6 +-- .../api/endpoints/notes/global-timeline.ts | 16 +++---- .../api/endpoints/notes/hybrid-timeline.ts | 20 ++++---- .../api/endpoints/notes/local-timeline.ts | 22 ++++----- .../server/api/endpoints/notes/mentions.ts | 12 ++--- .../endpoints/notes/polls/recommendation.ts | 2 +- .../server/api/endpoints/notes/polls/vote.ts | 6 +-- .../server/api/endpoints/notes/reactions.ts | 7 ++- .../api/endpoints/notes/reactions/create.ts | 6 +-- .../api/endpoints/notes/reactions/delete.ts | 6 +-- .../endpoints/notes/recommended-timeline.ts | 20 ++++---- .../src/server/api/endpoints/notes/renotes.ts | 14 +++--- .../src/server/api/endpoints/notes/replies.ts | 10 ++-- .../api/endpoints/notes/search-by-tag.ts | 10 ++-- .../src/server/api/endpoints/notes/search.ts | 10 ++-- .../src/server/api/endpoints/notes/show.ts | 6 +-- .../src/server/api/endpoints/notes/state.ts | 5 +- .../endpoints/notes/thread-muting/create.ts | 6 +-- .../endpoints/notes/thread-muting/delete.ts | 6 +-- .../server/api/endpoints/notes/timeline.ts | 20 ++++---- .../server/api/endpoints/notes/translate.ts | 6 +-- .../server/api/endpoints/notes/unrenote.ts | 6 +-- .../api/endpoints/notes/user-list-timeline.ts | 8 ++-- .../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 | 2 +- .../api/endpoints/notifications/read.ts | 4 +- .../src/server/api/endpoints/page-push.ts | 4 +- .../src/server/api/endpoints/pages/create.ts | 4 +- .../src/server/api/endpoints/pages/delete.ts | 4 +- .../server/api/endpoints/pages/featured.ts | 2 +- .../src/server/api/endpoints/pages/like.ts | 4 +- .../src/server/api/endpoints/pages/show.ts | 4 +- .../src/server/api/endpoints/pages/unlike.ts | 4 +- .../src/server/api/endpoints/pages/update.ts | 4 +- .../src/server/api/endpoints/patrons.ts | 2 +- .../backend/src/server/api/endpoints/ping.ts | 2 +- .../src/server/api/endpoints/pinned-users.ts | 2 +- .../src/server/api/endpoints/promo/read.ts | 6 +-- .../api/endpoints/recommended-instances.ts | 2 +- .../src/server/api/endpoints/release.ts | 2 +- .../api/endpoints/renote-mute/create.ts | 6 +-- .../api/endpoints/renote-mute/delete.ts | 6 +-- .../server/api/endpoints/renote-mute/list.ts | 4 +- .../api/endpoints/request-reset-password.ts | 4 +- .../src/server/api/endpoints/reset-db.ts | 3 +- .../server/api/endpoints/reset-password.ts | 6 +-- .../src/server/api/endpoints/server-info.ts | 2 +- .../backend/src/server/api/endpoints/stats.ts | 2 +- .../src/server/api/endpoints/sw/register.ts | 2 +- .../api/endpoints/sw/show-registration.ts | 2 +- .../src/server/api/endpoints/sw/unregister.ts | 2 +- .../api/endpoints/sw/update-registration.ts | 2 +- .../backend/src/server/api/endpoints/test.ts | 2 +- .../api/endpoints/username/available.ts | 2 +- .../backend/src/server/api/endpoints/users.ts | 6 +-- .../src/server/api/endpoints/users/clips.ts | 4 +- .../server/api/endpoints/users/followers.ts | 6 +-- .../server/api/endpoints/users/following.ts | 6 +-- .../api/endpoints/users/gallery/posts.ts | 4 +- .../users/get-frequently-replied-users.ts | 6 +-- .../api/endpoints/users/groups/create.ts | 2 +- .../api/endpoints/users/groups/delete.ts | 4 +- .../users/groups/invitations/accept.ts | 4 +- .../users/groups/invitations/reject.ts | 4 +- .../api/endpoints/users/groups/invite.ts | 6 +-- .../api/endpoints/users/groups/joined.ts | 2 +- .../api/endpoints/users/groups/leave.ts | 4 +- .../api/endpoints/users/groups/owned.ts | 2 +- .../server/api/endpoints/users/groups/pull.ts | 6 +-- .../server/api/endpoints/users/groups/show.ts | 4 +- .../api/endpoints/users/groups/transfer.ts | 6 +-- .../api/endpoints/users/groups/update.ts | 4 +- .../api/endpoints/users/lists/create.ts | 2 +- .../api/endpoints/users/lists/delete-all.ts | 4 +- .../api/endpoints/users/lists/delete.ts | 4 +- .../server/api/endpoints/users/lists/list.ts | 2 +- .../server/api/endpoints/users/lists/pull.ts | 6 +-- .../server/api/endpoints/users/lists/push.ts | 6 +-- .../server/api/endpoints/users/lists/show.ts | 4 +- .../api/endpoints/users/lists/update.ts | 4 +- .../src/server/api/endpoints/users/notes.ts | 14 +++--- .../src/server/api/endpoints/users/pages.ts | 4 +- .../server/api/endpoints/users/reactions.ts | 10 ++-- .../api/endpoints/users/recommendation.ts | 6 +-- .../server/api/endpoints/users/relation.ts | 2 +- .../api/endpoints/users/report-abuse.ts | 6 +-- .../users/search-by-username-and-host.ts | 3 +- .../src/server/api/endpoints/users/search.ts | 2 +- .../src/server/api/endpoints/users/show.ts | 6 +-- .../src/server/api/endpoints/users/stats.ts | 4 +- packages/backend/src/server/api/index.ts | 9 ++-- packages/backend/src/server/api/limiter.ts | 3 +- .../mastodon/ApiMastodonCompatibleService.ts | 2 +- .../src/server/api/mastodon/converters.ts | 2 +- .../server/api/mastodon/endpoints/account.ts | 5 +- .../src/server/api/mastodon/endpoints/auth.ts | 3 -- .../server/api/mastodon/endpoints/filter.ts | 3 +- .../api/mastodon/endpoints/notifications.ts | 4 +- .../server/api/mastodon/endpoints/search.ts | 1 - .../server/api/mastodon/endpoints/status.ts | 3 +- .../server/api/mastodon/endpoints/timeline.ts | 2 +- .../src/server/api/openapi/gen-spec.ts | 2 +- .../backend/src/server/api/private/signin.ts | 6 +-- .../src/server/api/private/signup-pending.ts | 6 +-- .../backend/src/server/api/private/signup.ts | 2 +- .../server/api/stream/channels/messaging.ts | 2 +- .../backend/src/server/api/stream/index.ts | 4 +- .../src/server/file/byte-range-readable.ts | 2 +- packages/backend/src/server/index.ts | 3 +- .../backend/src/server/web/views/flush.pug | 3 +- .../backend/src/services/blocking/create.ts | 1 - .../backend/src/services/blocking/delete.ts | 3 +- .../src/services/chart/charts/active-users.ts | 1 - .../src/services/create-system-user.ts | 2 +- .../backend/src/services/delete-account.ts | 4 +- .../backend/src/services/drive/add-file.ts | 3 +- .../backend/src/services/drive/delete-file.ts | 2 +- .../drive/generate-video-thumbnail.ts | 1 - packages/backend/src/services/drive/logger.ts | 2 +- packages/backend/src/services/drive/s3.ts | 2 +- .../src/services/fetch-instance-metadata.ts | 2 +- packages/backend/src/services/fetch-rel-me.ts | 1 - .../backend/src/services/following/create.ts | 4 +- .../backend/src/services/following/delete.ts | 2 +- .../backend/src/services/following/reject.ts | 1 - .../src/services/following/requests/accept.ts | 1 - .../src/services/following/requests/cancel.ts | 1 - .../src/services/following/requests/create.ts | 2 +- packages/backend/src/services/i/pin.ts | 2 +- packages/backend/src/services/i/update.ts | 2 +- packages/backend/src/services/logger.ts | 2 +- packages/backend/src/services/note/create.ts | 15 +++--- packages/backend/src/services/note/delete.ts | 4 +- .../backend/src/services/note/polls/update.ts | 2 +- .../backend/src/services/note/polls/vote.ts | 3 +- .../src/services/note/reaction/create.ts | 2 +- packages/backend/src/services/relay.ts | 2 +- .../src/services/send-email-notification.ts | 8 ++-- packages/backend/src/services/send-email.ts | 2 +- packages/backend/src/services/stream.ts | 2 +- .../backend/src/services/user-list/push.ts | 2 +- packages/backend/tsconfig.json | 2 +- packages/client/package.json | 10 ++-- packages/client/src/account.ts | 2 +- .../client/src/components/MkChatPreview.vue | 4 +- packages/client/src/components/MkDialog.vue | 4 +- .../src/components/MkDriveSelectDialog.vue | 4 +- .../client/src/components/MkLaunchPad.vue | 4 +- packages/client/src/components/MkMedia.vue | 6 +-- .../client/src/components/MkModPlayer.vue | 4 +- packages/client/src/components/MkModal.vue | 20 ++++---- .../src/components/MkModalPageWindow.vue | 1 - .../client/src/components/MkModalWindow.vue | 4 +- .../client/src/components/MkNotePreview.vue | 2 +- .../client/src/components/MkNoteSimple.vue | 2 +- packages/client/src/components/MkNotes.vue | 2 +- .../client/src/components/MkObjectView.vue | 3 +- .../client/src/components/MkPagination.vue | 24 +++++----- packages/client/src/components/MkPoll.vue | 8 ++-- .../client/src/components/MkPollEditor.vue | 4 +- packages/client/src/components/MkPostForm.vue | 28 +++++------ .../src/components/MkPostFormAttaches.vue | 1 - .../client/src/components/MkReactionIcon.vue | 2 +- .../src/components/MkReactionTooltip.vue | 2 +- .../components/MkReactionsViewer.details.vue | 2 +- packages/client/src/components/MkSignin.vue | 4 +- .../client/src/components/MkSigninDialog.vue | 2 +- packages/client/src/components/MkSignup.vue | 28 +++++------ .../client/src/components/MkSignupDialog.vue | 2 +- packages/client/src/components/MkUserList.vue | 2 +- .../client/src/components/MkUsersTooltip.vue | 3 +- .../src/components/MkVisibilityPicker.vue | 1 - .../client/src/components/global/MkTime.vue | 48 +++++++++++-------- packages/client/src/components/mfm.ts | 2 +- .../client/src/components/page/page.post.vue | 1 + packages/client/src/config.ts | 2 +- packages/client/src/directives/focus.ts | 2 +- packages/client/src/directives/hotkey.ts | 2 +- packages/client/src/directives/ripple.ts | 3 +- packages/client/src/directives/vibrate.ts | 2 +- packages/client/src/filters/note.ts | 4 +- packages/client/src/filters/number.ts | 2 +- packages/client/src/init.ts | 3 +- packages/client/src/nirax.ts | 2 +- packages/client/src/pages/_empty_.vue | 2 - packages/client/src/pages/_loading_.vue | 2 - .../client/src/pages/about.federation.vue | 24 +++++----- .../client/src/pages/admin/bot-protection.vue | 4 +- .../src/pages/admin/overview.queue.chart.vue | 24 +++++----- .../src/pages/admin/queue.chart.chart.vue | 24 +++++----- .../client/src/pages/admin/queue.chart.vue | 4 +- packages/client/src/pages/admin/security.vue | 32 ++++++------- packages/client/src/pages/api-console.vue | 16 +++---- packages/client/src/pages/settings/drive.vue | 4 +- packages/client/src/pages/theme-editor.vue | 4 +- packages/client/src/pages/timeline.vue | 12 ++--- packages/client/src/router.ts | 19 ++++---- packages/client/src/scripts/get-note-menu.ts | 2 +- .../client/src/scripts/get-note-summary.ts | 1 - packages/client/src/scripts/popup-position.ts | 2 - .../client/src/scripts/use-leave-guard.ts | 6 +-- packages/client/src/ui/_common_/common.vue | 2 +- .../src/ui/_common_/navbar-for-mobile.vue | 9 +--- .../src/ui/_common_/statusbar-federation.vue | 4 +- .../client/src/ui/_common_/statusbar-rss.vue | 3 +- .../src/ui/_common_/statusbar-user-list.vue | 2 +- .../client/src/ui/_common_/statusbars.vue | 3 +- packages/client/src/ui/_common_/sw-inject.ts | 2 - packages/client/src/ui/deck/column-core.vue | 1 - packages/client/src/ui/deck/deck-store.ts | 1 - packages/client/src/ui/visitor.vue | 3 +- packages/client/src/ui/visitor/a.vue | 2 +- packages/client/src/ui/visitor/kanban.vue | 2 +- packages/client/src/widgets/calendar.vue | 8 +--- packages/client/src/widgets/clock.vue | 6 +-- packages/client/src/widgets/digital-clock.vue | 2 +- .../client/src/widgets/instance-cloud.vue | 6 +-- packages/client/src/widgets/online-users.vue | 8 +--- packages/client/src/widgets/post-form.vue | 7 +-- packages/client/src/widgets/server-info.vue | 13 +---- packages/client/src/widgets/slideshow.vue | 8 +--- packages/client/src/widgets/timeline.vue | 8 ++-- packages/client/src/widgets/unix-clock.vue | 6 +-- packages/firefish-js/package.json | 4 +- packages/sw/package.json | 6 +-- 518 files changed, 1073 insertions(+), 1179 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index 829d577c..ee8c924c 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -168,11 +168,11 @@ cacheRemoteFiles: "Cache remote files" cacheRemoteFilesDescription: "When this setting is disabled, remote files are loaded directly from the remote server. Disabling this will decrease storage usage, but increase traffic, as thumbnails will not be generated." -flagAsBot: "Mark this account as a bot" +flagAsBot: "Mark this account as automated" flagAsBotDescription: "Enable this option if this account is controlled by a program. If enabled, it will act as a flag for other developers to prevent endless interaction - chains with other bots and adjust Firefish's internal systems to treat this account - as a bot." + chains with other automated accounts and adjust Firefish's internal systems to treat this + account as an automated account." flagAsCat: "Are you a cat? 😺" flagAsCatDescription: "You'll get cat ears and speak like a cat!" flagSpeakAsCat: "Speak as a cat" @@ -1117,7 +1117,7 @@ noGraze: "Please disable the \"Graze for Mastodon\" browser extension, as it int with Firefish." silencedWarning: "This page is showing because these users are from servers your admin silenced, so they may potentially be spam." -isBot: "This account is a bot" +isBot: "This account is automated" isLocked: "This account has follow approvals" isModerator: "Moderator" isAdmin: "Administrator" diff --git a/locales/fr-FR.yml b/locales/fr-FR.yml index 9cd2d1e3..f6c2eb55 100644 --- a/locales/fr-FR.yml +++ b/locales/fr-FR.yml @@ -114,7 +114,7 @@ you: "Vous" clickToShow: "Cliquer pour afficher" sensitive: "Contenu sensible" add: "Ajouter" -reaction: "Réactions" +reaction: "Réaction" reactionSetting: "Réactions à afficher dans le sélecteur de réactions" reactionSettingDescription2: "Déplacer pour réorganiser, cliquer pour effacer, utiliser « + » pour ajouter." @@ -1148,7 +1148,7 @@ _wordMute: langDescription: Cacher du fil de publication les publications qui correspondent à ces langues. muteLangs: Langages filtrés - muteLangsDescription: Séparer avec des espaces or des retours à la ligne pour une + muteLangsDescription: Séparer avec des espaces ou des retours à la ligne pour une condition OU (OR). _instanceMute: instanceMuteDescription2: "Séparer avec des sauts de lignes" @@ -2225,3 +2225,14 @@ indexable: Indexable languageForTranslation: Langage post-traduction vibrate: Jouer les vibrations clickToShowPatterns: Cliquer pour montrer les patrons de modules +iconSet: Jeu d'icônes +_iconSets: + fill: Rempli + regular: Normal + bold: Gras + duotone: Deux tons + light: Fin +reactions: Réactions +replies: Réponses +quotes: Citations +renotes: Boosts diff --git a/locales/id-ID.yml b/locales/id-ID.yml index 3c3d068d..22e0040c 100644 --- a/locales/id-ID.yml +++ b/locales/id-ID.yml @@ -148,11 +148,11 @@ cacheRemoteFiles: "Tembolokkan berkas remote" cacheRemoteFilesDescription: "Ketika pengaturan ini dinonaktifkan, berkas luar akan dimuat langsung dari server luar. Menonaktifkan ini akan mengurangi penggunaan penyimpanan, tapi dapat menyebabkan meningkatkan lalu lintas, mengingat keluku tidak akan dihasilkan." -flagAsBot: "Atur akun ini sebagai Bot" -flagAsBotDescription: "Jika akun ini dikendalikan oleh program, tetapkanlah opsi ini. +flagAsBot: "Tandai akun ini sebagai akun otomatis" +flagAsBotDescription: "Jika akun ini dikendalikan oleh program, aktifkan opsi ini. Jika diaktifkan, ini akan berfungsi sebagai tanda bagi pengembang lain untuk mencegah - interaksi berantai dengan bot lain dan menyesuaikan sistem internal Firefish untuk - memperlakukan akun ini sebagai bot." + interaksi berantai dengan akun otomatis lain dan menyesuaikan sistem internal Firefish + untuk memperlakukan akun ini sebagai akun otomatis." flagAsCat: "Atur akun ini sebagai kucing" flagAsCatDescription: "Kamu akan mendapatkan telinga kucing dan berbicara seperti seekor kucing!" @@ -2005,7 +2005,7 @@ signupsDisabled: Pendaftaran ke server ini nonaktif, tapi kamu dapat selalu mend ke server lain! Jika kamu memiliki kode undangan server ini, harap masukkan di bawah ini. enableCustomKaTeXMacro: Aktifkan makro KaTeX khusus -isBot: Akun ini bot +isBot: Akun ini akun otomatis customMOTD: MOTD khusus (pesan layar percik) recommendedInstancesDescription: Server yang direkomendasikan dipisahkan dengan garis baru untuk tampil di linimasa rekomendasi. diff --git a/locales/it-IT.yml b/locales/it-IT.yml index a4d3f5ba..01e52967 100644 --- a/locales/it-IT.yml +++ b/locales/it-IT.yml @@ -147,11 +147,11 @@ cacheRemoteFiles: "Mantieni i file remoti nella cache" cacheRemoteFilesDescription: "Disabilitando questa opzione, i file remoti verranno scaricati direttamente dal loro server. L'opzione permette di risparmiare spazio ma aumenta il traffico di rete e non verranno generate anteprime." -flagAsBot: "Questo account è un bot" +flagAsBot: "Questo account è automatizzato" flagAsBotDescription: "Se l'account esegue principalmente operazioni automatiche, - attiva quest'opzione. Quando attivata, opera come un segnalatore per gli altri sviluppatori - allo scopo di prevenire catene d’interazione senza fine con altri bot, e di adeguare - i sistemi interni di Firefish perché trattino questo account come un bot." + attiva quest'opzione. Quando attivata, permette agli sviluppatori di prevenire catene + d’interazione senza fine con altri account automatizzati. Inoltre imposta Firefish + perché tratti questo account come automatizzato." flagAsCat: "Sei un gatto? 😺" flagAsCatDescription: "Ti compariranno le orecchie e parlerai come un gatto!" autoAcceptFollowed: "Accetta in automatico i follow dagli account che segui" @@ -2079,7 +2079,7 @@ noGraze: Per favore disattiva l'estenzione del browser "Graze for Mastodon", per interferisce con Firefish. silencedWarning: Vedi questa pagina perché gli utenti sono su un server che il tuo admin ha silenziato, quindi potrebbero essere spam. -isBot: Questo account è un bot +isBot: Questo account è automatizzato isLocked: Serve una approvazione per seguire questo account moveFromDescription: Questa operazione crea un alias del vecchio account in modo che tu possa migrare su questo nuovo account. Fallo PRIMA di migrare il tuo vecchio diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index f0970cd4..8b17ccb3 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -149,8 +149,8 @@ addEmoji: "絵文字を追加" settingGuide: "おすすめ設定" cacheRemoteFiles: "リモートのファイルをキャッシュする" cacheRemoteFilesDescription: "この設定を無効にすると、リモートファイルをキャッシュせず直リンクします。サーバーのストレージを節約できますが、サムネイルが生成されないので通信量が増加します。" -flagAsBot: "Botとして設定" -flagAsBotDescription: "このアカウントがBotである場合は、この設定をオンにします。オンにすると、反応の連鎖を防ぐためのフラグとして他の開発者に役立ったり、Firefishのシステム上での扱いがBotに合ったものになります。" +flagAsBot: "自動化されたアカウントとして設定" +flagAsBotDescription: "このアカウントが自動で投稿する場合は、この設定をオンにします。オンにすると、反応の連鎖を防ぐためのフラグとして他の開発者に役立ったり、Firefishのシステム上での扱いが自動で投稿するアカウントに合ったものになります。" flagAsCat: "あなたは…猫?😺" flagAsCatDescription: "このアカウントが猫であることを示す猫モードを有効にするには、このフラグをオンにします。" flagSpeakAsCat: "猫語で話す" @@ -1968,7 +1968,7 @@ isModerator: モデレーター audio: 音声 image: 画像 video: 動画 -isBot: このアカウントはBotです +isBot: このアカウントは自動で投稿します isLocked: このアカウントのフォローは承認制です isAdmin: 管理者 isPatron: Firefish 後援者 diff --git a/locales/ru-RU.yml b/locales/ru-RU.yml index 7b9a24e2..cd6bf75c 100644 --- a/locales/ru-RU.yml +++ b/locales/ru-RU.yml @@ -2151,3 +2151,14 @@ deletePasskeysConfirm: Это действие безвозвратно удал на этом аккаунте. Продолжить? inputNotMatch: Введённые данные не совпадают addRe: Добавить "re:" в начале комментария в ответ на запись с предупреждением о содержимом +detectPostLanguage: Автоматическое определение языка и отображение кнопки перевода + для сообщений на иностранных языках +indexableDescription: Разрешить встроенной поисковой системе искать ваши публичные + записи +reactions: Реакции +indexable: Индексируемый(-ая) +languageForTranslation: Язык перевода поста +replies: Ответы +quotes: Цитаты +clickToShowPatterns: Нажмите, чтобы показать модуль шаблонов +renotes: Репосты diff --git a/neko/UPSTREAM_COMMIT_ID b/neko/UPSTREAM_COMMIT_ID index 93f6cb6b..4824f55f 100644 --- a/neko/UPSTREAM_COMMIT_ID +++ b/neko/UPSTREAM_COMMIT_ID @@ -1 +1 @@ -3b3320d5323648a5ad9a9c3e12561613e3b89a6c +465a585f47037ce26834587429f0bd341e35f76f diff --git a/package.json b/package.json index 0f68fa0d..cab2569f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "firefish", - "version": "1.0.5-dev20", + "version": "1.0.5-dev21", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/backend/package.json b/packages/backend/package.json index ac0c55dc..c710d340 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -41,7 +41,7 @@ "ajv": "8.12.0", "archiver": "6.0.1", "argon2": "0.31.2", - "aws-sdk": "2.1496.0", + "aws-sdk": "2.1498.0", "axios": "1.6.2", "bcryptjs": "2.4.3", "blurhash": "2.0.5", @@ -95,7 +95,7 @@ "nsfwjs": "2.4.2", "opencc-js": "1.0.5", "os-utils": "0.0.14", - "otpauth": "9.1.5", + "otpauth": "9.2.0", "parse5": "7.1.2", "pg": "8.11.3", "private-ip": "3.0.1", @@ -135,7 +135,7 @@ "xev": "3.0.2" }, "devDependencies": { - "@swc/cli": "0.1.62", + "@swc/cli": "0.1.63", "@swc/core": "1.3.78", "@types/adm-zip": "0.5.4", "@types/bcryptjs": "2.4.6", @@ -158,6 +158,8 @@ "@types/node-fetch": "2.6.9", "@types/nodemailer": "6.4.14", "@types/oauth": "0.9.4", + "@types/opencc-js": "1.0.3", + "@types/pg": "8.10.9", "@types/probe-image-size": "7.2.3", "@types/pug": "2.0.9", "@types/punycode": "2.1.2", @@ -169,6 +171,7 @@ "@types/sanitize-html": "2.9.4", "@types/semver": "7.5.5", "@types/sinonjs__fake-timers": "8.1.5", + "@types/syslog-pro": "1.0.3", "@types/tinycolor2": "1.4.6", "@types/tmp": "0.2.6", "@types/uuid": "9.0.7", diff --git a/packages/backend/src/boot/master.ts b/packages/backend/src/boot/master.ts index 4470cea9..89f72227 100644 --- a/packages/backend/src/boot/master.ts +++ b/packages/backend/src/boot/master.ts @@ -10,10 +10,9 @@ import semver from "semver"; import Logger from "@/services/logger.js"; import loadConfig from "@/config/load.js"; import type { Config } from "@/config/types.js"; -import { lessThan } from "@/prelude/array.js"; -import { envOption } from "../env.js"; +import { envOption } from "@/env.js"; import { showMachineInfo } from "@/misc/show-machine-info.js"; -import { db, initDb } from "../db/postgre.js"; +import { db, initDb } from "@/db/postgre.js"; const _filename = fileURLToPath(import.meta.url); const _dirname = dirname(_filename); diff --git a/packages/backend/src/boot/worker.ts b/packages/backend/src/boot/worker.ts index 236621b0..0acdcd97 100644 --- a/packages/backend/src/boot/worker.ts +++ b/packages/backend/src/boot/worker.ts @@ -1,6 +1,5 @@ import cluster from "node:cluster"; -import { initDb } from "../db/postgre.js"; -import config from "@/config/index.js"; +import { initDb } from "@/db/postgre.js"; import os from "node:os"; /** diff --git a/packages/backend/src/daemons/queue-stats.ts b/packages/backend/src/daemons/queue-stats.ts index 381b52a9..c358518f 100644 --- a/packages/backend/src/daemons/queue-stats.ts +++ b/packages/backend/src/daemons/queue-stats.ts @@ -1,5 +1,5 @@ import Xev from "xev"; -import { deliverQueue, inboxQueue } from "../queue/queues.js"; +import { deliverQueue, inboxQueue } from "@/queue/queues.js"; const ev = new Xev(); diff --git a/packages/backend/src/daemons/server-stats.ts b/packages/backend/src/daemons/server-stats.ts index 39d81ec9..dc749338 100644 --- a/packages/backend/src/daemons/server-stats.ts +++ b/packages/backend/src/daemons/server-stats.ts @@ -2,7 +2,7 @@ import si from "systeminformation"; import Xev from "xev"; import * as osUtils from "os-utils"; import { fetchMeta } from "@/misc/fetch-meta.js"; -import meilisearch from "../db/meilisearch.js"; +import meilisearch from "@/db/meilisearch.js"; const ev = new Xev(); diff --git a/packages/backend/src/db/postgre.ts b/packages/backend/src/db/postgre.ts index 89784650..4090cc50 100644 --- a/packages/backend/src/db/postgre.ts +++ b/packages/backend/src/db/postgre.ts @@ -74,9 +74,10 @@ import { UserIp } from "@/models/entities/user-ip.js"; import { NoteEdit } from "@/models/entities/note-edit.js"; import { entities as charts } from "@/services/chart/entities.js"; -import { envOption } from "../env.js"; import { dbLogger } from "./logger.js"; import { redisClient } from "./redis.js"; + +// TODO?: should we avoid importing things from built directory? import { nativeInitDatabase } from "native-utils/built/index.js"; const sqlLogger = dbLogger.createSubLogger("sql", "gray", false); diff --git a/packages/backend/src/misc/app-lock.ts b/packages/backend/src/misc/app-lock.ts index 198310c8..91d408ac 100644 --- a/packages/backend/src/misc/app-lock.ts +++ b/packages/backend/src/misc/app-lock.ts @@ -1,4 +1,4 @@ -import { redisClient } from "../db/redis.js"; +import { redisClient } from "@/db/redis.js"; import { Mutex } from "redis-semaphore"; /** diff --git a/packages/backend/src/misc/captcha.ts b/packages/backend/src/misc/captcha.ts index 8ea4abed..b3b3dca3 100644 --- a/packages/backend/src/misc/captcha.ts +++ b/packages/backend/src/misc/captcha.ts @@ -1,6 +1,6 @@ import fetch from "node-fetch"; import { URLSearchParams } from "node:url"; -import { getAgentByUrl } from "./fetch.js"; +import { getAgentByUrl } from "@/misc/fetch.js"; import config from "@/config/index.js"; export async function verifyRecaptcha(secret: string, response: string) { diff --git a/packages/backend/src/misc/check-hit-antenna.ts b/packages/backend/src/misc/check-hit-antenna.ts index df6bc9af..e0a3c792 100644 --- a/packages/backend/src/misc/check-hit-antenna.ts +++ b/packages/backend/src/misc/check-hit-antenna.ts @@ -4,9 +4,9 @@ import type { User } from "@/models/entities/user.js"; import { Blockings, Followings, UserProfiles } from "@/models/index.js"; import { getFullApAccount } from "./convert-host.js"; import * as Acct from "@/misc/acct.js"; -import type { Packed } from "./schema.js"; -import { Cache } from "./cache.js"; -import { getWordHardMute } from "./check-word-mute.js"; +import type { Packed } from "@/misc/schema.js"; +import { Cache } from "@/misc/cache.js"; +import { getWordHardMute } from "@/misc/check-word-mute.js"; const blockingCache = new Cache("blocking", 60 * 5); const mutedWordsCache = new Cache("mutedWords", 60 * 5); diff --git a/packages/backend/src/models/entities/note-thread-muting.ts b/packages/backend/src/models/entities/note-thread-muting.ts index 704b3285..7e5fad59 100644 --- a/packages/backend/src/models/entities/note-thread-muting.ts +++ b/packages/backend/src/models/entities/note-thread-muting.ts @@ -7,7 +7,6 @@ import { ManyToOne, } from "typeorm"; import { User } from "./user.js"; -import { Note } from "./note.js"; import { id } from "../id.js"; @Entity() diff --git a/packages/backend/src/models/entities/user-ip.ts b/packages/backend/src/models/entities/user-ip.ts index c30e56b6..adef48e4 100644 --- a/packages/backend/src/models/entities/user-ip.ts +++ b/packages/backend/src/models/entities/user-ip.ts @@ -1,14 +1,5 @@ -import { - PrimaryColumn, - Entity, - Index, - JoinColumn, - Column, - ManyToOne, - PrimaryGeneratedColumn, -} from "typeorm"; +import { Entity, Index, Column, PrimaryGeneratedColumn } from "typeorm"; import { id } from "../id.js"; -import { Note } from "./note.js"; import type { User } from "./user.js"; @Entity() diff --git a/packages/backend/src/models/index.ts b/packages/backend/src/models/index.ts index 8782d574..c1f37cf6 100644 --- a/packages/backend/src/models/index.ts +++ b/packages/backend/src/models/index.ts @@ -1,9 +1,7 @@ -import {} from "typeorm"; import { db } from "@/db/postgre.js"; import { Announcement } from "./entities/announcement.js"; import { AnnouncementRead } from "./entities/announcement-read.js"; -import { Instance } from "./entities/instance.js"; import { Poll } from "./entities/poll.js"; import { PollVote } from "./entities/poll-vote.js"; import { Meta } from "./entities/meta.js"; diff --git a/packages/backend/src/models/repositories/drive-file.ts b/packages/backend/src/models/repositories/drive-file.ts index 3918f794..1b4f477d 100644 --- a/packages/backend/src/models/repositories/drive-file.ts +++ b/packages/backend/src/models/repositories/drive-file.ts @@ -2,12 +2,10 @@ import { db } from "@/db/postgre.js"; import { DriveFile } from "@/models/entities/drive-file.js"; import type { User } from "@/models/entities/user.js"; import { toPuny } from "@/misc/convert-host.js"; -import { awaitAll, Promiseable } from "@/prelude/await-all.js"; +import { awaitAll } from "@/prelude/await-all.js"; import type { Packed } from "@/misc/schema.js"; import config from "@/config/index.js"; import { query, appendQuery } from "@/prelude/url.js"; -import { Meta } from "@/models/entities/meta.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; import { Users, DriveFolders } from "../index.js"; import { deepClone } from "@/misc/clone.js"; diff --git a/packages/backend/src/models/repositories/notification.ts b/packages/backend/src/models/repositories/notification.ts index 1538e67d..90dfbd73 100644 --- a/packages/backend/src/models/repositories/notification.ts +++ b/packages/backend/src/models/repositories/notification.ts @@ -1,4 +1,4 @@ -import { In, Repository } from "typeorm"; +import { In } from "typeorm"; import { Notification } from "@/models/entities/notification.js"; import { awaitAll } from "@/prelude/await-all.js"; import type { Packed } from "@/misc/schema.js"; @@ -6,7 +6,6 @@ import type { Note } from "@/models/entities/note.js"; import type { NoteReaction } from "@/models/entities/note-reaction.js"; import type { User } from "@/models/entities/user.js"; import { aggregateNoteEmojis, prefetchEmojis } from "@/misc/populate-emojis.js"; -import { notificationTypes } from "@/types.js"; import { db } from "@/db/postgre.js"; import { Users, diff --git a/packages/backend/src/models/repositories/user.ts b/packages/backend/src/models/repositories/user.ts index a667f775..6b74dd66 100644 --- a/packages/backend/src/models/repositories/user.ts +++ b/packages/backend/src/models/repositories/user.ts @@ -7,7 +7,6 @@ import type { Packed } from "@/misc/schema.js"; import type { Promiseable } from "@/prelude/await-all.js"; import { awaitAll } from "@/prelude/await-all.js"; import { populateEmojis } from "@/misc/populate-emojis.js"; -import { getAntennas } from "@/misc/antenna-cache.js"; import { USER_ACTIVE_THRESHOLD, USER_ONLINE_THRESHOLD } from "@/const.js"; import { Cache } from "@/misc/cache.js"; import { db } from "@/db/postgre.js"; diff --git a/packages/backend/src/queue/processors/background/index-all-notes.ts b/packages/backend/src/queue/processors/background/index-all-notes.ts index c0275b42..262724cb 100644 --- a/packages/backend/src/queue/processors/background/index-all-notes.ts +++ b/packages/backend/src/queue/processors/background/index-all-notes.ts @@ -6,7 +6,7 @@ import { Notes } from "@/models/index.js"; import { MoreThan } from "typeorm"; import { index } from "@/services/note/create.js"; import { Note } from "@/models/entities/note.js"; -import meilisearch from "../../../db/meilisearch.js"; +import meilisearch from "@/db/meilisearch.js"; const logger = queueLogger.createSubLogger("index-all-notes"); diff --git a/packages/backend/src/queue/processors/db/export-custom-emojis.ts b/packages/backend/src/queue/processors/db/export-custom-emojis.ts index 7a19d0b6..86de43af 100644 --- a/packages/backend/src/queue/processors/db/export-custom-emojis.ts +++ b/packages/backend/src/queue/processors/db/export-custom-emojis.ts @@ -1,14 +1,12 @@ import type Bull from "bull"; import * as fs from "node:fs"; -import { ulid } from "ulid"; import mime from "mime-types"; import archiver from "archiver"; import { queueLogger } from "../../logger.js"; import { addFile } from "@/services/drive/add-file.js"; import { format as dateFormat } from "date-fns"; import { Users, Emojis } from "@/models/index.js"; -import {} from "@/queue/types.js"; import { createTemp, createTempDir } from "@/misc/create-temp.js"; import { downloadUrl } from "@/misc/download-url.js"; import config from "@/config/index.js"; diff --git a/packages/backend/src/queue/processors/db/import-blocking.ts b/packages/backend/src/queue/processors/db/import-blocking.ts index 2fdf80a6..290c9dbc 100644 --- a/packages/backend/src/queue/processors/db/import-blocking.ts +++ b/packages/backend/src/queue/processors/db/import-blocking.ts @@ -5,7 +5,7 @@ import * as Acct from "@/misc/acct.js"; import { resolveUser } from "@/remote/resolve-user.js"; import { downloadTextFile } from "@/misc/download-text-file.js"; import { isSelfHost, toPuny } from "@/misc/convert-host.js"; -import { Users, DriveFiles, Blockings } from "@/models/index.js"; +import { Users, DriveFiles } from "@/models/index.js"; import type { DbUserImportJobData } from "@/queue/types.js"; import block from "@/services/blocking/create.js"; import { IsNull } from "typeorm"; diff --git a/packages/backend/src/queue/processors/db/import-masto-post.ts b/packages/backend/src/queue/processors/db/import-masto-post.ts index 9b86a590..c484ac0e 100644 --- a/packages/backend/src/queue/processors/db/import-masto-post.ts +++ b/packages/backend/src/queue/processors/db/import-masto-post.ts @@ -5,7 +5,6 @@ import { queueLogger } from "../../logger.js"; import type Bull from "bull"; import { htmlToMfm } from "@/remote/activitypub/misc/html-to-mfm.js"; import { resolveNote } from "@/remote/activitypub/models/note.js"; -import { Note } from "@/models/entities/note.js"; import { uploadFromUrl } from "@/services/drive/upload-from-url.js"; import type { DriveFile } from "@/models/entities/drive-file.js"; import { Notes, NoteEdits } from "@/models/index.js"; diff --git a/packages/backend/src/queue/processors/ended-poll-notification.ts b/packages/backend/src/queue/processors/ended-poll-notification.ts index 3bf010a1..f93b067b 100644 --- a/packages/backend/src/queue/processors/ended-poll-notification.ts +++ b/packages/backend/src/queue/processors/ended-poll-notification.ts @@ -1,11 +1,12 @@ import type Bull from "bull"; import { Notes, PollVotes } from "@/models/index.js"; -import { queueLogger } from "../logger.js"; +// import { queueLogger } from "../logger.js"; import type { EndedPollNotificationJobData } from "@/queue/types.js"; import { createNotification } from "@/services/create-notification.js"; import { deliverQuestionUpdate } from "@/services/note/polls/update.js"; -const logger = queueLogger.createSubLogger("ended-poll-notification"); +// unused +// const logger = queueLogger.createSubLogger("ended-poll-notification"); export async function endedPollNotification( job: Bull.Job, diff --git a/packages/backend/src/queue/processors/system/verify-links.ts b/packages/backend/src/queue/processors/system/verify-links.ts index 3ddda9ba..4ee88c63 100644 --- a/packages/backend/src/queue/processors/system/verify-links.ts +++ b/packages/backend/src/queue/processors/system/verify-links.ts @@ -4,7 +4,6 @@ import { UserProfiles } from "@/models/index.js"; import { Not } from "typeorm"; import { queueLogger } from "../../logger.js"; import { verifyLink } from "@/services/fetch-rel-me.js"; -import config from "@/config/index.js"; const logger = queueLogger.createSubLogger("verify-links"); diff --git a/packages/backend/src/queue/processors/webhook-deliver.ts b/packages/backend/src/queue/processors/webhook-deliver.ts index 286b401b..12c9a054 100644 --- a/packages/backend/src/queue/processors/webhook-deliver.ts +++ b/packages/backend/src/queue/processors/webhook-deliver.ts @@ -1,4 +1,3 @@ -import { URL } from "node:url"; import type Bull from "bull"; import Logger from "@/services/logger.js"; import type { WebhookDeliverJobData } from "../types.js"; diff --git a/packages/backend/src/remote/activitypub/audience.ts b/packages/backend/src/remote/activitypub/audience.ts index 21b1b2e6..9d840bc5 100644 --- a/packages/backend/src/remote/activitypub/audience.ts +++ b/packages/backend/src/remote/activitypub/audience.ts @@ -8,7 +8,6 @@ import type { CacheableRemoteUser, CacheableUser, } from "@/models/entities/user.js"; -import { User } from "@/models/entities/user.js"; type Visibility = "public" | "home" | "followers" | "specified"; diff --git a/packages/backend/src/remote/activitypub/kernel/read.ts b/packages/backend/src/remote/activitypub/kernel/read.ts index 7cc70976..53fa7fe6 100644 --- a/packages/backend/src/remote/activitypub/kernel/read.ts +++ b/packages/backend/src/remote/activitypub/kernel/read.ts @@ -3,7 +3,7 @@ import type { IRead } from "../type.js"; import { getApId } from "../type.js"; import { isSelfHost, extractDbHost } from "@/misc/convert-host.js"; import { MessagingMessages } from "@/models/index.js"; -import { readUserMessagingMessage } from "../../../server/api/common/read-messaging-message.js"; +import { readUserMessagingMessage } from "@/server/api/common/read-messaging-message.js"; export const performReadActivity = async ( actor: CacheableRemoteUser, diff --git a/packages/backend/src/remote/activitypub/kernel/undo/accept.ts b/packages/backend/src/remote/activitypub/kernel/undo/accept.ts index 2cd05a77..7cf45704 100644 --- a/packages/backend/src/remote/activitypub/kernel/undo/accept.ts +++ b/packages/backend/src/remote/activitypub/kernel/undo/accept.ts @@ -1,5 +1,4 @@ import unfollow from "@/services/following/delete.js"; -import cancelRequest from "@/services/following/requests/cancel.js"; import type { IAccept } from "../../type.js"; import type { CacheableRemoteUser } from "@/models/entities/user.js"; import { Followings } from "@/models/index.js"; diff --git a/packages/backend/src/remote/activitypub/misc/get-note-html.ts b/packages/backend/src/remote/activitypub/misc/get-note-html.ts index cb5294f7..7521d121 100644 --- a/packages/backend/src/remote/activitypub/misc/get-note-html.ts +++ b/packages/backend/src/remote/activitypub/misc/get-note-html.ts @@ -1,6 +1,6 @@ import * as mfm from "mfm-js"; import type { Note } from "@/models/entities/note.js"; -import { toHtml } from "../../../mfm/to-html.js"; +import { toHtml } from "@/mfm/to-html.js"; export default function (note: Note) { if (!note.text) return ""; diff --git a/packages/backend/src/remote/activitypub/misc/html-to-mfm.ts b/packages/backend/src/remote/activitypub/misc/html-to-mfm.ts index 9d71a46a..f18958f7 100644 --- a/packages/backend/src/remote/activitypub/misc/html-to-mfm.ts +++ b/packages/backend/src/remote/activitypub/misc/html-to-mfm.ts @@ -1,6 +1,6 @@ import type { IObject } from "../type.js"; import { extractApHashtagObjects } from "../models/tag.js"; -import { fromHtml } from "../../../mfm/from-html.js"; +import { fromHtml } from "@/mfm/from-html.js"; export function htmlToMfm(html: string, tag?: IObject | IObject[]) { const hashtagNames = extractApHashtagObjects(tag) diff --git a/packages/backend/src/remote/activitypub/models/image.ts b/packages/backend/src/remote/activitypub/models/image.ts index 67652d57..2cf0c6c1 100644 --- a/packages/backend/src/remote/activitypub/models/image.ts +++ b/packages/backend/src/remote/activitypub/models/image.ts @@ -1,11 +1,10 @@ import { uploadFromUrl } from "@/services/drive/upload-from-url.js"; import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { IRemoteUser } from "@/models/entities/user.js"; import Resolver from "../resolver.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { apLogger } from "../logger.js"; import type { DriveFile } from "@/models/entities/drive-file.js"; -import { DriveFiles, Users } from "@/models/index.js"; +import { DriveFiles } from "@/models/index.js"; import { truncate } from "@/misc/truncate.js"; import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; diff --git a/packages/backend/src/remote/activitypub/models/mention.ts b/packages/backend/src/remote/activitypub/models/mention.ts index b888fa21..e9f80bc4 100644 --- a/packages/backend/src/remote/activitypub/models/mention.ts +++ b/packages/backend/src/remote/activitypub/models/mention.ts @@ -1,7 +1,6 @@ import promiseLimit from "promise-limit"; import { toArray, unique } from "@/prelude/array.js"; import type { CacheableUser } from "@/models/entities/user.js"; -import { User } from "@/models/entities/user.js"; import type { IObject, IApMention } from "../type.js"; import { isMention } from "../type.js"; import Resolver from "../resolver.js"; diff --git a/packages/backend/src/remote/activitypub/models/note.ts b/packages/backend/src/remote/activitypub/models/note.ts index b2354bba..d9eedb30 100644 --- a/packages/backend/src/remote/activitypub/models/note.ts +++ b/packages/backend/src/remote/activitypub/models/note.ts @@ -6,10 +6,7 @@ import post from "@/services/note/create.js"; import { extractMentionedUsers } from "@/services/note/create.js"; import { resolvePerson } from "./person.js"; import { resolveImage } from "./image.js"; -import type { - ILocalUser, - CacheableRemoteUser, -} from "@/models/entities/user.js"; +import type { CacheableRemoteUser } from "@/models/entities/user.js"; import { htmlToMfm } from "../misc/html-to-mfm.js"; import { extractApHashtags } from "./tag.js"; import { unique, toArray, toSingle } from "@/prelude/array.js"; @@ -52,7 +49,6 @@ import { In } from "typeorm"; import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; import { truncate } from "@/misc/truncate.js"; import { type Size, getEmojiSize } from "@/misc/emoji-meta.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; import { langmap } from "@/misc/langmap.js"; const logger = apLogger; diff --git a/packages/backend/src/remote/activitypub/models/person.ts b/packages/backend/src/remote/activitypub/models/person.ts index 52554de3..a5a74700 100644 --- a/packages/backend/src/remote/activitypub/models/person.ts +++ b/packages/backend/src/remote/activitypub/models/person.ts @@ -8,7 +8,6 @@ import { updateUsertags } from "@/services/update-hashtag.js"; import { Users, Instances, - DriveFiles, Followings, UserProfiles, UserPublickeys, @@ -32,8 +31,8 @@ import { publishInternalEvent } from "@/services/stream.js"; import { db } from "@/db/postgre.js"; import { apLogger } from "../logger.js"; import { htmlToMfm } from "../misc/html-to-mfm.js"; -import { fromHtml } from "../../../mfm/from-html.js"; -import type { IActor, IObject, IApPropertyValue } from "../type.js"; +import { fromHtml } from "@/mfm/from-html.js"; +import type { IActor, IObject } from "../type.js"; import { isCollectionOrOrderedCollection, isCollection, @@ -312,7 +311,9 @@ export async function createPerson( await transactionalEntityManager.save( new UserProfile({ userId: user.id, - description: person.summary + description: person._misskey_summary + ? truncate(person._misskey_summary, summaryLength) + : person.summary ? htmlToMfm(truncate(person.summary, summaryLength), person.tag) : null, url: url, diff --git a/packages/backend/src/remote/activitypub/renderer/flag.ts b/packages/backend/src/remote/activitypub/renderer/flag.ts index f94d508e..44da33f5 100644 --- a/packages/backend/src/remote/activitypub/renderer/flag.ts +++ b/packages/backend/src/remote/activitypub/renderer/flag.ts @@ -1,8 +1,5 @@ import config from "@/config/index.js"; -import { IObject, IActivity } from "@/remote/activitypub/type.js"; import type { ILocalUser } from "@/models/entities/user.js"; -import { IRemoteUser } from "@/models/entities/user.js"; -import { getInstanceActor } from "@/services/instance-actor.js"; // to anonymise reporters, the reporting actor must be a system user // object has to be a uri or array of uris diff --git a/packages/backend/src/remote/activitypub/renderer/index.ts b/packages/backend/src/remote/activitypub/renderer/index.ts index 7d2eb952..c60a1f4c 100644 --- a/packages/backend/src/remote/activitypub/renderer/index.ts +++ b/packages/backend/src/remote/activitypub/renderer/index.ts @@ -43,6 +43,7 @@ export const renderActivity = (x: any): IActivity | null => { _misskey_talk: "misskey:_misskey_talk", _misskey_reaction: "misskey:_misskey_reaction", _misskey_votes: "misskey:_misskey_votes", + _misskey_summary: "misskey:_misskey_summary", isCat: "misskey:isCat", // Fedibird fedibird: "http://fedibird.com/ns#", diff --git a/packages/backend/src/remote/activitypub/renderer/person.ts b/packages/backend/src/remote/activitypub/renderer/person.ts index 9f642bb9..db176a0d 100644 --- a/packages/backend/src/remote/activitypub/renderer/person.ts +++ b/packages/backend/src/remote/activitypub/renderer/person.ts @@ -74,6 +74,7 @@ export async function renderPerson(user: ILocalUser) { summary: profile.description ? toHtml(mfm.parse(profile.description)) : null, + _misskey_summary: profile.description, icon: avatar ? renderImage(avatar) : null, image: banner ? renderImage(banner) : null, tag, diff --git a/packages/backend/src/remote/activitypub/renderer/undo.ts b/packages/backend/src/remote/activitypub/renderer/undo.ts index 249d643b..4394c4bf 100644 --- a/packages/backend/src/remote/activitypub/renderer/undo.ts +++ b/packages/backend/src/remote/activitypub/renderer/undo.ts @@ -1,6 +1,5 @@ import config from "@/config/index.js"; import type { User } from "@/models/entities/user.js"; -import { ILocalUser } from "@/models/entities/user.js"; export default (object: any, user: { id: User["id"] }) => { if (object == null) return null; diff --git a/packages/backend/src/remote/activitypub/resolver.ts b/packages/backend/src/remote/activitypub/resolver.ts index 608ca3e9..c4bee109 100644 --- a/packages/backend/src/remote/activitypub/resolver.ts +++ b/packages/backend/src/remote/activitypub/resolver.ts @@ -7,13 +7,7 @@ import { extractDbHost, isSelfHost } from "@/misc/convert-host.js"; import { signedGet } from "./request.js"; import type { IObject, ICollection, IOrderedCollection } from "./type.js"; import { isCollectionOrOrderedCollection, getApId } from "./type.js"; -import { - FollowRequests, - Notes, - NoteReactions, - Polls, - Users, -} from "@/models/index.js"; +import { Notes, NoteReactions, Polls, Users } from "@/models/index.js"; import { parseUri } from "./db-resolver.js"; import renderNote from "@/remote/activitypub/renderer/note.js"; import { renderLike } from "@/remote/activitypub/renderer/like.js"; diff --git a/packages/backend/src/remote/activitypub/type.ts b/packages/backend/src/remote/activitypub/type.ts index 0e63f3ed..cf041076 100644 --- a/packages/backend/src/remote/activitypub/type.ts +++ b/packages/backend/src/remote/activitypub/type.ts @@ -205,6 +205,7 @@ export interface IActor extends IObject { }; "vcard:bday"?: string; "vcard:Address"?: string; + _misskey_summary?: string; } export const isCollection = (object: IObject): object is ICollection => diff --git a/packages/backend/src/server/activitypub.ts b/packages/backend/src/server/activitypub.ts index f9d5eb99..337db599 100644 --- a/packages/backend/src/server/activitypub.ts +++ b/packages/backend/src/server/activitypub.ts @@ -9,7 +9,7 @@ import renderKey from "@/remote/activitypub/renderer/key.js"; import { renderPerson } from "@/remote/activitypub/renderer/person.js"; import renderEmoji from "@/remote/activitypub/renderer/emoji.js"; import { inbox as processInbox } from "@/queue/index.js"; -import { isSelfHost, toPuny } from "@/misc/convert-host.js"; +import { isSelfHost } from "@/misc/convert-host.js"; import { Notes, Users, @@ -22,7 +22,6 @@ import { renderLike } from "@/remote/activitypub/renderer/like.js"; import { getUserKeypair } from "@/misc/keypair-store.js"; import { checkFetch, - hasSignature, getSignatureUser, } from "@/remote/activitypub/check-fetch.js"; import { getInstanceActor } from "@/services/instance-actor.js"; diff --git a/packages/backend/src/server/api/call.ts b/packages/backend/src/server/api/call.ts index 0a1027b8..2132edd0 100644 --- a/packages/backend/src/server/api/call.ts +++ b/packages/backend/src/server/api/call.ts @@ -1,7 +1,6 @@ import { performance } from "perf_hooks"; import type Koa from "koa"; import type { CacheableLocalUser } from "@/models/entities/user.js"; -import { User } from "@/models/entities/user.js"; import type { AccessToken } from "@/models/entities/access-token.js"; import { getIpHash } from "@/misc/get-ip-hash.js"; import { limiter } from "./limiter.js"; @@ -10,7 +9,6 @@ import endpoints from "./endpoints.js"; import compatibility from "./compatibility.js"; import { ApiError } from "./error.js"; import { apiLogger } from "./logger.js"; -import type { AccessToken } from "@/models/entities/access-token.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; const accessDenied = { diff --git a/packages/backend/src/server/api/define.ts b/packages/backend/src/server/api/define.ts index ee084418..946f86a6 100644 --- a/packages/backend/src/server/api/define.ts +++ b/packages/backend/src/server/api/define.ts @@ -1,7 +1,6 @@ import * as fs from "node:fs"; import Ajv from "ajv"; import type { CacheableLocalUser } from "@/models/entities/user.js"; -import { ILocalUser } from "@/models/entities/user.js"; import type { Schema, SchemaType } from "@/misc/schema.js"; import type { AccessToken } from "@/models/entities/access-token.js"; import type { IEndpointMeta } from "./endpoints.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts b/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts index 48614314..78034917 100644 --- a/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts +++ b/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { AbuseUserReports } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/create.ts b/packages/backend/src/server/api/endpoints/admin/accounts/create.ts index 2e035d16..e5972173 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/create.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; -import { signup } from "../../../common/signup.js"; +import { signup } from "@/server/api/common/signup.js"; import { IsNull } from "typeorm"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts b/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts index 3f7243ab..42351808 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; import { doPostSuspend } from "@/services/suspend-user.js"; import { publishUserEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/hosted.ts b/packages/backend/src/server/api/endpoints/admin/accounts/hosted.ts index a7b6e95c..601cd950 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/hosted.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/hosted.ts @@ -2,7 +2,7 @@ import config from "@/config/index.js"; import { Meta } from "@/models/entities/meta.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; import { db } from "@/db/postgre.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/ad/create.ts b/packages/backend/src/server/api/endpoints/admin/ad/create.ts index db39f3eb..bfe4d544 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/create.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Ads } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/ad/delete.ts b/packages/backend/src/server/api/endpoints/admin/ad/delete.ts index ee6d314d..802eb5ef 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/delete.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Ads } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/ad/list.ts b/packages/backend/src/server/api/endpoints/admin/ad/list.ts index 65944d31..1f39e73e 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/list.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Ads } from "@/models/index.js"; -import { makePaginationQuery } from "../../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/ad/update.ts b/packages/backend/src/server/api/endpoints/admin/ad/update.ts index 2c703873..52f31a3c 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/update.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Ads } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/create.ts b/packages/backend/src/server/api/endpoints/admin/announcements/create.ts index 754cc6c8..8af77848 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/create.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Announcements } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts b/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts index 5665b94a..8b2326cd 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Announcements } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/list.ts b/packages/backend/src/server/api/endpoints/admin/announcements/list.ts index e96517c6..a13fabd6 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/list.ts @@ -1,7 +1,7 @@ import { Announcements, AnnouncementReads } from "@/models/index.js"; import type { Announcement } from "@/models/entities/announcement.js"; -import define from "../../../define.js"; -import { makePaginationQuery } from "../../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/update.ts b/packages/backend/src/server/api/endpoints/admin/announcements/update.ts index 616b94d6..03af4147 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/update.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Announcements } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/delete-2fa.ts b/packages/backend/src/server/api/endpoints/admin/delete-2fa.ts index 04f6abb8..1cf60d9c 100644 --- a/packages/backend/src/server/api/endpoints/admin/delete-2fa.ts +++ b/packages/backend/src/server/api/endpoints/admin/delete-2fa.ts @@ -1,6 +1,6 @@ import { Users, UserProfiles } from "@/models/index.js"; import { publishMainStream } from "@/services/stream.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/delete-account.ts b/packages/backend/src/server/api/endpoints/admin/delete-account.ts index 9fd19688..1b6dc31a 100644 --- a/packages/backend/src/server/api/endpoints/admin/delete-account.ts +++ b/packages/backend/src/server/api/endpoints/admin/delete-account.ts @@ -1,6 +1,6 @@ import { Users } from "@/models/index.js"; import { deleteAccount } from "@/services/delete-account.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts b/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts index 79690081..b52f6098 100644 --- a/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { deleteFile } from "@/services/drive/delete-file.js"; import { DriveFiles } from "@/models/index.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/delete-passkeys.ts b/packages/backend/src/server/api/endpoints/admin/delete-passkeys.ts index 3b5c5952..7a54f5d9 100644 --- a/packages/backend/src/server/api/endpoints/admin/delete-passkeys.ts +++ b/packages/backend/src/server/api/endpoints/admin/delete-passkeys.ts @@ -1,6 +1,6 @@ import { Users, UserProfiles, UserSecurityKeys } from "@/models/index.js"; import { publishMainStream } from "@/services/stream.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/drive-capacity-override.ts b/packages/backend/src/server/api/endpoints/admin/drive-capacity-override.ts index c8be3446..d4bb3045 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive-capacity-override.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive-capacity-override.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/drive/clean-remote-files.ts b/packages/backend/src/server/api/endpoints/admin/drive/clean-remote-files.ts index 1b0c1260..84c04793 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/clean-remote-files.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/clean-remote-files.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { createCleanRemoteFilesJob } from "@/queue/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts b/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts index 04208f60..e56c027f 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts @@ -1,5 +1,5 @@ import { IsNull } from "typeorm"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { deleteFile } from "@/services/drive/delete-file.js"; import { DriveFiles } from "@/models/index.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/drive/files.ts b/packages/backend/src/server/api/endpoints/admin/drive/files.ts index 5cb0aecd..e068f1dc 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/files.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/files.ts @@ -1,6 +1,6 @@ import { DriveFiles } from "@/models/index.js"; -import define from "../../../define.js"; -import { makePaginationQuery } from "../../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts b/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts index d65ec09f..a080615e 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts @@ -1,6 +1,6 @@ import { DriveFiles } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/add-aliases-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/add-aliases-bulk.ts index af4a3ebd..9153a644 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/add-aliases-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/add-aliases-bulk.ts @@ -1,7 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { In } from "typeorm"; -import { ApiError } from "../../../error.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/add.ts b/packages/backend/src/server/api/endpoints/admin/emoji/add.ts index eadc52e3..d2bb420a 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/add.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/add.ts @@ -1,8 +1,8 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis, DriveFiles } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; import rndstr from "rndstr"; import { publishBroadcastStream } from "@/services/stream.js"; import { db } from "@/db/postgre.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts b/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts index 3143d70e..c4e32ff4 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts @@ -1,7 +1,7 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; import type { DriveFile } from "@/models/entities/drive-file.js"; import { uploadFromUrl } from "@/services/drive/upload-from-url.js"; import { publishBroadcastStream } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/delete-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/delete-bulk.ts index d208cb73..59dadb14 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/delete-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/delete-bulk.ts @@ -1,8 +1,7 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { In } from "typeorm"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; -import { ApiError } from "../../../error.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts b/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts index 01807a75..0dfe9603 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts @@ -1,7 +1,7 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/import-zip.ts b/packages/backend/src/server/api/endpoints/admin/emoji/import-zip.ts index ef1027df..7e65203a 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/import-zip.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/import-zip.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { createImportCustomEmojisJob } from "@/queue/index.js"; import { ApiError } from "../../../error.js"; 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 53c234ad..85cc8c1a 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts @@ -1,7 +1,7 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { toPuny } from "@/misc/convert-host.js"; -import { makePaginationQuery } from "../../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; import { ApiError } from "../../../error.js"; 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 759b9eab..206a2809 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/list.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { makePaginationQuery } from "../../../common/make-pagination-query.js"; import type { Emoji } from "@/models/entities/emoji.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/remove-aliases-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/remove-aliases-bulk.ts index d6cd6296..980e7ca1 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/remove-aliases-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/remove-aliases-bulk.ts @@ -1,7 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { In } from "typeorm"; -import { ApiError } from "../../../error.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/set-aliases-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/set-aliases-bulk.ts index ea7e70f6..d5dbb573 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/set-aliases-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/set-aliases-bulk.ts @@ -1,7 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { In } from "typeorm"; -import { ApiError } from "../../../error.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/set-category-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/set-category-bulk.ts index eada64e3..9b087009 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/set-category-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/set-category-bulk.ts @@ -1,7 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { In } from "typeorm"; -import { ApiError } from "../../../error.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/set-license-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/set-license-bulk.ts index 0c498a19..c8be42ff 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/set-license-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/set-license-bulk.ts @@ -1,7 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; import { In } from "typeorm"; -import { ApiError } from "../../../error.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/update.ts b/packages/backend/src/server/api/endpoints/admin/emoji/update.ts index 039acb39..25e6b111 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/update.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Emojis } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts b/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts index 534f226c..d1a7fb69 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { deleteFile } from "@/services/drive/delete-file.js"; import { DriveFiles } from "@/models/index.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts b/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts index 9c716559..bf71cd25 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Instances } from "@/models/index.js"; import { toPuny } from "@/misc/convert-host.js"; import { fetchInstanceMetadata } from "@/services/fetch-instance-metadata.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts b/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts index a1ccf11a..a2ce44bd 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import deleteFollowing from "@/services/following/delete.js"; import { Followings, Users } from "@/models/index.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts b/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts index 016989b5..653d187c 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Instances } from "@/models/index.js"; import { toPuny } from "@/misc/convert-host.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/get-index-stats.ts b/packages/backend/src/server/api/endpoints/admin/get-index-stats.ts index f39a369e..98f1f024 100644 --- a/packages/backend/src/server/api/endpoints/admin/get-index-stats.ts +++ b/packages/backend/src/server/api/endpoints/admin/get-index-stats.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts b/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts index 25d07f32..13c893f4 100644 --- a/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts +++ b/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts @@ -1,5 +1,5 @@ import { db } from "@/db/postgre.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/admin/get-user-ips.ts b/packages/backend/src/server/api/endpoints/admin/get-user-ips.ts index da76ae62..1b394ebb 100644 --- a/packages/backend/src/server/api/endpoints/admin/get-user-ips.ts +++ b/packages/backend/src/server/api/endpoints/admin/get-user-ips.ts @@ -1,5 +1,5 @@ import { UserIps } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/invite.ts b/packages/backend/src/server/api/endpoints/admin/invite.ts index b8bdb38b..ebc523d4 100644 --- a/packages/backend/src/server/api/endpoints/admin/invite.ts +++ b/packages/backend/src/server/api/endpoints/admin/invite.ts @@ -1,5 +1,5 @@ import rndstr from "rndstr"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { RegistrationTickets } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index 8cffb34f..6f23ef18 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -1,7 +1,7 @@ import config from "@/config/index.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { MAX_NOTE_TEXT_LENGTH, MAX_CAPTION_TEXT_LENGTH } from "@/const.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/admin/moderators/add.ts b/packages/backend/src/server/api/endpoints/admin/moderators/add.ts index 478f2661..c8b53088 100644 --- a/packages/backend/src/server/api/endpoints/admin/moderators/add.ts +++ b/packages/backend/src/server/api/endpoints/admin/moderators/add.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/moderators/remove.ts b/packages/backend/src/server/api/endpoints/admin/moderators/remove.ts index a43cc0cb..e2af1ca3 100644 --- a/packages/backend/src/server/api/endpoints/admin/moderators/remove.ts +++ b/packages/backend/src/server/api/endpoints/admin/moderators/remove.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/promo/create.ts b/packages/backend/src/server/api/endpoints/admin/promo/create.ts index 00244a77..55038fc8 100644 --- a/packages/backend/src/server/api/endpoints/admin/promo/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/promo/create.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getNote } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getNote } from "@/server/api/common/getters.js"; import { PromoNotes } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/queue/clear.ts b/packages/backend/src/server/api/endpoints/admin/queue/clear.ts index 9b828bb2..9895f34b 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/clear.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/clear.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { destroy } from "@/queue/index.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts b/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts index 15fdfb02..ea8c5056 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts @@ -1,6 +1,6 @@ import { deliverQueue } from "@/queue/queues.js"; import { URL } from "node:url"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts b/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts index 1890bd43..d4f44e30 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts @@ -1,5 +1,5 @@ import { URL } from "node:url"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { inboxQueue } from "@/queue/queues.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/queue/stats.ts b/packages/backend/src/server/api/endpoints/admin/queue/stats.ts index 4a437c3d..f51c1e6d 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/stats.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/stats.ts @@ -5,7 +5,7 @@ import { objectStorageQueue, backgroundQueue, } from "@/queue/queues.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/relays/add.ts b/packages/backend/src/server/api/endpoints/admin/relays/add.ts index bb56216a..ac008486 100644 --- a/packages/backend/src/server/api/endpoints/admin/relays/add.ts +++ b/packages/backend/src/server/api/endpoints/admin/relays/add.ts @@ -1,7 +1,7 @@ import { URL } from "node:url"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { addRelay } from "@/services/relay.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/relays/list.ts b/packages/backend/src/server/api/endpoints/admin/relays/list.ts index 4c294ba9..5c3b7a92 100644 --- a/packages/backend/src/server/api/endpoints/admin/relays/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/relays/list.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { listRelay } from "@/services/relay.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/relays/remove.ts b/packages/backend/src/server/api/endpoints/admin/relays/remove.ts index 1b3d9062..19a9dfa3 100644 --- a/packages/backend/src/server/api/endpoints/admin/relays/remove.ts +++ b/packages/backend/src/server/api/endpoints/admin/relays/remove.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { removeRelay } from "@/services/relay.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/reset-password.ts b/packages/backend/src/server/api/endpoints/admin/reset-password.ts index cbe6735c..5fbed130 100644 --- a/packages/backend/src/server/api/endpoints/admin/reset-password.ts +++ b/packages/backend/src/server/api/endpoints/admin/reset-password.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; // import bcrypt from "bcryptjs"; import rndstr from "rndstr"; import { Users, UserProfiles } from "@/models/index.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts b/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts index c876a219..a94687cf 100644 --- a/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts +++ b/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { AbuseUserReports, Users } from "@/models/index.js"; import { getInstanceActor } from "@/services/instance-actor.js"; import { deliver } from "@/queue/index.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/search/index-all.ts b/packages/backend/src/server/api/endpoints/admin/search/index-all.ts index 135b48ec..53142884 100644 --- a/packages/backend/src/server/api/endpoints/admin/search/index-all.ts +++ b/packages/backend/src/server/api/endpoints/admin/search/index-all.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { createIndexAllNotesJob } from "@/queue/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/send-email.ts b/packages/backend/src/server/api/endpoints/admin/send-email.ts index 1676f689..1b43d90c 100644 --- a/packages/backend/src/server/api/endpoints/admin/send-email.ts +++ b/packages/backend/src/server/api/endpoints/admin/send-email.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { sendEmail } from "@/services/send-email.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/send-mod-mail.ts b/packages/backend/src/server/api/endpoints/admin/send-mod-mail.ts index a36dca2f..5dcbaf2e 100644 --- a/packages/backend/src/server/api/endpoints/admin/send-mod-mail.ts +++ b/packages/backend/src/server/api/endpoints/admin/send-mod-mail.ts @@ -1,7 +1,7 @@ import sanitizeHtml from "sanitize-html"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Users, UserProfiles } from "@/models/index.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { sendEmail } from "@/services/send-email.js"; import { createNotification } from "@/services/create-notification.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/server-info.ts b/packages/backend/src/server/api/endpoints/admin/server-info.ts index 8998032c..ff469196 100644 --- a/packages/backend/src/server/api/endpoints/admin/server-info.ts +++ b/packages/backend/src/server/api/endpoints/admin/server-info.ts @@ -1,7 +1,7 @@ import * as os from "node:os"; import si from "systeminformation"; -import define from "../../define.js"; -import { redisClient } from "../../../../db/redis.js"; +import define from "@/server/api/define.js"; +import { redisClient } from "@/db/redis.js"; import { db } from "@/db/postgre.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts b/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts index df7e8979..adceda41 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { ModerationLogs } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/show-user.ts b/packages/backend/src/server/api/endpoints/admin/show-user.ts index 44ef1bc1..196e8554 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-user.ts @@ -1,5 +1,5 @@ import { Signins, UserProfiles, Users } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/show-users.ts b/packages/backend/src/server/api/endpoints/admin/show-users.ts index b777bd26..1e6ebeda 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-users.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-users.ts @@ -1,5 +1,5 @@ import { Users } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/silence-user.ts b/packages/backend/src/server/api/endpoints/admin/silence-user.ts index a6182329..8d9dcac6 100644 --- a/packages/backend/src/server/api/endpoints/admin/silence-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/silence-user.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/suspend-user.ts b/packages/backend/src/server/api/endpoints/admin/suspend-user.ts index 984bc078..c6d6f47b 100644 --- a/packages/backend/src/server/api/endpoints/admin/suspend-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/suspend-user.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import deleteFollowing from "@/services/following/delete.js"; import { Users, Followings, Notifications } from "@/models/index.js"; import type { User } from "@/models/entities/user.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts b/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts index 6a01b8e8..6592bf44 100644 --- a/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts b/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts index e51d5851..3289fb57 100644 --- a/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; import { doPostUnsuspend } from "@/services/unsuspend-user.js"; diff --git a/packages/backend/src/server/api/endpoints/admin/update-user-note.ts b/packages/backend/src/server/api/endpoints/admin/update-user-note.ts index 04870d1c..d1a4a604 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-user-note.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-user-note.ts @@ -1,5 +1,5 @@ import { UserProfiles, Users } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["admin"], diff --git a/packages/backend/src/server/api/endpoints/admin/vacuum.ts b/packages/backend/src/server/api/endpoints/admin/vacuum.ts index 559b310e..d5b086bb 100644 --- a/packages/backend/src/server/api/endpoints/admin/vacuum.ts +++ b/packages/backend/src/server/api/endpoints/admin/vacuum.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; import { db } from "@/db/postgre.js"; diff --git a/packages/backend/src/server/api/endpoints/announcements.ts b/packages/backend/src/server/api/endpoints/announcements.ts index 1bab61ba..504eb30e 100644 --- a/packages/backend/src/server/api/endpoints/announcements.ts +++ b/packages/backend/src/server/api/endpoints/announcements.ts @@ -1,6 +1,6 @@ import { Announcements, AnnouncementReads } from "@/models/index.js"; -import define from "../define.js"; -import { makePaginationQuery } from "../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/antennas/create.ts b/packages/backend/src/server/api/endpoints/antennas/create.ts index ed164501..46df3aa8 100644 --- a/packages/backend/src/server/api/endpoints/antennas/create.ts +++ b/packages/backend/src/server/api/endpoints/antennas/create.ts @@ -1,7 +1,7 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { genId } from "@/misc/gen-id.js"; import { Antennas, UserLists, UserGroupJoinings } from "@/models/index.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { publishInternalEvent } from "@/services/stream.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/antennas/delete.ts b/packages/backend/src/server/api/endpoints/antennas/delete.ts index a6cf7901..e5a372f1 100644 --- a/packages/backend/src/server/api/endpoints/antennas/delete.ts +++ b/packages/backend/src/server/api/endpoints/antennas/delete.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Antennas } from "@/models/index.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/antennas/list.ts b/packages/backend/src/server/api/endpoints/antennas/list.ts index 929b761d..2726ecc8 100644 --- a/packages/backend/src/server/api/endpoints/antennas/list.ts +++ b/packages/backend/src/server/api/endpoints/antennas/list.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Antennas } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/antennas/markread.ts b/packages/backend/src/server/api/endpoints/antennas/markread.ts index db8e683e..bb5b5b77 100644 --- a/packages/backend/src/server/api/endpoints/antennas/markread.ts +++ b/packages/backend/src/server/api/endpoints/antennas/markread.ts @@ -1,6 +1,5 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Antennas } from "@/models/index.js"; -import { FindOptionsWhere } from "typeorm"; export const meta = { tags: ["antennas", "account"], diff --git a/packages/backend/src/server/api/endpoints/antennas/notes.ts b/packages/backend/src/server/api/endpoints/antennas/notes.ts index a7e4c171..cbe03185 100644 --- a/packages/backend/src/server/api/endpoints/antennas/notes.ts +++ b/packages/backend/src/server/api/endpoints/antennas/notes.ts @@ -1,13 +1,13 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import readNote from "@/services/note/read.js"; import { Antennas, Notes } from "@/models/index.js"; import { redisClient } from "@/db/redis.js"; -import { genId, getTimestamp } from "@/misc/gen-id.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { ApiError } from "../../error.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import { getTimestamp } from "@/misc/gen-id.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { ApiError } from "@/server/api/error.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; export const meta = { tags: ["antennas", "account", "notes"], diff --git a/packages/backend/src/server/api/endpoints/antennas/show.ts b/packages/backend/src/server/api/endpoints/antennas/show.ts index 350d7392..3700052f 100644 --- a/packages/backend/src/server/api/endpoints/antennas/show.ts +++ b/packages/backend/src/server/api/endpoints/antennas/show.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Antennas } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/antennas/update.ts b/packages/backend/src/server/api/endpoints/antennas/update.ts index f491c0b6..9a71a8f9 100644 --- a/packages/backend/src/server/api/endpoints/antennas/update.ts +++ b/packages/backend/src/server/api/endpoints/antennas/update.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Antennas, UserLists, UserGroupJoinings } from "@/models/index.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/ap/get.ts b/packages/backend/src/server/api/endpoints/ap/get.ts index f0db67a3..5159ce3b 100644 --- a/packages/backend/src/server/api/endpoints/ap/get.ts +++ b/packages/backend/src/server/api/endpoints/ap/get.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import Resolver from "@/remote/activitypub/resolver.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/ap/show.ts b/packages/backend/src/server/api/endpoints/ap/show.ts index c25f0a80..50eb7e9c 100644 --- a/packages/backend/src/server/api/endpoints/ap/show.ts +++ b/packages/backend/src/server/api/endpoints/ap/show.ts @@ -1,9 +1,9 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createPerson } from "@/remote/activitypub/models/person.js"; import { createNote } from "@/remote/activitypub/models/note.js"; import DbResolver from "@/remote/activitypub/db-resolver.js"; import Resolver from "@/remote/activitypub/resolver.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { extractDbHost } from "@/misc/convert-host.js"; import { Users, Notes } from "@/models/index.js"; import type { Note } from "@/models/entities/note.js"; diff --git a/packages/backend/src/server/api/endpoints/app/create.ts b/packages/backend/src/server/api/endpoints/app/create.ts index 013c5a10..e32edf12 100644 --- a/packages/backend/src/server/api/endpoints/app/create.ts +++ b/packages/backend/src/server/api/endpoints/app/create.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Apps } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import { unique } from "@/prelude/array.js"; diff --git a/packages/backend/src/server/api/endpoints/app/show.ts b/packages/backend/src/server/api/endpoints/app/show.ts index 60949512..d6f38428 100644 --- a/packages/backend/src/server/api/endpoints/app/show.ts +++ b/packages/backend/src/server/api/endpoints/app/show.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Apps } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/auth/accept.ts b/packages/backend/src/server/api/endpoints/auth/accept.ts index 8e6ad652..088de786 100644 --- a/packages/backend/src/server/api/endpoints/auth/accept.ts +++ b/packages/backend/src/server/api/endpoints/auth/accept.ts @@ -1,6 +1,6 @@ import * as crypto from "node:crypto"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { AuthSessions, AccessTokens, Apps } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import { secureRndstr } from "@/misc/secure-rndstr.js"; diff --git a/packages/backend/src/server/api/endpoints/auth/session/generate.ts b/packages/backend/src/server/api/endpoints/auth/session/generate.ts index 1defb940..bd172110 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/generate.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/generate.ts @@ -1,7 +1,7 @@ import { v4 as uuid } from "uuid"; import config from "@/config/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Apps, AuthSessions } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; diff --git a/packages/backend/src/server/api/endpoints/auth/session/show.ts b/packages/backend/src/server/api/endpoints/auth/session/show.ts index 01a5fe5d..70c6d54c 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/show.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/show.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { AuthSessions } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/auth/session/userkey.ts b/packages/backend/src/server/api/endpoints/auth/session/userkey.ts index 0e97bf41..39468151 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/userkey.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/userkey.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Apps, AuthSessions, AccessTokens, Users } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/blocking/create.ts b/packages/backend/src/server/api/endpoints/blocking/create.ts index f00a2923..50154dd6 100644 --- a/packages/backend/src/server/api/endpoints/blocking/create.ts +++ b/packages/backend/src/server/api/endpoints/blocking/create.ts @@ -1,7 +1,7 @@ import create from "@/services/blocking/create.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { Blockings, NoteWatchings, Users } from "@/models/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/blocking/delete.ts b/packages/backend/src/server/api/endpoints/blocking/delete.ts index 037d5af2..addf4bbd 100644 --- a/packages/backend/src/server/api/endpoints/blocking/delete.ts +++ b/packages/backend/src/server/api/endpoints/blocking/delete.ts @@ -1,7 +1,7 @@ import deleteBlocking from "@/services/blocking/delete.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { Blockings, Users } from "@/models/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/blocking/list.ts b/packages/backend/src/server/api/endpoints/blocking/list.ts index 83fca7b4..6f51a645 100644 --- a/packages/backend/src/server/api/endpoints/blocking/list.ts +++ b/packages/backend/src/server/api/endpoints/blocking/list.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Blockings } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/channels/create.ts b/packages/backend/src/server/api/endpoints/channels/create.ts index 26a3448b..177492ed 100644 --- a/packages/backend/src/server/api/endpoints/channels/create.ts +++ b/packages/backend/src/server/api/endpoints/channels/create.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Channels, DriveFiles } from "@/models/index.js"; import type { Channel } from "@/models/entities/channel.js"; import { genId } from "@/misc/gen-id.js"; diff --git a/packages/backend/src/server/api/endpoints/channels/featured.ts b/packages/backend/src/server/api/endpoints/channels/featured.ts index 06e0e850..e0575af2 100644 --- a/packages/backend/src/server/api/endpoints/channels/featured.ts +++ b/packages/backend/src/server/api/endpoints/channels/featured.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Channels } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/channels/follow.ts b/packages/backend/src/server/api/endpoints/channels/follow.ts index de055438..87833982 100644 --- a/packages/backend/src/server/api/endpoints/channels/follow.ts +++ b/packages/backend/src/server/api/endpoints/channels/follow.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Channels, ChannelFollowings } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import { publishUserEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/channels/followed.ts b/packages/backend/src/server/api/endpoints/channels/followed.ts index 993a211f..94374f6b 100644 --- a/packages/backend/src/server/api/endpoints/channels/followed.ts +++ b/packages/backend/src/server/api/endpoints/channels/followed.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Channels, ChannelFollowings } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/channels/owned.ts b/packages/backend/src/server/api/endpoints/channels/owned.ts index 78d9e80c..23607b02 100644 --- a/packages/backend/src/server/api/endpoints/channels/owned.ts +++ b/packages/backend/src/server/api/endpoints/channels/owned.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Channels } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["channels", "account"], diff --git a/packages/backend/src/server/api/endpoints/channels/search.ts b/packages/backend/src/server/api/endpoints/channels/search.ts index b21fa762..b2fab701 100644 --- a/packages/backend/src/server/api/endpoints/channels/search.ts +++ b/packages/backend/src/server/api/endpoints/channels/search.ts @@ -1,9 +1,7 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Brackets } from "typeorm"; -import { Endpoint } from "@/server/api/endpoint-base.js"; import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; import { Channels } from "@/models/index.js"; -import { DI } from "@/di-symbols.js"; import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/channels/show.ts b/packages/backend/src/server/api/endpoints/channels/show.ts index e4ca7566..c5c1b657 100644 --- a/packages/backend/src/server/api/endpoints/channels/show.ts +++ b/packages/backend/src/server/api/endpoints/channels/show.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Channels } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/channels/timeline.ts b/packages/backend/src/server/api/endpoints/channels/timeline.ts index b5d53252..f061acab 100644 --- a/packages/backend/src/server/api/endpoints/channels/timeline.ts +++ b/packages/backend/src/server/api/endpoints/channels/timeline.ts @@ -1,7 +1,7 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Notes, Channels } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; import { activeUsersChart } from "@/services/chart/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/channels/unfollow.ts b/packages/backend/src/server/api/endpoints/channels/unfollow.ts index 654a4fbb..33710003 100644 --- a/packages/backend/src/server/api/endpoints/channels/unfollow.ts +++ b/packages/backend/src/server/api/endpoints/channels/unfollow.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Channels, ChannelFollowings } from "@/models/index.js"; import { publishUserEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/channels/update.ts b/packages/backend/src/server/api/endpoints/channels/update.ts index d9f6f764..0de7a837 100644 --- a/packages/backend/src/server/api/endpoints/channels/update.ts +++ b/packages/backend/src/server/api/endpoints/channels/update.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Channels, DriveFiles } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/charts/active-users.ts b/packages/backend/src/server/api/endpoints/charts/active-users.ts index 3817a32c..d5c3c4eb 100644 --- a/packages/backend/src/server/api/endpoints/charts/active-users.ts +++ b/packages/backend/src/server/api/endpoints/charts/active-users.ts @@ -1,6 +1,6 @@ import { getJsonSchema } from "@/services/chart/core.js"; import { activeUsersChart } from "@/services/chart/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["charts", "users"], diff --git a/packages/backend/src/server/api/endpoints/clips/add-note.ts b/packages/backend/src/server/api/endpoints/clips/add-note.ts index 416af6fa..887c8af0 100644 --- a/packages/backend/src/server/api/endpoints/clips/add-note.ts +++ b/packages/backend/src/server/api/endpoints/clips/add-note.ts @@ -1,8 +1,8 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { ClipNotes, Clips } from "@/models/index.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { genId } from "@/misc/gen-id.js"; -import { getNote } from "../../common/getters.js"; +import { getNote } from "@/server/api/common/getters.js"; export const meta = { tags: ["account", "notes", "clips"], diff --git a/packages/backend/src/server/api/endpoints/clips/create.ts b/packages/backend/src/server/api/endpoints/clips/create.ts index 918e9462..df03b87b 100644 --- a/packages/backend/src/server/api/endpoints/clips/create.ts +++ b/packages/backend/src/server/api/endpoints/clips/create.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { genId } from "@/misc/gen-id.js"; import { Clips } from "@/models/index.js"; diff --git a/packages/backend/src/server/api/endpoints/clips/delete.ts b/packages/backend/src/server/api/endpoints/clips/delete.ts index 8f2489dd..02d95b31 100644 --- a/packages/backend/src/server/api/endpoints/clips/delete.ts +++ b/packages/backend/src/server/api/endpoints/clips/delete.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Clips } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/clips/list.ts b/packages/backend/src/server/api/endpoints/clips/list.ts index d1625ee0..d2762243 100644 --- a/packages/backend/src/server/api/endpoints/clips/list.ts +++ b/packages/backend/src/server/api/endpoints/clips/list.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Clips } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/clips/notes.ts b/packages/backend/src/server/api/endpoints/clips/notes.ts index c641d9ba..13d8310e 100644 --- a/packages/backend/src/server/api/endpoints/clips/notes.ts +++ b/packages/backend/src/server/api/endpoints/clips/notes.ts @@ -1,10 +1,10 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { ClipNotes, Clips, Notes } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { ApiError } from "../../error.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { ApiError } from "@/server/api/error.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; export const meta = { tags: ["account", "notes", "clips"], diff --git a/packages/backend/src/server/api/endpoints/clips/remove-note.ts b/packages/backend/src/server/api/endpoints/clips/remove-note.ts index 2cc19aca..c081a87a 100644 --- a/packages/backend/src/server/api/endpoints/clips/remove-note.ts +++ b/packages/backend/src/server/api/endpoints/clips/remove-note.ts @@ -1,7 +1,7 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { ClipNotes, Clips } from "@/models/index.js"; -import { ApiError } from "../../error.js"; -import { getNote } from "../../common/getters.js"; +import { ApiError } from "@/server/api/error.js"; +import { getNote } from "@/server/api/common/getters.js"; export const meta = { tags: ["account", "notes", "clips"], diff --git a/packages/backend/src/server/api/endpoints/clips/show.ts b/packages/backend/src/server/api/endpoints/clips/show.ts index 14709b50..8218a4fb 100644 --- a/packages/backend/src/server/api/endpoints/clips/show.ts +++ b/packages/backend/src/server/api/endpoints/clips/show.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Clips } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/clips/update.ts b/packages/backend/src/server/api/endpoints/clips/update.ts index e78f36e4..fc88548b 100644 --- a/packages/backend/src/server/api/endpoints/clips/update.ts +++ b/packages/backend/src/server/api/endpoints/clips/update.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Clips } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/compatibility/custom-emojis.ts b/packages/backend/src/server/api/endpoints/compatibility/custom-emojis.ts index 62e0836e..f6c5573a 100644 --- a/packages/backend/src/server/api/endpoints/compatibility/custom-emojis.ts +++ b/packages/backend/src/server/api/endpoints/compatibility/custom-emojis.ts @@ -2,7 +2,7 @@ import { Emojis } from "@/models/index.js"; import type { Emoji } from "@/models/entities/emoji.js"; import { IsNull, In } from "typeorm"; import { FILE_TYPE_BROWSERSAFE } from "@/const.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { requireCredential: false, diff --git a/packages/backend/src/server/api/endpoints/compatibility/peers.ts b/packages/backend/src/server/api/endpoints/compatibility/peers.ts index 30f6e0e9..df81d2b0 100644 --- a/packages/backend/src/server/api/endpoints/compatibility/peers.ts +++ b/packages/backend/src/server/api/endpoints/compatibility/peers.ts @@ -1,5 +1,5 @@ import { Instances } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/custom-motd.ts b/packages/backend/src/server/api/endpoints/custom-motd.ts index 098a676a..d61b31fe 100644 --- a/packages/backend/src/server/api/endpoints/custom-motd.ts +++ b/packages/backend/src/server/api/endpoints/custom-motd.ts @@ -1,6 +1,6 @@ // import { IsNull } from 'typeorm'; import { fetchMeta } from "@/misc/fetch-meta.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/custom-splash-icons.ts b/packages/backend/src/server/api/endpoints/custom-splash-icons.ts index c4833a4e..f63a1b96 100644 --- a/packages/backend/src/server/api/endpoints/custom-splash-icons.ts +++ b/packages/backend/src/server/api/endpoints/custom-splash-icons.ts @@ -1,6 +1,6 @@ // import { IsNull } from 'typeorm'; import { fetchMeta } from "@/misc/fetch-meta.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/drive.ts b/packages/backend/src/server/api/endpoints/drive.ts index ce98b53a..164e7b8f 100644 --- a/packages/backend/src/server/api/endpoints/drive.ts +++ b/packages/backend/src/server/api/endpoints/drive.ts @@ -1,6 +1,6 @@ import { fetchMeta } from "@/misc/fetch-meta.js"; import { DriveFiles } from "@/models/index.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["drive", "account"], diff --git a/packages/backend/src/server/api/endpoints/drive/files.ts b/packages/backend/src/server/api/endpoints/drive/files.ts index c749e490..d5dae876 100644 --- a/packages/backend/src/server/api/endpoints/drive/files.ts +++ b/packages/backend/src/server/api/endpoints/drive/files.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { DriveFiles } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts b/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts index 9267da58..5f821fa7 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFiles, Notes } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/drive/files/caption-image.ts b/packages/backend/src/server/api/endpoints/drive/files/caption-image.ts index 30c8e3de..8b23e324 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/caption-image.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/caption-image.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { createWorker } from "tesseract.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts b/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts index e26da30e..2ce9fa47 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { DriveFiles } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/drive/files/create.ts b/packages/backend/src/server/api/endpoints/drive/files/create.ts index 51b9ea4c..54ca5f8d 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/create.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/create.ts @@ -4,9 +4,9 @@ import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; import { IdentifiableError } from "@/misc/identifiable-error.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { MINUTE } from "@/const.js"; -import define from "../../../define.js"; -import { apiLogger } from "../../../logger.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { apiLogger } from "@/server/api/logger.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/drive/files/delete.ts b/packages/backend/src/server/api/endpoints/drive/files/delete.ts index 4e8b4156..062b69b9 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/delete.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/delete.ts @@ -1,8 +1,8 @@ import { deleteFile } from "@/services/drive/delete-file.js"; import { publishDriveStream } from "@/services/stream.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { DriveFiles, Users } from "@/models/index.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { DriveFiles } from "@/models/index.js"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts b/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts index ce14f4e0..eb6881f5 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts @@ -1,5 +1,5 @@ import { DriveFiles } from "@/models/index.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/drive/files/find.ts b/packages/backend/src/server/api/endpoints/drive/files/find.ts index c2ad9512..5a243de8 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/find.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/find.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { DriveFiles } from "@/models/index.js"; import { IsNull } from "typeorm"; diff --git a/packages/backend/src/server/api/endpoints/drive/files/show.ts b/packages/backend/src/server/api/endpoints/drive/files/show.ts index 291e3f56..455eb76b 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/show.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/show.ts @@ -1,7 +1,7 @@ import type { DriveFile } from "@/models/entities/drive-file.js"; -import { DriveFiles, Users } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import { DriveFiles } from "@/models/index.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/drive/files/update.ts b/packages/backend/src/server/api/endpoints/drive/files/update.ts index e833fddb..bde81e00 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/update.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/update.ts @@ -1,8 +1,8 @@ import { publishDriveStream } from "@/services/stream.js"; import { DriveFiles, DriveFolders, Users } from "@/models/index.js"; import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts b/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts index 7bb47dbe..cdfcb030 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts @@ -1,5 +1,5 @@ import { uploadFromUrl } from "@/services/drive/upload-from-url.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { DriveFiles } from "@/models/index.js"; import { publishMainStream } from "@/services/stream.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/drive/folders.ts b/packages/backend/src/server/api/endpoints/drive/folders.ts index ed0d3884..d02b4fac 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { DriveFolders } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/drive/folders/create.ts b/packages/backend/src/server/api/endpoints/drive/folders/create.ts index d50f5f28..554e61ec 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/create.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/create.ts @@ -1,6 +1,6 @@ import { publishDriveStream } from "@/services/stream.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFolders } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; diff --git a/packages/backend/src/server/api/endpoints/drive/folders/delete.ts b/packages/backend/src/server/api/endpoints/drive/folders/delete.ts index 98895a73..1954b433 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/delete.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/delete.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { publishDriveStream } from "@/services/stream.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFolders, DriveFiles } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/drive/folders/find.ts b/packages/backend/src/server/api/endpoints/drive/folders/find.ts index 45451fb9..d29015e7 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/find.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/find.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { DriveFolders } from "@/models/index.js"; import { IsNull } from "typeorm"; diff --git a/packages/backend/src/server/api/endpoints/drive/folders/show.ts b/packages/backend/src/server/api/endpoints/drive/folders/show.ts index 6a72a227..611724ae 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/show.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/show.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFolders } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/drive/folders/update.ts b/packages/backend/src/server/api/endpoints/drive/folders/update.ts index 13673e9f..5bd880da 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/update.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/update.ts @@ -1,6 +1,6 @@ import { publishDriveStream } from "@/services/stream.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFolders } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/drive/stream.ts b/packages/backend/src/server/api/endpoints/drive/stream.ts index 0c9654ca..cbd78601 100644 --- a/packages/backend/src/server/api/endpoints/drive/stream.ts +++ b/packages/backend/src/server/api/endpoints/drive/stream.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { DriveFiles } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["drive"], diff --git a/packages/backend/src/server/api/endpoints/email-address/available.ts b/packages/backend/src/server/api/endpoints/email-address/available.ts index dc3c5e4b..eb1d833b 100644 --- a/packages/backend/src/server/api/endpoints/email-address/available.ts +++ b/packages/backend/src/server/api/endpoints/email-address/available.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { validateEmailForAccount } from "@/services/validate-email-for-account.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/emoji.ts b/packages/backend/src/server/api/endpoints/emoji.ts index f5a5be4e..2675ba7b 100644 --- a/packages/backend/src/server/api/endpoints/emoji.ts +++ b/packages/backend/src/server/api/endpoints/emoji.ts @@ -1,7 +1,7 @@ import { IsNull } from "typeorm"; import { Emojis } from "@/models/index.js"; -import define from "../define.js"; -import { ApiError } from "../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/endpoint.ts b/packages/backend/src/server/api/endpoints/endpoint.ts index ad0ce456..7dd24f7b 100644 --- a/packages/backend/src/server/api/endpoints/endpoint.ts +++ b/packages/backend/src/server/api/endpoints/endpoint.ts @@ -1,5 +1,5 @@ -import define from "../define.js"; -import endpoints from "../endpoints.js"; +import define from "@/server/api/define.js"; +import endpoints from "@/server/api/endpoints.js"; export const meta = { requireCredential: false, diff --git a/packages/backend/src/server/api/endpoints/endpoints.ts b/packages/backend/src/server/api/endpoints/endpoints.ts index c5844f84..3064fa07 100644 --- a/packages/backend/src/server/api/endpoints/endpoints.ts +++ b/packages/backend/src/server/api/endpoints/endpoints.ts @@ -1,5 +1,5 @@ -import define from "../define.js"; -import endpoints from "../endpoints.js"; +import define from "@/server/api/define.js"; +import endpoints from "@/server/api/endpoints.js"; export const meta = { requireCredential: false, diff --git a/packages/backend/src/server/api/endpoints/export-custom-emojis.ts b/packages/backend/src/server/api/endpoints/export-custom-emojis.ts index f4fc43c1..ca013314 100644 --- a/packages/backend/src/server/api/endpoints/export-custom-emojis.ts +++ b/packages/backend/src/server/api/endpoints/export-custom-emojis.ts @@ -1,5 +1,5 @@ import { createExportCustomEmojisJob } from "@/queue/index.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; import { HOUR } from "@/const.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/federation/followers.ts b/packages/backend/src/server/api/endpoints/federation/followers.ts index 4c6d83ab..2a88d27a 100644 --- a/packages/backend/src/server/api/endpoints/federation/followers.ts +++ b/packages/backend/src/server/api/endpoints/federation/followers.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Followings } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["federation"], diff --git a/packages/backend/src/server/api/endpoints/federation/following.ts b/packages/backend/src/server/api/endpoints/federation/following.ts index 88b16860..c13ee8b1 100644 --- a/packages/backend/src/server/api/endpoints/federation/following.ts +++ b/packages/backend/src/server/api/endpoints/federation/following.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Followings } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["federation"], diff --git a/packages/backend/src/server/api/endpoints/federation/instances.ts b/packages/backend/src/server/api/endpoints/federation/instances.ts index fa1a4153..27a6dabb 100644 --- a/packages/backend/src/server/api/endpoints/federation/instances.ts +++ b/packages/backend/src/server/api/endpoints/federation/instances.ts @@ -1,5 +1,4 @@ -import config from "@/config/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Instances } from "@/models/index.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; diff --git a/packages/backend/src/server/api/endpoints/federation/show-instance.ts b/packages/backend/src/server/api/endpoints/federation/show-instance.ts index 633bb570..c4a6304d 100644 --- a/packages/backend/src/server/api/endpoints/federation/show-instance.ts +++ b/packages/backend/src/server/api/endpoints/federation/show-instance.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Instances } from "@/models/index.js"; import { toPuny } from "@/misc/convert-host.js"; diff --git a/packages/backend/src/server/api/endpoints/federation/stats.ts b/packages/backend/src/server/api/endpoints/federation/stats.ts index ede7a56c..6702eeff 100644 --- a/packages/backend/src/server/api/endpoints/federation/stats.ts +++ b/packages/backend/src/server/api/endpoints/federation/stats.ts @@ -1,7 +1,7 @@ import { IsNull, MoreThan, Not } from "typeorm"; import { Followings, Instances } from "@/models/index.js"; import { awaitAll } from "@/prelude/await-all.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["federation"], diff --git a/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts b/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts index f4c3f6d1..e8ada9e6 100644 --- a/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts +++ b/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { getRemoteUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { getRemoteUser } from "@/server/api/common/getters.js"; import { updatePerson } from "@/remote/activitypub/models/person.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/federation/users.ts b/packages/backend/src/server/api/endpoints/federation/users.ts index ded0a26c..4e925a29 100644 --- a/packages/backend/src/server/api/endpoints/federation/users.ts +++ b/packages/backend/src/server/api/endpoints/federation/users.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["federation"], diff --git a/packages/backend/src/server/api/endpoints/fetch-rss.ts b/packages/backend/src/server/api/endpoints/fetch-rss.ts index b73d7262..bda3c455 100644 --- a/packages/backend/src/server/api/endpoints/fetch-rss.ts +++ b/packages/backend/src/server/api/endpoints/fetch-rss.ts @@ -1,7 +1,7 @@ import Parser from "rss-parser"; import { getResponse } from "@/misc/fetch.js"; import config from "@/config/index.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; const rssParser = new Parser(); diff --git a/packages/backend/src/server/api/endpoints/following/create.ts b/packages/backend/src/server/api/endpoints/following/create.ts index 48ae6ae7..f6e341ad 100644 --- a/packages/backend/src/server/api/endpoints/following/create.ts +++ b/packages/backend/src/server/api/endpoints/following/create.ts @@ -1,7 +1,7 @@ import create from "@/services/following/create.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { Followings, Users } from "@/models/index.js"; import { IdentifiableError } from "@/misc/identifiable-error.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/following/delete.ts b/packages/backend/src/server/api/endpoints/following/delete.ts index cbc6097f..3ef031eb 100644 --- a/packages/backend/src/server/api/endpoints/following/delete.ts +++ b/packages/backend/src/server/api/endpoints/following/delete.ts @@ -1,7 +1,7 @@ import deleteFollowing from "@/services/following/delete.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { Followings, Users } from "@/models/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/following/invalidate.ts b/packages/backend/src/server/api/endpoints/following/invalidate.ts index 01ccc276..7559062c 100644 --- a/packages/backend/src/server/api/endpoints/following/invalidate.ts +++ b/packages/backend/src/server/api/endpoints/following/invalidate.ts @@ -1,7 +1,7 @@ import deleteFollowing from "@/services/following/delete.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { Followings, Users } from "@/models/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/following/requests/accept.ts b/packages/backend/src/server/api/endpoints/following/requests/accept.ts index a4fc0523..cb6b0107 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/accept.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/accept.ts @@ -1,7 +1,7 @@ import acceptFollowRequest from "@/services/following/requests/accept.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getUser } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; export const meta = { tags: ["following", "account"], diff --git a/packages/backend/src/server/api/endpoints/following/requests/cancel.ts b/packages/backend/src/server/api/endpoints/following/requests/cancel.ts index f309e329..7acb0f94 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/cancel.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/cancel.ts @@ -1,7 +1,7 @@ import cancelFollowRequest from "@/services/following/requests/cancel.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getUser } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { Users } from "@/models/index.js"; import { IdentifiableError } from "@/misc/identifiable-error.js"; diff --git a/packages/backend/src/server/api/endpoints/following/requests/list.ts b/packages/backend/src/server/api/endpoints/following/requests/list.ts index 6ba23de5..97f52d4a 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/list.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/list.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { FollowRequests } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/following/requests/reject.ts b/packages/backend/src/server/api/endpoints/following/requests/reject.ts index fedc0db4..37e7bc0a 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/reject.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/reject.ts @@ -1,7 +1,7 @@ import { rejectFollowRequest } from "@/services/following/reject.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getUser } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; export const meta = { tags: ["following", "account"], diff --git a/packages/backend/src/server/api/endpoints/gallery/featured.ts b/packages/backend/src/server/api/endpoints/gallery/featured.ts index d478e8e3..e20e4ab2 100644 --- a/packages/backend/src/server/api/endpoints/gallery/featured.ts +++ b/packages/backend/src/server/api/endpoints/gallery/featured.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { GalleryPosts } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/gallery/popular.ts b/packages/backend/src/server/api/endpoints/gallery/popular.ts index 5eef68d9..805307e4 100644 --- a/packages/backend/src/server/api/endpoints/gallery/popular.ts +++ b/packages/backend/src/server/api/endpoints/gallery/popular.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { GalleryPosts } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/gallery/posts.ts b/packages/backend/src/server/api/endpoints/gallery/posts.ts index f97c161a..0dd02b93 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; import { GalleryPosts } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/create.ts b/packages/backend/src/server/api/endpoints/gallery/posts/create.ts index f3b3768e..a74f2165 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/create.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/create.ts @@ -1,8 +1,7 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { DriveFiles, GalleryPosts } from "@/models/index.js"; -import { genId } from "../../../../../misc/gen-id.js"; +import { genId } from "@/server/api/../../misc/gen-id.js"; import { GalleryPost } from "@/models/entities/gallery-post.js"; -import { ApiError } from "../../../error.js"; import type { DriveFile } from "@/models/entities/drive-file.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts b/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts index 9fd9a500..360ca8c5 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { GalleryPosts } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/like.ts b/packages/backend/src/server/api/endpoints/gallery/posts/like.ts index 2506e40a..f5ccc5bc 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/like.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/like.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { GalleryPosts, GalleryLikes } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/show.ts b/packages/backend/src/server/api/endpoints/gallery/posts/show.ts index 87e272f0..7e172da4 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/show.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/show.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { GalleryPosts } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts b/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts index 03bc299b..f37456a6 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { GalleryPosts, GalleryLikes } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/update.ts b/packages/backend/src/server/api/endpoints/gallery/posts/update.ts index 64e20417..16c62970 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/update.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/update.ts @@ -1,7 +1,5 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { DriveFiles, GalleryPosts } from "@/models/index.js"; -import { GalleryPost } from "@/models/entities/gallery-post.js"; -import { ApiError } from "../../../error.js"; import type { DriveFile } from "@/models/entities/drive-file.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/get-online-users-count.ts b/packages/backend/src/server/api/endpoints/get-online-users-count.ts index 805674a5..633e7533 100644 --- a/packages/backend/src/server/api/endpoints/get-online-users-count.ts +++ b/packages/backend/src/server/api/endpoints/get-online-users-count.ts @@ -1,7 +1,7 @@ import { MoreThan } from "typeorm"; import { USER_ONLINE_THRESHOLD } from "@/const.js"; import { Users } from "@/models/index.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/get-sounds.ts b/packages/backend/src/server/api/endpoints/get-sounds.ts index f7edd386..4fd1498b 100644 --- a/packages/backend/src/server/api/endpoints/get-sounds.ts +++ b/packages/backend/src/server/api/endpoints/get-sounds.ts @@ -1,5 +1,5 @@ import { readdir } from "fs/promises"; -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/hashtags/list.ts b/packages/backend/src/server/api/endpoints/hashtags/list.ts index df99a1e5..6e8016f6 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/list.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/list.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Hashtags } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/hashtags/search.ts b/packages/backend/src/server/api/endpoints/hashtags/search.ts index cde586af..1dc1fb49 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/search.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/search.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Hashtags } from "@/models/index.js"; import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; diff --git a/packages/backend/src/server/api/endpoints/hashtags/show.ts b/packages/backend/src/server/api/endpoints/hashtags/show.ts index 8cf90e45..09849dbd 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/show.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/show.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Hashtags } from "@/models/index.js"; import { normalizeForSearch } from "@/misc/normalize-for-search.js"; diff --git a/packages/backend/src/server/api/endpoints/hashtags/trend.ts b/packages/backend/src/server/api/endpoints/hashtags/trend.ts index e2a83451..fe8bba95 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/trend.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/trend.ts @@ -1,5 +1,5 @@ import { Brackets } from "typeorm"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { Notes } from "@/models/index.js"; import type { Note } from "@/models/entities/note.js"; diff --git a/packages/backend/src/server/api/endpoints/hashtags/users.ts b/packages/backend/src/server/api/endpoints/hashtags/users.ts index 532c6630..ccb70a05 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/users.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/users.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Users } from "@/models/index.js"; import { normalizeForSearch } from "@/misc/normalize-for-search.js"; diff --git a/packages/backend/src/server/api/endpoints/i.ts b/packages/backend/src/server/api/endpoints/i.ts index 39543442..69eabf4d 100644 --- a/packages/backend/src/server/api/endpoints/i.ts +++ b/packages/backend/src/server/api/endpoints/i.ts @@ -1,5 +1,5 @@ import { Users } from "@/models/index.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/i/2fa/done.ts b/packages/backend/src/server/api/endpoints/i/2fa/done.ts index 05d57d28..c1a7b16a 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/done.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/done.ts @@ -1,6 +1,6 @@ import { publishMainStream } from "@/services/stream.js"; import * as OTPAuth from "otpauth"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Users, UserProfiles } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts b/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts index 9ea437b0..b8104e31 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts @@ -1,5 +1,5 @@ import { decode } from "cbor-x"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { UserProfiles, UserSecurityKeys, @@ -7,7 +7,7 @@ import { Users, } from "@/models/index.js"; import config from "@/config/index.js"; -import { procedures, hash } from "../../../2fa.js"; +import { procedures, hash } from "@/server/api/2fa.js"; import { publishMainStream } from "@/services/stream.js"; import { comparePassword } from "@/misc/password.js"; diff --git a/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts b/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts index b9f34268..8125f817 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts @@ -1,7 +1,7 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Users, UserProfiles, UserSecurityKeys } from "@/models/index.js"; import { publishMainStream } from "@/services/stream.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts b/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts index a10dc9b2..8080c939 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts @@ -1,9 +1,9 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { UserProfiles, AttestationChallenges } from "@/models/index.js"; import { promisify } from "node:util"; import * as crypto from "node:crypto"; import { genId } from "@/misc/gen-id.js"; -import { hash } from "../../../2fa.js"; +import { hash } from "@/server/api/2fa.js"; import { comparePassword } from "@/misc/password.js"; const randomBytes = promisify(crypto.randomBytes); diff --git a/packages/backend/src/server/api/endpoints/i/2fa/register.ts b/packages/backend/src/server/api/endpoints/i/2fa/register.ts index cf391ca2..52e1df39 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/register.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/register.ts @@ -2,7 +2,7 @@ import * as OTPAuth from "otpauth"; import * as QRCode from "qrcode"; import config from "@/config/index.js"; import { UserProfiles } from "@/models/index.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { comparePassword } from "@/misc/password.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts b/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts index d91c8f21..b3bc5bdf 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts @@ -1,5 +1,5 @@ import { comparePassword } from "@/misc/password.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { UserProfiles, UserSecurityKeys, Users } from "@/models/index.js"; import { publishMainStream } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts b/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts index 54f1422d..c4e78eec 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts @@ -1,5 +1,5 @@ import { publishMainStream } from "@/services/stream.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Users, UserProfiles } from "@/models/index.js"; import { comparePassword } from "@/misc/password.js"; diff --git a/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts b/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts index 7587ec78..d77ecc88 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts @@ -1,7 +1,7 @@ import { publishMainStream } from "@/services/stream.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Users, UserSecurityKeys } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/i/apps.ts b/packages/backend/src/server/api/endpoints/i/apps.ts index b9516019..7e7574ec 100644 --- a/packages/backend/src/server/api/endpoints/i/apps.ts +++ b/packages/backend/src/server/api/endpoints/i/apps.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { AccessTokens } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/authorized-apps.ts b/packages/backend/src/server/api/endpoints/i/authorized-apps.ts index f759b230..ad66fe1f 100644 --- a/packages/backend/src/server/api/endpoints/i/authorized-apps.ts +++ b/packages/backend/src/server/api/endpoints/i/authorized-apps.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { AccessTokens, Apps } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/change-password.ts b/packages/backend/src/server/api/endpoints/i/change-password.ts index 8bbb3ad9..b0dc8bba 100644 --- a/packages/backend/src/server/api/endpoints/i/change-password.ts +++ b/packages/backend/src/server/api/endpoints/i/change-password.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { UserProfiles } from "@/models/index.js"; import { hashPassword, comparePassword } from "@/misc/password.js"; diff --git a/packages/backend/src/server/api/endpoints/i/delete-account.ts b/packages/backend/src/server/api/endpoints/i/delete-account.ts index 781abe0b..606cde82 100644 --- a/packages/backend/src/server/api/endpoints/i/delete-account.ts +++ b/packages/backend/src/server/api/endpoints/i/delete-account.ts @@ -1,6 +1,6 @@ import { UserProfiles, Users } from "@/models/index.js"; import { deleteAccount } from "@/services/delete-account.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { comparePassword } from "@/misc/password.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/export-blocking.ts b/packages/backend/src/server/api/endpoints/i/export-blocking.ts index 4517ad5f..30e74ab2 100644 --- a/packages/backend/src/server/api/endpoints/i/export-blocking.ts +++ b/packages/backend/src/server/api/endpoints/i/export-blocking.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createExportBlockingJob } from "@/queue/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/i/export-following.ts b/packages/backend/src/server/api/endpoints/i/export-following.ts index a228de8f..07d2997a 100644 --- a/packages/backend/src/server/api/endpoints/i/export-following.ts +++ b/packages/backend/src/server/api/endpoints/i/export-following.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createExportFollowingJob } from "@/queue/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/i/export-mute.ts b/packages/backend/src/server/api/endpoints/i/export-mute.ts index 7bddc434..7d22a073 100644 --- a/packages/backend/src/server/api/endpoints/i/export-mute.ts +++ b/packages/backend/src/server/api/endpoints/i/export-mute.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createExportMuteJob } from "@/queue/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/i/export-notes.ts b/packages/backend/src/server/api/endpoints/i/export-notes.ts index 48506ed6..f167bb83 100644 --- a/packages/backend/src/server/api/endpoints/i/export-notes.ts +++ b/packages/backend/src/server/api/endpoints/i/export-notes.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createExportNotesJob } from "@/queue/index.js"; import { DAY } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/i/export-user-lists.ts b/packages/backend/src/server/api/endpoints/i/export-user-lists.ts index a71b1730..b68d889d 100644 --- a/packages/backend/src/server/api/endpoints/i/export-user-lists.ts +++ b/packages/backend/src/server/api/endpoints/i/export-user-lists.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createExportUserListsJob } from "@/queue/index.js"; import { MINUTE } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/i/favorites.ts b/packages/backend/src/server/api/endpoints/i/favorites.ts index f0dbd2de..f0961ea2 100644 --- a/packages/backend/src/server/api/endpoints/i/favorites.ts +++ b/packages/backend/src/server/api/endpoints/i/favorites.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { NoteFavorites } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["account", "notes", "favorites"], diff --git a/packages/backend/src/server/api/endpoints/i/gallery/likes.ts b/packages/backend/src/server/api/endpoints/i/gallery/likes.ts index d71ee3e5..80c90e68 100644 --- a/packages/backend/src/server/api/endpoints/i/gallery/likes.ts +++ b/packages/backend/src/server/api/endpoints/i/gallery/likes.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { GalleryLikes } from "@/models/index.js"; -import { makePaginationQuery } from "../../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["account", "gallery"], diff --git a/packages/backend/src/server/api/endpoints/i/gallery/posts.ts b/packages/backend/src/server/api/endpoints/i/gallery/posts.ts index e471731a..05478484 100644 --- a/packages/backend/src/server/api/endpoints/i/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/i/gallery/posts.ts @@ -1,6 +1,6 @@ import { GalleryPosts } from "@/models/index.js"; -import define from "../../../define.js"; -import { makePaginationQuery } from "../../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["account", "gallery"], diff --git a/packages/backend/src/server/api/endpoints/i/get-word-muted-notes-count.ts b/packages/backend/src/server/api/endpoints/i/get-word-muted-notes-count.ts index bd58f925..39cc45e8 100644 --- a/packages/backend/src/server/api/endpoints/i/get-word-muted-notes-count.ts +++ b/packages/backend/src/server/api/endpoints/i/get-word-muted-notes-count.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { MutedNotes } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/import-blocking.ts b/packages/backend/src/server/api/endpoints/i/import-blocking.ts index e4f1da60..58314ace 100644 --- a/packages/backend/src/server/api/endpoints/i/import-blocking.ts +++ b/packages/backend/src/server/api/endpoints/i/import-blocking.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createImportBlockingJob } from "@/queue/index.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFiles } from "@/models/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/i/import-following.ts b/packages/backend/src/server/api/endpoints/i/import-following.ts index 1a6c9b56..b7c47569 100644 --- a/packages/backend/src/server/api/endpoints/i/import-following.ts +++ b/packages/backend/src/server/api/endpoints/i/import-following.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createImportFollowingJob } from "@/queue/index.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFiles } from "@/models/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/i/import-muting.ts b/packages/backend/src/server/api/endpoints/i/import-muting.ts index 20d240e7..494fb0d4 100644 --- a/packages/backend/src/server/api/endpoints/i/import-muting.ts +++ b/packages/backend/src/server/api/endpoints/i/import-muting.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createImportMutingJob } from "@/queue/index.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFiles } from "@/models/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/i/import-posts.ts b/packages/backend/src/server/api/endpoints/i/import-posts.ts index 3adba051..b8b52be9 100644 --- a/packages/backend/src/server/api/endpoints/i/import-posts.ts +++ b/packages/backend/src/server/api/endpoints/i/import-posts.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createImportPostsJob } from "@/queue/index.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFiles } from "@/models/index.js"; import { DAY } from "@/const.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; diff --git a/packages/backend/src/server/api/endpoints/i/import-user-lists.ts b/packages/backend/src/server/api/endpoints/i/import-user-lists.ts index 03b1dffb..ed82a960 100644 --- a/packages/backend/src/server/api/endpoints/i/import-user-lists.ts +++ b/packages/backend/src/server/api/endpoints/i/import-user-lists.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { createImportUserListsJob } from "@/queue/index.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { DriveFiles } from "@/models/index.js"; import { HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/i/known-as.ts b/packages/backend/src/server/api/endpoints/i/known-as.ts index 384cbd7c..39bf6fff 100644 --- a/packages/backend/src/server/api/endpoints/i/known-as.ts +++ b/packages/backend/src/server/api/endpoints/i/known-as.ts @@ -5,9 +5,9 @@ import acceptAllFollowRequests from "@/services/following/requests/accept-all.js import { publishToFollowers } from "@/services/i/update.js"; import { publishMainStream } from "@/services/stream.js"; import { DAY } from "@/const.js"; -import { apiLogger } from "../../logger.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import { apiLogger } from "@/server/api/logger.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { parse } from "@/misc/acct.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/move.ts b/packages/backend/src/server/api/endpoints/i/move.ts index fd4ef6b1..17b70ac8 100644 --- a/packages/backend/src/server/api/endpoints/i/move.ts +++ b/packages/backend/src/server/api/endpoints/i/move.ts @@ -3,9 +3,9 @@ import { resolveUser } from "@/remote/resolve-user.js"; import { DAY } from "@/const.js"; import DeliverManager from "@/remote/activitypub/deliver-manager.js"; import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { apiLogger } from "../../logger.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { apiLogger } from "@/server/api/logger.js"; import deleteFollowing from "@/services/following/delete.js"; import create from "@/services/following/create.js"; import { getUser } from "@/server/api/common/getters.js"; diff --git a/packages/backend/src/server/api/endpoints/i/notifications.ts b/packages/backend/src/server/api/endpoints/i/notifications.ts index 6e1aabef..b07247dd 100644 --- a/packages/backend/src/server/api/endpoints/i/notifications.ts +++ b/packages/backend/src/server/api/endpoints/i/notifications.ts @@ -8,9 +8,9 @@ import { } from "@/models/index.js"; import { notificationTypes } from "@/types.js"; import read from "@/services/note/read.js"; -import { readNotification } from "../../common/read-notification.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { readNotification } from "@/server/api/common/read-notification.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["account", "notifications"], diff --git a/packages/backend/src/server/api/endpoints/i/page-likes.ts b/packages/backend/src/server/api/endpoints/i/page-likes.ts index 1be783a0..289d0726 100644 --- a/packages/backend/src/server/api/endpoints/i/page-likes.ts +++ b/packages/backend/src/server/api/endpoints/i/page-likes.ts @@ -1,6 +1,6 @@ import { PageLikes } from "@/models/index.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["account", "pages"], diff --git a/packages/backend/src/server/api/endpoints/i/pages.ts b/packages/backend/src/server/api/endpoints/i/pages.ts index 78b72e3b..1177d2e6 100644 --- a/packages/backend/src/server/api/endpoints/i/pages.ts +++ b/packages/backend/src/server/api/endpoints/i/pages.ts @@ -1,6 +1,6 @@ import { Pages } from "@/models/index.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["account", "pages"], diff --git a/packages/backend/src/server/api/endpoints/i/pin.ts b/packages/backend/src/server/api/endpoints/i/pin.ts index 75207052..4291541e 100644 --- a/packages/backend/src/server/api/endpoints/i/pin.ts +++ b/packages/backend/src/server/api/endpoints/i/pin.ts @@ -1,6 +1,6 @@ import { addPinned } from "@/services/i/pin.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Users } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/read-all-messaging-messages.ts b/packages/backend/src/server/api/endpoints/i/read-all-messaging-messages.ts index 03336772..505c424e 100644 --- a/packages/backend/src/server/api/endpoints/i/read-all-messaging-messages.ts +++ b/packages/backend/src/server/api/endpoints/i/read-all-messaging-messages.ts @@ -1,5 +1,5 @@ import { publishMainStream } from "@/services/stream.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { MessagingMessages, UserGroupJoinings } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts b/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts index 8a8857c8..6f70e55a 100644 --- a/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts +++ b/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts @@ -1,5 +1,5 @@ import { publishMainStream } from "@/services/stream.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { NoteUnreads } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/read-announcement.ts b/packages/backend/src/server/api/endpoints/i/read-announcement.ts index d0dfa665..a59d15b9 100644 --- a/packages/backend/src/server/api/endpoints/i/read-announcement.ts +++ b/packages/backend/src/server/api/endpoints/i/read-announcement.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { genId } from "@/misc/gen-id.js"; import { AnnouncementReads, Announcements, Users } from "@/models/index.js"; import { publishMainStream } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/i/regenerate-token.ts b/packages/backend/src/server/api/endpoints/i/regenerate-token.ts index b5b34c09..c1b4325a 100644 --- a/packages/backend/src/server/api/endpoints/i/regenerate-token.ts +++ b/packages/backend/src/server/api/endpoints/i/regenerate-token.ts @@ -3,8 +3,8 @@ import { publishMainStream, publishUserEvent, } from "@/services/stream.js"; -import generateUserToken from "../../common/generate-native-user-token.js"; -import define from "../../define.js"; +import generateUserToken from "@/server/api/common/generate-native-user-token.js"; +import define from "@/server/api/define.js"; import { Users, UserProfiles } from "@/models/index.js"; import { comparePassword } from "@/misc/password.js"; diff --git a/packages/backend/src/server/api/endpoints/i/registry/get-all.ts b/packages/backend/src/server/api/endpoints/i/registry/get-all.ts index ee9fe7e9..c267bb14 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get-all.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get-all.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { RegistryItems } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts b/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts index 85900bd7..57db3c71 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { RegistryItems } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts b/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts index a9bcf693..ac37beea 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts @@ -1,5 +1,5 @@ -import { ApiError } from "../../../error.js"; -import define from "../../../define.js"; +import { ApiError } from "@/server/api/error.js"; +import define from "@/server/api/define.js"; import { RegistryItems } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/registry/get.ts b/packages/backend/src/server/api/endpoints/i/registry/get.ts index b143b722..d25047e0 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { RegistryItems } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts b/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts index 23698dc5..f691552b 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { RegistryItems } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/registry/keys.ts b/packages/backend/src/server/api/endpoints/i/registry/keys.ts index ad7d08c5..186e744b 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/keys.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/keys.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { RegistryItems } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/registry/remove.ts b/packages/backend/src/server/api/endpoints/i/registry/remove.ts index d3793b0e..aa459952 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/remove.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/remove.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { RegistryItems } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/i/registry/scopes.ts b/packages/backend/src/server/api/endpoints/i/registry/scopes.ts index 3d66359c..e235ef67 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/scopes.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/scopes.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { RegistryItems } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/registry/set.ts b/packages/backend/src/server/api/endpoints/i/registry/set.ts index 7f9eebd5..7a1f8ab5 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/set.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/set.ts @@ -1,5 +1,5 @@ import { publishMainStream } from "@/services/stream.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { RegistryItems } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; diff --git a/packages/backend/src/server/api/endpoints/i/revoke-token.ts b/packages/backend/src/server/api/endpoints/i/revoke-token.ts index 3a410fa0..f3e81169 100644 --- a/packages/backend/src/server/api/endpoints/i/revoke-token.ts +++ b/packages/backend/src/server/api/endpoints/i/revoke-token.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { AccessTokens } from "@/models/index.js"; import { publishUserEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/i/signin-history.ts b/packages/backend/src/server/api/endpoints/i/signin-history.ts index 288b750b..14d30308 100644 --- a/packages/backend/src/server/api/endpoints/i/signin-history.ts +++ b/packages/backend/src/server/api/endpoints/i/signin-history.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Signins } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/i/unpin.ts b/packages/backend/src/server/api/endpoints/i/unpin.ts index c248eb34..9aee1dfe 100644 --- a/packages/backend/src/server/api/endpoints/i/unpin.ts +++ b/packages/backend/src/server/api/endpoints/i/unpin.ts @@ -1,6 +1,6 @@ import { removePinned } from "@/services/i/pin.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Users } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/update-email.ts b/packages/backend/src/server/api/endpoints/i/update-email.ts index 94ad6b3c..a48252ed 100644 --- a/packages/backend/src/server/api/endpoints/i/update-email.ts +++ b/packages/backend/src/server/api/endpoints/i/update-email.ts @@ -1,10 +1,10 @@ import { publishMainStream } from "@/services/stream.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import rndstr from "rndstr"; import config from "@/config/index.js"; import { Users, UserProfiles } from "@/models/index.js"; import { sendEmail } from "@/services/send-email.js"; -import { ApiError } from "../../error.js"; +import { ApiError } from "@/server/api/error.js"; import { validateEmailForAccount } from "@/services/validate-email-for-account.js"; import { HOUR } from "@/const.js"; import { comparePassword } from "@/misc/password.js"; diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index 0037839b..08210838 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -13,9 +13,8 @@ import { notificationTypes } from "@/types.js"; import { normalizeForSearch } from "@/misc/normalize-for-search.js"; import { langmap } from "@/misc/langmap.js"; import { verifyLink } from "@/services/fetch-rel-me.js"; -import { ApiError } from "../../error.js"; -import config from "@/config/index.js"; -import define from "../../define.js"; +import { ApiError } from "@/server/api/error.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/i/user-group-invites.ts b/packages/backend/src/server/api/endpoints/i/user-group-invites.ts index d0c6caf0..99e8209a 100644 --- a/packages/backend/src/server/api/endpoints/i/user-group-invites.ts +++ b/packages/backend/src/server/api/endpoints/i/user-group-invites.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { UserGroupInvitations } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["account", "groups"], diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/create.ts b/packages/backend/src/server/api/endpoints/i/webhooks/create.ts index 2b0f1781..ee38b763 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/create.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/create.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { genId } from "@/misc/gen-id.js"; import { Webhooks } from "@/models/index.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts b/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts index 4a2c3d83..a92ed179 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Webhooks } from "@/models/index.js"; import { publishInternalEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/list.ts b/packages/backend/src/server/api/endpoints/i/webhooks/list.ts index 3afead59..f937e560 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/list.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/list.ts @@ -1,4 +1,4 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { Webhooks } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/show.ts b/packages/backend/src/server/api/endpoints/i/webhooks/show.ts index 96c04574..b24850f5 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/show.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/show.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Webhooks } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/update.ts b/packages/backend/src/server/api/endpoints/i/webhooks/update.ts index 161d705e..4a211b91 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/update.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/update.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { Webhooks } from "@/models/index.js"; import { publishInternalEvent } from "@/services/stream.js"; import { webhookEventTypes } from "@/models/entities/webhook.js"; diff --git a/packages/backend/src/server/api/endpoints/latest-version.ts b/packages/backend/src/server/api/endpoints/latest-version.ts index a5127f98..4b12f1bd 100644 --- a/packages/backend/src/server/api/endpoints/latest-version.ts +++ b/packages/backend/src/server/api/endpoints/latest-version.ts @@ -1,4 +1,4 @@ -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/messaging/history.ts b/packages/backend/src/server/api/endpoints/messaging/history.ts index 7d1df698..25418a17 100644 --- a/packages/backend/src/server/api/endpoints/messaging/history.ts +++ b/packages/backend/src/server/api/endpoints/messaging/history.ts @@ -5,7 +5,7 @@ import { Mutings, UserGroupJoinings, } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["messaging"], diff --git a/packages/backend/src/server/api/endpoints/messaging/messages.ts b/packages/backend/src/server/api/endpoints/messaging/messages.ts index 17f626b6..01f70286 100644 --- a/packages/backend/src/server/api/endpoints/messaging/messages.ts +++ b/packages/backend/src/server/api/endpoints/messaging/messages.ts @@ -1,19 +1,19 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { MessagingMessages, UserGroups, UserGroupJoinings, Users, } from "@/models/index.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; import { Brackets } from "typeorm"; import { readUserMessagingMessage, readGroupMessagingMessage, deliverReadActivity, -} from "../../common/read-messaging-message.js"; +} from "@/server/api/common/read-messaging-message.js"; export const meta = { tags: ["messaging"], diff --git a/packages/backend/src/server/api/endpoints/messaging/messages/create.ts b/packages/backend/src/server/api/endpoints/messaging/messages/create.ts index 4ffbb069..6fd38eff 100644 --- a/packages/backend/src/server/api/endpoints/messaging/messages/create.ts +++ b/packages/backend/src/server/api/endpoints/messaging/messages/create.ts @@ -1,8 +1,7 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getUser } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { - MessagingMessages, DriveFiles, UserGroups, UserGroupJoinings, diff --git a/packages/backend/src/server/api/endpoints/messaging/messages/delete.ts b/packages/backend/src/server/api/endpoints/messaging/messages/delete.ts index 42ff050d..76691dd3 100644 --- a/packages/backend/src/server/api/endpoints/messaging/messages/delete.ts +++ b/packages/backend/src/server/api/endpoints/messaging/messages/delete.ts @@ -1,5 +1,5 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { MessagingMessages } from "@/models/index.js"; import { deleteMessage } from "@/services/messages/delete.js"; import { SECOND, HOUR } from "@/const.js"; diff --git a/packages/backend/src/server/api/endpoints/messaging/messages/read.ts b/packages/backend/src/server/api/endpoints/messaging/messages/read.ts index 0ef013b7..5aa50155 100644 --- a/packages/backend/src/server/api/endpoints/messaging/messages/read.ts +++ b/packages/backend/src/server/api/endpoints/messaging/messages/read.ts @@ -1,10 +1,10 @@ -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { MessagingMessages } from "@/models/index.js"; import { readUserMessagingMessage, readGroupMessagingMessage, -} from "../../../common/read-messaging-message.js"; +} from "@/server/api/common/read-messaging-message.js"; export const meta = { tags: ["messaging"], diff --git a/packages/backend/src/server/api/endpoints/meta.ts b/packages/backend/src/server/api/endpoints/meta.ts index 5889d00a..27fa3dff 100644 --- a/packages/backend/src/server/api/endpoints/meta.ts +++ b/packages/backend/src/server/api/endpoints/meta.ts @@ -4,7 +4,7 @@ import config from "@/config/index.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { Ads, Emojis, Users } from "@/models/index.js"; import { MAX_NOTE_TEXT_LENGTH, MAX_CAPTION_TEXT_LENGTH } from "@/const.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/miauth/gen-token.ts b/packages/backend/src/server/api/endpoints/miauth/gen-token.ts index 0525d79a..bca09d3f 100644 --- a/packages/backend/src/server/api/endpoints/miauth/gen-token.ts +++ b/packages/backend/src/server/api/endpoints/miauth/gen-token.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { AccessTokens } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import { secureRndstr } from "@/misc/secure-rndstr.js"; diff --git a/packages/backend/src/server/api/endpoints/mute/create.ts b/packages/backend/src/server/api/endpoints/mute/create.ts index 7b2f1090..2eb93519 100644 --- a/packages/backend/src/server/api/endpoints/mute/create.ts +++ b/packages/backend/src/server/api/endpoints/mute/create.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { genId } from "@/misc/gen-id.js"; import { Mutings, NoteWatchings } from "@/models/index.js"; import type { Muting } from "@/models/entities/muting.js"; diff --git a/packages/backend/src/server/api/endpoints/mute/delete.ts b/packages/backend/src/server/api/endpoints/mute/delete.ts index cd00c1a8..8058e9a6 100644 --- a/packages/backend/src/server/api/endpoints/mute/delete.ts +++ b/packages/backend/src/server/api/endpoints/mute/delete.ts @@ -1,6 +1,6 @@ -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; import { Mutings } from "@/models/index.js"; import { publishUserEvent } from "@/services/stream.js"; diff --git a/packages/backend/src/server/api/endpoints/mute/list.ts b/packages/backend/src/server/api/endpoints/mute/list.ts index 7bbe29a4..9619457c 100644 --- a/packages/backend/src/server/api/endpoints/mute/list.ts +++ b/packages/backend/src/server/api/endpoints/mute/list.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; import { Mutings } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/my/apps.ts b/packages/backend/src/server/api/endpoints/my/apps.ts index 8a097c8a..bc75b38e 100644 --- a/packages/backend/src/server/api/endpoints/my/apps.ts +++ b/packages/backend/src/server/api/endpoints/my/apps.ts @@ -1,4 +1,4 @@ -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { Apps } from "@/models/index.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/notes.ts b/packages/backend/src/server/api/endpoints/notes.ts index 9787740a..6e2d3b4f 100644 --- a/packages/backend/src/server/api/endpoints/notes.ts +++ b/packages/backend/src/server/api/endpoints/notes.ts @@ -1,6 +1,6 @@ import { Notes } from "@/models/index.js"; -import define from "../define.js"; -import { makePaginationQuery } from "../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/children.ts b/packages/backend/src/server/api/endpoints/notes/children.ts index a35b17a0..d76771c3 100644 --- a/packages/backend/src/server/api/endpoints/notes/children.ts +++ b/packages/backend/src/server/api/endpoints/notes/children.ts @@ -1,9 +1,9 @@ import { Notes } from "@/models/index.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/clips.ts b/packages/backend/src/server/api/endpoints/notes/clips.ts index 34b035ad..430ed02e 100644 --- a/packages/backend/src/server/api/endpoints/notes/clips.ts +++ b/packages/backend/src/server/api/endpoints/notes/clips.ts @@ -1,8 +1,8 @@ import { In } from "typeorm"; import { ClipNotes, Clips } from "@/models/index.js"; -import define from "../../define.js"; -import { getNote } from "../../common/getters.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["clips", "notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/conversation.ts b/packages/backend/src/server/api/endpoints/notes/conversation.ts index c74da2ec..99397408 100644 --- a/packages/backend/src/server/api/endpoints/notes/conversation.ts +++ b/packages/backend/src/server/api/endpoints/notes/conversation.ts @@ -1,8 +1,8 @@ import type { Note } from "@/models/entities/note.js"; import { Notes } from "@/models/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getNote } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getNote } from "@/server/api/common/getters.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/create.ts b/packages/backend/src/server/api/endpoints/notes/create.ts index 15035681..0465d09e 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -12,11 +12,11 @@ import type { DriveFile } from "@/models/entities/drive-file.js"; import type { Note } from "@/models/entities/note.js"; import type { Channel } from "@/models/entities/channel.js"; import { MAX_NOTE_TEXT_LENGTH } from "@/const.js"; -import { noteVisibilities } from "../../../../types.js"; -import { ApiError } from "../../error.js"; -import define from "../../define.js"; +import { noteVisibilities } from "@/types.js"; +import { ApiError } from "@/server/api/error.js"; +import define from "@/server/api/define.js"; import { HOUR } from "@/const.js"; -import { getNote } from "../../common/getters.js"; +import { getNote } from "@/server/api/common/getters.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/delete.ts b/packages/backend/src/server/api/endpoints/notes/delete.ts index 5fc79db7..54aad1eb 100644 --- a/packages/backend/src/server/api/endpoints/notes/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/delete.ts @@ -1,8 +1,8 @@ import deleteNote from "@/services/note/delete.js"; import { Users } from "@/models/index.js"; -import define from "../../define.js"; -import { getNote } from "../../common/getters.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; import { SECOND, HOUR } from "@/const.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/notes/edit.ts b/packages/backend/src/server/api/endpoints/notes/edit.ts index e6d39c52..a0869e41 100644 --- a/packages/backend/src/server/api/endpoints/notes/edit.ts +++ b/packages/backend/src/server/api/endpoints/notes/edit.ts @@ -1,5 +1,5 @@ import { In } from "typeorm"; -import create, { index } from "@/services/note/create.js"; +import { index } from "@/services/note/create.js"; import type { IRemoteUser, User } from "@/models/entities/user.js"; import { Users, @@ -15,11 +15,11 @@ import type { DriveFile } from "@/models/entities/drive-file.js"; import type { IMentionedRemoteUsers, Note } from "@/models/entities/note.js"; import type { Channel } from "@/models/entities/channel.js"; import { MAX_NOTE_TEXT_LENGTH } from "@/const.js"; -import { noteVisibilities } from "../../../../types.js"; -import { ApiError } from "../../error.js"; -import define from "../../define.js"; +import { noteVisibilities } from "@/types.js"; +import { ApiError } from "@/server/api/error.js"; +import define from "@/server/api/define.js"; import { HOUR } from "@/const.js"; -import { getNote } from "../../common/getters.js"; +import { getNote } from "@/server/api/common/getters.js"; import { Poll } from "@/models/entities/poll.js"; import * as mfm from "mfm-js"; import { concat } from "@/prelude/array.js"; @@ -34,7 +34,6 @@ import renderNote from "@/remote/activitypub/renderer/note.js"; import renderUpdate from "@/remote/activitypub/renderer/update.js"; import { deliverToRelays } from "@/services/relay.js"; // import { deliverQuestionUpdate } from "@/services/note/polls/update.js"; -import { fetchMeta } from "@/misc/fetch-meta.js"; import { langmap } from "@/misc/langmap.js"; import detectLanguage from "@/misc/detect-language.js"; diff --git a/packages/backend/src/server/api/endpoints/notes/favorites/create.ts b/packages/backend/src/server/api/endpoints/notes/favorites/create.ts index 64862a37..8b2c7ad3 100644 --- a/packages/backend/src/server/api/endpoints/notes/favorites/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/favorites/create.ts @@ -1,8 +1,8 @@ import { NoteFavorites } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getNote } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getNote } from "@/server/api/common/getters.js"; export const meta = { tags: ["notes", "favorites"], diff --git a/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts b/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts index e05d04a9..018ef91b 100644 --- a/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts @@ -1,7 +1,7 @@ import { NoteFavorites } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getNote } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getNote } from "@/server/api/common/getters.js"; export const meta = { tags: ["notes", "favorites"], diff --git a/packages/backend/src/server/api/endpoints/notes/featured.ts b/packages/backend/src/server/api/endpoints/notes/featured.ts index 47c1e138..4f90145e 100644 --- a/packages/backend/src/server/api/endpoints/notes/featured.ts +++ b/packages/backend/src/server/api/endpoints/notes/featured.ts @@ -1,7 +1,7 @@ import { Notes } from "@/models/index.js"; -import define from "../../define.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import define from "@/server/api/define.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/global-timeline.ts b/packages/backend/src/server/api/endpoints/notes/global-timeline.ts index 0a365a6d..fee660dd 100644 --- a/packages/backend/src/server/api/endpoints/notes/global-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/global-timeline.ts @@ -1,14 +1,14 @@ import { fetchMeta } from "@/misc/fetch-meta.js"; import { Notes } from "@/models/index.js"; import { activeUsersChart } from "@/services/chart/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { generateRepliesQuery } from "../../common/generate-replies-query.js"; -import { generateMutedNoteQuery } from "../../common/generate-muted-note-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; -import { generateMutedUserRenotesQueryForNotes } from "../../common/generated-muted-renote-query.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { generateRepliesQuery } from "@/server/api/common/generate-replies-query.js"; +import { generateMutedNoteQuery } from "@/server/api/common/generate-muted-note-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; +import { generateMutedUserRenotesQueryForNotes } from "@/server/api/common/generated-muted-renote-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts index 4e32b0ab..c573a0c8 100644 --- a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts @@ -2,16 +2,16 @@ import { Brackets } from "typeorm"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { Followings, Notes } from "@/models/index.js"; import { activeUsersChart } from "@/services/chart/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { generateRepliesQuery } from "../../common/generate-replies-query.js"; -import { generateMutedNoteQuery } from "../../common/generate-muted-note-query.js"; -import { generateChannelQuery } from "../../common/generate-channel-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; -import { generateMutedUserRenotesQueryForNotes } from "../../common/generated-muted-renote-query.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { generateRepliesQuery } from "@/server/api/common/generate-replies-query.js"; +import { generateMutedNoteQuery } from "@/server/api/common/generate-muted-note-query.js"; +import { generateChannelQuery } from "@/server/api/common/generate-channel-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; +import { generateMutedUserRenotesQueryForNotes } from "@/server/api/common/generated-muted-renote-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts index 82e93e37..c89b8f87 100644 --- a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts @@ -1,17 +1,17 @@ import { Brackets } from "typeorm"; import { fetchMeta } from "@/misc/fetch-meta.js"; -import { Notes, Users } from "@/models/index.js"; +import { Notes } from "@/models/index.js"; import { activeUsersChart } from "@/services/chart/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateRepliesQuery } from "../../common/generate-replies-query.js"; -import { generateMutedNoteQuery } from "../../common/generate-muted-note-query.js"; -import { generateChannelQuery } from "../../common/generate-channel-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; -import { generateMutedUserRenotesQueryForNotes } from "../../common/generated-muted-renote-query.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateRepliesQuery } from "@/server/api/common/generate-replies-query.js"; +import { generateMutedNoteQuery } from "@/server/api/common/generate-muted-note-query.js"; +import { generateChannelQuery } from "@/server/api/common/generate-channel-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; +import { generateMutedUserRenotesQueryForNotes } from "@/server/api/common/generated-muted-renote-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/mentions.ts b/packages/backend/src/server/api/endpoints/notes/mentions.ts index 68688b50..44ee9093 100644 --- a/packages/backend/src/server/api/endpoints/notes/mentions.ts +++ b/packages/backend/src/server/api/endpoints/notes/mentions.ts @@ -1,12 +1,12 @@ import { Brackets } from "typeorm"; import read from "@/services/note/read.js"; import { Notes, Followings } from "@/models/index.js"; -import define from "../../define.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; -import { generateMutedNoteThreadQuery } from "../../common/generate-muted-note-thread-query.js"; +import define from "@/server/api/define.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; +import { generateMutedNoteThreadQuery } from "@/server/api/common/generate-muted-note-thread-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts b/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts index fcd24db9..ca0d0f03 100644 --- a/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts +++ b/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts @@ -1,6 +1,6 @@ import { Brackets, In } from "typeorm"; import { Polls, Mutings, Notes, PollVotes } from "@/models/index.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/polls/vote.ts b/packages/backend/src/server/api/endpoints/notes/polls/vote.ts index 40535d34..1680eca6 100644 --- a/packages/backend/src/server/api/endpoints/notes/polls/vote.ts +++ b/packages/backend/src/server/api/endpoints/notes/polls/vote.ts @@ -13,9 +13,9 @@ import { } from "@/models/index.js"; import type { IRemoteUser } from "@/models/entities/user.js"; import { genId } from "@/misc/gen-id.js"; -import { getNote } from "../../../common/getters.js"; -import { ApiError } from "../../../error.js"; -import define from "../../../define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/reactions.ts b/packages/backend/src/server/api/endpoints/notes/reactions.ts index 3c8af119..386a3a08 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions.ts @@ -1,10 +1,9 @@ import type { FindOptionsWhere } from "typeorm"; -import { DeepPartial } from "typeorm"; import { NoteReactions } from "@/models/index.js"; import type { NoteReaction } from "@/models/entities/note-reaction.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getNote } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getNote } from "@/server/api/common/getters.js"; export const meta = { tags: ["notes", "reactions"], diff --git a/packages/backend/src/server/api/endpoints/notes/reactions/create.ts b/packages/backend/src/server/api/endpoints/notes/reactions/create.ts index 2c867107..c49a957d 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions/create.ts @@ -1,7 +1,7 @@ import createReaction from "@/services/note/reaction/create.js"; -import define from "../../../define.js"; -import { getNote } from "../../../common/getters.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["reactions", "notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts b/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts index 59096c4c..f135bd7f 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts @@ -1,7 +1,7 @@ import deleteReaction from "@/services/note/reaction/delete.js"; -import define from "../../../define.js"; -import { getNote } from "../../../common/getters.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; import { SECOND, HOUR } from "@/const.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index d3b5cbff..53ac1288 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -2,16 +2,16 @@ import { Brackets } from "typeorm"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { Notes } from "@/models/index.js"; import { activeUsersChart } from "@/services/chart/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateRepliesQuery } from "../../common/generate-replies-query.js"; -import { generateMutedNoteQuery } from "../../common/generate-muted-note-query.js"; -import { generateChannelQuery } from "../../common/generate-channel-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; -import { generateMutedUserRenotesQueryForNotes } from "../../common/generated-muted-renote-query.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateRepliesQuery } from "@/server/api/common/generate-replies-query.js"; +import { generateMutedNoteQuery } from "@/server/api/common/generate-muted-note-query.js"; +import { generateChannelQuery } from "@/server/api/common/generate-channel-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; +import { generateMutedUserRenotesQueryForNotes } from "@/server/api/common/generated-muted-renote-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/renotes.ts b/packages/backend/src/server/api/endpoints/notes/renotes.ts index df801c7f..683004eb 100644 --- a/packages/backend/src/server/api/endpoints/notes/renotes.ts +++ b/packages/backend/src/server/api/endpoints/notes/renotes.ts @@ -1,11 +1,11 @@ import { Notes } from "@/models/index.js"; -import define from "../../define.js"; -import { getNote } from "../../common/getters.js"; -import { ApiError } from "../../error.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/replies.ts b/packages/backend/src/server/api/endpoints/notes/replies.ts index 5ea4d479..e4341ebc 100644 --- a/packages/backend/src/server/api/endpoints/notes/replies.ts +++ b/packages/backend/src/server/api/endpoints/notes/replies.ts @@ -1,9 +1,9 @@ import { Notes } from "@/models/index.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts b/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts index f988acaa..e87725e3 100644 --- a/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts +++ b/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts @@ -2,11 +2,11 @@ import { Brackets } from "typeorm"; import { Notes } from "@/models/index.js"; import { safeForSql } from "@/misc/safe-for-sql.js"; import { normalizeForSearch } from "@/misc/normalize-for-search.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; export const meta = { tags: ["notes", "hashtags"], diff --git a/packages/backend/src/server/api/endpoints/notes/search.ts b/packages/backend/src/server/api/endpoints/notes/search.ts index fe1d3d4c..c6712519 100644 --- a/packages/backend/src/server/api/endpoints/notes/search.ts +++ b/packages/backend/src/server/api/endpoints/notes/search.ts @@ -5,11 +5,11 @@ import config from "@/config/index.js"; import es from "@/db/elasticsearch.js"; import sonic from "@/db/sonic.js"; import meilisearch, { MeilisearchNote } from "@/db/meilisearch.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/notes/show.ts b/packages/backend/src/server/api/endpoints/notes/show.ts index 8c5f91c5..1319e47d 100644 --- a/packages/backend/src/server/api/endpoints/notes/show.ts +++ b/packages/backend/src/server/api/endpoints/notes/show.ts @@ -1,7 +1,7 @@ import { Notes } from "@/models/index.js"; -import define from "../../define.js"; -import { getNote } from "../../common/getters.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/state.ts b/packages/backend/src/server/api/endpoints/notes/state.ts index 630b2a80..b14e6842 100644 --- a/packages/backend/src/server/api/endpoints/notes/state.ts +++ b/packages/backend/src/server/api/endpoints/notes/state.ts @@ -1,11 +1,10 @@ import { NoteFavorites, - Notes, NoteThreadMutings, NoteWatchings, } from "@/models/index.js"; -import { getNote } from "../../common/getters.js"; -import define from "../../define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts b/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts index e4803cc2..7c40a459 100644 --- a/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts @@ -1,9 +1,9 @@ import { Notes, NoteThreadMutings } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import readNote from "@/services/note/read.js"; -import define from "../../../define.js"; -import { getNote } from "../../../common/getters.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts b/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts index c06fd59b..62766bed 100644 --- a/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts @@ -1,7 +1,7 @@ import { NoteThreadMutings } from "@/models/index.js"; -import define from "../../../define.js"; -import { getNote } from "../../../common/getters.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/timeline.ts b/packages/backend/src/server/api/endpoints/notes/timeline.ts index 56243977..0f8da62e 100644 --- a/packages/backend/src/server/api/endpoints/notes/timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/timeline.ts @@ -1,16 +1,16 @@ import { Brackets } from "typeorm"; import { Notes, Followings } from "@/models/index.js"; import { activeUsersChart } from "@/services/chart/index.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { generateRepliesQuery } from "../../common/generate-replies-query.js"; -import { generateMutedNoteQuery } from "../../common/generate-muted-note-query.js"; -import { generateChannelQuery } from "../../common/generate-channel-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; -import { generateMutedUserRenotesQueryForNotes } from "../../common/generated-muted-renote-query.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { generateRepliesQuery } from "@/server/api/common/generate-replies-query.js"; +import { generateMutedNoteQuery } from "@/server/api/common/generate-muted-note-query.js"; +import { generateChannelQuery } from "@/server/api/common/generate-channel-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; +import { generateMutedUserRenotesQueryForNotes } from "@/server/api/common/generated-muted-renote-query.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/translate.ts b/packages/backend/src/server/api/endpoints/notes/translate.ts index d46a8193..d1de3999 100644 --- a/packages/backend/src/server/api/endpoints/notes/translate.ts +++ b/packages/backend/src/server/api/endpoints/notes/translate.ts @@ -4,9 +4,9 @@ import config from "@/config/index.js"; import { Converter } from "opencc-js"; import { getAgentByUrl } from "@/misc/fetch.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; -import { ApiError } from "../../error.js"; -import { getNote } from "../../common/getters.js"; -import define from "../../define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getNote } from "@/server/api/common/getters.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/unrenote.ts b/packages/backend/src/server/api/endpoints/notes/unrenote.ts index a30a19f1..4a396612 100644 --- a/packages/backend/src/server/api/endpoints/notes/unrenote.ts +++ b/packages/backend/src/server/api/endpoints/notes/unrenote.ts @@ -1,8 +1,8 @@ import deleteNote from "@/services/note/delete.js"; import { Notes, Users } from "@/models/index.js"; -import define from "../../define.js"; -import { getNote } from "../../common/getters.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; import { SECOND, HOUR } from "@/const.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts b/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts index 5c3fc55b..3a87ed64 100644 --- a/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts @@ -1,10 +1,10 @@ import { Brackets } from "typeorm"; import { UserLists, UserListJoinings, Notes } from "@/models/index.js"; import { activeUsersChart } from "@/services/chart/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; export const meta = { tags: ["notes", "lists"], diff --git a/packages/backend/src/server/api/endpoints/notes/watching/create.ts b/packages/backend/src/server/api/endpoints/notes/watching/create.ts index f8921099..ec13f5aa 100644 --- a/packages/backend/src/server/api/endpoints/notes/watching/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/watching/create.ts @@ -1,7 +1,7 @@ import watch from "@/services/note/watch.js"; -import define from "../../../define.js"; -import { getNote } from "../../../common/getters.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notes/watching/delete.ts b/packages/backend/src/server/api/endpoints/notes/watching/delete.ts index b441ad74..18994fa8 100644 --- a/packages/backend/src/server/api/endpoints/notes/watching/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/watching/delete.ts @@ -1,7 +1,7 @@ import unwatch from "@/services/note/unwatch.js"; -import define from "../../../define.js"; -import { getNote } from "../../../common/getters.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { getNote } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/notifications/create.ts b/packages/backend/src/server/api/endpoints/notifications/create.ts index bc572336..2077cceb 100644 --- a/packages/backend/src/server/api/endpoints/notifications/create.ts +++ b/packages/backend/src/server/api/endpoints/notifications/create.ts @@ -1,5 +1,5 @@ import { createNotification } from "@/services/create-notification.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["notifications"], diff --git a/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts b/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts index e0888ad7..56803638 100644 --- a/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts +++ b/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts @@ -1,7 +1,7 @@ import { publishMainStream } from "@/services/stream.js"; import { pushNotification } from "@/services/push-notification.js"; import { Notifications } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["notifications", "account"], diff --git a/packages/backend/src/server/api/endpoints/notifications/read.ts b/packages/backend/src/server/api/endpoints/notifications/read.ts index 9efb2fcc..358ca062 100644 --- a/packages/backend/src/server/api/endpoints/notifications/read.ts +++ b/packages/backend/src/server/api/endpoints/notifications/read.ts @@ -1,5 +1,5 @@ -import define from "../../define.js"; -import { readNotification } from "../../common/read-notification.js"; +import define from "@/server/api/define.js"; +import { readNotification } from "@/server/api/common/read-notification.js"; export const meta = { tags: ["notifications", "account"], diff --git a/packages/backend/src/server/api/endpoints/page-push.ts b/packages/backend/src/server/api/endpoints/page-push.ts index a0f1e912..1f87372d 100644 --- a/packages/backend/src/server/api/endpoints/page-push.ts +++ b/packages/backend/src/server/api/endpoints/page-push.ts @@ -1,7 +1,7 @@ import { publishMainStream } from "@/services/stream.js"; import { Users, Pages } from "@/models/index.js"; -import define from "../define.js"; -import { ApiError } from "../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/pages/create.ts b/packages/backend/src/server/api/endpoints/pages/create.ts index 716d3265..ea0f8ba8 100644 --- a/packages/backend/src/server/api/endpoints/pages/create.ts +++ b/packages/backend/src/server/api/endpoints/pages/create.ts @@ -1,8 +1,8 @@ import { Pages, DriveFiles } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import { Page } from "@/models/entities/page.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { HOUR } from "@/const.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/pages/delete.ts b/packages/backend/src/server/api/endpoints/pages/delete.ts index 98b035f7..85688d9b 100644 --- a/packages/backend/src/server/api/endpoints/pages/delete.ts +++ b/packages/backend/src/server/api/endpoints/pages/delete.ts @@ -1,6 +1,6 @@ import { Pages } from "@/models/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["pages"], diff --git a/packages/backend/src/server/api/endpoints/pages/featured.ts b/packages/backend/src/server/api/endpoints/pages/featured.ts index a7634658..c3ff1f57 100644 --- a/packages/backend/src/server/api/endpoints/pages/featured.ts +++ b/packages/backend/src/server/api/endpoints/pages/featured.ts @@ -1,5 +1,5 @@ import { Pages } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["pages"], diff --git a/packages/backend/src/server/api/endpoints/pages/like.ts b/packages/backend/src/server/api/endpoints/pages/like.ts index 03482c96..ab64b9b9 100644 --- a/packages/backend/src/server/api/endpoints/pages/like.ts +++ b/packages/backend/src/server/api/endpoints/pages/like.ts @@ -1,7 +1,7 @@ import { Pages, PageLikes } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["pages"], diff --git a/packages/backend/src/server/api/endpoints/pages/show.ts b/packages/backend/src/server/api/endpoints/pages/show.ts index a25eb30b..ac347cf1 100644 --- a/packages/backend/src/server/api/endpoints/pages/show.ts +++ b/packages/backend/src/server/api/endpoints/pages/show.ts @@ -1,8 +1,8 @@ import { IsNull } from "typeorm"; import { Pages, Users } from "@/models/index.js"; import type { Page } from "@/models/entities/page.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["pages"], diff --git a/packages/backend/src/server/api/endpoints/pages/unlike.ts b/packages/backend/src/server/api/endpoints/pages/unlike.ts index e607d7a5..428f9845 100644 --- a/packages/backend/src/server/api/endpoints/pages/unlike.ts +++ b/packages/backend/src/server/api/endpoints/pages/unlike.ts @@ -1,6 +1,6 @@ import { Pages, PageLikes } from "@/models/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["pages"], diff --git a/packages/backend/src/server/api/endpoints/pages/update.ts b/packages/backend/src/server/api/endpoints/pages/update.ts index 65e1b3b2..5f434d02 100644 --- a/packages/backend/src/server/api/endpoints/pages/update.ts +++ b/packages/backend/src/server/api/endpoints/pages/update.ts @@ -1,7 +1,7 @@ import { Not } from "typeorm"; import { Pages, DriveFiles } from "@/models/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; import { HOUR } from "@/const.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/patrons.ts b/packages/backend/src/server/api/endpoints/patrons.ts index c9dc43fb..51ab2752 100644 --- a/packages/backend/src/server/api/endpoints/patrons.ts +++ b/packages/backend/src/server/api/endpoints/patrons.ts @@ -1,4 +1,4 @@ -import define from "../define.js"; +import define from "@/server/api/define.js"; import * as fs from "node:fs"; import { fileURLToPath } from "node:url"; import { dirname } from "node:path"; diff --git a/packages/backend/src/server/api/endpoints/ping.ts b/packages/backend/src/server/api/endpoints/ping.ts index c1f7e110..7b45edad 100644 --- a/packages/backend/src/server/api/endpoints/ping.ts +++ b/packages/backend/src/server/api/endpoints/ping.ts @@ -1,4 +1,4 @@ -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { requireCredential: false, diff --git a/packages/backend/src/server/api/endpoints/pinned-users.ts b/packages/backend/src/server/api/endpoints/pinned-users.ts index 22020068..b3273787 100644 --- a/packages/backend/src/server/api/endpoints/pinned-users.ts +++ b/packages/backend/src/server/api/endpoints/pinned-users.ts @@ -3,7 +3,7 @@ import { Users } from "@/models/index.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; import * as Acct from "@/misc/acct.js"; import type { User } from "@/models/entities/user.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/promo/read.ts b/packages/backend/src/server/api/endpoints/promo/read.ts index 5310382a..4b414679 100644 --- a/packages/backend/src/server/api/endpoints/promo/read.ts +++ b/packages/backend/src/server/api/endpoints/promo/read.ts @@ -1,8 +1,8 @@ import { PromoReads } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getNote } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getNote } from "@/server/api/common/getters.js"; export const meta = { tags: ["notes"], diff --git a/packages/backend/src/server/api/endpoints/recommended-instances.ts b/packages/backend/src/server/api/endpoints/recommended-instances.ts index 8407afb1..b2356784 100644 --- a/packages/backend/src/server/api/endpoints/recommended-instances.ts +++ b/packages/backend/src/server/api/endpoints/recommended-instances.ts @@ -1,6 +1,6 @@ // import { IsNull } from 'typeorm'; import { fetchMeta } from "@/misc/fetch-meta.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/release.ts b/packages/backend/src/server/api/endpoints/release.ts index bce1bc08..1314e903 100644 --- a/packages/backend/src/server/api/endpoints/release.ts +++ b/packages/backend/src/server/api/endpoints/release.ts @@ -1,4 +1,4 @@ -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["meta"], diff --git a/packages/backend/src/server/api/endpoints/renote-mute/create.ts b/packages/backend/src/server/api/endpoints/renote-mute/create.ts index f09f197c..afe23f38 100644 --- a/packages/backend/src/server/api/endpoints/renote-mute/create.ts +++ b/packages/backend/src/server/api/endpoints/renote-mute/create.ts @@ -1,9 +1,9 @@ import { genId } from "@/misc/gen-id.js"; import { RenoteMutings } from "@/models/index.js"; import { RenoteMuting } from "@/models/entities/renote-muting.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/renote-mute/delete.ts b/packages/backend/src/server/api/endpoints/renote-mute/delete.ts index 7a898141..6a824881 100644 --- a/packages/backend/src/server/api/endpoints/renote-mute/delete.ts +++ b/packages/backend/src/server/api/endpoints/renote-mute/delete.ts @@ -1,7 +1,7 @@ import { RenoteMutings } from "@/models/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/renote-mute/list.ts b/packages/backend/src/server/api/endpoints/renote-mute/list.ts index 9149dd97..b1945271 100644 --- a/packages/backend/src/server/api/endpoints/renote-mute/list.ts +++ b/packages/backend/src/server/api/endpoints/renote-mute/list.ts @@ -1,6 +1,6 @@ import { RenoteMutings } from "@/models/index.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/request-reset-password.ts b/packages/backend/src/server/api/endpoints/request-reset-password.ts index bac564c1..3c78058a 100644 --- a/packages/backend/src/server/api/endpoints/request-reset-password.ts +++ b/packages/backend/src/server/api/endpoints/request-reset-password.ts @@ -1,12 +1,10 @@ import rndstr from "rndstr"; import { IsNull } from "typeorm"; -import { publishMainStream } from "@/services/stream.js"; import config from "@/config/index.js"; import { Users, UserProfiles, PasswordResetRequests } from "@/models/index.js"; import { sendEmail } from "@/services/send-email.js"; import { genId } from "@/misc/gen-id.js"; -import { ApiError } from "../error.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; import { HOUR } from "@/const.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/reset-db.ts b/packages/backend/src/server/api/endpoints/reset-db.ts index c64db7bc..daba09b8 100644 --- a/packages/backend/src/server/api/endpoints/reset-db.ts +++ b/packages/backend/src/server/api/endpoints/reset-db.ts @@ -1,6 +1,5 @@ import { resetDb } from "@/db/postgre.js"; -import define from "../define.js"; -import { ApiError } from "../error.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["non-productive"], diff --git a/packages/backend/src/server/api/endpoints/reset-password.ts b/packages/backend/src/server/api/endpoints/reset-password.ts index f695ae41..ff5c8d98 100644 --- a/packages/backend/src/server/api/endpoints/reset-password.ts +++ b/packages/backend/src/server/api/endpoints/reset-password.ts @@ -1,7 +1,5 @@ -import { publishMainStream } from "@/services/stream.js"; -import { Users, UserProfiles, PasswordResetRequests } from "@/models/index.js"; -import define from "../define.js"; -import { ApiError } from "../error.js"; +import { UserProfiles, PasswordResetRequests } from "@/models/index.js"; +import define from "@/server/api/define.js"; import { hashPassword } from "@/misc/password.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/server-info.ts b/packages/backend/src/server/api/endpoints/server-info.ts index 87132758..ff3bfcd1 100644 --- a/packages/backend/src/server/api/endpoints/server-info.ts +++ b/packages/backend/src/server/api/endpoints/server-info.ts @@ -1,6 +1,6 @@ import * as os from "node:os"; import si from "systeminformation"; -import define from "../define.js"; +import define from "@/server/api/define.js"; import meilisearch from "@/db/meilisearch.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; diff --git a/packages/backend/src/server/api/endpoints/stats.ts b/packages/backend/src/server/api/endpoints/stats.ts index 737873be..184d7fb7 100644 --- a/packages/backend/src/server/api/endpoints/stats.ts +++ b/packages/backend/src/server/api/endpoints/stats.ts @@ -1,5 +1,5 @@ import { Instances, Notes, Users } from "@/models/index.js"; -import define from "../define.js"; +import define from "@/server/api/define.js"; import { IsNull } from "typeorm"; import { Cache } from "@/misc/cache.js"; diff --git a/packages/backend/src/server/api/endpoints/sw/register.ts b/packages/backend/src/server/api/endpoints/sw/register.ts index 6268ae26..ee6b3bbf 100644 --- a/packages/backend/src/server/api/endpoints/sw/register.ts +++ b/packages/backend/src/server/api/endpoints/sw/register.ts @@ -1,7 +1,7 @@ import { fetchMeta } from "@/misc/fetch-meta.js"; import { genId } from "@/misc/gen-id.js"; import { SwSubscriptions } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/sw/show-registration.ts b/packages/backend/src/server/api/endpoints/sw/show-registration.ts index 3ccb7de9..41217924 100644 --- a/packages/backend/src/server/api/endpoints/sw/show-registration.ts +++ b/packages/backend/src/server/api/endpoints/sw/show-registration.ts @@ -1,5 +1,5 @@ import { SwSubscriptions } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/sw/unregister.ts b/packages/backend/src/server/api/endpoints/sw/unregister.ts index e2a40f51..d8a49cbe 100644 --- a/packages/backend/src/server/api/endpoints/sw/unregister.ts +++ b/packages/backend/src/server/api/endpoints/sw/unregister.ts @@ -1,5 +1,5 @@ import { SwSubscriptions } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/sw/update-registration.ts b/packages/backend/src/server/api/endpoints/sw/update-registration.ts index 5ba53ee8..ece1c844 100644 --- a/packages/backend/src/server/api/endpoints/sw/update-registration.ts +++ b/packages/backend/src/server/api/endpoints/sw/update-registration.ts @@ -1,5 +1,5 @@ import { SwSubscriptions } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["account"], diff --git a/packages/backend/src/server/api/endpoints/test.ts b/packages/backend/src/server/api/endpoints/test.ts index 2c43c611..f5041cfb 100644 --- a/packages/backend/src/server/api/endpoints/test.ts +++ b/packages/backend/src/server/api/endpoints/test.ts @@ -1,4 +1,4 @@ -import define from "../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["non-productive"], diff --git a/packages/backend/src/server/api/endpoints/username/available.ts b/packages/backend/src/server/api/endpoints/username/available.ts index 6fa09ba3..cd634a79 100644 --- a/packages/backend/src/server/api/endpoints/username/available.ts +++ b/packages/backend/src/server/api/endpoints/username/available.ts @@ -1,7 +1,7 @@ import { IsNull } from "typeorm"; import { Users, UsedUsernames } from "@/models/index.js"; import config from "@/config/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/users.ts b/packages/backend/src/server/api/endpoints/users.ts index f0a86709..20371fce 100644 --- a/packages/backend/src/server/api/endpoints/users.ts +++ b/packages/backend/src/server/api/endpoints/users.ts @@ -1,7 +1,7 @@ import { Users } from "@/models/index.js"; -import define from "../define.js"; -import { generateMutedUserQueryForUsers } from "../common/generate-muted-user-query.js"; -import { generateBlockQueryForUsers } from "../common/generate-block-query.js"; +import define from "@/server/api/define.js"; +import { generateMutedUserQueryForUsers } from "@/server/api/common/generate-muted-user-query.js"; +import { generateBlockQueryForUsers } from "@/server/api/common/generate-block-query.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/users/clips.ts b/packages/backend/src/server/api/endpoints/users/clips.ts index 0dc90b8f..132e190b 100644 --- a/packages/backend/src/server/api/endpoints/users/clips.ts +++ b/packages/backend/src/server/api/endpoints/users/clips.ts @@ -1,6 +1,6 @@ import { Clips } from "@/models/index.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["users", "clips"], diff --git a/packages/backend/src/server/api/endpoints/users/followers.ts b/packages/backend/src/server/api/endpoints/users/followers.ts index 31719bad..f57983d4 100644 --- a/packages/backend/src/server/api/endpoints/users/followers.ts +++ b/packages/backend/src/server/api/endpoints/users/followers.ts @@ -1,9 +1,9 @@ import { IsNull } from "typeorm"; import { Users, Followings, UserProfiles } from "@/models/index.js"; import { toPunyNullable } from "@/misc/convert-host.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/users/following.ts b/packages/backend/src/server/api/endpoints/users/following.ts index 1c1da0e1..84eb7ccc 100644 --- a/packages/backend/src/server/api/endpoints/users/following.ts +++ b/packages/backend/src/server/api/endpoints/users/following.ts @@ -1,9 +1,9 @@ import { IsNull } from "typeorm"; import { Users, Followings, UserProfiles } from "@/models/index.js"; import { toPunyNullable } from "@/misc/convert-host.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/users/gallery/posts.ts b/packages/backend/src/server/api/endpoints/users/gallery/posts.ts index 5d64fb47..e2edbee8 100644 --- a/packages/backend/src/server/api/endpoints/users/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/users/gallery/posts.ts @@ -1,6 +1,6 @@ -import define from "../../../define.js"; +import define from "@/server/api/define.js"; import { GalleryPosts } from "@/models/index.js"; -import { makePaginationQuery } from "../../../common/make-pagination-query.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["users", "gallery"], diff --git a/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts b/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts index 9722804c..0694bd66 100644 --- a/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts +++ b/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts @@ -1,9 +1,9 @@ import { Not, In, IsNull } from "typeorm"; import { maximum } from "@/prelude/array.js"; import { Notes, Users } from "@/models/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/create.ts b/packages/backend/src/server/api/endpoints/users/groups/create.ts index 76bd78c4..1cfb2230 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/create.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/create.ts @@ -2,7 +2,7 @@ import { UserGroups, UserGroupJoinings } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import type { UserGroup } from "@/models/entities/user-group.js"; import type { UserGroupJoining } from "@/models/entities/user-group-joining.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["groups"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/delete.ts b/packages/backend/src/server/api/endpoints/users/groups/delete.ts index 81c15ad3..93bf594f 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/delete.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/delete.ts @@ -1,6 +1,6 @@ import { UserGroups } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["groups"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/invitations/accept.ts b/packages/backend/src/server/api/endpoints/users/groups/invitations/accept.ts index 5cb3a7ba..a483ccd1 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/invitations/accept.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/invitations/accept.ts @@ -1,8 +1,8 @@ import { UserGroupJoinings, UserGroupInvitations } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import type { UserGroupJoining } from "@/models/entities/user-group-joining.js"; -import { ApiError } from "../../../../error.js"; -import define from "../../../../define.js"; +import { ApiError } from "@/server/api/error.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["groups", "users"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/invitations/reject.ts b/packages/backend/src/server/api/endpoints/users/groups/invitations/reject.ts index c04ebed2..9d4e51cc 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/invitations/reject.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/invitations/reject.ts @@ -1,6 +1,6 @@ import { UserGroupInvitations } from "@/models/index.js"; -import define from "../../../../define.js"; -import { ApiError } from "../../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["groups", "users"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/invite.ts b/packages/backend/src/server/api/endpoints/users/groups/invite.ts index 10cc2158..8a1e6b31 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/invite.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/invite.ts @@ -6,9 +6,9 @@ import { import { genId } from "@/misc/gen-id.js"; import type { UserGroupInvitation } from "@/models/entities/user-group-invitation.js"; import { createNotification } from "@/services/create-notification.js"; -import { getUser } from "../../../common/getters.js"; -import { ApiError } from "../../../error.js"; -import define from "../../../define.js"; +import { getUser } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["groups", "users"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/joined.ts b/packages/backend/src/server/api/endpoints/users/groups/joined.ts index 8422cf58..5d50b5e3 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/joined.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/joined.ts @@ -1,6 +1,6 @@ import { Not, In } from "typeorm"; import { UserGroups, UserGroupJoinings } from "@/models/index.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["groups", "account"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/leave.ts b/packages/backend/src/server/api/endpoints/users/groups/leave.ts index fac0a47f..8165b1d9 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/leave.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/leave.ts @@ -1,6 +1,6 @@ import { UserGroups, UserGroupJoinings } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["groups", "users"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/owned.ts b/packages/backend/src/server/api/endpoints/users/groups/owned.ts index d86185ff..293897c1 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/owned.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/owned.ts @@ -1,5 +1,5 @@ import { UserGroups } from "@/models/index.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["groups", "account"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/pull.ts b/packages/backend/src/server/api/endpoints/users/groups/pull.ts index ce294b8c..5e7f91d7 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/pull.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/pull.ts @@ -1,7 +1,7 @@ import { UserGroups, UserGroupJoinings } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getUser } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; export const meta = { tags: ["groups", "users"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/show.ts b/packages/backend/src/server/api/endpoints/users/groups/show.ts index 46f4410c..0cd5a923 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/show.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/show.ts @@ -1,6 +1,6 @@ import { UserGroups, UserGroupJoinings } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["groups", "account"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/transfer.ts b/packages/backend/src/server/api/endpoints/users/groups/transfer.ts index 03224415..b58ea57b 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/transfer.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/transfer.ts @@ -1,7 +1,7 @@ import { UserGroups, UserGroupJoinings } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getUser } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; export const meta = { tags: ["groups", "users"], diff --git a/packages/backend/src/server/api/endpoints/users/groups/update.ts b/packages/backend/src/server/api/endpoints/users/groups/update.ts index fa720c9c..77e63c6d 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/update.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/update.ts @@ -1,6 +1,6 @@ import { UserGroups } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["groups"], diff --git a/packages/backend/src/server/api/endpoints/users/lists/create.ts b/packages/backend/src/server/api/endpoints/users/lists/create.ts index 6bbbf603..c23e8f6f 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/create.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/create.ts @@ -1,7 +1,7 @@ import { UserLists } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import type { UserList } from "@/models/entities/user-list.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["lists"], diff --git a/packages/backend/src/server/api/endpoints/users/lists/delete-all.ts b/packages/backend/src/server/api/endpoints/users/lists/delete-all.ts index 49c4cf6f..49ab4f10 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/delete-all.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/delete-all.ts @@ -1,6 +1,6 @@ import { UserLists } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["lists"], diff --git a/packages/backend/src/server/api/endpoints/users/lists/delete.ts b/packages/backend/src/server/api/endpoints/users/lists/delete.ts index 45662956..e1df6813 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/delete.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/delete.ts @@ -1,6 +1,6 @@ import { UserLists } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["lists"], diff --git a/packages/backend/src/server/api/endpoints/users/lists/list.ts b/packages/backend/src/server/api/endpoints/users/lists/list.ts index 5d590ee0..2a731b70 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/list.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/list.ts @@ -1,5 +1,5 @@ import { UserLists } from "@/models/index.js"; -import define from "../../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["lists", "account"], diff --git a/packages/backend/src/server/api/endpoints/users/lists/pull.ts b/packages/backend/src/server/api/endpoints/users/lists/pull.ts index 07fae206..ffca5b20 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/pull.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/pull.ts @@ -1,8 +1,8 @@ import { publishUserListStream } from "@/services/stream.js"; import { UserLists, UserListJoinings, Users } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getUser } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; export const meta = { tags: ["lists", "users"], diff --git a/packages/backend/src/server/api/endpoints/users/lists/push.ts b/packages/backend/src/server/api/endpoints/users/lists/push.ts index 899754aa..8dd4442d 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/push.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/push.ts @@ -1,8 +1,8 @@ import { pushUserToUserList } from "@/services/user-list/push.js"; import { UserLists, UserListJoinings, Blockings } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; -import { getUser } from "../../../common/getters.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; export const meta = { tags: ["lists", "users"], diff --git a/packages/backend/src/server/api/endpoints/users/lists/show.ts b/packages/backend/src/server/api/endpoints/users/lists/show.ts index cb4893b0..ca90fec3 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/show.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/show.ts @@ -1,6 +1,6 @@ import { UserLists } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["lists", "account"], diff --git a/packages/backend/src/server/api/endpoints/users/lists/update.ts b/packages/backend/src/server/api/endpoints/users/lists/update.ts index 0ac788fd..e331ce33 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/update.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/update.ts @@ -1,6 +1,6 @@ import { UserLists } from "@/models/index.js"; -import define from "../../../define.js"; -import { ApiError } from "../../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["lists"], diff --git a/packages/backend/src/server/api/endpoints/users/notes.ts b/packages/backend/src/server/api/endpoints/users/notes.ts index 724cfc9a..1485dfa6 100644 --- a/packages/backend/src/server/api/endpoints/users/notes.ts +++ b/packages/backend/src/server/api/endpoints/users/notes.ts @@ -1,12 +1,12 @@ import { Brackets } from "typeorm"; import { Notes } from "@/models/index.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; -import { getUser } from "../../common/getters.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { generateMutedUserQuery } from "../../common/generate-muted-user-query.js"; -import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; +import { getUser } from "@/server/api/common/getters.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { generateMutedUserQuery } from "@/server/api/common/generate-muted-user-query.js"; +import { generateBlockedUserQuery } from "@/server/api/common/generate-block-query.js"; export const meta = { tags: ["users", "notes"], diff --git a/packages/backend/src/server/api/endpoints/users/pages.ts b/packages/backend/src/server/api/endpoints/users/pages.ts index c08258b1..1af50e78 100644 --- a/packages/backend/src/server/api/endpoints/users/pages.ts +++ b/packages/backend/src/server/api/endpoints/users/pages.ts @@ -1,6 +1,6 @@ import { Pages } from "@/models/index.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; export const meta = { tags: ["users", "pages"], diff --git a/packages/backend/src/server/api/endpoints/users/reactions.ts b/packages/backend/src/server/api/endpoints/users/reactions.ts index 6b6d32e8..483a7886 100644 --- a/packages/backend/src/server/api/endpoints/users/reactions.ts +++ b/packages/backend/src/server/api/endpoints/users/reactions.ts @@ -1,8 +1,8 @@ import { NoteReactions, UserProfiles } from "@/models/index.js"; -import define from "../../define.js"; -import { makePaginationQuery } from "../../common/make-pagination-query.js"; -import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; +import { generateVisibilityQuery } from "@/server/api/common/generate-visibility-query.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["users", "reactions"], @@ -49,7 +49,7 @@ export const paramDef = { export default define(meta, paramDef, async (ps, me) => { const profile = await UserProfiles.findOneByOrFail({ userId: ps.userId }); - if (me.id !== ps.userId && !profile.publicReactions) { + if (!profile.publicReactions && (me == null || me.id !== ps.userId)) { throw new ApiError(meta.errors.reactionsNotPublic); } diff --git a/packages/backend/src/server/api/endpoints/users/recommendation.ts b/packages/backend/src/server/api/endpoints/users/recommendation.ts index 615cca78..4ea0d618 100644 --- a/packages/backend/src/server/api/endpoints/users/recommendation.ts +++ b/packages/backend/src/server/api/endpoints/users/recommendation.ts @@ -1,10 +1,10 @@ import { Users, Followings } from "@/models/index.js"; -import define from "../../define.js"; -import { generateMutedUserQueryForUsers } from "../../common/generate-muted-user-query.js"; +import define from "@/server/api/define.js"; +import { generateMutedUserQueryForUsers } from "@/server/api/common/generate-muted-user-query.js"; import { generateBlockedUserQuery, generateBlockQueryForUsers, -} from "../../common/generate-block-query.js"; +} from "@/server/api/common/generate-block-query.js"; import { DAY } from "@/const.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/users/relation.ts b/packages/backend/src/server/api/endpoints/users/relation.ts index 5580eaea..61cc7611 100644 --- a/packages/backend/src/server/api/endpoints/users/relation.ts +++ b/packages/backend/src/server/api/endpoints/users/relation.ts @@ -1,5 +1,5 @@ import { Users } from "@/models/index.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/users/report-abuse.ts b/packages/backend/src/server/api/endpoints/users/report-abuse.ts index 1368f9e2..7e9ba723 100644 --- a/packages/backend/src/server/api/endpoints/users/report-abuse.ts +++ b/packages/backend/src/server/api/endpoints/users/report-abuse.ts @@ -5,9 +5,9 @@ import { AbuseUserReports, UserProfiles, Users } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import { sendEmail } from "@/services/send-email.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; -import { getUser } from "../../common/getters.js"; -import { ApiError } from "../../error.js"; -import define from "../../define.js"; +import { getUser } from "@/server/api/common/getters.js"; +import { ApiError } from "@/server/api/error.js"; +import define from "@/server/api/define.js"; import { toHtml } from "@/mfm/to-html.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts b/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts index f3408323..517ef615 100644 --- a/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts +++ b/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts @@ -1,8 +1,7 @@ import { Brackets } from "typeorm"; import { Followings, Users } from "@/models/index.js"; -import { USER_ACTIVE_THRESHOLD } from "@/const.js"; import type { User } from "@/models/entities/user.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/users/search.ts b/packages/backend/src/server/api/endpoints/users/search.ts index dd0f8c4f..a15a0feb 100644 --- a/packages/backend/src/server/api/endpoints/users/search.ts +++ b/packages/backend/src/server/api/endpoints/users/search.ts @@ -1,7 +1,7 @@ import { Brackets } from "typeorm"; import { UserProfiles, Users } from "@/models/index.js"; import type { User } from "@/models/entities/user.js"; -import define from "../../define.js"; +import define from "@/server/api/define.js"; import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/users/show.ts b/packages/backend/src/server/api/endpoints/users/show.ts index bead8df0..61812a01 100644 --- a/packages/backend/src/server/api/endpoints/users/show.ts +++ b/packages/backend/src/server/api/endpoints/users/show.ts @@ -3,9 +3,9 @@ import { In, IsNull } from "typeorm"; import { resolveUser } from "@/remote/resolve-user.js"; import { Users } from "@/models/index.js"; import type { User } from "@/models/entities/user.js"; -import define from "../../define.js"; -import { apiLogger } from "../../logger.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { apiLogger } from "@/server/api/logger.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/endpoints/users/stats.ts b/packages/backend/src/server/api/endpoints/users/stats.ts index 83e821f4..ed4dd3b0 100644 --- a/packages/backend/src/server/api/endpoints/users/stats.ts +++ b/packages/backend/src/server/api/endpoints/users/stats.ts @@ -9,8 +9,8 @@ import { Users, } from "@/models/index.js"; import { awaitAll } from "@/prelude/await-all.js"; -import define from "../../define.js"; -import { ApiError } from "../../error.js"; +import define from "@/server/api/define.js"; +import { ApiError } from "@/server/api/error.js"; export const meta = { tags: ["users"], diff --git a/packages/backend/src/server/api/index.ts b/packages/backend/src/server/api/index.ts index bf617f06..a5970d58 100644 --- a/packages/backend/src/server/api/index.ts +++ b/packages/backend/src/server/api/index.ts @@ -11,9 +11,8 @@ import { apiMastodonCompatible, getClient, } from "./mastodon/ApiMastodonCompatibleService.js"; -import { Instances, AccessTokens, Users } from "@/models/index.js"; +import { AccessTokens, Users } from "@/models/index.js"; import config from "@/config/index.js"; -import fs from "fs"; import endpoints from "./endpoints.js"; import compatibility from "./compatibility.js"; import handler from "./api-handler.js"; @@ -22,11 +21,13 @@ import signin from "./private/signin.js"; import signupPending from "./private/signup-pending.js"; import verifyEmail from "./private/verify-email.js"; import { koaBody } from "koa-body"; +import { convertAttachment } from "./mastodon/converters.js"; + +// TODO?: should we avoid importing things from built directory? import { convertId, IdConvertType as IdType, -} from "../../../native-utils/built/index.js"; -import { convertAttachment } from "./mastodon/converters.js"; +} from "native-utils/built/index.js"; // re-export native rust id conversion (function and enum) export { IdType, convertId }; diff --git a/packages/backend/src/server/api/limiter.ts b/packages/backend/src/server/api/limiter.ts index 367fb3d2..f03f8754 100644 --- a/packages/backend/src/server/api/limiter.ts +++ b/packages/backend/src/server/api/limiter.ts @@ -1,7 +1,6 @@ import Limiter from "ratelimiter"; -import { CacheableLocalUser, User } from "@/models/entities/user.js"; import Logger from "@/services/logger.js"; -import { redisClient } from "../../db/redis.js"; +import { redisClient } from "@/db/redis.js"; import type { IEndpointMeta } from "./endpoints.js"; import { convertMilliseconds } from "@/misc/convert-milliseconds.js"; diff --git a/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts b/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts index 44485ac4..e029bc60 100644 --- a/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts +++ b/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts @@ -13,7 +13,7 @@ import { convertAnnouncement, convertFilter, } from "./converters.js"; -import { convertId, IdType } from "../index.js"; +import { convertId, IdType } from "@/server/api/index.js"; import { Users } from "@/models/index.js"; import { IsNull } from "typeorm"; diff --git a/packages/backend/src/server/api/mastodon/converters.ts b/packages/backend/src/server/api/mastodon/converters.ts index 6469d9c9..30506d9c 100644 --- a/packages/backend/src/server/api/mastodon/converters.ts +++ b/packages/backend/src/server/api/mastodon/converters.ts @@ -1,5 +1,5 @@ import { Entity } from "megalodon"; -import { convertId, IdType } from "../index.js"; +import { convertId, IdType } from "@/server/api/index.js"; function simpleConvert(data: any) { // copy the object to bypass weird pass by reference bugs diff --git a/packages/backend/src/server/api/mastodon/endpoints/account.ts b/packages/backend/src/server/api/mastodon/endpoints/account.ts index 36548cd3..76c3af37 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/account.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/account.ts @@ -1,10 +1,7 @@ -import { Users } from "@/models/index.js"; -import { resolveUser } from "@/remote/resolve-user.js"; import Router from "@koa/router"; -import { FindOptionsWhere, IsNull } from "typeorm"; import { getClient } from "../ApiMastodonCompatibleService.js"; import { argsToBools, convertTimelinesArgsId, limitToInt } from "./timeline.js"; -import { convertId, IdType } from "../../index.js"; +import { convertId, IdType } from "@/server/api/index.js"; import { convertAccount, convertFeaturedTag, diff --git a/packages/backend/src/server/api/mastodon/endpoints/auth.ts b/packages/backend/src/server/api/mastodon/endpoints/auth.ts index b55cb638..3c7ece92 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/auth.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/auth.ts @@ -1,8 +1,5 @@ -import megalodon, { MegalodonInterface } from "megalodon"; import Router from "@koa/router"; -import { koaBody } from "koa-body"; import { getClient } from "../ApiMastodonCompatibleService.js"; -import bodyParser from "koa-bodyparser"; const readScope = [ "read:account", diff --git a/packages/backend/src/server/api/mastodon/endpoints/filter.ts b/packages/backend/src/server/api/mastodon/endpoints/filter.ts index e27b7e22..6524fd2f 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/filter.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/filter.ts @@ -1,7 +1,6 @@ -import megalodon, { MegalodonInterface } from "megalodon"; import Router from "@koa/router"; import { getClient } from "../ApiMastodonCompatibleService.js"; -import { IdType, convertId } from "../../index.js"; +import { IdType, convertId } from "@/server/api/index.js"; import { convertFilter } from "../converters.js"; export function apiFilterMastodon(router: Router): void { diff --git a/packages/backend/src/server/api/mastodon/endpoints/notifications.ts b/packages/backend/src/server/api/mastodon/endpoints/notifications.ts index f0a0bab9..9628eccd 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/notifications.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/notifications.ts @@ -1,7 +1,5 @@ -import megalodon, { MegalodonInterface } from "megalodon"; import Router from "@koa/router"; -import { koaBody } from "koa-body"; -import { convertId, IdType } from "../../index.js"; +import { convertId, IdType } from "@/server/api/index.js"; import { getClient } from "../ApiMastodonCompatibleService.js"; import { convertTimelinesArgsId } from "./timeline.js"; import { convertNotification } from "../converters.js"; diff --git a/packages/backend/src/server/api/mastodon/endpoints/search.ts b/packages/backend/src/server/api/mastodon/endpoints/search.ts index 8a481755..c9bbab0a 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/search.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/search.ts @@ -1,4 +1,3 @@ -import megalodon, { MegalodonInterface } from "megalodon"; import Router from "@koa/router"; import { getClient } from "../ApiMastodonCompatibleService.js"; import axios from "axios"; diff --git a/packages/backend/src/server/api/mastodon/endpoints/status.ts b/packages/backend/src/server/api/mastodon/endpoints/status.ts index bc95d777..ac1cbe60 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/status.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/status.ts @@ -1,11 +1,10 @@ import Router from "@koa/router"; import { getClient } from "../ApiMastodonCompatibleService.js"; import { emojiRegexAtStartToEnd } from "@/misc/emoji-regex.js"; -import axios from "axios"; import querystring from "node:querystring"; import qs from "qs"; import { convertTimelinesArgsId, limitToInt } from "./timeline.js"; -import { convertId, IdType } from "../../index.js"; +import { convertId, IdType } from "@/server/api/index.js"; import { convertAccount, convertAttachment, diff --git a/packages/backend/src/server/api/mastodon/endpoints/timeline.ts b/packages/backend/src/server/api/mastodon/endpoints/timeline.ts index 0a4da322..05741c4c 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/timeline.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/timeline.ts @@ -7,7 +7,7 @@ import { convertList, convertStatus, } from "../converters.js"; -import { convertId, IdType } from "../../index.js"; +import { convertId, IdType } from "@/server/api/index.js"; export function limitToInt(q: ParsedUrlQuery) { let object: any = q; diff --git a/packages/backend/src/server/api/openapi/gen-spec.ts b/packages/backend/src/server/api/openapi/gen-spec.ts index ea5bcd44..25f84e5b 100644 --- a/packages/backend/src/server/api/openapi/gen-spec.ts +++ b/packages/backend/src/server/api/openapi/gen-spec.ts @@ -1,4 +1,4 @@ -import endpoints from "../endpoints.js"; +import endpoints from "@/server/api/endpoints.js"; import config from "@/config/index.js"; import { errors as basicErrors } from "./errors.js"; import { schemas, convertSchemaToOpenApiSchema } from "./schemas.js"; diff --git a/packages/backend/src/server/api/private/signin.ts b/packages/backend/src/server/api/private/signin.ts index 06d801a9..3e70d80f 100644 --- a/packages/backend/src/server/api/private/signin.ts +++ b/packages/backend/src/server/api/private/signin.ts @@ -1,6 +1,6 @@ import type Koa from "koa"; import * as OTPAuth from "otpauth"; -import signin from "../common/signin.js"; +import signin from "@/server/api/common/signin.js"; import config from "@/config/index.js"; import { Users, @@ -16,10 +16,10 @@ import { hashPassword, isOldAlgorithm, } from "@/misc/password.js"; -import { verifyLogin, hash } from "../2fa.js"; +import { verifyLogin, hash } from "@/server/api/2fa.js"; import { randomBytes } from "node:crypto"; import { IsNull } from "typeorm"; -import { limiter } from "../limiter.js"; +import { limiter } from "@/server/api/limiter.js"; import { getIpHash } from "@/misc/get-ip-hash.js"; export default async (ctx: Koa.Context) => { diff --git a/packages/backend/src/server/api/private/signup-pending.ts b/packages/backend/src/server/api/private/signup-pending.ts index c7fdcea2..b92fb90b 100644 --- a/packages/backend/src/server/api/private/signup-pending.ts +++ b/packages/backend/src/server/api/private/signup-pending.ts @@ -1,7 +1,7 @@ import type Koa from "koa"; -import { Users, UserPendings, UserProfiles } from "@/models/index.js"; -import { signup } from "../common/signup.js"; -import signin from "../common/signin.js"; +import { UserPendings, UserProfiles } from "@/models/index.js"; +import { signup } from "@/server/api/common/signup.js"; +import signin from "@/server/api/common/signin.js"; export default async (ctx: Koa.Context) => { const body = ctx.request.body; diff --git a/packages/backend/src/server/api/private/signup.ts b/packages/backend/src/server/api/private/signup.ts index 440d0e36..d60e5a19 100644 --- a/packages/backend/src/server/api/private/signup.ts +++ b/packages/backend/src/server/api/private/signup.ts @@ -3,7 +3,7 @@ import rndstr from "rndstr"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { verifyHcaptcha, verifyRecaptcha } from "@/misc/captcha.js"; import { Users, RegistrationTickets, UserPendings } from "@/models/index.js"; -import { signup } from "../common/signup.js"; +import { signup } from "@/server/api/common/signup.js"; import config from "@/config/index.js"; import { sendEmail } from "@/services/send-email.js"; import { genId } from "@/misc/gen-id.js"; diff --git a/packages/backend/src/server/api/stream/channels/messaging.ts b/packages/backend/src/server/api/stream/channels/messaging.ts index 0622bd46..a650db8b 100644 --- a/packages/backend/src/server/api/stream/channels/messaging.ts +++ b/packages/backend/src/server/api/stream/channels/messaging.ts @@ -2,7 +2,7 @@ import { readUserMessagingMessage, readGroupMessagingMessage, deliverReadActivity, -} from "../../common/read-messaging-message.js"; +} from "@/server/api/common/read-messaging-message.js"; import Channel from "../channel.js"; import { UserGroupJoinings, Users, MessagingMessages } from "@/models/index.js"; import type { User, ILocalUser, IRemoteUser } from "@/models/entities/user.js"; diff --git a/packages/backend/src/server/api/stream/index.ts b/packages/backend/src/server/api/stream/index.ts index e4836831..86408a03 100644 --- a/packages/backend/src/server/api/stream/index.ts +++ b/packages/backend/src/server/api/stream/index.ts @@ -21,12 +21,12 @@ import { } from "@/services/stream.js"; import type { UserGroup } from "@/models/entities/user-group.js"; import type { Packed } from "@/misc/schema.js"; -import { readNotification } from "../common/read-notification.js"; +import { readNotification } from "@/server/api/common/read-notification.js"; import channels from "./channels/index.js"; import type Channel from "./channel.js"; import type { StreamEventEmitter, StreamMessages } from "./types.js"; import { Converter } from "megalodon"; -import { getClient } from "../mastodon/ApiMastodonCompatibleService.js"; +import { getClient } from "@/server/api/mastodon/ApiMastodonCompatibleService.js"; /** * Main stream connection diff --git a/packages/backend/src/server/file/byte-range-readable.ts b/packages/backend/src/server/file/byte-range-readable.ts index d80e783c..96dcbc4a 100644 --- a/packages/backend/src/server/file/byte-range-readable.ts +++ b/packages/backend/src/server/file/byte-range-readable.ts @@ -1,5 +1,5 @@ import { Readable, ReadableOptions } from "node:stream"; -import { Buffer, constants as BufferConstants } from "node:buffer"; +import { Buffer } from "node:buffer"; import * as fs from "node:fs"; interface ByteRange { diff --git a/packages/backend/src/server/index.ts b/packages/backend/src/server/index.ts index f26853eb..3a9f62f3 100644 --- a/packages/backend/src/server/index.ts +++ b/packages/backend/src/server/index.ts @@ -15,11 +15,10 @@ import * as slow from "koa-slow"; import { IsNull } from "typeorm"; import config from "@/config/index.js"; import Logger from "@/services/logger.js"; -import { UserProfiles, Users } from "@/models/index.js"; +import { Users } from "@/models/index.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { genIdenticon } from "@/misc/gen-identicon.js"; import { createTemp } from "@/misc/create-temp.js"; -import { publishMainStream } from "@/services/stream.js"; import * as Acct from "@/misc/acct.js"; import { envOption } from "@/env.js"; import megalodon, { MegalodonInterface } from "megalodon"; diff --git a/packages/backend/src/server/web/views/flush.pug b/packages/backend/src/server/web/views/flush.pug index e9866587..bb032ffa 100644 --- a/packages/backend/src/server/web/views/flush.pug +++ b/packages/backend/src/server/web/views/flush.pug @@ -37,7 +37,8 @@ html localStorage.clear(); message('localStorage cleared.'); - const idbPromises = ['MisskeyClient', 'keyval-store'].map((name, i, arr) => new Promise((res, rej) => { + //- Removed 'MisskeyClient' due to seemingly being never referenced + const idbPromises = ['keyval-store'].map((name, i, arr) => new Promise((res, rej) => { const delidb = indexedDB.deleteDatabase(name); delidb.onsuccess = () => res(message(`indexedDB "${name}" cleared. (${i + 1}/${arr.length})`)); delidb.onerror = e => rej(e) diff --git a/packages/backend/src/services/blocking/create.ts b/packages/backend/src/services/blocking/create.ts index 3166cb82..144304cf 100644 --- a/packages/backend/src/services/blocking/create.ts +++ b/packages/backend/src/services/blocking/create.ts @@ -16,7 +16,6 @@ import { UserLists, } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; -import { IdentifiableError } from "@/misc/identifiable-error.js"; import { getActiveWebhooks } from "@/misc/webhook-cache.js"; import { webhookDeliver } from "@/queue/index.js"; diff --git a/packages/backend/src/services/blocking/delete.ts b/packages/backend/src/services/blocking/delete.ts index 67f1e76f..271883fe 100644 --- a/packages/backend/src/services/blocking/delete.ts +++ b/packages/backend/src/services/blocking/delete.ts @@ -2,9 +2,8 @@ import { renderActivity } from "@/remote/activitypub/renderer/index.js"; import { renderBlock } from "@/remote/activitypub/renderer/block.js"; import renderUndo from "@/remote/activitypub/renderer/undo.js"; import { deliver } from "@/queue/index.js"; -import Logger from "../logger.js"; +import Logger from "@/services/logger.js"; import type { CacheableUser } from "@/models/entities/user.js"; -import { User } from "@/models/entities/user.js"; import { Blockings, Users } from "@/models/index.js"; const logger = new Logger("blocking/delete"); diff --git a/packages/backend/src/services/chart/charts/active-users.ts b/packages/backend/src/services/chart/charts/active-users.ts index a99c07dc..3f4b7e33 100644 --- a/packages/backend/src/services/chart/charts/active-users.ts +++ b/packages/backend/src/services/chart/charts/active-users.ts @@ -1,7 +1,6 @@ import type { KVs } from "../core.js"; import Chart from "../core.js"; import type { User } from "@/models/entities/user.js"; -import { Users } from "@/models/index.js"; import { name, schema } from "./entities/active-users.js"; const week = 1000 * 60 * 60 * 24 * 7; diff --git a/packages/backend/src/services/create-system-user.ts b/packages/backend/src/services/create-system-user.ts index 24536090..0ebd1142 100644 --- a/packages/backend/src/services/create-system-user.ts +++ b/packages/backend/src/services/create-system-user.ts @@ -1,5 +1,5 @@ import { v4 as uuid } from "uuid"; -import generateNativeUserToken from "../server/api/common/generate-native-user-token.js"; +import generateNativeUserToken from "@/server/api/common/generate-native-user-token.js"; import { genRsaKeyPair } from "@/misc/gen-key-pair.js"; import { User } from "@/models/entities/user.js"; import { UserProfile } from "@/models/entities/user-profile.js"; diff --git a/packages/backend/src/services/delete-account.ts b/packages/backend/src/services/delete-account.ts index 92777619..b307611c 100644 --- a/packages/backend/src/services/delete-account.ts +++ b/packages/backend/src/services/delete-account.ts @@ -1,7 +1,7 @@ import { Users } from "@/models/index.js"; import { createDeleteAccountJob } from "@/queue/index.js"; -import { publishUserEvent } from "./stream.js"; -import { doPostSuspend } from "./suspend-user.js"; +import { publishUserEvent } from "@/services/stream.js"; +import { doPostSuspend } from "@/services/suspend-user.js"; export async function deleteAccount(user: { id: string; diff --git a/packages/backend/src/services/drive/add-file.ts b/packages/backend/src/services/drive/add-file.ts index 37b43dc2..1042c0e0 100644 --- a/packages/backend/src/services/drive/add-file.ts +++ b/packages/backend/src/services/drive/add-file.ts @@ -2,7 +2,7 @@ import * as fs from "node:fs"; import { v4 as uuid } from "uuid"; -import type S3 from "aws-sdk/clients/s3.js"; +import type S3 from "aws-sdk/clients/s3.js"; // TODO: migrate to SDK v3 import sharp from "sharp"; import { IsNull } from "typeorm"; import { publishMainStream, publishDriveStream } from "@/services/stream.js"; @@ -13,7 +13,6 @@ import { DriveFiles, DriveFolders, Users, - Instances, UserProfiles, } from "@/models/index.js"; import { DriveFile } from "@/models/entities/drive-file.js"; diff --git a/packages/backend/src/services/drive/delete-file.ts b/packages/backend/src/services/drive/delete-file.ts index 3402bd25..b172c7d9 100644 --- a/packages/backend/src/services/drive/delete-file.ts +++ b/packages/backend/src/services/drive/delete-file.ts @@ -1,6 +1,6 @@ import type { DriveFile } from "@/models/entities/drive-file.js"; import { InternalStorage } from "./internal-storage.js"; -import { DriveFiles, Instances } from "@/models/index.js"; +import { DriveFiles } from "@/models/index.js"; import { createDeleteObjectStorageFileJob } from "@/queue/index.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; import { getS3 } from "./s3.js"; diff --git a/packages/backend/src/services/drive/generate-video-thumbnail.ts b/packages/backend/src/services/drive/generate-video-thumbnail.ts index 356623e7..0e3f0db5 100644 --- a/packages/backend/src/services/drive/generate-video-thumbnail.ts +++ b/packages/backend/src/services/drive/generate-video-thumbnail.ts @@ -1,4 +1,3 @@ -import * as fs from "node:fs"; import { createTempDir } from "@/misc/create-temp.js"; import type { IImage } from "./image-processor.js"; import { convertToWebp } from "./image-processor.js"; diff --git a/packages/backend/src/services/drive/logger.ts b/packages/backend/src/services/drive/logger.ts index ebde2d70..06382ddd 100644 --- a/packages/backend/src/services/drive/logger.ts +++ b/packages/backend/src/services/drive/logger.ts @@ -1,3 +1,3 @@ -import Logger from "../logger.js"; +import Logger from "@/services/logger.js"; export const driveLogger = new Logger("drive", "blue"); diff --git a/packages/backend/src/services/drive/s3.ts b/packages/backend/src/services/drive/s3.ts index 9357be21..d01f89cb 100644 --- a/packages/backend/src/services/drive/s3.ts +++ b/packages/backend/src/services/drive/s3.ts @@ -1,5 +1,5 @@ import { URL } from "node:url"; -import S3 from "aws-sdk/clients/s3.js"; +import S3 from "aws-sdk/clients/s3.js"; // TODO: migrate to SDK v3 import type { Meta } from "@/models/entities/meta.js"; import { getAgentByUrl } from "@/misc/fetch.js"; diff --git a/packages/backend/src/services/fetch-instance-metadata.ts b/packages/backend/src/services/fetch-instance-metadata.ts index 01ad9176..a4cc33bc 100644 --- a/packages/backend/src/services/fetch-instance-metadata.ts +++ b/packages/backend/src/services/fetch-instance-metadata.ts @@ -6,7 +6,7 @@ import { getJson, getAgentByUrl } from "@/misc/fetch.js"; import type { Instance } from "@/models/entities/instance.js"; import { Instances } from "@/models/index.js"; import { getFetchInstanceMetadataLock } from "@/misc/app-lock.js"; -import Logger from "./logger.js"; +import Logger from "@/services/logger.js"; const logger = new Logger("metadata", "cyan"); diff --git a/packages/backend/src/services/fetch-rel-me.ts b/packages/backend/src/services/fetch-rel-me.ts index 31e7a95a..c9a37d1c 100644 --- a/packages/backend/src/services/fetch-rel-me.ts +++ b/packages/backend/src/services/fetch-rel-me.ts @@ -1,4 +1,3 @@ -import { getHtml } from "@/misc/fetch.js"; import { Window } from "happy-dom"; import config from "@/config/index.js"; diff --git a/packages/backend/src/services/following/create.ts b/packages/backend/src/services/following/create.ts index f851c0f0..3b8f6328 100644 --- a/packages/backend/src/services/following/create.ts +++ b/packages/backend/src/services/following/create.ts @@ -5,7 +5,7 @@ import renderAccept from "@/remote/activitypub/renderer/accept.js"; import renderReject from "@/remote/activitypub/renderer/reject.js"; import { deliver } from "@/queue/index.js"; import createFollowRequest from "./requests/create.js"; -import { registerOrFetchInstanceDoc } from "../register-or-fetch-instance-doc.js"; +import { registerOrFetchInstanceDoc } from "@/services/register-or-fetch-instance-doc.js"; import Logger from "../logger.js"; import { IdentifiableError } from "@/misc/identifiable-error.js"; import type { User } from "@/models/entities/user.js"; @@ -18,7 +18,7 @@ import { UserProfiles, } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; -import { createNotification } from "../create-notification.js"; +import { createNotification } from "@/services/create-notification.js"; import { isDuplicateKeyValueError } from "@/misc/is-duplicate-key-value-error.js"; import type { Packed } from "@/misc/schema.js"; import { getActiveWebhooks } from "@/misc/webhook-cache.js"; diff --git a/packages/backend/src/services/following/delete.ts b/packages/backend/src/services/following/delete.ts index 0e0c9598..e71e23de 100644 --- a/packages/backend/src/services/following/delete.ts +++ b/packages/backend/src/services/following/delete.ts @@ -5,7 +5,7 @@ import renderUndo from "@/remote/activitypub/renderer/undo.js"; import renderReject from "@/remote/activitypub/renderer/reject.js"; import { deliver, webhookDeliver } from "@/queue/index.js"; import Logger from "../logger.js"; -import { registerOrFetchInstanceDoc } from "../register-or-fetch-instance-doc.js"; +import { registerOrFetchInstanceDoc } from "@/services/register-or-fetch-instance-doc.js"; import type { User } from "@/models/entities/user.js"; import { Followings, Users, Instances } from "@/models/index.js"; import { getActiveWebhooks } from "@/misc/webhook-cache.js"; diff --git a/packages/backend/src/services/following/reject.ts b/packages/backend/src/services/following/reject.ts index 7464219b..3f461268 100644 --- a/packages/backend/src/services/following/reject.ts +++ b/packages/backend/src/services/following/reject.ts @@ -4,7 +4,6 @@ import renderReject from "@/remote/activitypub/renderer/reject.js"; import { deliver, webhookDeliver } from "@/queue/index.js"; import { publishMainStream, publishUserEvent } from "@/services/stream.js"; import type { ILocalUser, IRemoteUser } from "@/models/entities/user.js"; -import { User } from "@/models/entities/user.js"; import { Users, FollowRequests, Followings } from "@/models/index.js"; import { decrementFollowing } from "./delete.js"; import { getActiveWebhooks } from "@/misc/webhook-cache.js"; diff --git a/packages/backend/src/services/following/requests/accept.ts b/packages/backend/src/services/following/requests/accept.ts index 6aa17b09..1bc10f60 100644 --- a/packages/backend/src/services/following/requests/accept.ts +++ b/packages/backend/src/services/following/requests/accept.ts @@ -5,7 +5,6 @@ import { deliver } from "@/queue/index.js"; import { publishMainStream } from "@/services/stream.js"; import { insertFollowingDoc } from "../create.js"; import type { User, CacheableUser } from "@/models/entities/user.js"; -import { ILocalUser } from "@/models/entities/user.js"; import { FollowRequests, Users } from "@/models/index.js"; import { IdentifiableError } from "@/misc/identifiable-error.js"; diff --git a/packages/backend/src/services/following/requests/cancel.ts b/packages/backend/src/services/following/requests/cancel.ts index 00daae38..45b8ee06 100644 --- a/packages/backend/src/services/following/requests/cancel.ts +++ b/packages/backend/src/services/following/requests/cancel.ts @@ -5,7 +5,6 @@ import { deliver } from "@/queue/index.js"; import { publishMainStream } from "@/services/stream.js"; import { IdentifiableError } from "@/misc/identifiable-error.js"; import type { User } from "@/models/entities/user.js"; -import { ILocalUser } from "@/models/entities/user.js"; import { Users, FollowRequests } from "@/models/index.js"; export default async function ( diff --git a/packages/backend/src/services/following/requests/create.ts b/packages/backend/src/services/following/requests/create.ts index 50dbd9b3..12dfddf3 100644 --- a/packages/backend/src/services/following/requests/create.ts +++ b/packages/backend/src/services/following/requests/create.ts @@ -5,7 +5,7 @@ import { deliver } from "@/queue/index.js"; import type { User } from "@/models/entities/user.js"; import { Blockings, FollowRequests, Users } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; -import { createNotification } from "../../create-notification.js"; +import { createNotification } from "@/services/create-notification.js"; import config from "@/config/index.js"; export default async function ( diff --git a/packages/backend/src/services/i/pin.ts b/packages/backend/src/services/i/pin.ts index 37961459..94ebf753 100644 --- a/packages/backend/src/services/i/pin.ts +++ b/packages/backend/src/services/i/pin.ts @@ -9,7 +9,7 @@ import { Notes, UserNotePinings, Users } from "@/models/index.js"; import type { UserNotePining } from "@/models/entities/user-note-pining.js"; import { genId } from "@/misc/gen-id.js"; import { deliverToFollowers } from "@/remote/activitypub/deliver-manager.js"; -import { deliverToRelays } from "../relay.js"; +import { deliverToRelays } from "@/services/relay.js"; /** * 指定した投稿をピン留めします diff --git a/packages/backend/src/services/i/update.ts b/packages/backend/src/services/i/update.ts index cc950ac8..21b03d98 100644 --- a/packages/backend/src/services/i/update.ts +++ b/packages/backend/src/services/i/update.ts @@ -4,7 +4,7 @@ import { Users } from "@/models/index.js"; import type { User } from "@/models/entities/user.js"; import { renderPerson } from "@/remote/activitypub/renderer/person.js"; import { deliverToFollowers } from "@/remote/activitypub/deliver-manager.js"; -import { deliverToRelays } from "../relay.js"; +import { deliverToRelays } from "@/services/relay.js"; export async function publishToFollowers(userId: User["id"]) { const user = await Users.findOneBy({ id: userId }); diff --git a/packages/backend/src/services/logger.ts b/packages/backend/src/services/logger.ts index 330d2750..df4c2e35 100644 --- a/packages/backend/src/services/logger.ts +++ b/packages/backend/src/services/logger.ts @@ -2,7 +2,7 @@ import cluster from "node:cluster"; import chalk from "chalk"; import { default as convertColor } from "color-convert"; import { format as dateFormat } from "date-fns"; -import { envOption } from "../env.js"; +import { envOption } from "@/env.js"; import config from "@/config/index.js"; import * as SyslogPro from "syslog-pro"; diff --git a/packages/backend/src/services/note/create.ts b/packages/backend/src/services/note/create.ts index 24e64532..f4fd03c2 100644 --- a/packages/backend/src/services/note/create.ts +++ b/packages/backend/src/services/note/create.ts @@ -13,10 +13,10 @@ import renderAnnounce from "@/remote/activitypub/renderer/announce.js"; import { renderActivity } from "@/remote/activitypub/renderer/index.js"; import { resolveUser } from "@/remote/resolve-user.js"; import config from "@/config/index.js"; -import { updateHashtags } from "../update-hashtag.js"; +import { updateHashtags } from "@/services/update-hashtag.js"; import { concat } from "@/prelude/array.js"; import { insertNoteUnread } from "@/services/note/unread.js"; -import { registerOrFetchInstanceDoc } from "../register-or-fetch-instance-doc.js"; +import { registerOrFetchInstanceDoc } from "@/services/register-or-fetch-instance-doc.js"; import { extractMentions } from "@/misc/extract-mentions.js"; import { extractCustomEmojisFromMfm } from "@/misc/extract-custom-emojis-from-mfm.js"; import { extractHashtags } from "@/misc/extract-hashtags.js"; @@ -43,11 +43,11 @@ import { genId } from "@/misc/gen-id.js"; import { activeUsersChart } from "@/services/chart/index.js"; import type { IPoll } from "@/models/entities/poll.js"; import { Poll } from "@/models/entities/poll.js"; -import { createNotification } from "../create-notification.js"; +import { createNotification } from "@/services/create-notification.js"; import { isDuplicateKeyValueError } from "@/misc/is-duplicate-key-value-error.js"; import { checkHitAntenna } from "@/misc/check-hit-antenna.js"; import { getWordHardMute } from "@/misc/check-word-mute.js"; -import { addNoteToAntenna } from "../add-note-to-antenna.js"; +import { addNoteToAntenna } from "@/services/add-note-to-antenna.js"; import { countSameRenotes } from "@/misc/count-same-renotes.js"; import { deliverToRelays, getCachedRelays } from "../relay.js"; import type { Channel } from "@/models/entities/channel.js"; @@ -169,9 +169,10 @@ export default async ( data: Option, silent = false, ) => - // rome-ignore lint/suspicious/noAsyncPromiseExecutor: FIXME + // biome-ignore lint/suspicious/noAsyncPromiseExecutor: FIXME new Promise(async (res, rej) => { - const dontFederateInitially = data.visibility === "hidden"; + const dontFederateInitially = + data.localOnly || data.visibility?.startsWith("hidden") === true; // If you reply outside the channel, match the scope of the target. // TODO (I think it's a process that could be done on the client side, but it's server side for now.) @@ -205,7 +206,7 @@ export default async ( if (data.channel != null) data.visibility = "public"; if (data.channel != null) data.visibleUsers = []; if (data.channel != null) data.localOnly = true; - if (data.visibility.startsWith("hidden")) + if (data.visibility.startsWith("hidden") && data.visibility !== "hidden") data.visibility = data.visibility.slice(6); // enforce silent clients on server diff --git a/packages/backend/src/services/note/delete.ts b/packages/backend/src/services/note/delete.ts index 73577e59..f22fc35e 100644 --- a/packages/backend/src/services/note/delete.ts +++ b/packages/backend/src/services/note/delete.ts @@ -14,8 +14,8 @@ import { deliverToUser, } from "@/remote/activitypub/deliver-manager.js"; import { countSameRenotes } from "@/misc/count-same-renotes.js"; -import { registerOrFetchInstanceDoc } from "../register-or-fetch-instance-doc.js"; -import { deliverToRelays } from "../relay.js"; +import { registerOrFetchInstanceDoc } from "@/services/register-or-fetch-instance-doc.js"; +import { deliverToRelays } from "@/services/relay.js"; import meilisearch from "@/db/meilisearch.js"; /** diff --git a/packages/backend/src/services/note/polls/update.ts b/packages/backend/src/services/note/polls/update.ts index e02d48d0..270b4d9b 100644 --- a/packages/backend/src/services/note/polls/update.ts +++ b/packages/backend/src/services/note/polls/update.ts @@ -4,7 +4,7 @@ import renderNote from "@/remote/activitypub/renderer/note.js"; import { Users, Notes } from "@/models/index.js"; import type { Note } from "@/models/entities/note.js"; import { deliverToFollowers } from "@/remote/activitypub/deliver-manager.js"; -import { deliverToRelays } from "../../relay.js"; +import { deliverToRelays } from "@/services/relay.js"; export async function deliverQuestionUpdate(noteId: Note["id"]) { const note = await Notes.findOneBy({ id: noteId }); diff --git a/packages/backend/src/services/note/polls/vote.ts b/packages/backend/src/services/note/polls/vote.ts index 582af0b1..6ade8997 100644 --- a/packages/backend/src/services/note/polls/vote.ts +++ b/packages/backend/src/services/note/polls/vote.ts @@ -1,11 +1,10 @@ import { publishNoteStream } from "@/services/stream.js"; import type { CacheableUser } from "@/models/entities/user.js"; -import { User } from "@/models/entities/user.js"; import type { Note } from "@/models/entities/note.js"; import { PollVotes, NoteWatchings, Polls, Blockings } from "@/models/index.js"; import { Not } from "typeorm"; import { genId } from "@/misc/gen-id.js"; -import { createNotification } from "../../create-notification.js"; +import { createNotification } from "@/services/create-notification.js"; export default async function ( user: CacheableUser, diff --git a/packages/backend/src/services/note/reaction/create.ts b/packages/backend/src/services/note/reaction/create.ts index e5c6b5bc..1ea4b45e 100644 --- a/packages/backend/src/services/note/reaction/create.ts +++ b/packages/backend/src/services/note/reaction/create.ts @@ -15,7 +15,7 @@ import { } from "@/models/index.js"; import { IsNull, Not } from "typeorm"; import { genId } from "@/misc/gen-id.js"; -import { createNotification } from "../../create-notification.js"; +import { createNotification } from "@/services/create-notification.js"; import deleteReaction from "./delete.js"; import { isDuplicateKeyValueError } from "@/misc/is-duplicate-key-value-error.js"; import type { NoteReaction } from "@/models/entities/note-reaction.js"; diff --git a/packages/backend/src/services/relay.ts b/packages/backend/src/services/relay.ts index e969d783..fdc42616 100644 --- a/packages/backend/src/services/relay.ts +++ b/packages/backend/src/services/relay.ts @@ -11,7 +11,7 @@ import { Users, Relays } from "@/models/index.js"; import { genId } from "@/misc/gen-id.js"; import { Cache } from "@/misc/cache.js"; import type { Relay } from "@/models/entities/relay.js"; -import { createSystemUser } from "./create-system-user.js"; +import { createSystemUser } from "@/services/create-system-user.js"; const ACTOR_USERNAME = "relay.actor" as const; diff --git a/packages/backend/src/services/send-email-notification.ts b/packages/backend/src/services/send-email-notification.ts index 14a9754f..a2f422a9 100644 --- a/packages/backend/src/services/send-email-notification.ts +++ b/packages/backend/src/services/send-email-notification.ts @@ -1,8 +1,8 @@ -import { UserProfiles } from "@/models/index.js"; +// import { UserProfiles } from "@/models/index.js"; import type { User } from "@/models/entities/user.js"; -import { sendEmail } from "./send-email.js"; -import { I18n } from "@/misc/i18n.js"; -import * as Acct from "@/misc/acct.js"; +// import { sendEmail } from "./send-email.js"; +// import { I18n } from "@/misc/i18n.js"; +// import * as Acct from "@/misc/acct.js"; // TODO //const locales = await import('../../../../locales/index.js'); diff --git a/packages/backend/src/services/send-email.ts b/packages/backend/src/services/send-email.ts index 07038658..ccc6b365 100644 --- a/packages/backend/src/services/send-email.ts +++ b/packages/backend/src/services/send-email.ts @@ -1,6 +1,6 @@ import * as nodemailer from "nodemailer"; import { fetchMeta } from "@/misc/fetch-meta.js"; -import Logger from "./logger.js"; +import Logger from "@/services/logger.js"; import config from "@/config/index.js"; export const logger = new Logger("email"); diff --git a/packages/backend/src/services/stream.ts b/packages/backend/src/services/stream.ts index f3846fea..f59674ad 100644 --- a/packages/backend/src/services/stream.ts +++ b/packages/backend/src/services/stream.ts @@ -1,4 +1,4 @@ -import { redisClient } from "../db/redis.js"; +import { redisClient } from "@/db/redis.js"; import type { User } from "@/models/entities/user.js"; import type { Note } from "@/models/entities/note.js"; import type { UserList } from "@/models/entities/user-list.js"; diff --git a/packages/backend/src/services/user-list/push.ts b/packages/backend/src/services/user-list/push.ts index 01bb0660..db01b0a9 100644 --- a/packages/backend/src/services/user-list/push.ts +++ b/packages/backend/src/services/user-list/push.ts @@ -5,7 +5,7 @@ import { UserListJoinings, Users } from "@/models/index.js"; import type { UserListJoining } from "@/models/entities/user-list-joining.js"; import { genId } from "@/misc/gen-id.js"; import { fetchProxyAccount } from "@/misc/fetch-proxy-account.js"; -import createFollowing from "../following/create.js"; +import createFollowing from "@/services/following/create.js"; export async function pushUserToUserList(target: User, list: UserList) { await UserListJoinings.insert({ diff --git a/packages/backend/tsconfig.json b/packages/backend/tsconfig.json index 692d7b95..324d7da8 100644 --- a/packages/backend/tsconfig.json +++ b/packages/backend/tsconfig.json @@ -10,7 +10,7 @@ "declaration": false, "sourceMap": false, "target": "es2021", - "module": "es2020", + "module": "esnext", "moduleResolution": "node", "allowSyntheticDefaultImports": true, "removeComments": false, diff --git a/packages/client/package.json b/packages/client/package.json index 0b394297..3e90036f 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -18,17 +18,21 @@ "@rollup/plugin-json": "6.0.1", "@rollup/pluginutils": "5.0.5", "@syuilo/aiscript": "0.16.0", + "@types/autosize": "4.0.3", "@types/glob": "8.1.0", "@types/gulp": "4.0.17", "@types/gulp-rename": "2.0.5", + "@types/insert-text-at-cursor": "0.3.2", "@types/katex": "0.16.6", "@types/matter-js": "0.19.4", + "@types/prismjs": "1.26.3", "@types/punycode": "2.1.2", "@types/seedrandom": "3.0.8", + "@types/textarea-caret": "3.0.3", "@types/throttle-debounce": "5.0.2", "@types/tinycolor2": "1.4.6", "@types/uuid": "9.0.7", - "@vitejs/plugin-vue": "4.4.1", + "@vitejs/plugin-vue": "4.5.0", "@vue/compiler-sfc": "3.3.8", "@vue/runtime-core": "3.3.8", "autobind-decorator": "2.4.0", @@ -80,10 +84,10 @@ "typescript": "5.2.2", "unicode-emoji-json": "0.4.0", "uuid": "9.0.1", - "vite": "4.5.0", + "vite": "5.0.0", "vite-plugin-compression": "0.5.1", "vue": "3.3.8", - "vue-draggable-plus": "0.2.6", + "vue-draggable-plus": "0.2.7", "vue-plyr": "7.0.0", "vue-prism-editor": "2.0.0-alpha.2" } diff --git a/packages/client/src/account.ts b/packages/client/src/account.ts index 2f113f75..5844c5bd 100644 --- a/packages/client/src/account.ts +++ b/packages/client/src/account.ts @@ -1,5 +1,5 @@ import type * as firefish from "firefish-js"; -import { defineAsyncComponent, reactive } from "vue"; +import { defineAsyncComponent } from "vue"; import { i18n } from "./i18n"; import { apiUrl } from "@/config"; import { alert, api, popup, popupMenu, waiting } from "@/os"; diff --git a/packages/client/src/components/MkChatPreview.vue b/packages/client/src/components/MkChatPreview.vue index 27db671b..b309c8b0 100644 --- a/packages/client/src/components/MkChatPreview.vue +++ b/packages/client/src/components/MkChatPreview.vue @@ -22,8 +22,8 @@ message.groupId ? message.user : isMe(message) - ? message.recipient - : message.user + ? message.recipient + : message.user " :show-indicator="true" disable-link diff --git a/packages/client/src/components/MkDialog.vue b/packages/client/src/components/MkDialog.vue index a940f7d0..2659f139 100644 --- a/packages/client/src/components/MkDialog.vue +++ b/packages/client/src/components/MkDialog.vue @@ -327,8 +327,8 @@ async function ok() { const result = props.input ? inputValue.value : props.select - ? selectedValue.value - : true; + ? selectedValue.value + : true; done(false, result); } diff --git a/packages/client/src/components/MkDriveSelectDialog.vue b/packages/client/src/components/MkDriveSelectDialog.vue index af40dc84..1047acce 100644 --- a/packages/client/src/components/MkDriveSelectDialog.vue +++ b/packages/client/src/components/MkDriveSelectDialog.vue @@ -17,8 +17,8 @@ ? i18n.ts.selectFiles : i18n.ts.selectFolders : type === "file" - ? i18n.ts.selectFile - : i18n.ts.selectFolder + ? i18n.ts.selectFile + : i18n.ts.selectFolder }} >(); diff --git a/packages/client/src/components/MkMedia.vue b/packages/client/src/components/MkMedia.vue index 24db8d4e..dad2f9e7 100644 --- a/packages/client/src/components/MkMedia.vue +++ b/packages/client/src/components/MkMedia.vue @@ -113,9 +113,9 @@ const url = props.raw || defaultStore.state.loadRawImages ? props.media.url : defaultStore.state.disableShowingAnimatedImages && - props.media.type.startsWith("image") - ? getStaticImageUrl(props.media.thumbnailUrl) - : props.media.thumbnailUrl; + props.media.type.startsWith("image") + ? getStaticImageUrl(props.media.thumbnailUrl) + : props.media.thumbnailUrl; const mediaType = computed(() => { return props.media.type === "video/quicktime" diff --git a/packages/client/src/components/MkModPlayer.vue b/packages/client/src/components/MkModPlayer.vue index 1129d2bb..266f418f 100644 --- a/packages/client/src/components/MkModPlayer.vue +++ b/packages/client/src/components/MkModPlayer.vue @@ -91,7 +91,7 @@ class="_button" @click.stop="captionPopup" > - + diff --git a/packages/client/src/components/MkModal.vue b/packages/client/src/components/MkModal.vue index 893cced0..f6b52a62 100644 --- a/packages/client/src/components/MkModal.vue +++ b/packages/client/src/components/MkModal.vue @@ -169,22 +169,22 @@ const transitionName = computed(() => ? useSendAnime.value ? "send" : type.value === "drawer" - ? "modal-drawer" - : type.value === "popup" - ? "modal-popup" - : "modal" + ? "modal-drawer" + : type.value === "popup" + ? "modal-popup" + : "modal" : "", ); const transitionDuration = computed(() => transitionName.value === "send" ? 400 : transitionName.value === "modal-popup" - ? 100 - : transitionName.value === "modal" - ? 200 - : transitionName.value === "modal-drawer" - ? 200 - : 0, + ? 100 + : transitionName.value === "modal" + ? 200 + : transitionName.value === "modal-drawer" + ? 200 + : 0, ); let contentClicking = false; diff --git a/packages/client/src/components/MkModalPageWindow.vue b/packages/client/src/components/MkModalPageWindow.vue index bcf763e3..bd443790 100644 --- a/packages/client/src/components/MkModalPageWindow.vue +++ b/packages/client/src/components/MkModalPageWindow.vue @@ -64,7 +64,6 @@ import { i18n } from "@/i18n"; import type { PageMetadata } from "@/scripts/page-metadata"; import { provideMetadataReceiver } from "@/scripts/page-metadata"; import { Router } from "@/nirax"; -import { defaultStore } from "@/store"; import icon from "@/scripts/icon"; const props = defineProps<{ diff --git a/packages/client/src/components/MkModalWindow.vue b/packages/client/src/components/MkModalWindow.vue index 1a2b3db8..cab0f07a 100644 --- a/packages/client/src/components/MkModalWindow.vue +++ b/packages/client/src/components/MkModalWindow.vue @@ -17,8 +17,8 @@ ? `${props.height}px` : null : height - ? `min(${props.height}px, 100%)` - : '100%', + ? `min(${props.height}px, 100%)` + : '100%', }" tabindex="-1" > diff --git a/packages/client/src/components/MkNotePreview.vue b/packages/client/src/components/MkNotePreview.vue index be007738..62bcc0f0 100644 --- a/packages/client/src/components/MkNotePreview.vue +++ b/packages/client/src/components/MkNotePreview.vue @@ -22,7 +22,7 @@ diff --git a/packages/client/src/components/MkNoteSimple.vue b/packages/client/src/components/MkNoteSimple.vue index 5f45811f..70ee62bf 100644 --- a/packages/client/src/components/MkNoteSimple.vue +++ b/packages/client/src/components/MkNoteSimple.vue @@ -15,7 +15,7 @@ import type * as firefish from "firefish-js"; import XNoteHeader from "@/components/MkNoteHeader.vue"; import MkSubNoteContent from "@/components/MkSubNoteContent.vue"; -const props = defineProps<{ +defineProps<{ note: firefish.entities.Note; pinned?: boolean; }>(); diff --git a/packages/client/src/components/MkNotes.vue b/packages/client/src/components/MkNotes.vue index 267ce746..f64100a6 100644 --- a/packages/client/src/components/MkNotes.vue +++ b/packages/client/src/components/MkNotes.vue @@ -45,7 +45,7 @@ import { scroll } from "@/scripts/scroll"; const tlEl = ref(); -const props = defineProps<{ +defineProps<{ pagination: Paging; noGap?: boolean; }>(); diff --git a/packages/client/src/components/MkObjectView.vue b/packages/client/src/components/MkObjectView.vue index 74f3ed0a..1e69ba98 100644 --- a/packages/client/src/components/MkObjectView.vue +++ b/packages/client/src/components/MkObjectView.vue @@ -5,10 +5,9 @@ diff --git a/packages/client/src/components/MkPagination.vue b/packages/client/src/components/MkPagination.vue index f06e8a11..17d2ef3e 100644 --- a/packages/client/src/components/MkPagination.vue +++ b/packages/client/src/components/MkPagination.vue @@ -259,12 +259,12 @@ const fetchMore = async (): Promise => { offset: offset.value, } : props.pagination.reversed - ? { - sinceId: items.value[0].id, - } - : { - untilId: items.value[items.value.length - 1].id, - }), + ? { + sinceId: items.value[0].id, + } + : { + untilId: items.value[items.value.length - 1].id, + }), }) .then( (res) => { @@ -320,12 +320,12 @@ const fetchMoreAhead = async (): Promise => { offset: offset.value, } : props.pagination.reversed - ? { - untilId: items.value[0].id, - } - : { - sinceId: items.value[items.value.length - 1].id, - }), + ? { + untilId: items.value[0].id, + } + : { + sinceId: items.value[items.value.length - 1].id, + }), }) .then( (res) => { diff --git a/packages/client/src/components/MkPoll.vue b/packages/client/src/components/MkPoll.vue index 21540ba4..48211f17 100644 --- a/packages/client/src/components/MkPoll.vue +++ b/packages/client/src/components/MkPoll.vue @@ -81,10 +81,10 @@ const timer = computed(() => remaining.value >= 86400 ? "_poll.remainingDays" : remaining.value >= 3600 - ? "_poll.remainingHours" - : remaining.value >= 60 - ? "_poll.remainingMinutes" - : "_poll.remainingSeconds", + ? "_poll.remainingHours" + : remaining.value >= 60 + ? "_poll.remainingMinutes" + : "_poll.remainingSeconds", { s: Math.floor(remaining.value % 60), m: Math.floor(remaining.value / 60) % 60, diff --git a/packages/client/src/components/MkPollEditor.vue b/packages/client/src/components/MkPollEditor.vue index d6dcd75b..622ac7fd 100644 --- a/packages/client/src/components/MkPollEditor.vue +++ b/packages/client/src/components/MkPollEditor.vue @@ -171,8 +171,8 @@ function get() { ...(expiration.value === "at" ? { expiresAt: calcAt() } : expiration.value === "after" - ? { expiredAfter: calcAfter() } - : {}), + ? { expiredAfter: calcAfter() } + : {}), }; } diff --git a/packages/client/src/components/MkPostForm.vue b/packages/client/src/components/MkPostForm.vue index cfb9a561..d5ec6a1c 100644 --- a/packages/client/src/components/MkPostForm.vue +++ b/packages/client/src/components/MkPostForm.vue @@ -76,8 +76,8 @@ reply ? 'ph-arrow-u-up-left' : renote - ? 'ph-quotes' - : 'ph-paper-plane-tilt', + ? 'ph-quotes' + : 'ph-paper-plane-tilt', ) " > @@ -232,8 +232,8 @@ reply ? 'ph-arrow-u-up-left' : renote - ? 'ph-quotes' - : 'ph-paper-plane-tilt', + ? 'ph-quotes' + : 'ph-paper-plane-tilt', ) " > @@ -417,10 +417,10 @@ const submitText = computed((): string => { return props.editId ? i18n.ts.edit : props.renote - ? i18n.ts.quote - : props.reply - ? i18n.ts.reply - : i18n.ts.note; + ? i18n.ts.quote + : props.reply + ? i18n.ts.reply + : i18n.ts.note; }); const textLength = computed((): number => { @@ -489,8 +489,8 @@ if (props.reply && props.reply.text != null) { const mention = x.host ? `@${x.username}@${toASCII(x.host)}` : otherHost == null || otherHost === host - ? `@${x.username}` - : `@${x.username}@${toASCII(otherHost)}`; + ? `@${x.username}` + : `@${x.username}@${toASCII(otherHost)}`; // 自分は除外 if ($i.username === x.username && (x.host == null || x.host === host)) @@ -886,8 +886,8 @@ async function post() { renoteId: props.renote ? props.renote.id : quoteId.value - ? quoteId.value - : undefined, + ? quoteId.value + : undefined, channelId: props.channel ? props.channel.id : undefined, poll: poll.value, cw: useCw.value ? cw.value || "" : undefined, @@ -898,8 +898,8 @@ async function post() { visibility.value === "private" ? [] : visibility.value === "specified" - ? visibleUsers.value.map((u) => u.id) - : undefined, + ? visibleUsers.value.map((u) => u.id) + : undefined, }; if (withHashtags.value && hashtags.value && hashtags.value.trim() !== "") { diff --git a/packages/client/src/components/MkPostFormAttaches.vue b/packages/client/src/components/MkPostFormAttaches.vue index 8e6e41a2..a879bd5d 100644 --- a/packages/client/src/components/MkPostFormAttaches.vue +++ b/packages/client/src/components/MkPostFormAttaches.vue @@ -35,7 +35,6 @@ import { VueDraggable } from "vue-draggable-plus"; import MkDriveFileThumbnail from "@/components/MkDriveFileThumbnail.vue"; import * as os from "@/os"; import { i18n } from "@/i18n"; -import { defaultStore } from "@/store"; import icon from "@/scripts/icon"; const props = defineProps({ diff --git a/packages/client/src/components/MkReactionIcon.vue b/packages/client/src/components/MkReactionIcon.vue index 89e056ba..e9d5a198 100644 --- a/packages/client/src/components/MkReactionIcon.vue +++ b/packages/client/src/components/MkReactionIcon.vue @@ -9,7 +9,7 @@ diff --git a/packages/client/src/pages/_loading_.vue b/packages/client/src/pages/_loading_.vue index 832c0591..93bb8bb2 100644 --- a/packages/client/src/pages/_loading_.vue +++ b/packages/client/src/pages/_loading_.vue @@ -1,5 +1,3 @@ - - diff --git a/packages/client/src/pages/about.federation.vue b/packages/client/src/pages/about.federation.vue index 163166a3..d2d00dce 100644 --- a/packages/client/src/pages/about.federation.vue +++ b/packages/client/src/pages/about.federation.vue @@ -127,18 +127,18 @@ const pagination = { ...(state.value === "federating" ? { federating: true } : state.value === "subscribing" - ? { subscribing: true } - : state.value === "publishing" - ? { publishing: true } - : state.value === "suspended" - ? { suspended: true } - : state.value === "blocked" - ? { blocked: true } - : state.value === "silenced" - ? { silenced: true } - : state.value === "notResponding" - ? { notResponding: true } - : {}), + ? { subscribing: true } + : state.value === "publishing" + ? { publishing: true } + : state.value === "suspended" + ? { suspended: true } + : state.value === "blocked" + ? { blocked: true } + : state.value === "silenced" + ? { silenced: true } + : state.value === "notResponding" + ? { notResponding: true } + : {}), })), }; diff --git a/packages/client/src/pages/admin/bot-protection.vue b/packages/client/src/pages/admin/bot-protection.vue index 54d1b2ae..0114aa39 100644 --- a/packages/client/src/pages/admin/bot-protection.vue +++ b/packages/client/src/pages/admin/bot-protection.vue @@ -105,8 +105,8 @@ async function init() { provider.value = meta.enableHcaptcha ? "hcaptcha" : meta.enableRecaptcha - ? "recaptcha" - : null; + ? "recaptcha" + : null; } function save() { diff --git a/packages/client/src/pages/admin/overview.queue.chart.vue b/packages/client/src/pages/admin/overview.queue.chart.vue index 2e9195e2..6482d99d 100644 --- a/packages/client/src/pages/admin/overview.queue.chart.vue +++ b/packages/client/src/pages/admin/overview.queue.chart.vue @@ -51,23 +51,23 @@ const label = props.type === "process" ? "Process" : props.type === "active" - ? "Active" - : props.type === "delayed" - ? "Delayed" - : props.type === "waiting" - ? "Waiting" - : ("?" as never); + ? "Active" + : props.type === "delayed" + ? "Delayed" + : props.type === "waiting" + ? "Waiting" + : ("?" as never); const color = props.type === "process" ? "#c4a7e7" : props.type === "active" - ? "#31748f" - : props.type === "delayed" - ? "#eb6f92" - : props.type === "waiting" - ? "#f6c177" - : ("?" as never); + ? "#31748f" + : props.type === "delayed" + ? "#eb6f92" + : props.type === "waiting" + ? "#f6c177" + : ("?" as never); onMounted(() => { const vLineColor = defaultStore.state.darkMode diff --git a/packages/client/src/pages/admin/queue.chart.chart.vue b/packages/client/src/pages/admin/queue.chart.chart.vue index bd7b781c..fd3edea9 100644 --- a/packages/client/src/pages/admin/queue.chart.chart.vue +++ b/packages/client/src/pages/admin/queue.chart.chart.vue @@ -96,23 +96,23 @@ const label = props.type === "process" ? "Process" : props.type === "active" - ? "Active" - : props.type === "delayed" - ? "Delayed" - : props.type === "waiting" - ? "Waiting" - : ("?" as never); + ? "Active" + : props.type === "delayed" + ? "Delayed" + : props.type === "waiting" + ? "Waiting" + : ("?" as never); const color = props.type === "process" ? "#9ccfd8" : props.type === "active" - ? "#31748f" - : props.type === "delayed" - ? "#eb6f92" - : props.type === "waiting" - ? "#f6c177" - : ("?" as never); + ? "#31748f" + : props.type === "delayed" + ? "#eb6f92" + : props.type === "waiting" + ? "#f6c177" + : ("?" as never); onMounted(() => { chartInstance = new Chart(chartEl.value, { diff --git a/packages/client/src/pages/admin/queue.chart.vue b/packages/client/src/pages/admin/queue.chart.vue index fad0deb6..cb10e27e 100644 --- a/packages/client/src/pages/admin/queue.chart.vue +++ b/packages/client/src/pages/admin/queue.chart.vue @@ -117,8 +117,8 @@ onMounted(() => { props.domain === "inbox" ? "admin/queue/inbox-delayed" : props.domain === "deliver" - ? "admin/queue/deliver-delayed" - : null, + ? "admin/queue/deliver-delayed" + : null, {}, ).then((result) => { jobs.value = result; diff --git a/packages/client/src/pages/admin/security.vue b/packages/client/src/pages/admin/security.vue index dd8eff4f..7522b53d 100644 --- a/packages/client/src/pages/admin/security.vue +++ b/packages/client/src/pages/admin/security.vue @@ -290,14 +290,14 @@ async function init() { meta.sensitiveMediaDetectionSensitivity === "veryLow" ? 0 : meta.sensitiveMediaDetectionSensitivity === "low" - ? 1 - : meta.sensitiveMediaDetectionSensitivity === "medium" - ? 2 - : meta.sensitiveMediaDetectionSensitivity === "high" - ? 3 - : meta.sensitiveMediaDetectionSensitivity === "veryHigh" - ? 4 - : 0; + ? 1 + : meta.sensitiveMediaDetectionSensitivity === "medium" + ? 2 + : meta.sensitiveMediaDetectionSensitivity === "high" + ? 3 + : meta.sensitiveMediaDetectionSensitivity === "veryHigh" + ? 4 + : 0; setSensitiveFlagAutomatically.value = meta.setSensitiveFlagAutomatically; enableSensitiveMediaDetectionForVideos.value = meta.enableSensitiveMediaDetectionForVideos; @@ -317,14 +317,14 @@ function save() { sensitiveMediaDetectionSensitivity.value === 0 ? "veryLow" : sensitiveMediaDetectionSensitivity.value === 1 - ? "low" - : sensitiveMediaDetectionSensitivity.value === 2 - ? "medium" - : sensitiveMediaDetectionSensitivity.value === 3 - ? "high" - : sensitiveMediaDetectionSensitivity.value === 4 - ? "veryHigh" - : 0, + ? "low" + : sensitiveMediaDetectionSensitivity.value === 2 + ? "medium" + : sensitiveMediaDetectionSensitivity.value === 3 + ? "high" + : sensitiveMediaDetectionSensitivity.value === 4 + ? "veryHigh" + : 0, setSensitiveFlagAutomatically: setSensitiveFlagAutomatically.value, enableSensitiveMediaDetectionForVideos: enableSensitiveMediaDetectionForVideos.value, diff --git a/packages/client/src/pages/api-console.vue b/packages/client/src/pages/api-console.vue index 63957c11..083db86c 100644 --- a/packages/client/src/pages/api-console.vue +++ b/packages/client/src/pages/api-console.vue @@ -98,14 +98,14 @@ function onEndpointChange() { p.type === "String" ? "" : p.type === "Number" - ? 0 - : p.type === "Boolean" - ? false - : p.type === "Array" - ? [] - : p.type === "Object" - ? {} - : null; + ? 0 + : p.type === "Boolean" + ? false + : p.type === "Array" + ? [] + : p.type === "Object" + ? {} + : null; } body.value = JSON5.stringify(endpointBody, null, 2); }); diff --git a/packages/client/src/pages/settings/drive.vue b/packages/client/src/pages/settings/drive.vue index bd0a25c7..fbc526d3 100644 --- a/packages/client/src/pages/settings/drive.vue +++ b/packages/client/src/pages/settings/drive.vue @@ -77,8 +77,8 @@ const fetching = ref(true); const usage = ref(null); const capacity = ref(null); const uploadFolder = ref(null); -const alwaysMarkNsfw = ref($i.alwaysMarkNsfw); -const autoSensitive = ref($i.autoSensitive); +const alwaysMarkNsfw = ref($i != null && $i.alwaysMarkNsfw); +const autoSensitive = ref($i != null && $i.autoSensitive); const meterStyle = computed(() => { return { diff --git a/packages/client/src/pages/theme-editor.vue b/packages/client/src/pages/theme-editor.vue index 527b62c4..474fe51b 100644 --- a/packages/client/src/pages/theme-editor.vue +++ b/packages/client/src/pages/theme-editor.vue @@ -90,8 +90,8 @@ color: color.forPreview ? color.forPreview : theme.base === 'light' - ? '#5f5f5f' - : '#dadada', + ? '#5f5f5f' + : '#dadada', }" > A diff --git a/packages/client/src/pages/timeline.vue b/packages/client/src/pages/timeline.vue index 95c04849..da74c803 100644 --- a/packages/client/src/pages/timeline.vue +++ b/packages/client/src/pages/timeline.vue @@ -270,12 +270,12 @@ definePageMetadata( src.value === "local" ? "ph-users ph-lg" : src.value === "social" - ? "ph-handshake ph-lg" - : src.value === "recommended" - ? "ph-thumbs-up ph-lg" - : src.value === "global" - ? "ph-planet ph-lg" - : "ph-house ph-lg", + ? "ph-handshake ph-lg" + : src.value === "recommended" + ? "ph-thumbs-up ph-lg" + : src.value === "global" + ? "ph-planet ph-lg" + : "ph-house ph-lg", })), ); diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index c851de89..abc61368 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -1,22 +1,21 @@ import type { AsyncComponentLoader } from "vue"; import { defineAsyncComponent, inject } from "vue"; import { iAmEmojiMod, iAmModerator } from "@/account"; -import { ui } from "@/config"; import { Router } from "@/nirax"; -import { api } from "@/os"; import MkError from "@/pages/_error_.vue"; import MkLoading from "@/pages/_loading_.vue"; import { $i } from "@/reactiveAccount"; +// import { api } from "@/os"; -function getGuestTimelineStatus() { - api("meta", { - detail: false, - }).then((meta) => { - return meta.enableGuestTimeline; - }); -} +// function getGuestTimelineStatus() { +// api("meta", { +// detail: false, +// }).then((meta) => { +// return meta.enableGuestTimeline; +// }); +// } -const guestTimeline = getGuestTimelineStatus(); +// const guestTimeline = getGuestTimelineStatus(); const page = (loader: AsyncComponentLoader) => defineAsyncComponent({ diff --git a/packages/client/src/scripts/get-note-menu.ts b/packages/client/src/scripts/get-note-menu.ts index 56fec4bb..f8858bae 100644 --- a/packages/client/src/scripts/get-note-menu.ts +++ b/packages/client/src/scripts/get-note-menu.ts @@ -1,5 +1,5 @@ import type { Ref } from "vue"; -import { defineAsyncComponent, inject } from "vue"; +import { defineAsyncComponent } from "vue"; import type * as firefish from "firefish-js"; import { $i } from "@/reactiveAccount"; import { i18n } from "@/i18n"; diff --git a/packages/client/src/scripts/get-note-summary.ts b/packages/client/src/scripts/get-note-summary.ts index a2ea4b4e..7a09c601 100644 --- a/packages/client/src/scripts/get-note-summary.ts +++ b/packages/client/src/scripts/get-note-summary.ts @@ -1,5 +1,4 @@ import type * as firefish from "firefish-js"; -import { i18n } from "@/i18n"; /** * 投稿を表す文字列を取得します。 diff --git a/packages/client/src/scripts/popup-position.ts b/packages/client/src/scripts/popup-position.ts index abc6cfb6..45bcd4db 100644 --- a/packages/client/src/scripts/popup-position.ts +++ b/packages/client/src/scripts/popup-position.ts @@ -1,5 +1,3 @@ -import { Ref } from "vue"; - export function calcPopupPosition( el: HTMLElement, props: { diff --git a/packages/client/src/scripts/use-leave-guard.ts b/packages/client/src/scripts/use-leave-guard.ts index 12c25651..07e22556 100644 --- a/packages/client/src/scripts/use-leave-guard.ts +++ b/packages/client/src/scripts/use-leave-guard.ts @@ -1,7 +1,7 @@ import type { Ref } from "vue"; -import { inject, onUnmounted } from "vue"; -import { i18n } from "@/i18n"; -import * as os from "@/os"; +// import { inject, onUnmounted } from "vue"; +// import { i18n } from "@/i18n"; +// import * as os from "@/os"; export function useLeaveGuard(enabled: Ref) { /* TODO diff --git a/packages/client/src/ui/_common_/common.vue b/packages/client/src/ui/_common_/common.vue index d808f303..dc20b690 100644 --- a/packages/client/src/ui/_common_/common.vue +++ b/packages/client/src/ui/_common_/common.vue @@ -19,7 +19,7 @@