From c548ec9906947c72743e611254a6557e8e8d057c Mon Sep 17 00:00:00 2001 From: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Wed, 5 Feb 2025 19:01:44 +0900 Subject: refactor(frontend): verbatimModuleSyntaxを有効化 (#15323) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * wip * wip * wip * wip * revert unnecessary changes * wip * refactor(frontend): enforce verbatimModuleSyntax * fix * refactor(frontend-shared): enforce verbatimModuleSyntax * wip * refactor(frontend-embed): enforce verbatimModuleSyntax * enforce consistent-type-imports * fix lint config * attemt to fix ci * fix lint * fix * fix * fix --- packages/frontend/src/boot/common.ts | 3 +- packages/frontend/src/boot/main-boot.ts | 5 +- .../components/MkAbuseReportWindow.stories.impl.ts | 2 +- .../src/components/MkAccountMoved.stories.impl.ts | 2 +- .../src/components/MkAchievements.stories.impl.ts | 2 +- .../src/components/MkAnalogClock.stories.impl.ts | 2 +- .../MkAnnouncementDialog.stories.impl.ts | 2 +- .../src/components/MkAntennaEditor.stories.impl.ts | 2 +- .../MkAntennaEditorDialog.stories.impl.ts | 2 +- packages/frontend/src/components/MkAsUi.vue | 5 +- .../src/components/MkAutocomplete.stories.impl.ts | 2 +- .../frontend/src/components/MkAutocomplete.vue | 3 +- .../src/components/MkAvatars.stories.impl.ts | 2 +- .../src/components/MkButton.stories.impl.ts | 2 +- .../MkChannelFollowButton.stories.impl.ts | 2 +- .../src/components/MkChannelList.stories.impl.ts | 2 +- packages/frontend/src/components/MkChannelList.vue | 3 +- .../components/MkChannelPreview.stories.impl.ts | 2 +- .../src/components/MkChart.stories.impl.ts | 2 +- packages/frontend/src/components/MkChartLegend.vue | 3 +- .../src/components/MkClickerGame.stories.impl.ts | 2 +- .../src/components/MkClipPreview.stories.impl.ts | 2 +- .../frontend/src/components/MkCode.stories.impl.ts | 2 +- .../src/components/MkCodeEditor.stories.impl.ts | 2 +- .../src/components/MkCodeInline.stories.impl.ts | 2 +- .../src/components/MkColorInput.stories.impl.ts | 2 +- .../src/components/MkContextMenu.stories.impl.ts | 2 +- .../src/components/MkCropperDialog.stories.impl.ts | 2 +- .../MkCustomEmojiDetailedDialog.stories.impl.ts | 2 +- .../src/components/MkCwButton.stories.impl.ts | 2 +- .../src/components/MkDateSeparatedList.vue | 5 +- .../src/components/MkDialog.stories.impl.ts | 2 +- .../src/components/MkDigitalClock.stories.impl.ts | 2 +- .../src/components/MkDonation.stories.impl.ts | 2 +- .../src/components/MkDrive.file.stories.impl.ts | 2 +- .../src/components/MkDrive.folder.stories.impl.ts | 2 +- .../src/components/MkDrive.stories.impl.ts | 2 +- .../MkDriveFileThumbnail.stories.impl.ts | 2 +- .../src/components/MkEmojiPicker.section.vue | 6 +- .../src/components/MkEmojiPicker.stories.impl.ts | 2 +- packages/frontend/src/components/MkEmojiPicker.vue | 6 +- .../MkExtensionInstaller.stories.impl.ts | 2 +- .../src/components/MkFlashPreview.stories.impl.ts | 2 +- .../MkGalleryPostPreview.stories.impl.ts | 2 +- packages/frontend/src/components/MkInput.vue | 6 +- .../components/MkInstanceCardMini.stories.impl.ts | 2 +- .../frontend/src/components/MkInstanceStats.vue | 3 +- .../frontend/src/components/MkInstanceTicker.vue | 3 +- .../src/components/MkInviteCode.stories.impl.ts | 2 +- packages/frontend/src/components/MkLink.vue | 2 +- packages/frontend/src/components/MkMediaAudio.vue | 2 +- packages/frontend/src/components/MkMediaRange.vue | 5 +- packages/frontend/src/components/MkMediaVideo.vue | 2 +- packages/frontend/src/components/MkMention.vue | 2 +- packages/frontend/src/components/MkMenu.vue | 4 +- packages/frontend/src/components/MkModal.vue | 2 +- packages/frontend/src/components/MkNote.vue | 8 ++- .../frontend/src/components/MkNoteDetailed.vue | 8 ++- .../frontend/src/components/MkNoteMediaGrid.vue | 70 +++++++++++----------- packages/frontend/src/components/MkNotes.vue | 3 +- .../src/components/MkNotificationSelectWindow.vue | 3 +- .../frontend/src/components/MkNotifications.vue | 2 +- packages/frontend/src/components/MkPageWindow.vue | 3 +- packages/frontend/src/components/MkPagination.vue | 5 +- packages/frontend/src/components/MkPostForm.vue | 6 +- packages/frontend/src/components/MkRadios.vue | 3 +- .../components/MkRoleSelectDialog.stories.impl.ts | 2 +- packages/frontend/src/components/MkSelect.vue | 3 +- packages/frontend/src/components/MkSignin.vue | 3 +- .../src/components/MkSignupDialog.form.vue | 3 +- .../MkSignupDialog.rules.stories.impl.ts | 2 +- .../frontend/src/components/MkSortOrderEditor.vue | 4 +- packages/frontend/src/components/MkSuperMenu.vue | 2 +- .../frontend/src/components/MkSwitch.button.vue | 3 +- packages/frontend/src/components/MkSwitch.vue | 3 +- .../src/components/MkSystemWebhookEditor.vue | 2 +- .../src/components/MkTagItem.stories.impl.ts | 2 +- packages/frontend/src/components/MkTextarea.vue | 3 +- packages/frontend/src/components/MkTimeline.vue | 2 +- packages/frontend/src/components/MkUserList.vue | 3 +- .../MkUserSetupDialog.Follow.stories.impl.ts | 2 +- .../src/components/MkUserSetupDialog.Follow.vue | 3 +- .../MkUserSetupDialog.Privacy.stories.impl.ts | 2 +- .../MkUserSetupDialog.Profile.stories.impl.ts | 2 +- .../MkUserSetupDialog.User.stories.impl.ts | 2 +- .../components/MkUserSetupDialog.stories.impl.ts | 2 +- .../src/components/global/MkA.stories.impl.ts | 2 +- .../src/components/global/MkAcct.stories.impl.ts | 2 +- .../src/components/global/MkAd.stories.impl.ts | 2 +- .../src/components/global/MkAvatar.stories.impl.ts | 2 +- .../global/MkCondensedLine.stories.impl.ts | 2 +- .../global/MkCustomEmoji.stories.impl.ts | 2 +- .../components/global/MkEllipsis.stories.impl.ts | 2 +- .../src/components/global/MkEmoji.stories.impl.ts | 2 +- .../src/components/global/MkError.stories.impl.ts | 2 +- .../src/components/global/MkError.stories.meta.ts | 2 +- .../components/global/MkLoading.stories.impl.ts | 2 +- .../src/components/global/MkMfm.stories.impl.ts | 4 +- packages/frontend/src/components/global/MkMfm.ts | 6 +- .../components/global/MkPageHeader.stories.impl.ts | 2 +- .../src/components/global/MkPageHeader.vue | 3 +- .../src/components/global/MkStickyContainer.vue | 3 +- .../src/components/global/MkTime.stories.impl.ts | 2 +- .../src/components/global/MkUrl.stories.impl.ts | 2 +- packages/frontend/src/components/global/MkUrl.vue | 2 +- .../components/global/MkUserName.stories.impl.ts | 2 +- .../frontend/src/components/global/RouterView.vue | 2 +- .../frontend/src/components/grid/MkDataCell.vue | 7 ++- .../frontend/src/components/grid/MkDataRow.vue | 7 ++- .../src/components/grid/MkGrid.stories.impl.ts | 8 +-- packages/frontend/src/components/grid/MkGrid.vue | 17 ++++-- .../frontend/src/components/grid/MkHeaderCell.vue | 5 +- .../frontend/src/components/grid/MkHeaderRow.vue | 7 ++- .../frontend/src/components/grid/MkNumberCell.vue | 3 +- .../src/components/grid/cell-validators.ts | 6 +- packages/frontend/src/components/grid/cell.ts | 12 ++-- packages/frontend/src/components/grid/column.ts | 12 ++-- .../frontend/src/components/grid/grid-event.ts | 10 ++-- .../frontend/src/components/grid/grid-utils.ts | 14 +++-- packages/frontend/src/components/grid/grid.ts | 6 +- packages/frontend/src/components/grid/row.ts | 10 ++-- packages/frontend/src/components/index.ts | 2 +- packages/frontend/src/debug.ts | 3 +- packages/frontend/src/directives/adaptive-bg.ts | 2 +- .../frontend/src/directives/adaptive-border.ts | 2 +- packages/frontend/src/directives/anim.ts | 2 +- packages/frontend/src/directives/appear.ts | 2 +- packages/frontend/src/directives/click-anime.ts | 2 +- packages/frontend/src/directives/follow-append.ts | 2 +- packages/frontend/src/directives/get-size.ts | 2 +- packages/frontend/src/directives/hotkey.ts | 2 +- packages/frontend/src/directives/index.ts | 2 +- packages/frontend/src/directives/panel.ts | 2 +- packages/frontend/src/directives/tooltip.ts | 3 +- packages/frontend/src/directives/user-preview.ts | 3 +- packages/frontend/src/nirax.ts | 3 +- packages/frontend/src/os.ts | 3 +- packages/frontend/src/pages/about.federation.vue | 3 +- .../abuse-report/notification-recipient.editor.vue | 3 +- .../frontend/src/pages/admin/bot-protection.vue | 2 +- .../admin/custom-emojis-manager.local.list.vue | 7 ++- .../admin/custom-emojis-manager.local.register.vue | 12 ++-- .../pages/admin/custom-emojis-manager.remote.vue | 15 ++--- .../admin/custom-emojis-manager2.stories.impl.ts | 2 +- packages/frontend/src/pages/admin/index.vue | 3 +- packages/frontend/src/pages/admin/invites.vue | 3 +- .../admin/overview.ap-requests.stories.impl.ts | 2 +- .../src/pages/admin/overview.federation.vue | 3 +- packages/frontend/src/pages/admin/queue.vue | 3 +- packages/frontend/src/pages/api-console.vue | 2 +- packages/frontend/src/pages/channel.vue | 2 +- packages/frontend/src/pages/drive.file.notes.vue | 2 +- .../frontend/src/pages/drop-and-fusion.game.vue | 3 +- packages/frontend/src/pages/flash/flash.vue | 9 ++- packages/frontend/src/pages/follow-requests.vue | 3 +- packages/frontend/src/pages/install-extensions.vue | 6 +- packages/frontend/src/pages/instance-info.vue | 6 +- packages/frontend/src/pages/invite.vue | 5 +- packages/frontend/src/pages/scratchpad.vue | 8 ++- packages/frontend/src/pages/search.stories.impl.ts | 2 +- packages/frontend/src/pages/settings/accounts.vue | 4 +- .../frontend/src/pages/settings/drive-cleaner.vue | 3 +- .../frontend/src/pages/settings/emoji-picker.vue | 3 +- packages/frontend/src/pages/settings/index.vue | 6 +- .../frontend/src/pages/settings/notifications.vue | 3 +- packages/frontend/src/pages/settings/sounds.vue | 3 +- .../frontend/src/pages/settings/theme.manage.vue | 3 +- packages/frontend/src/pages/theme-editor.vue | 3 +- .../frontend/src/pages/user/activity.following.vue | 3 +- .../frontend/src/pages/user/activity.notes.vue | 3 +- packages/frontend/src/pages/user/activity.pv.vue | 3 +- .../frontend/src/pages/user/home.stories.impl.ts | 2 +- packages/frontend/src/pizzax.ts | 3 +- packages/frontend/src/plugin.ts | 3 +- packages/frontend/src/router/definition.ts | 3 +- packages/frontend/src/router/main.ts | 2 +- packages/frontend/src/router/supplier.ts | 3 +- packages/frontend/src/scripts/aiscript/common.ts | 3 +- packages/frontend/src/scripts/aiscript/ui.ts | 3 +- packages/frontend/src/scripts/autocomplete.ts | 3 +- packages/frontend/src/scripts/chart-legend.ts | 2 +- packages/frontend/src/scripts/chart-vline.ts | 2 +- .../src/scripts/check-reaction-permissions.ts | 2 +- packages/frontend/src/scripts/emoji-picker.ts | 3 +- packages/frontend/src/scripts/get-note-menu.ts | 3 +- packages/frontend/src/scripts/get-user-menu.ts | 2 +- packages/frontend/src/scripts/install-theme.ts | 3 +- .../frontend/src/scripts/mfm-function-picker.ts | 3 +- packages/frontend/src/scripts/page-metadata.ts | 3 +- packages/frontend/src/scripts/reaction-picker.ts | 3 +- packages/frontend/src/scripts/theme-editor.ts | 3 +- packages/frontend/src/scripts/use-form.ts | 3 +- packages/frontend/src/scripts/use-leave-guard.ts | 2 +- packages/frontend/src/scripts/use-note-capture.ts | 3 +- packages/frontend/src/scripts/use-tooltip.ts | 3 +- packages/frontend/src/store.ts | 3 +- packages/frontend/src/theme-store.ts | 3 +- packages/frontend/src/types/menu.ts | 2 +- packages/frontend/src/ui/classic.vue | 3 +- packages/frontend/src/ui/deck/antenna-column.vue | 5 +- packages/frontend/src/ui/deck/channel-column.vue | 5 +- packages/frontend/src/ui/deck/column.vue | 3 +- packages/frontend/src/ui/deck/deck-store.ts | 2 +- packages/frontend/src/ui/deck/direct-column.vue | 2 +- packages/frontend/src/ui/deck/list-column.vue | 5 +- packages/frontend/src/ui/deck/main-column.vue | 6 +- packages/frontend/src/ui/deck/mentions-column.vue | 2 +- .../frontend/src/ui/deck/notifications-column.vue | 3 +- .../frontend/src/ui/deck/role-timeline-column.vue | 5 +- packages/frontend/src/ui/deck/tl-column.vue | 5 +- .../frontend/src/ui/deck/tl-note-notification.ts | 7 ++- packages/frontend/src/ui/deck/widgets-column.vue | 3 +- packages/frontend/src/ui/minimum.vue | 3 +- packages/frontend/src/ui/universal.vue | 6 +- packages/frontend/src/ui/visitor.vue | 3 +- packages/frontend/src/ui/zen.vue | 3 +- packages/frontend/src/widgets/WidgetActivity.vue | 5 +- packages/frontend/src/widgets/WidgetAichan.vue | 5 +- packages/frontend/src/widgets/WidgetAiscript.vue | 5 +- .../frontend/src/widgets/WidgetAiscriptApp.vue | 11 ++-- .../src/widgets/WidgetBirthdayFollowings.vue | 5 +- packages/frontend/src/widgets/WidgetButton.vue | 5 +- packages/frontend/src/widgets/WidgetCalendar.vue | 5 +- packages/frontend/src/widgets/WidgetClicker.vue | 5 +- packages/frontend/src/widgets/WidgetClock.vue | 5 +- .../frontend/src/widgets/WidgetDigitalClock.vue | 5 +- packages/frontend/src/widgets/WidgetFederation.vue | 5 +- .../frontend/src/widgets/WidgetInstanceCloud.vue | 5 +- .../frontend/src/widgets/WidgetInstanceInfo.vue | 5 +- packages/frontend/src/widgets/WidgetJobQueue.vue | 5 +- packages/frontend/src/widgets/WidgetMemo.vue | 5 +- .../frontend/src/widgets/WidgetNotifications.vue | 5 +- .../frontend/src/widgets/WidgetOnlineUsers.vue | 5 +- packages/frontend/src/widgets/WidgetPhotos.vue | 5 +- packages/frontend/src/widgets/WidgetPostForm.vue | 5 +- packages/frontend/src/widgets/WidgetProfile.vue | 5 +- packages/frontend/src/widgets/WidgetRss.vue | 5 +- packages/frontend/src/widgets/WidgetRssTicker.vue | 5 +- packages/frontend/src/widgets/WidgetSlideshow.vue | 5 +- packages/frontend/src/widgets/WidgetTimeline.vue | 5 +- packages/frontend/src/widgets/WidgetTrends.vue | 5 +- packages/frontend/src/widgets/WidgetUnixClock.vue | 5 +- packages/frontend/src/widgets/WidgetUserList.vue | 5 +- packages/frontend/src/widgets/index.ts | 3 +- .../frontend/src/widgets/server-metric/index.vue | 5 +- packages/frontend/src/widgets/widget.ts | 2 +- 246 files changed, 552 insertions(+), 402 deletions(-) (limited to 'packages/frontend/src') diff --git a/packages/frontend/src/boot/common.ts b/packages/frontend/src/boot/common.ts index ae6b1aee26..1d8e40a12d 100644 --- a/packages/frontend/src/boot/common.ts +++ b/packages/frontend/src/boot/common.ts @@ -3,7 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { computed, watch, version as vueVersion, App } from 'vue'; +import { computed, watch, version as vueVersion } from 'vue'; +import type { App } from 'vue'; import { compareVersions } from 'compare-versions'; import { version, lang, updateLocale, locale } from '@@/js/config.js'; import widgets from '@/widgets/index.js'; diff --git a/packages/frontend/src/boot/main-boot.ts b/packages/frontend/src/boot/main-boot.ts index 874e97f3a4..3a43c6794b 100644 --- a/packages/frontend/src/boot/main-boot.ts +++ b/packages/frontend/src/boot/main-boot.ts @@ -6,7 +6,7 @@ import { createApp, defineAsyncComponent, markRaw } from 'vue'; import { ui } from '@@/js/config.js'; import { common } from './common.js'; -import type * as Misskey from 'misskey-js'; +import * as Misskey from 'misskey-js'; import type { Component } from 'vue'; import { i18n } from '@/i18n.js'; import { alert, confirm, popup, post, toast } from '@/os.js'; @@ -22,7 +22,8 @@ import { initializeSw } from '@/scripts/initialize-sw.js'; import { deckStore } from '@/ui/deck/deck-store.js'; import { emojiPicker } from '@/scripts/emoji-picker.js'; import { mainRouter } from '@/router/main.js'; -import { type Keymap, makeHotkey } from '@/scripts/hotkey.js'; +import { makeHotkey } from '@/scripts/hotkey.js'; +import type { Keymap } from '@/scripts/hotkey.js'; import { addCustomEmoji, removeCustomEmojis, updateCustomEmojis } from '@/custom-emojis.js'; export async function mainBoot() { diff --git a/packages/frontend/src/components/MkAbuseReportWindow.stories.impl.ts b/packages/frontend/src/components/MkAbuseReportWindow.stories.impl.ts index 9df957f3ec..b62096bbe9 100644 --- a/packages/frontend/src/components/MkAbuseReportWindow.stories.impl.ts +++ b/packages/frontend/src/components/MkAbuseReportWindow.stories.impl.ts @@ -5,7 +5,7 @@ /* eslint-disable @typescript-eslint/explicit-function-return-type */ import { action } from '@storybook/addon-actions'; -import { StoryObj } from '@storybook/vue3'; +import type { StoryObj } from '@storybook/vue3'; import { HttpResponse, http } from 'msw'; import { userDetailed } from '../../.storybook/fakes.js'; import { commonHandlers } from '../../.storybook/mocks.js'; diff --git a/packages/frontend/src/components/MkAccountMoved.stories.impl.ts b/packages/frontend/src/components/MkAccountMoved.stories.impl.ts index cad26de6e2..b907b5b25a 100644 --- a/packages/frontend/src/components/MkAccountMoved.stories.impl.ts +++ b/packages/frontend/src/components/MkAccountMoved.stories.impl.ts @@ -5,7 +5,7 @@ /* eslint-disable @typescript-eslint/explicit-function-return-type */ import { action } from '@storybook/addon-actions'; -import { StoryObj } from '@storybook/vue3'; +import type { StoryObj } from '@storybook/vue3'; import { HttpResponse, http } from 'msw'; import { commonHandlers } from '../../.storybook/mocks.js'; import { userDetailed } from '../../.storybook/fakes.js'; diff --git a/packages/frontend/src/components/MkAchievements.stories.impl.ts b/packages/frontend/src/components/MkAchievements.stories.impl.ts index 7614da51da..bbd3f69d7c 100644 --- a/packages/frontend/src/components/MkAchievements.stories.impl.ts +++ b/packages/frontend/src/components/MkAchievements.stories.impl.ts @@ -4,7 +4,7 @@ */ /* eslint-disable @typescript-eslint/explicit-function-return-type */ -import { StoryObj } from '@storybook/vue3'; +import type { StoryObj } from '@storybook/vue3'; import { HttpResponse, http } from 'msw'; import { userDetailed } from '../../.storybook/fakes.js'; import { commonHandlers } from '../../.storybook/mocks.js'; diff --git a/packages/frontend/src/components/MkAnalogClock.stories.impl.ts b/packages/frontend/src/components/MkAnalogClock.stories.impl.ts index 270ca40825..a01d91ad20 100644 --- a/packages/frontend/src/components/MkAnalogClock.stories.impl.ts +++ b/packages/frontend/src/components/MkAnalogClock.stories.impl.ts @@ -4,7 +4,7 @@ */ /* eslint-disable @typescript-eslint/explicit-function-return-type */ -import { StoryObj } from '@storybook/vue3'; +import type { StoryObj } from '@storybook/vue3'; import isChromatic from 'chromatic/isChromatic'; import MkAnalogClock from './MkAnalogClock.vue'; export const Default = { diff --git a/packages/frontend/src/components/MkAnnouncementDialog.stories.impl.ts b/packages/frontend/src/components/MkAnnouncementDialog.stories.impl.ts index bf3ddb935b..627cb0c4ff 100644 --- a/packages/frontend/src/components/MkAnnouncementDialog.stories.impl.ts +++ b/packages/frontend/src/components/MkAnnouncementDialog.stories.impl.ts @@ -5,7 +5,7 @@ /* eslint-disable @typescript-eslint/explicit-function-return-type */ import { action } from '@storybook/addon-actions'; -import { StoryObj } from '@storybook/vue3'; +import type { StoryObj } from '@storybook/vue3'; import { HttpResponse, http } from 'msw'; import { commonHandlers } from '../../.storybook/mocks.js'; import MkAnnouncementDialog from './MkAnnouncementDialog.vue'; diff --git a/packages/frontend/src/components/MkAntennaEditor.stories.impl.ts b/packages/frontend/src/components/MkAntennaEditor.stories.impl.ts index 1749e07a4e..4d921a4c48 100644 --- a/packages/frontend/src/components/MkAntennaEditor.stories.impl.ts +++ b/packages/frontend/src/components/MkAntennaEditor.stories.impl.ts @@ -5,7 +5,7 @@ /* eslint-disable @typescript-eslint/explicit-function-return-type */ import { action } from '@storybook/addon-actions'; -import { StoryObj } from '@storybook/vue3'; +import type { StoryObj } from '@storybook/vue3'; import { HttpResponse, http } from 'msw'; import { commonHandlers } from '../../.storybook/mocks.js'; import MkAntennaEditor from './MkAntennaEditor.vue'; diff --git a/packages/frontend/src/components/MkAntennaEditorDialog.stories.impl.ts b/packages/frontend/src/components/MkAntennaEditorDialog.stories.impl.ts index 1c6ca83b47..5878b52fb9 100644 --- a/packages/frontend/src/components/MkAntennaEditorDialog.stories.impl.ts +++ b/packages/frontend/src/components/MkAntennaEditorDialog.stories.impl.ts @@ -5,7 +5,7 @@ /* eslint-disable @typescript-eslint/explicit-function-return-type */ import { action } from '@storybook/addon-actions'; -import { StoryObj } from '@storybook/vue3'; +import type { StoryObj } from '@storybook/vue3'; import { HttpResponse, http } from 'msw'; import { commonHandlers } from '../../.storybook/mocks.js'; import MkAntennaEditorDialog from './MkAntennaEditorDialog.vue'; diff --git a/packages/frontend/src/components/MkAsUi.vue b/packages/frontend/src/components/MkAsUi.vue index 365b767bd6..5c4d887e0c 100644 --- a/packages/frontend/src/components/MkAsUi.vue +++ b/packages/frontend/src/components/MkAsUi.vue @@ -63,14 +63,15 @@ SPDX-License-Identifier: AGPL-3.0-only + diff --git a/packages/frontend/src/components/MkPostFormAttaches.vue b/packages/frontend/src/components/MkPostFormAttaches.vue index 1336b61356..33fe82b759 100644 --- a/packages/frontend/src/components/MkPostFormAttaches.vue +++ b/packages/frontend/src/components/MkPostFormAttaches.vue @@ -22,20 +22,24 @@ SPDX-License-Identifier: AGPL-3.0-only -

{{ 16 - props.modelValue.length }}/16

+

+ {{ 16 - props.modelValue.length }}/16 +

-- cgit v1.2.3-freya From 9ffe504c7f75490822a3efdb39b70a8f0d046bcf Mon Sep 17 00:00:00 2001 From: claustra01 <108509532+claustra01@users.noreply.github.com> Date: Sun, 16 Feb 2025 19:34:50 +0900 Subject: enhance(frontend): CWの注釈で入力済みの文字数を表示する (#15070) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * enhance: CW注釈の文字数表示 * update: CHANGELOG.md * chore: maxCwTextLengthをただのconstにする * fix: 投稿ボタンのdisable判定条件 --------- Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> --- CHANGELOG.md | 2 ++ packages/frontend/src/components/MkPostForm.vue | 34 ++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) (limited to 'packages/frontend/src') diff --git a/CHANGELOG.md b/CHANGELOG.md index 885c8270da..57100aaf3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,10 +12,12 @@ - Enhance: 開発者モードでメニューからファイルIDをコピー出来るように `#15441' - Enhance: ノートに埋め込まれたメディアのコンテキストメニューから管理者用のファイル管理画面を開けるように ( #15440 ) - Enhance: リアクションする際に確認ダイアログを表示できるように +- Enhance: CWの注釈で入力済みの文字数を表示 - Fix: コンディショナルロールを手動で割り当てできる導線を削除 `#13529` - Fix: 埋め込みプレイヤーから外部ページに移動できない問題を修正 - Fix: Play の再読込時に UI が以前の状態を引き継いでしまう問題を修正 `#14378` - Fix: カスタム絵文字管理画面(beta)にてisSensitive/localOnlyの絞り込みが上手くいかない問題の修正 ( #15445 ) +- Fix: CWの注釈が100文字を超えている場合、ノート投稿ボタンを非アクティブに ### Server - Fix: `following/invalidate`でフォロワーを解除しようとしているユーザーの情報を返すように diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index 49ed4197de..ad0a332f99 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -65,7 +65,10 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.notSpecifiedMentionWarning }} - - +
+ +
{{ maxCwTextLength - cwTextLength }}
+
+ + +
+ + + + + diff --git a/packages/frontend/src/pages/chat/room.info.vue b/packages/frontend/src/pages/chat/room.info.vue new file mode 100644 index 0000000000..7d38d07b3a --- /dev/null +++ b/packages/frontend/src/pages/chat/room.info.vue @@ -0,0 +1,87 @@ + + + + + + + diff --git a/packages/frontend/src/pages/chat/room.members.vue b/packages/frontend/src/pages/chat/room.members.vue new file mode 100644 index 0000000000..d20216a81c --- /dev/null +++ b/packages/frontend/src/pages/chat/room.members.vue @@ -0,0 +1,73 @@ + + + + + + + diff --git a/packages/frontend/src/pages/chat/room.search.vue b/packages/frontend/src/pages/chat/room.search.vue new file mode 100644 index 0000000000..de5e7156ca --- /dev/null +++ b/packages/frontend/src/pages/chat/room.search.vue @@ -0,0 +1,68 @@ + + + + + + + diff --git a/packages/frontend/src/pages/chat/room.vue b/packages/frontend/src/pages/chat/room.vue new file mode 100644 index 0000000000..15e9f43db2 --- /dev/null +++ b/packages/frontend/src/pages/chat/room.vue @@ -0,0 +1,426 @@ + + + + + + + diff --git a/packages/frontend/src/pages/settings/notifications.vue b/packages/frontend/src/pages/settings/notifications.vue index 530b63b701..93a41e9ddd 100644 --- a/packages/frontend/src/pages/settings/notifications.vue +++ b/packages/frontend/src/pages/settings/notifications.vue @@ -38,7 +38,6 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.markAsReadAllNotifications }} - {{ i18n.ts.markAsReadAllUnreadNotes }}
@@ -93,10 +92,6 @@ const pushRegistrationInServer = computed(() => allowButton.value?.pushRegistrat const sendReadMessage = computed(() => pushRegistrationInServer.value?.sendReadMessage || false); const userLists = await misskeyApi('users/lists/list'); -async function readAllUnreadNotes() { - await os.apiWithDialog('i/read-all-unread-notes'); -} - async function readAllNotifications() { await os.apiWithDialog('notifications/mark-all-as-read'); } diff --git a/packages/frontend/src/pages/settings/privacy.vue b/packages/frontend/src/pages/settings/privacy.vue index f6eb203095..2f8a697d74 100644 --- a/packages/frontend/src/pages/settings/privacy.vue +++ b/packages/frontend/src/pages/settings/privacy.vue @@ -78,6 +78,20 @@ SPDX-License-Identifier: AGPL-3.0-only + + + + + + + + + + + + + + @@ -208,6 +222,7 @@ const hideOnlineStatus = ref($i.hideOnlineStatus); const publicReactions = ref($i.publicReactions); const followingVisibility = ref($i.followingVisibility); const followersVisibility = ref($i.followersVisibility); +const chatScope = ref($i.chatScope); const makeNotesFollowersOnlyBefore_type = computed(() => { if (makeNotesFollowersOnlyBefore.value == null) { @@ -260,6 +275,7 @@ function save() { publicReactions: !!publicReactions.value, followingVisibility: followingVisibility.value, followersVisibility: followersVisibility.value, + chatScope: chatScope.value, }); } diff --git a/packages/frontend/src/pages/settings/sounds.vue b/packages/frontend/src/pages/settings/sounds.vue index 9e5c82a266..4461ee1ab1 100644 --- a/packages/frontend/src/pages/settings/sounds.vue +++ b/packages/frontend/src/pages/settings/sounds.vue @@ -85,6 +85,7 @@ const sounds = ref>>({ noteMy: prefer.r['sound.on.noteMy'], notification: prefer.r['sound.on.notification'], reaction: prefer.r['sound.on.reaction'], + chatMessage: prefer.r['sound.on.chatMessage'], }); function getSoundTypeName(f: SoundType): string { diff --git a/packages/frontend/src/preferences/def.ts b/packages/frontend/src/preferences/def.ts index c3c37553d7..127ebeef0c 100644 --- a/packages/frontend/src/preferences/def.ts +++ b/packages/frontend/src/preferences/def.ts @@ -136,6 +136,7 @@ export const PREF_DEF = { 'clips', 'drive', 'followRequests', + 'chat', '-', 'explore', 'announcements', @@ -331,6 +332,7 @@ export const PREF_DEF = { plugins: { default: [] as Plugin[], }, + 'sound.masterVolume': { default: 0.3, }, @@ -352,6 +354,10 @@ export const PREF_DEF = { 'sound.on.reaction': { default: { type: 'syuilo/bubble2', volume: 1 } as SoundStore, }, + 'sound.on.chatMessage': { + default: { type: 'syuilo/waon', volume: 1 } as SoundStore, + }, + 'deck.alwaysShowMainColumn': { default: true, }, @@ -364,6 +370,7 @@ export const PREF_DEF = { 'deck.columnAlign': { default: 'left' as 'left' | 'right' | 'center', }, + 'game.dropAndFusion': { default: { bgmVolume: 0.25, diff --git a/packages/frontend/src/router.definition.ts b/packages/frontend/src/router.definition.ts index 3b60ee68e3..0585a31fd1 100644 --- a/packages/frontend/src/router.definition.ts +++ b/packages/frontend/src/router.definition.ts @@ -40,6 +40,22 @@ export const ROUTE_DEF = [{ }, { path: '/clips/:clipId', component: page(() => import('@/pages/clip.vue')), +}, { + path: '/chat', + component: page(() => import('@/pages/chat/home.vue')), + loginRequired: true, +}, { + path: '/chat/user/:userId', + component: page(() => import('@/pages/chat/room.vue')), + loginRequired: true, +}, { + path: '/chat/room/:roomId', + component: page(() => import('@/pages/chat/room.vue')), + loginRequired: true, +}, { + path: '/chat/messages/:messageId', + component: page(() => import('@/pages/chat/message.vue')), + loginRequired: true, }, { path: '/instance-info/:host', component: page(() => import('@/pages/instance-info.vue')), diff --git a/packages/frontend/src/style.scss b/packages/frontend/src/style.scss index 8c5617b72e..f122f47c06 100644 --- a/packages/frontend/src/style.scss +++ b/packages/frontend/src/style.scss @@ -113,10 +113,6 @@ a { outline-offset: 2px; } - &:hover { - text-decoration: underline; - } - &[target="_blank"] { -webkit-touch-callout: default; } @@ -335,13 +331,13 @@ rt { ._gaps_m { display: flex; flex-direction: column; - gap: 1.5em; + gap: 21px; } ._gaps_s { display: flex; flex-direction: column; - gap: 0.75em; + gap: 10px; } ._gaps { diff --git a/packages/frontend/src/types/menu.ts b/packages/frontend/src/types/menu.ts index 5d1fc1fe72..820759ce61 100644 --- a/packages/frontend/src/types/menu.ts +++ b/packages/frontend/src/types/menu.ts @@ -15,16 +15,16 @@ export type MenuAction = (ev: MouseEvent) => void; export type MenuDivider = { type: 'divider' }; export type MenuNull = undefined; -export type MenuLabel = { type: 'label', text: string }; -export type MenuLink = { type: 'link', to: string, text: string, icon?: string, indicate?: boolean, avatar?: Misskey.entities.User }; -export type MenuA = { type: 'a', href: string, target?: string, download?: string, text: string, icon?: string, indicate?: boolean }; +export type MenuLabel = { type: 'label', text: string, caption?: string }; +export type MenuLink = { type: 'link', to: string, text: string, caption?: string, icon?: string, indicate?: boolean, avatar?: Misskey.entities.User }; +export type MenuA = { type: 'a', href: string, target?: string, download?: string, text: string, caption?: string, icon?: string, indicate?: boolean }; export type MenuUser = { type: 'user', user: Misskey.entities.User, active?: boolean, indicate?: boolean, action: MenuAction }; -export type MenuSwitch = { type: 'switch', ref: Ref, text: string, icon?: string, disabled?: boolean | Ref }; -export type MenuButton = { type?: 'button', text: string, icon?: string, indicate?: boolean, danger?: boolean, active?: boolean | ComputedRef, avatar?: Misskey.entities.User; action: MenuAction }; -export type MenuRadio = { type: 'radio', text: string, icon?: string, ref: Ref, options: MenuRadioOptionsDef, disabled?: boolean | Ref }; -export type MenuRadioOption = { type: 'radioOption', text: string, action: MenuAction; active?: boolean | ComputedRef }; +export type MenuSwitch = { type: 'switch', ref: Ref, text: string, caption?: string, icon?: string, disabled?: boolean | Ref }; +export type MenuButton = { type?: 'button', text: string, caption?: string, icon?: string, indicate?: boolean, danger?: boolean, active?: boolean | ComputedRef, avatar?: Misskey.entities.User; action: MenuAction }; +export type MenuRadio = { type: 'radio', text: string, caption?: string, icon?: string, ref: Ref, options: MenuRadioOptionsDef, disabled?: boolean | Ref }; +export type MenuRadioOption = { type: 'radioOption', text: string, caption?: string, action: MenuAction; active?: boolean | ComputedRef }; export type MenuComponent = { type: 'component', component: T, props?: ComponentProps }; -export type MenuParent = { type: 'parent', text: string, icon?: string, children: MenuItem[] | (() => Promise | MenuItem[]) }; +export type MenuParent = { type: 'parent', text: string, caption?: string, icon?: string, children: MenuItem[] | (() => Promise | MenuItem[]) }; export type MenuPending = { type: 'pending' }; diff --git a/packages/frontend/src/ui/_common_/navbar.vue b/packages/frontend/src/ui/_common_/navbar.vue index 98d6f329ab..88ce3a96e2 100644 --- a/packages/frontend/src/ui/_common_/navbar.vue +++ b/packages/frontend/src/ui/_common_/navbar.vue @@ -65,7 +65,7 @@ SPDX-License-Identifier: AGPL-3.0-only --> -
+
@@ -74,9 +74,9 @@ SPDX-License-Identifier: AGPL-3.0-only
-
-
-
+
+
+
diff --git a/packages/frontend/src/utility/autogen/settings-search-index.ts b/packages/frontend/src/utility/autogen/settings-search-index.ts index fd92876880..64fe328478 100644 --- a/packages/frontend/src/utility/autogen/settings-search-index.ts +++ b/packages/frontend/src/utility/autogen/settings-search-index.ts @@ -240,20 +240,25 @@ export const searchIndexes: SearchIndexItem[] = [ keywords: ['explore', i18n.ts.makeExplorableDescription], }, { - id: '7vr04wKol', + id: 'xEYlOghao', + label: i18n.ts._chat.chatAllowedUsers, + keywords: ['chat'], + }, + { + id: 'BnOtlyaAh', children: [ { - id: 'Av7fAaHv8', + id: 'BzMIVBpL0', label: i18n.ts._accountSettings.requireSigninToViewContents, keywords: ['login', 'signin'], }, { - id: '5RbESWefG', + id: 'jJUqPqBAv', label: i18n.ts._accountSettings.makeNotesFollowersOnlyBefore, keywords: ['follower', i18n.ts._accountSettings.makeNotesFollowersOnlyBeforeDescription], }, { - id: 'hdzwDs3qd', + id: 'ra10txIFV', label: i18n.ts._accountSettings.makeNotesHiddenBefore, keywords: ['hidden', i18n.ts._accountSettings.makeNotesHiddenBeforeDescription], }, diff --git a/packages/frontend/src/utility/get-user-menu.ts b/packages/frontend/src/utility/get-user-menu.ts index de20f2678e..37c88c9665 100644 --- a/packages/frontend/src/utility/get-user-menu.ts +++ b/packages/frontend/src/utility/get-user-menu.ts @@ -151,24 +151,6 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: Router const menuItems: MenuItem[] = []; - menuItems.push({ - icon: 'ti ti-at', - text: i18n.ts.copyUsername, - action: () => { - copyToClipboard(`@${user.username}@${user.host ?? host}`); - }, - }); - - if (notesSearchAvailable && (user.host == null || canSearchNonLocalNotes)) { - menuItems.push({ - icon: 'ti ti-search', - text: i18n.ts.searchThisUsersNotes, - action: () => { - router.push(`/search?username=${encodeURIComponent(user.username)}${user.host != null ? '&host=' + encodeURIComponent(user.host) : ''}`); - }, - }); - } - if (iAmModerator) { menuItems.push({ icon: 'ti ti-user-exclamation', @@ -176,9 +158,26 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: Router action: () => { router.push(`/admin/user/${user.id}`); }, - }); + }, { type: 'divider' }); } + menuItems.push({ + icon: 'ti ti-at', + text: i18n.ts.copyUsername, + action: () => { + copyToClipboard(`@${user.username}@${user.host ?? host}`); + }, + }); + + menuItems.push({ + icon: 'ti ti-share', + text: i18n.ts.copyProfileUrl, + action: () => { + const canonical = user.host === null ? `@${user.username}` : `@${user.username}@${toUnicode(user.host)}`; + copyToClipboard(`${url}/${canonical}`); + }, + }); + menuItems.push({ icon: 'ti ti-rss', text: i18n.ts.copyRSS, @@ -210,24 +209,18 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: Router }); } - menuItems.push({ - icon: 'ti ti-share', - text: i18n.ts.copyProfileUrl, - action: () => { - const canonical = user.host === null ? `@${user.username}` : `@${user.username}@${toUnicode(user.host)}`; - copyToClipboard(`${url}/${canonical}`); - }, - }); - - if ($i) { + if (notesSearchAvailable && (user.host == null || canSearchNonLocalNotes)) { menuItems.push({ - icon: 'ti ti-mail', - text: i18n.ts.sendMessage, + icon: 'ti ti-search', + text: i18n.ts.searchThisUsersNotes, action: () => { - const canonical = user.host === null ? `@${user.username}` : `@${user.username}@${user.host}`; - os.post({ specified: user, initialText: `${canonical} ` }); + router.push(`/search?username=${encodeURIComponent(user.username)}${user.host != null ? '&host=' + encodeURIComponent(user.host) : ''}`); }, - }, { type: 'divider' }, { + }); + } + + if ($i) { + menuItems.push({ type: 'divider' }, { icon: 'ti ti-pencil', text: i18n.ts.editMemo, action: editMemo, @@ -363,6 +356,18 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: Router //} menuItems.push({ type: 'divider' }, { + icon: 'ti ti-mail', + text: i18n.ts.sendMessage, + action: () => { + const canonical = user.host === null ? `@${user.username}` : `@${user.username}@${user.host}`; + os.post({ specified: user, initialText: `${canonical} ` }); + }, + }, { + type: 'link', + icon: 'ti ti-messages', + text: i18n.ts._chat.chatWithThisUser, + to: `/chat/user/${user.id}`, + }, { type: 'divider' }, { icon: user.isMuted ? 'ti ti-eye' : 'ti ti-eye-off', text: user.isMuted ? i18n.ts.unmute : i18n.ts.mute, action: toggleMute, diff --git a/packages/frontend/src/utility/sound.ts b/packages/frontend/src/utility/sound.ts index 796af0e5ca..f217bdfcd5 100644 --- a/packages/frontend/src/utility/sound.ts +++ b/packages/frontend/src/utility/sound.ts @@ -77,6 +77,7 @@ export const operationTypes = [ 'note', 'notification', 'reaction', + 'chatMessage', ] as const; /** サウンドの種類 */ diff --git a/packages/frontend/src/utility/upload.ts b/packages/frontend/src/utility/upload.ts index eb3cbd3dfa..e13d793ffb 100644 --- a/packages/frontend/src/utility/upload.ts +++ b/packages/frontend/src/utility/upload.ts @@ -32,7 +32,7 @@ const mimeTypeMap = { export function uploadFile( file: File, - folder?: string | Misskey.entities.DriveFolder, + folder?: string | Misskey.entities.DriveFolder | null, name?: string, keepOriginal: boolean = prefer.s.keepOriginalUploading, ): Promise { diff --git a/packages/misskey-js/README.md b/packages/misskey-js/README.md index 4753e2434b..5ab2787c47 100644 --- a/packages/misskey-js/README.md +++ b/packages/misskey-js/README.md @@ -83,8 +83,8 @@ const mainChannel = stream.useChannel('main'); ``` ts const stream = new Misskey.Stream('https://misskey.test', { token: 'TOKEN' }); -const messagingChannel = stream.useChannel('messaging', { - otherparty: 'xxxxxxxxxx', +const chatChannel = stream.useChannel('chat', { + other: 'xxxxxxxxxx', }); ``` @@ -115,11 +115,11 @@ mainChannel.on('notification', notification => { ``` ts const stream = new Misskey.Stream('https://misskey.test', { token: 'TOKEN' }); -const messagingChannel = stream.useChannel('messaging', { - otherparty: 'xxxxxxxxxx', +const chatChannel = stream.useChannel('chat', { + other: 'xxxxxxxxxx', }); -messagingChannel.send('read', { +chatChannel.send('read', { id: 'xxxxxxxxxx' }); ``` diff --git a/packages/misskey-js/etc/misskey-js.api.md b/packages/misskey-js/etc/misskey-js.api.md index 6060812b53..e79cd794a6 100644 --- a/packages/misskey-js/etc/misskey-js.api.md +++ b/packages/misskey-js/etc/misskey-js.api.md @@ -619,13 +619,9 @@ export type Channels = { }) => void; readAllNotifications: () => void; unreadNotification: (payload: Notification_2) => void; - unreadMention: (payload: Note['id']) => void; - readAllUnreadMentions: () => void; notificationFlushed: () => void; - unreadSpecifiedNote: (payload: Note['id']) => void; - readAllUnreadSpecifiedNotes: () => void; - readAllAntennas: () => void; unreadAntenna: (payload: Antenna) => void; + newChatMessage: (payload: ChatMessage) => void; readAllAnnouncements: () => void; myTokenRegenerated: () => void; signin: (payload: Signin) => void; @@ -951,6 +947,153 @@ type ChartsUsersRequest = operations['charts___users']['requestBody']['content'] // @public (undocumented) type ChartsUsersResponse = operations['charts___users']['responses']['200']['content']['application/json']; +// @public (undocumented) +type ChatHistoryRequest = operations['chat___history']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatHistoryResponse = operations['chat___history']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatMessage = components['schemas']['ChatMessage']; + +// @public (undocumented) +type ChatMessageLite = components['schemas']['ChatMessageLite']; + +// @public (undocumented) +type ChatMessagesCreateToRoomRequest = operations['chat___messages___create-to-room']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatMessagesCreateToRoomResponse = operations['chat___messages___create-to-room']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatMessagesCreateToUserRequest = operations['chat___messages___create-to-user']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatMessagesCreateToUserResponse = operations['chat___messages___create-to-user']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatMessagesDeleteRequest = operations['chat___messages___delete']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatMessagesDeleteResponse = operations['chat___messages___delete']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatMessagesReactRequest = operations['chat___messages___react']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatMessagesReactResponse = operations['chat___messages___react']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatMessagesRoomTimelineRequest = operations['chat___messages___room-timeline']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatMessagesRoomTimelineResponse = operations['chat___messages___room-timeline']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatMessagesSearchRequest = operations['chat___messages___search']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatMessagesSearchResponse = operations['chat___messages___search']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatMessagesShowRequest = operations['chat___messages___show']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatMessagesShowResponse = operations['chat___messages___show']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatMessagesUserTimelineRequest = operations['chat___messages___user-timeline']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatMessagesUserTimelineResponse = operations['chat___messages___user-timeline']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatRoom = components['schemas']['ChatRoom']; + +// @public (undocumented) +type ChatRoomInvitation = components['schemas']['ChatRoomInvitation']; + +// @public (undocumented) +type ChatRoomMembership = components['schemas']['ChatRoomMembership']; + +// @public (undocumented) +type ChatRoomsCreateRequest = operations['chat___rooms___create']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsCreateResponse = operations['chat___rooms___create']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsDeleteRequest = operations['chat___rooms___delete']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsDeleteResponse = operations['chat___rooms___delete']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsInvitationsCreateRequest = operations['chat___rooms___invitations___create']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsInvitationsCreateResponse = operations['chat___rooms___invitations___create']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsInvitationsIgnoreRequest = operations['chat___rooms___invitations___ignore']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsInvitationsIgnoreResponse = operations['chat___rooms___invitations___ignore']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsInvitationsInboxRequest = operations['chat___rooms___invitations___inbox']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsInvitationsInboxResponse = operations['chat___rooms___invitations___inbox']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsJoiningRequest = operations['chat___rooms___joining']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsJoiningResponse = operations['chat___rooms___joining']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsJoinRequest = operations['chat___rooms___join']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsJoinResponse = operations['chat___rooms___join']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsLeaveRequest = operations['chat___rooms___leave']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsLeaveResponse = operations['chat___rooms___leave']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsMembersRequest = operations['chat___rooms___members']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsMembersResponse = operations['chat___rooms___members']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsMuteRequest = operations['chat___rooms___mute']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsMuteResponse = operations['chat___rooms___mute']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsOwnedRequest = operations['chat___rooms___owned']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsOwnedResponse = operations['chat___rooms___owned']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsShowRequest = operations['chat___rooms___show']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsShowResponse = operations['chat___rooms___show']['responses']['200']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsUpdateRequest = operations['chat___rooms___update']['requestBody']['content']['application/json']; + +// @public (undocumented) +type ChatRoomsUpdateResponse = operations['chat___rooms___update']['responses']['200']['content']['application/json']; + // @public (undocumented) type Clip = components['schemas']['Clip']; @@ -1448,6 +1591,50 @@ declare namespace entities { ChartsUserReactionsResponse, ChartsUsersRequest, ChartsUsersResponse, + ChatHistoryRequest, + ChatHistoryResponse, + ChatMessagesCreateToRoomRequest, + ChatMessagesCreateToRoomResponse, + ChatMessagesCreateToUserRequest, + ChatMessagesCreateToUserResponse, + ChatMessagesDeleteRequest, + ChatMessagesDeleteResponse, + ChatMessagesReactRequest, + ChatMessagesReactResponse, + ChatMessagesRoomTimelineRequest, + ChatMessagesRoomTimelineResponse, + ChatMessagesSearchRequest, + ChatMessagesSearchResponse, + ChatMessagesShowRequest, + ChatMessagesShowResponse, + ChatMessagesUserTimelineRequest, + ChatMessagesUserTimelineResponse, + ChatRoomsCreateRequest, + ChatRoomsCreateResponse, + ChatRoomsDeleteRequest, + ChatRoomsDeleteResponse, + ChatRoomsInvitationsCreateRequest, + ChatRoomsInvitationsCreateResponse, + ChatRoomsInvitationsIgnoreRequest, + ChatRoomsInvitationsIgnoreResponse, + ChatRoomsInvitationsInboxRequest, + ChatRoomsInvitationsInboxResponse, + ChatRoomsJoinRequest, + ChatRoomsJoinResponse, + ChatRoomsJoiningRequest, + ChatRoomsJoiningResponse, + ChatRoomsLeaveRequest, + ChatRoomsLeaveResponse, + ChatRoomsMembersRequest, + ChatRoomsMembersResponse, + ChatRoomsMuteRequest, + ChatRoomsMuteResponse, + ChatRoomsOwnedRequest, + ChatRoomsOwnedResponse, + ChatRoomsShowRequest, + ChatRoomsShowResponse, + ChatRoomsUpdateRequest, + ChatRoomsUpdateResponse, ClipsAddNoteRequest, ClipsCreateRequest, ClipsCreateResponse, @@ -1880,7 +2067,12 @@ declare namespace entities { MetaDetailedOnly, MetaDetailed, SystemWebhook, - AbuseReportNotificationRecipient + AbuseReportNotificationRecipient, + ChatMessage, + ChatMessageLite, + ChatRoom, + ChatRoomInvitation, + ChatRoomMembership } } export { entities } @@ -2903,7 +3095,7 @@ type PartialRolePolicyOverride = Partial<{ }>; // @public (undocumented) -export const permissions: readonly ["read:account", "write:account", "read:blocks", "write:blocks", "read:drive", "write:drive", "read:favorites", "write:favorites", "read:following", "write:following", "read:messaging", "write:messaging", "read:mutes", "write:mutes", "write:notes", "read:notifications", "write:notifications", "read:reactions", "write:reactions", "write:votes", "read:pages", "write:pages", "write:page-likes", "read:page-likes", "read:user-groups", "write:user-groups", "read:channels", "write:channels", "read:gallery", "write:gallery", "read:gallery-likes", "write:gallery-likes", "read:flash", "write:flash", "read:flash-likes", "write:flash-likes", "read:admin:abuse-user-reports", "write:admin:delete-account", "write:admin:delete-all-files-of-a-user", "read:admin:index-stats", "read:admin:table-stats", "read:admin:user-ips", "read:admin:meta", "write:admin:reset-password", "write:admin:resolve-abuse-user-report", "write:admin:send-email", "read:admin:server-info", "read:admin:show-moderation-log", "read:admin:show-user", "write:admin:suspend-user", "write:admin:unset-user-avatar", "write:admin:unset-user-banner", "write:admin:unsuspend-user", "write:admin:meta", "write:admin:user-note", "write:admin:roles", "read:admin:roles", "write:admin:relays", "read:admin:relays", "write:admin:invite-codes", "read:admin:invite-codes", "write:admin:announcements", "read:admin:announcements", "write:admin:avatar-decorations", "read:admin:avatar-decorations", "write:admin:federation", "write:admin:account", "read:admin:account", "write:admin:emoji", "read:admin:emoji", "write:admin:queue", "read:admin:queue", "write:admin:promo", "write:admin:drive", "read:admin:drive", "write:admin:ad", "read:admin:ad", "write:invite-codes", "read:invite-codes", "write:clip-favorite", "read:clip-favorite", "read:federation", "write:report-abuse"]; +export const permissions: readonly ["read:account", "write:account", "read:blocks", "write:blocks", "read:drive", "write:drive", "read:favorites", "write:favorites", "read:following", "write:following", "read:messaging", "write:messaging", "read:mutes", "write:mutes", "write:notes", "read:notifications", "write:notifications", "read:reactions", "write:reactions", "write:votes", "read:pages", "write:pages", "write:page-likes", "read:page-likes", "read:user-groups", "write:user-groups", "read:channels", "write:channels", "read:gallery", "write:gallery", "read:gallery-likes", "write:gallery-likes", "read:flash", "write:flash", "read:flash-likes", "write:flash-likes", "read:admin:abuse-user-reports", "write:admin:delete-account", "write:admin:delete-all-files-of-a-user", "read:admin:index-stats", "read:admin:table-stats", "read:admin:user-ips", "read:admin:meta", "write:admin:reset-password", "write:admin:resolve-abuse-user-report", "write:admin:send-email", "read:admin:server-info", "read:admin:show-moderation-log", "read:admin:show-user", "write:admin:suspend-user", "write:admin:unset-user-avatar", "write:admin:unset-user-banner", "write:admin:unsuspend-user", "write:admin:meta", "write:admin:user-note", "write:admin:roles", "read:admin:roles", "write:admin:relays", "read:admin:relays", "write:admin:invite-codes", "read:admin:invite-codes", "write:admin:announcements", "read:admin:announcements", "write:admin:avatar-decorations", "read:admin:avatar-decorations", "write:admin:federation", "write:admin:account", "read:admin:account", "write:admin:emoji", "read:admin:emoji", "write:admin:queue", "read:admin:queue", "write:admin:promo", "write:admin:drive", "read:admin:drive", "write:admin:ad", "read:admin:ad", "write:invite-codes", "read:invite-codes", "write:clip-favorite", "read:clip-favorite", "read:federation", "write:report-abuse", "write:chat", "read:chat"]; // @public (undocumented) type PingResponse = operations['ping']['responses']['200']['content']['application/json']; @@ -3444,8 +3636,8 @@ type V2AdminEmojiListResponse = operations['v2___admin___emoji___list']['respons // // src/entities.ts:50:2 - (ae-forgotten-export) The symbol "ModerationLogPayloads" needs to be exported by the entry point index.d.ts // src/streaming.ts:57:3 - (ae-forgotten-export) The symbol "ReconnectingWebSocket" needs to be exported by the entry point index.d.ts -// src/streaming.types.ts:220:4 - (ae-forgotten-export) The symbol "ReversiUpdateKey" needs to be exported by the entry point index.d.ts -// src/streaming.types.ts:230:4 - (ae-forgotten-export) The symbol "ReversiUpdateSettings" needs to be exported by the entry point index.d.ts +// src/streaming.types.ts:217:4 - (ae-forgotten-export) The symbol "ReversiUpdateKey" needs to be exported by the entry point index.d.ts +// src/streaming.types.ts:227:4 - (ae-forgotten-export) The symbol "ReversiUpdateSettings" needs to be exported by the entry point index.d.ts // (No @packageDocumentation comment for this package) diff --git a/packages/misskey-js/src/autogen/apiClientJSDoc.ts b/packages/misskey-js/src/autogen/apiClientJSDoc.ts index a1543952fc..e12ba0d6b2 100644 --- a/packages/misskey-js/src/autogen/apiClientJSDoc.ts +++ b/packages/misskey-js/src/autogen/apiClientJSDoc.ts @@ -1534,6 +1534,248 @@ declare module '../api.js' { credential?: string | null, ): Promise>; + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + + /** + * No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + request( + endpoint: E, + params: P, + credential?: string | null, + ): Promise>; + /** * No description provided. * @@ -2827,17 +3069,6 @@ declare module '../api.js' { credential?: string | null, ): Promise>; - /** - * No description provided. - * - * **Credential required**: *Yes* / **Permission**: *write:account* - */ - request( - endpoint: E, - params: P, - credential?: string | null, - ): Promise>; - /** * No description provided. * diff --git a/packages/misskey-js/src/autogen/endpoint.ts b/packages/misskey-js/src/autogen/endpoint.ts index 9bb8fb2225..558f4ab514 100644 --- a/packages/misskey-js/src/autogen/endpoint.ts +++ b/packages/misskey-js/src/autogen/endpoint.ts @@ -207,6 +207,50 @@ import type { ChartsUserReactionsResponse, ChartsUsersRequest, ChartsUsersResponse, + ChatHistoryRequest, + ChatHistoryResponse, + ChatMessagesCreateToRoomRequest, + ChatMessagesCreateToRoomResponse, + ChatMessagesCreateToUserRequest, + ChatMessagesCreateToUserResponse, + ChatMessagesDeleteRequest, + ChatMessagesDeleteResponse, + ChatMessagesReactRequest, + ChatMessagesReactResponse, + ChatMessagesRoomTimelineRequest, + ChatMessagesRoomTimelineResponse, + ChatMessagesSearchRequest, + ChatMessagesSearchResponse, + ChatMessagesShowRequest, + ChatMessagesShowResponse, + ChatMessagesUserTimelineRequest, + ChatMessagesUserTimelineResponse, + ChatRoomsCreateRequest, + ChatRoomsCreateResponse, + ChatRoomsDeleteRequest, + ChatRoomsDeleteResponse, + ChatRoomsInvitationsCreateRequest, + ChatRoomsInvitationsCreateResponse, + ChatRoomsInvitationsIgnoreRequest, + ChatRoomsInvitationsIgnoreResponse, + ChatRoomsInvitationsInboxRequest, + ChatRoomsInvitationsInboxResponse, + ChatRoomsJoinRequest, + ChatRoomsJoinResponse, + ChatRoomsJoiningRequest, + ChatRoomsJoiningResponse, + ChatRoomsLeaveRequest, + ChatRoomsLeaveResponse, + ChatRoomsMembersRequest, + ChatRoomsMembersResponse, + ChatRoomsMuteRequest, + ChatRoomsMuteResponse, + ChatRoomsOwnedRequest, + ChatRoomsOwnedResponse, + ChatRoomsShowRequest, + ChatRoomsShowResponse, + ChatRoomsUpdateRequest, + ChatRoomsUpdateResponse, ClipsAddNoteRequest, ClipsCreateRequest, ClipsCreateResponse, @@ -726,6 +770,28 @@ export type Endpoints = { 'charts/user/pv': { req: ChartsUserPvRequest; res: ChartsUserPvResponse }; 'charts/user/reactions': { req: ChartsUserReactionsRequest; res: ChartsUserReactionsResponse }; 'charts/users': { req: ChartsUsersRequest; res: ChartsUsersResponse }; + 'chat/history': { req: ChatHistoryRequest; res: ChatHistoryResponse }; + 'chat/messages/create-to-room': { req: ChatMessagesCreateToRoomRequest; res: ChatMessagesCreateToRoomResponse }; + 'chat/messages/create-to-user': { req: ChatMessagesCreateToUserRequest; res: ChatMessagesCreateToUserResponse }; + 'chat/messages/delete': { req: ChatMessagesDeleteRequest; res: ChatMessagesDeleteResponse }; + 'chat/messages/react': { req: ChatMessagesReactRequest; res: ChatMessagesReactResponse }; + 'chat/messages/room-timeline': { req: ChatMessagesRoomTimelineRequest; res: ChatMessagesRoomTimelineResponse }; + 'chat/messages/search': { req: ChatMessagesSearchRequest; res: ChatMessagesSearchResponse }; + 'chat/messages/show': { req: ChatMessagesShowRequest; res: ChatMessagesShowResponse }; + 'chat/messages/user-timeline': { req: ChatMessagesUserTimelineRequest; res: ChatMessagesUserTimelineResponse }; + 'chat/rooms/create': { req: ChatRoomsCreateRequest; res: ChatRoomsCreateResponse }; + 'chat/rooms/delete': { req: ChatRoomsDeleteRequest; res: ChatRoomsDeleteResponse }; + 'chat/rooms/invitations/create': { req: ChatRoomsInvitationsCreateRequest; res: ChatRoomsInvitationsCreateResponse }; + 'chat/rooms/invitations/ignore': { req: ChatRoomsInvitationsIgnoreRequest; res: ChatRoomsInvitationsIgnoreResponse }; + 'chat/rooms/invitations/inbox': { req: ChatRoomsInvitationsInboxRequest; res: ChatRoomsInvitationsInboxResponse }; + 'chat/rooms/join': { req: ChatRoomsJoinRequest; res: ChatRoomsJoinResponse }; + 'chat/rooms/joining': { req: ChatRoomsJoiningRequest; res: ChatRoomsJoiningResponse }; + 'chat/rooms/leave': { req: ChatRoomsLeaveRequest; res: ChatRoomsLeaveResponse }; + 'chat/rooms/members': { req: ChatRoomsMembersRequest; res: ChatRoomsMembersResponse }; + 'chat/rooms/mute': { req: ChatRoomsMuteRequest; res: ChatRoomsMuteResponse }; + 'chat/rooms/owned': { req: ChatRoomsOwnedRequest; res: ChatRoomsOwnedResponse }; + 'chat/rooms/show': { req: ChatRoomsShowRequest; res: ChatRoomsShowResponse }; + 'chat/rooms/update': { req: ChatRoomsUpdateRequest; res: ChatRoomsUpdateResponse }; 'clips/add-note': { req: ClipsAddNoteRequest; res: EmptyResponse }; 'clips/create': { req: ClipsCreateRequest; res: ClipsCreateResponse }; 'clips/delete': { req: ClipsDeleteRequest; res: EmptyResponse }; @@ -841,7 +907,6 @@ export type Endpoints = { 'i/page-likes': { req: IPageLikesRequest; res: IPageLikesResponse }; 'i/pages': { req: IPagesRequest; res: IPagesResponse }; 'i/pin': { req: IPinRequest; res: IPinResponse }; - 'i/read-all-unread-notes': { req: EmptyRequest; res: EmptyResponse }; 'i/read-announcement': { req: IReadAnnouncementRequest; res: EmptyResponse }; 'i/regenerate-token': { req: IRegenerateTokenRequest; res: EmptyResponse }; 'i/registry/get': { req: IRegistryGetRequest; res: IRegistryGetResponse }; diff --git a/packages/misskey-js/src/autogen/entities.ts b/packages/misskey-js/src/autogen/entities.ts index f3d26efa69..bb21272e01 100644 --- a/packages/misskey-js/src/autogen/entities.ts +++ b/packages/misskey-js/src/autogen/entities.ts @@ -210,6 +210,50 @@ export type ChartsUserReactionsRequest = operations['charts___user___reactions'] export type ChartsUserReactionsResponse = operations['charts___user___reactions']['responses']['200']['content']['application/json']; export type ChartsUsersRequest = operations['charts___users']['requestBody']['content']['application/json']; export type ChartsUsersResponse = operations['charts___users']['responses']['200']['content']['application/json']; +export type ChatHistoryRequest = operations['chat___history']['requestBody']['content']['application/json']; +export type ChatHistoryResponse = operations['chat___history']['responses']['200']['content']['application/json']; +export type ChatMessagesCreateToRoomRequest = operations['chat___messages___create-to-room']['requestBody']['content']['application/json']; +export type ChatMessagesCreateToRoomResponse = operations['chat___messages___create-to-room']['responses']['200']['content']['application/json']; +export type ChatMessagesCreateToUserRequest = operations['chat___messages___create-to-user']['requestBody']['content']['application/json']; +export type ChatMessagesCreateToUserResponse = operations['chat___messages___create-to-user']['responses']['200']['content']['application/json']; +export type ChatMessagesDeleteRequest = operations['chat___messages___delete']['requestBody']['content']['application/json']; +export type ChatMessagesDeleteResponse = operations['chat___messages___delete']['responses']['200']['content']['application/json']; +export type ChatMessagesReactRequest = operations['chat___messages___react']['requestBody']['content']['application/json']; +export type ChatMessagesReactResponse = operations['chat___messages___react']['responses']['200']['content']['application/json']; +export type ChatMessagesRoomTimelineRequest = operations['chat___messages___room-timeline']['requestBody']['content']['application/json']; +export type ChatMessagesRoomTimelineResponse = operations['chat___messages___room-timeline']['responses']['200']['content']['application/json']; +export type ChatMessagesSearchRequest = operations['chat___messages___search']['requestBody']['content']['application/json']; +export type ChatMessagesSearchResponse = operations['chat___messages___search']['responses']['200']['content']['application/json']; +export type ChatMessagesShowRequest = operations['chat___messages___show']['requestBody']['content']['application/json']; +export type ChatMessagesShowResponse = operations['chat___messages___show']['responses']['200']['content']['application/json']; +export type ChatMessagesUserTimelineRequest = operations['chat___messages___user-timeline']['requestBody']['content']['application/json']; +export type ChatMessagesUserTimelineResponse = operations['chat___messages___user-timeline']['responses']['200']['content']['application/json']; +export type ChatRoomsCreateRequest = operations['chat___rooms___create']['requestBody']['content']['application/json']; +export type ChatRoomsCreateResponse = operations['chat___rooms___create']['responses']['200']['content']['application/json']; +export type ChatRoomsDeleteRequest = operations['chat___rooms___delete']['requestBody']['content']['application/json']; +export type ChatRoomsDeleteResponse = operations['chat___rooms___delete']['responses']['200']['content']['application/json']; +export type ChatRoomsInvitationsCreateRequest = operations['chat___rooms___invitations___create']['requestBody']['content']['application/json']; +export type ChatRoomsInvitationsCreateResponse = operations['chat___rooms___invitations___create']['responses']['200']['content']['application/json']; +export type ChatRoomsInvitationsIgnoreRequest = operations['chat___rooms___invitations___ignore']['requestBody']['content']['application/json']; +export type ChatRoomsInvitationsIgnoreResponse = operations['chat___rooms___invitations___ignore']['responses']['200']['content']['application/json']; +export type ChatRoomsInvitationsInboxRequest = operations['chat___rooms___invitations___inbox']['requestBody']['content']['application/json']; +export type ChatRoomsInvitationsInboxResponse = operations['chat___rooms___invitations___inbox']['responses']['200']['content']['application/json']; +export type ChatRoomsJoinRequest = operations['chat___rooms___join']['requestBody']['content']['application/json']; +export type ChatRoomsJoinResponse = operations['chat___rooms___join']['responses']['200']['content']['application/json']; +export type ChatRoomsJoiningRequest = operations['chat___rooms___joining']['requestBody']['content']['application/json']; +export type ChatRoomsJoiningResponse = operations['chat___rooms___joining']['responses']['200']['content']['application/json']; +export type ChatRoomsLeaveRequest = operations['chat___rooms___leave']['requestBody']['content']['application/json']; +export type ChatRoomsLeaveResponse = operations['chat___rooms___leave']['responses']['200']['content']['application/json']; +export type ChatRoomsMembersRequest = operations['chat___rooms___members']['requestBody']['content']['application/json']; +export type ChatRoomsMembersResponse = operations['chat___rooms___members']['responses']['200']['content']['application/json']; +export type ChatRoomsMuteRequest = operations['chat___rooms___mute']['requestBody']['content']['application/json']; +export type ChatRoomsMuteResponse = operations['chat___rooms___mute']['responses']['200']['content']['application/json']; +export type ChatRoomsOwnedRequest = operations['chat___rooms___owned']['requestBody']['content']['application/json']; +export type ChatRoomsOwnedResponse = operations['chat___rooms___owned']['responses']['200']['content']['application/json']; +export type ChatRoomsShowRequest = operations['chat___rooms___show']['requestBody']['content']['application/json']; +export type ChatRoomsShowResponse = operations['chat___rooms___show']['responses']['200']['content']['application/json']; +export type ChatRoomsUpdateRequest = operations['chat___rooms___update']['requestBody']['content']['application/json']; +export type ChatRoomsUpdateResponse = operations['chat___rooms___update']['responses']['200']['content']['application/json']; export type ClipsAddNoteRequest = operations['clips___add-note']['requestBody']['content']['application/json']; export type ClipsCreateRequest = operations['clips___create']['requestBody']['content']['application/json']; export type ClipsCreateResponse = operations['clips___create']['responses']['200']['content']['application/json']; diff --git a/packages/misskey-js/src/autogen/models.ts b/packages/misskey-js/src/autogen/models.ts index 1a30da4437..0ff9749602 100644 --- a/packages/misskey-js/src/autogen/models.ts +++ b/packages/misskey-js/src/autogen/models.ts @@ -54,3 +54,8 @@ export type MetaDetailedOnly = components['schemas']['MetaDetailedOnly']; export type MetaDetailed = components['schemas']['MetaDetailed']; export type SystemWebhook = components['schemas']['SystemWebhook']; export type AbuseReportNotificationRecipient = components['schemas']['AbuseReportNotificationRecipient']; +export type ChatMessage = components['schemas']['ChatMessage']; +export type ChatMessageLite = components['schemas']['ChatMessageLite']; +export type ChatRoom = components['schemas']['ChatRoom']; +export type ChatRoomInvitation = components['schemas']['ChatRoomInvitation']; +export type ChatRoomMembership = components['schemas']['ChatRoomMembership']; diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts index 743aaf1608..31bc34e473 100644 --- a/packages/misskey-js/src/autogen/types.ts +++ b/packages/misskey-js/src/autogen/types.ts @@ -1358,6 +1358,204 @@ export type paths = { */ post: operations['charts___users']; }; + '/chat/history': { + /** + * chat/history + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + post: operations['chat___history']; + }; + '/chat/messages/create-to-room': { + /** + * chat/messages/create-to-room + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + post: operations['chat___messages___create-to-room']; + }; + '/chat/messages/create-to-user': { + /** + * chat/messages/create-to-user + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + post: operations['chat___messages___create-to-user']; + }; + '/chat/messages/delete': { + /** + * chat/messages/delete + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + post: operations['chat___messages___delete']; + }; + '/chat/messages/react': { + /** + * chat/messages/react + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + post: operations['chat___messages___react']; + }; + '/chat/messages/room-timeline': { + /** + * chat/messages/room-timeline + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + post: operations['chat___messages___room-timeline']; + }; + '/chat/messages/search': { + /** + * chat/messages/search + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + post: operations['chat___messages___search']; + }; + '/chat/messages/show': { + /** + * chat/messages/show + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + post: operations['chat___messages___show']; + }; + '/chat/messages/user-timeline': { + /** + * chat/messages/user-timeline + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + post: operations['chat___messages___user-timeline']; + }; + '/chat/rooms/create': { + /** + * chat/rooms/create + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + post: operations['chat___rooms___create']; + }; + '/chat/rooms/delete': { + /** + * chat/rooms/delete + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + post: operations['chat___rooms___delete']; + }; + '/chat/rooms/invitations/create': { + /** + * chat/rooms/invitations/create + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + post: operations['chat___rooms___invitations___create']; + }; + '/chat/rooms/invitations/ignore': { + /** + * chat/rooms/invitations/ignore + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + post: operations['chat___rooms___invitations___ignore']; + }; + '/chat/rooms/invitations/inbox': { + /** + * chat/rooms/invitations/inbox + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + post: operations['chat___rooms___invitations___inbox']; + }; + '/chat/rooms/join': { + /** + * chat/rooms/join + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + post: operations['chat___rooms___join']; + }; + '/chat/rooms/joining': { + /** + * chat/rooms/joining + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + post: operations['chat___rooms___joining']; + }; + '/chat/rooms/leave': { + /** + * chat/rooms/leave + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + post: operations['chat___rooms___leave']; + }; + '/chat/rooms/members': { + /** + * chat/rooms/members + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + post: operations['chat___rooms___members']; + }; + '/chat/rooms/mute': { + /** + * chat/rooms/mute + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + post: operations['chat___rooms___mute']; + }; + '/chat/rooms/owned': { + /** + * chat/rooms/owned + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + post: operations['chat___rooms___owned']; + }; + '/chat/rooms/show': { + /** + * chat/rooms/show + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + post: operations['chat___rooms___show']; + }; + '/chat/rooms/update': { + /** + * chat/rooms/update + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + post: operations['chat___rooms___update']; + }; '/clips/add-note': { /** * clips/add-note @@ -2470,15 +2668,6 @@ export type paths = { */ post: operations['i___pin']; }; - '/i/read-all-unread-notes': { - /** - * i/read-all-unread-notes - * @description No description provided. - * - * **Credential required**: *Yes* / **Permission**: *write:account* - */ - post: operations['i___read-all-unread-notes']; - }; '/i/read-announcement': { /** * i/read-announcement @@ -3848,6 +4037,8 @@ export type components = { followingVisibility: 'public' | 'followers' | 'private'; /** @enum {string} */ followersVisibility: 'public' | 'followers' | 'private'; + /** @enum {string} */ + chatScope: 'everyone' | 'following' | 'followers' | 'mutual' | 'none'; roles: components['schemas']['RoleLite'][]; followedMessage?: string | null; memo: string | null; @@ -3894,6 +4085,7 @@ export type components = { unreadAnnouncements: components['schemas']['Announcement'][]; hasUnreadAntenna: boolean; hasUnreadChannel: boolean; + hasUnreadChatMessages: boolean; hasUnreadNotification: boolean; hasPendingReceivedFollowRequest: boolean; unreadNotificationsCount: number; @@ -4947,6 +5139,7 @@ export type components = { canImportFollowing: boolean; canImportMuting: boolean; canImportUserLists: boolean; + canChat: boolean; }; ReversiGameLite: { /** Format: id */ @@ -5146,6 +5339,69 @@ export type components = { systemWebhookId?: string; systemWebhook?: components['schemas']['SystemWebhook']; }; + ChatMessage: { + id: string; + /** Format: date-time */ + createdAt: string; + fromUserId: string; + fromUser: components['schemas']['UserLite']; + toUserId?: string | null; + toUser?: components['schemas']['UserLite'] | null; + toRoomId?: string | null; + toRoom?: components['schemas']['ChatRoom'] | null; + text?: string | null; + fileId?: string | null; + file?: components['schemas']['DriveFile'] | null; + isRead?: boolean; + reactions: ({ + reaction: string; + user?: components['schemas']['UserLite'] | null; + })[]; + }; + ChatMessageLite: { + id: string; + /** Format: date-time */ + createdAt: string; + fromUserId: string; + fromUser?: components['schemas']['UserLite']; + toUserId?: string | null; + toRoomId?: string | null; + text?: string | null; + fileId?: string | null; + file?: components['schemas']['DriveFile'] | null; + reactions: ({ + reaction: string; + user?: components['schemas']['UserLite'] | null; + })[]; + }; + ChatRoom: { + id: string; + /** Format: date-time */ + createdAt: string; + ownerId: string; + owner: components['schemas']['UserLite']; + name: string; + description: string; + isMuted?: boolean; + }; + ChatRoomInvitation: { + id: string; + /** Format: date-time */ + createdAt: string; + userId: string; + user: components['schemas']['UserLite']; + roomId: string; + room: components['schemas']['ChatRoom']; + }; + ChatRoomMembership: { + id: string; + /** Format: date-time */ + createdAt: string; + userId: string; + user?: components['schemas']['UserLite']; + roomId: string; + room?: components['schemas']['ChatRoom']; + }; }; responses: never; parameters: never; @@ -13670,26 +13926,28 @@ export type operations = { }; }; /** - * clips/add-note + * chat/history * @description No description provided. * - * **Credential required**: *Yes* / **Permission**: *write:account* + * **Credential required**: *Yes* / **Permission**: *read:chat* */ - 'clips___add-note': { + chat___history: { requestBody: { content: { 'application/json': { - /** Format: misskey:id */ - clipId: string; - /** Format: misskey:id */ - noteId: string; + /** @default 10 */ + limit?: number; + /** @default false */ + room?: boolean; }; }; }; responses: { - /** @description OK (without any results) */ - 204: { - content: never; + /** @description OK (with results) */ + 200: { + content: { + 'application/json': components['schemas']['ChatMessage'][]; + }; }; /** @description Client error */ 400: { @@ -13715,12 +13973,6 @@ export type operations = { 'application/json': components['schemas']['Error']; }; }; - /** @description Too many requests */ - 429: { - content: { - 'application/json': components['schemas']['Error']; - }; - }; /** @description Internal server error */ 500: { content: { @@ -13730,19 +13982,20 @@ export type operations = { }; }; /** - * clips/create + * chat/messages/create-to-room * @description No description provided. * - * **Credential required**: *Yes* / **Permission**: *write:account* + * **Credential required**: *Yes* / **Permission**: *write:chat* */ - clips___create: { + 'chat___messages___create-to-room': { requestBody: { content: { 'application/json': { - name: string; - /** @default false */ - isPublic?: boolean; - description?: string | null; + text?: string | null; + /** Format: misskey:id */ + fileId?: string; + /** Format: misskey:id */ + toRoomId: string; }; }; }; @@ -13750,7 +14003,7 @@ export type operations = { /** @description OK (with results) */ 200: { content: { - 'application/json': components['schemas']['Clip']; + 'application/json': components['schemas']['ChatMessageLite']; }; }; /** @description Client error */ @@ -13777,6 +14030,12 @@ export type operations = { 'application/json': components['schemas']['Error']; }; }; + /** @description Too many requests */ + 429: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; /** @description Internal server error */ 500: { content: { @@ -13786,24 +14045,29 @@ export type operations = { }; }; /** - * clips/delete + * chat/messages/create-to-user * @description No description provided. * - * **Credential required**: *Yes* / **Permission**: *write:account* + * **Credential required**: *Yes* / **Permission**: *write:chat* */ - clips___delete: { + 'chat___messages___create-to-user': { requestBody: { content: { 'application/json': { + text?: string | null; /** Format: misskey:id */ - clipId: string; + fileId?: string; + /** Format: misskey:id */ + toUserId: string; }; }; }; responses: { - /** @description OK (without any results) */ - 204: { - content: never; + /** @description OK (with results) */ + 200: { + content: { + 'application/json': components['schemas']['ChatMessageLite']; + }; }; /** @description Client error */ 400: { @@ -13829,6 +14093,12 @@ export type operations = { 'application/json': components['schemas']['Error']; }; }; + /** @description Too many requests */ + 429: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; /** @description Internal server error */ 500: { content: { @@ -13838,24 +14108,26 @@ export type operations = { }; }; /** - * clips/favorite + * chat/messages/delete * @description No description provided. * - * **Credential required**: *Yes* / **Permission**: *write:clip-favorite* + * **Credential required**: *Yes* / **Permission**: *write:chat* */ - clips___favorite: { + chat___messages___delete: { requestBody: { content: { 'application/json': { /** Format: misskey:id */ - clipId: string; + messageId: string; }; }; }; responses: { - /** @description OK (without any results) */ - 204: { - content: never; + /** @description OK (with results) */ + 200: { + content: { + 'application/json': unknown; + }; }; /** @description Client error */ 400: { @@ -13890,17 +14162,26 @@ export type operations = { }; }; /** - * clips/list + * chat/messages/react * @description No description provided. * - * **Credential required**: *Yes* / **Permission**: *read:account* + * **Credential required**: *Yes* / **Permission**: *write:chat* */ - clips___list: { + chat___messages___react: { + requestBody: { + content: { + 'application/json': { + /** Format: misskey:id */ + messageId: string; + reaction: string; + }; + }; + }; responses: { /** @description OK (with results) */ 200: { content: { - 'application/json': components['schemas']['Clip'][]; + 'application/json': unknown; }; }; /** @description Client error */ @@ -13936,17 +14217,31 @@ export type operations = { }; }; /** - * clips/my-favorites + * chat/messages/room-timeline * @description No description provided. * - * **Credential required**: *Yes* / **Permission**: *read:clip-favorite* + * **Credential required**: *Yes* / **Permission**: *read:chat* */ - 'clips___my-favorites': { + 'chat___messages___room-timeline': { + requestBody: { + content: { + 'application/json': { + /** @default 10 */ + limit?: number; + /** Format: misskey:id */ + sinceId?: string; + /** Format: misskey:id */ + untilId?: string; + /** Format: misskey:id */ + roomId: string; + }; + }; + }; responses: { /** @description OK (with results) */ 200: { content: { - 'application/json': components['schemas']['Clip'][]; + 'application/json': components['schemas']['ChatMessageLite'][]; }; }; /** @description Client error */ @@ -13982,17 +14277,1239 @@ export type operations = { }; }; /** - * clips/notes + * chat/messages/search * @description No description provided. * - * **Credential required**: *No* / **Permission**: *read:account* + * **Credential required**: *Yes* / **Permission**: *read:chat* */ - clips___notes: { + chat___messages___search: { requestBody: { content: { 'application/json': { - /** Format: misskey:id */ - clipId: string; + query: string; + /** @default 10 */ + limit?: number; + /** Format: misskey:id */ + userId?: string | null; + /** Format: misskey:id */ + roomId?: string | null; + }; + }; + }; + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': components['schemas']['ChatMessage'][]; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * chat/messages/show + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + chat___messages___show: { + requestBody: { + content: { + 'application/json': { + /** Format: misskey:id */ + messageId: string; + }; + }; + }; + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': components['schemas']['ChatMessage']; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * chat/messages/user-timeline + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + 'chat___messages___user-timeline': { + requestBody: { + content: { + 'application/json': { + /** @default 10 */ + limit?: number; + /** Format: misskey:id */ + sinceId?: string; + /** Format: misskey:id */ + untilId?: string; + /** Format: misskey:id */ + userId: string; + }; + }; + }; + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': components['schemas']['ChatMessageLite'][]; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * chat/rooms/create + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + chat___rooms___create: { + requestBody: { + content: { + 'application/json': { + name: string; + description?: string; + }; + }; + }; + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': components['schemas']['ChatRoom']; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Too many requests */ + 429: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * chat/rooms/delete + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + chat___rooms___delete: { + requestBody: { + content: { + 'application/json': { + /** Format: misskey:id */ + roomId: string; + }; + }; + }; + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': unknown; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * chat/rooms/invitations/create + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + chat___rooms___invitations___create: { + requestBody: { + content: { + 'application/json': { + /** Format: misskey:id */ + roomId: string; + /** Format: misskey:id */ + userId: string; + }; + }; + }; + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': components['schemas']['ChatRoomInvitation']; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Too many requests */ + 429: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * chat/rooms/invitations/ignore + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + chat___rooms___invitations___ignore: { + requestBody: { + content: { + 'application/json': { + /** Format: misskey:id */ + roomId: string; + }; + }; + }; + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': unknown; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * chat/rooms/invitations/inbox + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + chat___rooms___invitations___inbox: { + requestBody: { + content: { + 'application/json': { + /** @default 30 */ + limit?: number; + /** Format: misskey:id */ + sinceId?: string; + /** Format: misskey:id */ + untilId?: string; + }; + }; + }; + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': components['schemas']['ChatRoomInvitation'][]; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * chat/rooms/join + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + chat___rooms___join: { + requestBody: { + content: { + 'application/json': { + /** Format: misskey:id */ + roomId: string; + }; + }; + }; + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': unknown; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * chat/rooms/joining + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + chat___rooms___joining: { + requestBody: { + content: { + 'application/json': { + /** @default 30 */ + limit?: number; + /** Format: misskey:id */ + sinceId?: string; + /** Format: misskey:id */ + untilId?: string; + }; + }; + }; + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': components['schemas']['ChatRoomMembership'][]; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * chat/rooms/leave + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + chat___rooms___leave: { + requestBody: { + content: { + 'application/json': { + /** Format: misskey:id */ + roomId: string; + }; + }; + }; + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': unknown; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * chat/rooms/members + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + chat___rooms___members: { + requestBody: { + content: { + 'application/json': { + /** Format: misskey:id */ + roomId: string; + /** @default 30 */ + limit?: number; + /** Format: misskey:id */ + sinceId?: string; + /** Format: misskey:id */ + untilId?: string; + }; + }; + }; + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': components['schemas']['ChatRoomMembership'][]; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * chat/rooms/mute + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + chat___rooms___mute: { + requestBody: { + content: { + 'application/json': { + /** Format: misskey:id */ + roomId: string; + mute: boolean; + }; + }; + }; + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': unknown; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * chat/rooms/owned + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + chat___rooms___owned: { + requestBody: { + content: { + 'application/json': { + /** @default 30 */ + limit?: number; + /** Format: misskey:id */ + sinceId?: string; + /** Format: misskey:id */ + untilId?: string; + }; + }; + }; + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': components['schemas']['ChatRoom'][]; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * chat/rooms/show + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:chat* + */ + chat___rooms___show: { + requestBody: { + content: { + 'application/json': { + /** Format: misskey:id */ + roomId: string; + }; + }; + }; + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': components['schemas']['ChatRoom']; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * chat/rooms/update + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:chat* + */ + chat___rooms___update: { + requestBody: { + content: { + 'application/json': { + /** Format: misskey:id */ + roomId: string; + name?: string; + description?: string; + }; + }; + }; + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': components['schemas']['ChatRoom']; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * clips/add-note + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:account* + */ + 'clips___add-note': { + requestBody: { + content: { + 'application/json': { + /** Format: misskey:id */ + clipId: string; + /** Format: misskey:id */ + noteId: string; + }; + }; + }; + responses: { + /** @description OK (without any results) */ + 204: { + content: never; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Too many requests */ + 429: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * clips/create + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:account* + */ + clips___create: { + requestBody: { + content: { + 'application/json': { + name: string; + /** @default false */ + isPublic?: boolean; + description?: string | null; + }; + }; + }; + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': components['schemas']['Clip']; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * clips/delete + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:account* + */ + clips___delete: { + requestBody: { + content: { + 'application/json': { + /** Format: misskey:id */ + clipId: string; + }; + }; + }; + responses: { + /** @description OK (without any results) */ + 204: { + content: never; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * clips/favorite + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *write:clip-favorite* + */ + clips___favorite: { + requestBody: { + content: { + 'application/json': { + /** Format: misskey:id */ + clipId: string; + }; + }; + }; + responses: { + /** @description OK (without any results) */ + 204: { + content: never; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * clips/list + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:account* + */ + clips___list: { + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': components['schemas']['Clip'][]; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * clips/my-favorites + * @description No description provided. + * + * **Credential required**: *Yes* / **Permission**: *read:clip-favorite* + */ + 'clips___my-favorites': { + responses: { + /** @description OK (with results) */ + 200: { + content: { + 'application/json': components['schemas']['Clip'][]; + }; + }; + /** @description Client error */ + 400: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Authentication error */ + 401: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Forbidden error */ + 403: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description I'm Ai */ + 418: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + /** @description Internal server error */ + 500: { + content: { + 'application/json': components['schemas']['Error']; + }; + }; + }; + }; + /** + * clips/notes + * @description No description provided. + * + * **Credential required**: *No* / **Permission**: *read:account* + */ + clips___notes: { + requestBody: { + content: { + 'application/json': { + /** Format: misskey:id */ + clipId: string; /** @default 10 */ limit?: number; /** Format: misskey:id */ @@ -20279,50 +21796,6 @@ export type operations = { }; }; }; - /** - * i/read-all-unread-notes - * @description No description provided. - * - * **Credential required**: *Yes* / **Permission**: *write:account* - */ - 'i___read-all-unread-notes': { - responses: { - /** @description OK (without any results) */ - 204: { - content: never; - }; - /** @description Client error */ - 400: { - content: { - 'application/json': components['schemas']['Error']; - }; - }; - /** @description Authentication error */ - 401: { - content: { - 'application/json': components['schemas']['Error']; - }; - }; - /** @description Forbidden error */ - 403: { - content: { - 'application/json': components['schemas']['Error']; - }; - }; - /** @description I'm Ai */ - 418: { - content: { - 'application/json': components['schemas']['Error']; - }; - }; - /** @description Internal server error */ - 500: { - content: { - 'application/json': components['schemas']['Error']; - }; - }; - }; - }; /** * i/read-announcement * @description No description provided. @@ -21089,6 +22562,8 @@ export type operations = { followingVisibility?: 'public' | 'followers' | 'private'; /** @enum {string} */ followersVisibility?: 'public' | 'followers' | 'private'; + /** @enum {string} */ + chatScope?: 'everyone' | 'followers' | 'following' | 'mutual' | 'none'; /** Format: misskey:id */ pinnedPageId?: string | null; mutedWords?: (string[] | string)[]; diff --git a/packages/misskey-js/src/consts.ts b/packages/misskey-js/src/consts.ts index c5911a70eb..9d0fe5e781 100644 --- a/packages/misskey-js/src/consts.ts +++ b/packages/misskey-js/src/consts.ts @@ -37,8 +37,8 @@ export const permissions = [ 'write:favorites', 'read:following', 'write:following', - 'read:messaging', - 'write:messaging', + 'read:messaging', // deprecated + 'write:messaging', // deprecated 'read:mutes', 'write:mutes', 'write:notes', @@ -110,6 +110,8 @@ export const permissions = [ 'read:clip-favorite', 'read:federation', 'write:report-abuse', + 'write:chat', + 'read:chat', ] as const; export const moderationLogTypes = [ diff --git a/packages/misskey-js/src/streaming.types.ts b/packages/misskey-js/src/streaming.types.ts index 26a50f9fa4..8e5438eeb6 100644 --- a/packages/misskey-js/src/streaming.types.ts +++ b/packages/misskey-js/src/streaming.types.ts @@ -1,5 +1,6 @@ import { Antenna, + ChatMessage, DriveFile, DriveFolder, Note, @@ -46,13 +47,9 @@ export type Channels = { urlUploadFinished: (payload: { marker: string; file: DriveFile; }) => void; readAllNotifications: () => void; unreadNotification: (payload: Notification) => void; - unreadMention: (payload: Note['id']) => void; - readAllUnreadMentions: () => void; notificationFlushed: () => void; - unreadSpecifiedNote: (payload: Note['id']) => void; - readAllUnreadSpecifiedNotes: () => void; - readAllAntennas: () => void; unreadAntenna: (payload: Antenna) => void; + newChatMessage: (payload: ChatMessage) => void; readAllAnnouncements: () => void; myTokenRegenerated: () => void; signin: (payload: Signin) => void; diff --git a/packages/misskey-js/test/streaming.ts b/packages/misskey-js/test/streaming.ts index 06b55cd8af..7e784cd20c 100644 --- a/packages/misskey-js/test/streaming.ts +++ b/packages/misskey-js/test/streaming.ts @@ -42,26 +42,26 @@ describe('Streaming', () => { test('useChannel with parameters', async () => { const server = new WS('wss://misskey.test/streaming'); const stream = new Stream('https://misskey.test', { token: 'TOKEN' }); - const messagingChannelReceived: any[] = []; - const messaging = stream.useChannel('messaging', { otherparty: 'aaa' }); - messaging.on('message', payload => { - messagingChannelReceived.push(payload); + const chatChannelReceived: any[] = []; + const chat = stream.useChannel('chat', { other: 'aaa' }); + chat.on('message', payload => { + chatChannelReceived.push(payload); }); const ws = await server.connected; expect(new URLSearchParams(new URL(ws.url).search).get('i')).toEqual('TOKEN'); const msg = JSON.parse(await server.nextMessage as string); - const messagingChannelId = msg.body.id; + const chatChannelId = msg.body.id; expect(msg.type).toEqual('connect'); - expect(msg.body.channel).toEqual('messaging'); - expect(msg.body.params).toEqual({ otherparty: 'aaa' }); - expect(messagingChannelId != null).toEqual(true); + expect(msg.body.channel).toEqual('chat'); + expect(msg.body.params).toEqual({ other: 'aaa' }); + expect(chatChannelId != null).toEqual(true); server.send(JSON.stringify({ type: 'channel', body: { - id: messagingChannelId, + id: chatChannelId, type: 'message', body: { id: 'foo' @@ -69,7 +69,7 @@ describe('Streaming', () => { } })); - expect(messagingChannelReceived[0]).toEqual({ + expect(chatChannelReceived[0]).toEqual({ id: 'foo' }); @@ -81,20 +81,20 @@ describe('Streaming', () => { const server = new WS('wss://misskey.test/streaming'); const stream = new Stream('https://misskey.test', { token: 'TOKEN' }); - stream.useChannel('messaging', { otherparty: 'aaa' }); - stream.useChannel('messaging', { otherparty: 'bbb' }); + stream.useChannel('chat', { other: 'aaa' }); + stream.useChannel('chat', { other: 'bbb' }); const ws = await server.connected; expect(new URLSearchParams(new URL(ws.url).search).get('i')).toEqual('TOKEN'); const msg = JSON.parse(await server.nextMessage as string); - const messagingChannelId = msg.body.id; + const chatChannelId = msg.body.id; const msg2 = JSON.parse(await server.nextMessage as string); - const messagingChannelId2 = msg2.body.id; + const chatChannelId2 = msg2.body.id; - expect(messagingChannelId != null).toEqual(true); - expect(messagingChannelId2 != null).toEqual(true); - expect(messagingChannelId).not.toEqual(messagingChannelId2); + expect(chatChannelId != null).toEqual(true); + expect(chatChannelId2 != null).toEqual(true); + expect(chatChannelId).not.toEqual(chatChannelId2); stream.close(); server.close(); @@ -104,8 +104,8 @@ describe('Streaming', () => { const server = new WS('wss://misskey.test/streaming'); const stream = new Stream('https://misskey.test', { token: 'TOKEN' }); - const messaging = stream.useChannel('messaging', { otherparty: 'aaa' }); - messaging.send('read', { id: 'aaa' }); + const chat = stream.useChannel('chat', { other: 'aaa' }); + chat.send('read', { id: 'aaa' }); const ws = await server.connected; expect(new URLSearchParams(new URL(ws.url).search).get('i')).toEqual('TOKEN'); -- cgit v1.2.3-freya From 5513337198efdc3fed95a9a20d2da4d0d1af61c1 Mon Sep 17 00:00:00 2001 From: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Tue, 25 Mar 2025 08:02:06 +0900 Subject: fix(frontend): 本番環境で不必要なconsole.logを出さないように (#15702) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/components/MkPagination.vue | 2 +- packages/frontend/src/preferences/manager.ts | 8 ++++---- packages/frontend/src/preferences/utility.ts | 4 ++-- packages/frontend/src/router.ts | 2 +- packages/frontend/src/tab-id.ts | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'packages/frontend/src') diff --git a/packages/frontend/src/components/MkPagination.vue b/packages/frontend/src/components/MkPagination.vue index a729619180..d90db1748c 100644 --- a/packages/frontend/src/components/MkPagination.vue +++ b/packages/frontend/src/components/MkPagination.vue @@ -380,7 +380,7 @@ function prepend(item: MisskeyEntity): void { return; } - console.log(isHead(), isPausingUpdate); + if (_DEV_) console.log(isHead(), isPausingUpdate); if (isHead() && !isPausingUpdate) unshiftItems([item]); else prependQueue(item); diff --git a/packages/frontend/src/preferences/manager.ts b/packages/frontend/src/preferences/manager.ts index 037d6a6bd1..f96aa2f368 100644 --- a/packages/frontend/src/preferences/manager.ts +++ b/packages/frontend/src/preferences/manager.ts @@ -142,11 +142,11 @@ export class PreferencesManager { const v = JSON.parse(JSON.stringify(value)); // deep copy 兼 vueのプロキシ解除 if (deepEqual(this.s[key], v)) { - console.log('(skip) prefer:commit', key, v); + if (_DEV_) console.log('(skip) prefer:commit', key, v); return; } - console.log('prefer:commit', key, v); + if (_DEV_) console.log('prefer:commit', key, v); this.rewriteRawState(key, v); @@ -250,13 +250,13 @@ export class PreferencesManager { if (!deepEqual(cloudValue, record[1])) { this.rewriteRawState(key, cloudValue); record[1] = cloudValue; - console.log('cloud fetched', key, cloudValue); + if (_DEV_) console.log('cloud fetched', key, cloudValue); } } } this.save(); - console.log('cloud fetch completed'); + if (_DEV_) console.log('cloud fetch completed'); } public static newProfile(): PreferencesProfile { diff --git a/packages/frontend/src/preferences/utility.ts b/packages/frontend/src/preferences/utility.ts index 7229b7348e..adba908c3c 100644 --- a/packages/frontend/src/preferences/utility.ts +++ b/packages/frontend/src/preferences/utility.ts @@ -153,7 +153,7 @@ export async function restoreFromCloudBackup() { scope: ['client', 'preferences', 'backups'], }); - console.log(keys); + if (_DEV_) console.log(keys); if (keys.length === 0) { os.alert({ @@ -179,7 +179,7 @@ export async function restoreFromCloudBackup() { key: select.result, }); - console.log(profile); + if (_DEV_) console.log(profile); miLocalStorage.setItem('preferences', JSON.stringify(profile)); miLocalStorage.setItem('hidePreferencesRestoreSuggestion', 'true'); diff --git a/packages/frontend/src/router.ts b/packages/frontend/src/router.ts index 3b79569995..d702da80fa 100644 --- a/packages/frontend/src/router.ts +++ b/packages/frontend/src/router.ts @@ -32,7 +32,7 @@ mainRouter.addListener('replace', ctx => { }); mainRouter.addListener('change', ctx => { - console.log('mainRouter: change', ctx.fullPath); + if (_DEV_) console.log('mainRouter: change', ctx.fullPath); analytics.page({ path: ctx.fullPath, title: ctx.fullPath, diff --git a/packages/frontend/src/tab-id.ts b/packages/frontend/src/tab-id.ts index e2e4f69eea..49b69f72d2 100644 --- a/packages/frontend/src/tab-id.ts +++ b/packages/frontend/src/tab-id.ts @@ -8,4 +8,4 @@ import { v4 as uuid } from 'uuid'; // HMR有効時にバグか知らんけど複数回実行されるのでその対策 export const TAB_ID = window.sessionStorage.getItem('TAB_ID') ?? uuid(); window.sessionStorage.setItem('TAB_ID', TAB_ID); -console.log('TAB_ID', TAB_ID); +if (_DEV_) console.log('TAB_ID', TAB_ID); -- cgit v1.2.3-freya From 8d6573fbec5f179e18e2522fe86f8c998e39ad75 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Tue, 25 Mar 2025 08:38:53 +0900 Subject: enhance(frontend): 設定の移行を手動でトリガーできるように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/index.d.ts | 8 ++ locales/ja-JP.yml | 2 + packages/frontend/src/boot/main-boot.ts | 137 +----------------------- packages/frontend/src/pages/settings/other.vue | 14 +++ packages/frontend/src/pref-migrate.ts | 142 +++++++++++++++++++++++++ 5 files changed, 170 insertions(+), 133 deletions(-) create mode 100644 packages/frontend/src/pref-migrate.ts (limited to 'packages/frontend/src') diff --git a/locales/index.d.ts b/locales/index.d.ts index 9ef6f9aa39..560335bf35 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -5350,6 +5350,14 @@ export interface Locale extends ILocale { * チャット */ "chat": string; + /** + * 旧設定情報を移行 + */ + "migrateOldSettings": string; + /** + * 通常これは自動で行われていますが、何らかの理由により上手く移行されなかった場合は手動で移行処理をトリガーできます。現在の設定情報は上書きされます。 + */ + "migrateOldSettings_description": string; "_chat": { /** * まだメッセージはありません diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index fccf24e759..9b4d74fbfb 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1333,6 +1333,8 @@ postForm: "投稿フォーム" textCount: "文字数" information: "情報" chat: "チャット" +migrateOldSettings: "旧設定情報を移行" +migrateOldSettings_description: "通常これは自動で行われていますが、何らかの理由により上手く移行されなかった場合は手動で移行処理をトリガーできます。現在の設定情報は上書きされます。" _chat: noMessagesYet: "まだメッセージはありません" diff --git a/packages/frontend/src/boot/main-boot.ts b/packages/frontend/src/boot/main-boot.ts index 19371dff0e..58873f684e 100644 --- a/packages/frontend/src/boot/main-boot.ts +++ b/packages/frontend/src/boot/main-boot.ts @@ -6,19 +6,17 @@ import { createApp, defineAsyncComponent, markRaw } from 'vue'; import { ui } from '@@/js/config.js'; import * as Misskey from 'misskey-js'; -import { v4 as uuid } from 'uuid'; import { compareVersions } from 'compare-versions'; import { common } from './common.js'; import type { Component } from 'vue'; import type { Keymap } from '@/utility/hotkey.js'; -import type { DeckProfile } from '@/deck.js'; import { i18n } from '@/i18n.js'; -import { alert, confirm, popup, post, toast } from '@/os.js'; +import { alert, confirm, popup, post } from '@/os.js'; import { useStream } from '@/stream.js'; import * as sound from '@/utility/sound.js'; import { $i } from '@/i.js'; import { instance } from '@/instance.js'; -import { ColdDeviceStorage, store } from '@/store.js'; +import { store } from '@/store.js'; import { reactionPicker } from '@/utility/reaction-picker.js'; import { miLocalStorage } from '@/local-storage.js'; import { claimAchievement, claimedAchievements } from '@/utility/achievements.js'; @@ -28,12 +26,10 @@ import { mainRouter } from '@/router.js'; import { makeHotkey } from '@/utility/hotkey.js'; import { addCustomEmoji, removeCustomEmojis, updateCustomEmojis } from '@/custom-emojis.js'; import { prefer } from '@/preferences.js'; -import { misskeyApi } from '@/utility/misskey-api.js'; -import { deckStore } from '@/ui/deck/deck-store.js'; import { launchPlugins } from '@/plugin.js'; -import { unisonReload } from '@/utility/unison-reload.js'; import { updateCurrentAccountPartial } from '@/accounts.js'; import { signout } from '@/signout.js'; +import { migrateOldSettings } from '@/pref-migrate.js'; export async function mainBoot() { const { isClientUpdated, lastVersion } = await common(() => { @@ -82,132 +78,7 @@ export async function mainBoot() { if (lastVersion && (compareVersions('2025.3.2-alpha.0', lastVersion) === 1)) { console.log('Preferences migration'); - store.loaded.then(async () => { - const themes = await misskeyApi('i/registry/get', { scope: ['client'], key: 'themes' }).catch(() => []); - if (themes.length > 0) { - prefer.commit('themes', themes); - } - - const plugins = ColdDeviceStorage.get('plugins'); - prefer.commit('plugins', plugins.map(p => ({ - ...p, - installId: (p as any).id, - id: undefined, - }))); - - prefer.commit('deck.profile', deckStore.s.profile); - misskeyApi('i/registry/keys', { - scope: ['client', 'deck', 'profiles'], - }).then(async keys => { - const profiles: DeckProfile[] = []; - for (const key of keys) { - const deck = await misskeyApi('i/registry/get', { - scope: ['client', 'deck', 'profiles'], - key: key, - }); - profiles.push({ - id: uuid(), - name: key, - columns: deck.columns, - layout: deck.layout, - }); - } - prefer.commit('deck.profiles', profiles); - }); - - prefer.commit('lightTheme', ColdDeviceStorage.get('lightTheme')); - prefer.commit('darkTheme', ColdDeviceStorage.get('darkTheme')); - prefer.commit('syncDeviceDarkMode', ColdDeviceStorage.get('syncDeviceDarkMode')); - prefer.commit('emojiPalettes', [{ - id: 'reactions', - name: '', - emojis: store.s.reactions, - }, { - id: 'pinnedEmojis', - name: '', - emojis: store.s.pinnedEmojis, - }]); - prefer.commit('emojiPaletteForMain', 'pinnedEmojis'); - prefer.commit('emojiPaletteForReaction', 'reactions'); - prefer.commit('overridedDeviceKind', store.s.overridedDeviceKind); - prefer.commit('widgets', store.s.widgets); - prefer.commit('keepCw', store.s.keepCw); - prefer.commit('collapseRenotes', store.s.collapseRenotes); - prefer.commit('rememberNoteVisibility', store.s.rememberNoteVisibility); - prefer.commit('uploadFolder', store.s.uploadFolder); - prefer.commit('keepOriginalUploading', store.s.keepOriginalUploading); - prefer.commit('menu', store.s.menu); - prefer.commit('statusbars', store.s.statusbars); - prefer.commit('pinnedUserLists', store.s.pinnedUserLists); - prefer.commit('serverDisconnectedBehavior', store.s.serverDisconnectedBehavior); - prefer.commit('nsfw', store.s.nsfw); - prefer.commit('highlightSensitiveMedia', store.s.highlightSensitiveMedia); - prefer.commit('animation', store.s.animation); - prefer.commit('animatedMfm', store.s.animatedMfm); - prefer.commit('advancedMfm', store.s.advancedMfm); - prefer.commit('showReactionsCount', store.s.showReactionsCount); - prefer.commit('enableQuickAddMfmFunction', store.s.enableQuickAddMfmFunction); - prefer.commit('loadRawImages', store.s.loadRawImages); - prefer.commit('imageNewTab', store.s.imageNewTab); - prefer.commit('disableShowingAnimatedImages', store.s.disableShowingAnimatedImages); - prefer.commit('emojiStyle', store.s.emojiStyle); - prefer.commit('menuStyle', store.s.menuStyle); - prefer.commit('useBlurEffectForModal', store.s.useBlurEffectForModal); - prefer.commit('useBlurEffect', store.s.useBlurEffect); - prefer.commit('showFixedPostForm', store.s.showFixedPostForm); - prefer.commit('showFixedPostFormInChannel', store.s.showFixedPostFormInChannel); - prefer.commit('enableInfiniteScroll', store.s.enableInfiniteScroll); - prefer.commit('useReactionPickerForContextMenu', store.s.useReactionPickerForContextMenu); - prefer.commit('showGapBetweenNotesInTimeline', store.s.showGapBetweenNotesInTimeline); - prefer.commit('instanceTicker', store.s.instanceTicker); - prefer.commit('emojiPickerScale', store.s.emojiPickerScale); - prefer.commit('emojiPickerWidth', store.s.emojiPickerWidth); - prefer.commit('emojiPickerHeight', store.s.emojiPickerHeight); - prefer.commit('emojiPickerStyle', store.s.emojiPickerStyle); - prefer.commit('reportError', store.s.reportError); - prefer.commit('squareAvatars', store.s.squareAvatars); - prefer.commit('showAvatarDecorations', store.s.showAvatarDecorations); - prefer.commit('numberOfPageCache', store.s.numberOfPageCache); - prefer.commit('showNoteActionsOnlyHover', store.s.showNoteActionsOnlyHover); - prefer.commit('showClipButtonInNoteFooter', store.s.showClipButtonInNoteFooter); - prefer.commit('reactionsDisplaySize', store.s.reactionsDisplaySize); - prefer.commit('limitWidthOfReaction', store.s.limitWidthOfReaction); - prefer.commit('forceShowAds', store.s.forceShowAds); - prefer.commit('aiChanMode', store.s.aiChanMode); - prefer.commit('devMode', store.s.devMode); - prefer.commit('mediaListWithOneImageAppearance', store.s.mediaListWithOneImageAppearance); - prefer.commit('notificationPosition', store.s.notificationPosition); - prefer.commit('notificationStackAxis', store.s.notificationStackAxis); - prefer.commit('enableCondensedLine', store.s.enableCondensedLine); - prefer.commit('keepScreenOn', store.s.keepScreenOn); - prefer.commit('disableStreamingTimeline', store.s.disableStreamingTimeline); - prefer.commit('useGroupedNotifications', store.s.useGroupedNotifications); - prefer.commit('dataSaver', store.s.dataSaver); - prefer.commit('enableSeasonalScreenEffect', store.s.enableSeasonalScreenEffect); - prefer.commit('enableHorizontalSwipe', store.s.enableHorizontalSwipe); - prefer.commit('useNativeUiForVideoAudioPlayer', store.s.useNativeUIForVideoAudioPlayer); - prefer.commit('keepOriginalFilename', store.s.keepOriginalFilename); - prefer.commit('alwaysConfirmFollow', store.s.alwaysConfirmFollow); - prefer.commit('confirmWhenRevealingSensitiveMedia', store.s.confirmWhenRevealingSensitiveMedia); - prefer.commit('contextMenu', store.s.contextMenu); - prefer.commit('skipNoteRender', store.s.skipNoteRender); - prefer.commit('showSoftWordMutedWord', store.s.showSoftWordMutedWord); - prefer.commit('confirmOnReact', store.s.confirmOnReact); - prefer.commit('defaultFollowWithReplies', store.s.defaultWithReplies); - prefer.commit('sound.masterVolume', store.s.sound_masterVolume); - prefer.commit('sound.notUseSound', store.s.sound_notUseSound); - prefer.commit('sound.useSoundOnlyWhenActive', store.s.sound_useSoundOnlyWhenActive); - prefer.commit('sound.on.note', store.s.sound_note as any); - prefer.commit('sound.on.noteMy', store.s.sound_noteMy as any); - prefer.commit('sound.on.notification', store.s.sound_notification as any); - prefer.commit('sound.on.reaction', store.s.sound_reaction as any); - prefer.commit('defaultNoteVisibility', store.s.defaultNoteVisibility); - prefer.commit('defaultNoteLocalOnly', store.s.defaultNoteLocalOnly); - - window.setTimeout(() => { - unisonReload(); - }, 5000); - }); + migrateOldSettings(); } } diff --git a/packages/frontend/src/pages/settings/other.vue b/packages/frontend/src/pages/settings/other.vue index d81c6fc93d..6736572e0b 100644 --- a/packages/frontend/src/pages/settings/other.vue +++ b/packages/frontend/src/pages/settings/other.vue @@ -115,6 +115,13 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.registry }} + +
+ + + {{ i18n.ts.migrateOldSettings }} + +
@@ -128,6 +135,7 @@ import MkFolder from '@/components/MkFolder.vue'; import FormInfo from '@/components/MkInfo.vue'; import MkKeyValue from '@/components/MkKeyValue.vue'; import MkButton from '@/components/MkButton.vue'; +import FormSlot from '@/components/form/slot.vue'; import * as os from '@/os.js'; import { misskeyApi } from '@/utility/misskey-api.js'; import { ensureSignin } from '@/i.js'; @@ -138,6 +146,7 @@ import FormSection from '@/components/form/section.vue'; import { prefer } from '@/preferences.js'; import MkRolePreview from '@/components/MkRolePreview.vue'; import { signout } from '@/signout.js'; +import { migrateOldSettings } from '@/pref-migrate.js'; const $i = ensureSignin(); @@ -175,6 +184,11 @@ async function deleteAccount() { await signout(); } +function migrate() { + os.waiting(); + migrateOldSettings(); +} + const headerActions = computed(() => []); const headerTabs = computed(() => []); diff --git a/packages/frontend/src/pref-migrate.ts b/packages/frontend/src/pref-migrate.ts new file mode 100644 index 0000000000..beeaac8383 --- /dev/null +++ b/packages/frontend/src/pref-migrate.ts @@ -0,0 +1,142 @@ +/* + * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { v4 as uuid } from 'uuid'; +import type { DeckProfile } from '@/deck.js'; +import { ColdDeviceStorage, store } from '@/store.js'; +import { prefer } from '@/preferences.js'; +import { misskeyApi } from '@/utility/misskey-api.js'; +import { deckStore } from '@/ui/deck/deck-store.js'; +import { unisonReload } from '@/utility/unison-reload.js'; + +// TODO: そのうち消す +export function migrateOldSettings() { + store.loaded.then(async () => { + const themes = await misskeyApi('i/registry/get', { scope: ['client'], key: 'themes' }).catch(() => []); + if (themes.length > 0) { + prefer.commit('themes', themes); + } + + const plugins = ColdDeviceStorage.get('plugins'); + prefer.commit('plugins', plugins.map(p => ({ + ...p, + installId: (p as any).id, + id: undefined, + }))); + + prefer.commit('deck.profile', deckStore.s.profile); + misskeyApi('i/registry/keys', { + scope: ['client', 'deck', 'profiles'], + }).then(async keys => { + const profiles: DeckProfile[] = []; + for (const key of keys) { + const deck = await misskeyApi('i/registry/get', { + scope: ['client', 'deck', 'profiles'], + key: key, + }); + profiles.push({ + id: uuid(), + name: key, + columns: deck.columns, + layout: deck.layout, + }); + } + prefer.commit('deck.profiles', profiles); + }); + + prefer.commit('lightTheme', ColdDeviceStorage.get('lightTheme')); + prefer.commit('darkTheme', ColdDeviceStorage.get('darkTheme')); + prefer.commit('syncDeviceDarkMode', ColdDeviceStorage.get('syncDeviceDarkMode')); + prefer.commit('emojiPalettes', [{ + id: 'reactions', + name: '', + emojis: store.s.reactions, + }, { + id: 'pinnedEmojis', + name: '', + emojis: store.s.pinnedEmojis, + }]); + prefer.commit('emojiPaletteForMain', 'pinnedEmojis'); + prefer.commit('emojiPaletteForReaction', 'reactions'); + prefer.commit('overridedDeviceKind', store.s.overridedDeviceKind); + prefer.commit('widgets', store.s.widgets); + prefer.commit('keepCw', store.s.keepCw); + prefer.commit('collapseRenotes', store.s.collapseRenotes); + prefer.commit('rememberNoteVisibility', store.s.rememberNoteVisibility); + prefer.commit('uploadFolder', store.s.uploadFolder); + prefer.commit('keepOriginalUploading', store.s.keepOriginalUploading); + prefer.commit('menu', store.s.menu); + prefer.commit('statusbars', store.s.statusbars); + prefer.commit('pinnedUserLists', store.s.pinnedUserLists); + prefer.commit('serverDisconnectedBehavior', store.s.serverDisconnectedBehavior); + prefer.commit('nsfw', store.s.nsfw); + prefer.commit('highlightSensitiveMedia', store.s.highlightSensitiveMedia); + prefer.commit('animation', store.s.animation); + prefer.commit('animatedMfm', store.s.animatedMfm); + prefer.commit('advancedMfm', store.s.advancedMfm); + prefer.commit('showReactionsCount', store.s.showReactionsCount); + prefer.commit('enableQuickAddMfmFunction', store.s.enableQuickAddMfmFunction); + prefer.commit('loadRawImages', store.s.loadRawImages); + prefer.commit('imageNewTab', store.s.imageNewTab); + prefer.commit('disableShowingAnimatedImages', store.s.disableShowingAnimatedImages); + prefer.commit('emojiStyle', store.s.emojiStyle); + prefer.commit('menuStyle', store.s.menuStyle); + prefer.commit('useBlurEffectForModal', store.s.useBlurEffectForModal); + prefer.commit('useBlurEffect', store.s.useBlurEffect); + prefer.commit('showFixedPostForm', store.s.showFixedPostForm); + prefer.commit('showFixedPostFormInChannel', store.s.showFixedPostFormInChannel); + prefer.commit('enableInfiniteScroll', store.s.enableInfiniteScroll); + prefer.commit('useReactionPickerForContextMenu', store.s.useReactionPickerForContextMenu); + prefer.commit('showGapBetweenNotesInTimeline', store.s.showGapBetweenNotesInTimeline); + prefer.commit('instanceTicker', store.s.instanceTicker); + prefer.commit('emojiPickerScale', store.s.emojiPickerScale); + prefer.commit('emojiPickerWidth', store.s.emojiPickerWidth); + prefer.commit('emojiPickerHeight', store.s.emojiPickerHeight); + prefer.commit('emojiPickerStyle', store.s.emojiPickerStyle); + prefer.commit('reportError', store.s.reportError); + prefer.commit('squareAvatars', store.s.squareAvatars); + prefer.commit('showAvatarDecorations', store.s.showAvatarDecorations); + prefer.commit('numberOfPageCache', store.s.numberOfPageCache); + prefer.commit('showNoteActionsOnlyHover', store.s.showNoteActionsOnlyHover); + prefer.commit('showClipButtonInNoteFooter', store.s.showClipButtonInNoteFooter); + prefer.commit('reactionsDisplaySize', store.s.reactionsDisplaySize); + prefer.commit('limitWidthOfReaction', store.s.limitWidthOfReaction); + prefer.commit('forceShowAds', store.s.forceShowAds); + prefer.commit('aiChanMode', store.s.aiChanMode); + prefer.commit('devMode', store.s.devMode); + prefer.commit('mediaListWithOneImageAppearance', store.s.mediaListWithOneImageAppearance); + prefer.commit('notificationPosition', store.s.notificationPosition); + prefer.commit('notificationStackAxis', store.s.notificationStackAxis); + prefer.commit('enableCondensedLine', store.s.enableCondensedLine); + prefer.commit('keepScreenOn', store.s.keepScreenOn); + prefer.commit('disableStreamingTimeline', store.s.disableStreamingTimeline); + prefer.commit('useGroupedNotifications', store.s.useGroupedNotifications); + prefer.commit('dataSaver', store.s.dataSaver); + prefer.commit('enableSeasonalScreenEffect', store.s.enableSeasonalScreenEffect); + prefer.commit('enableHorizontalSwipe', store.s.enableHorizontalSwipe); + prefer.commit('useNativeUiForVideoAudioPlayer', store.s.useNativeUIForVideoAudioPlayer); + prefer.commit('keepOriginalFilename', store.s.keepOriginalFilename); + prefer.commit('alwaysConfirmFollow', store.s.alwaysConfirmFollow); + prefer.commit('confirmWhenRevealingSensitiveMedia', store.s.confirmWhenRevealingSensitiveMedia); + prefer.commit('contextMenu', store.s.contextMenu); + prefer.commit('skipNoteRender', store.s.skipNoteRender); + prefer.commit('showSoftWordMutedWord', store.s.showSoftWordMutedWord); + prefer.commit('confirmOnReact', store.s.confirmOnReact); + prefer.commit('defaultFollowWithReplies', store.s.defaultWithReplies); + prefer.commit('sound.masterVolume', store.s.sound_masterVolume); + prefer.commit('sound.notUseSound', store.s.sound_notUseSound); + prefer.commit('sound.useSoundOnlyWhenActive', store.s.sound_useSoundOnlyWhenActive); + prefer.commit('sound.on.note', store.s.sound_note as any); + prefer.commit('sound.on.noteMy', store.s.sound_noteMy as any); + prefer.commit('sound.on.notification', store.s.sound_notification as any); + prefer.commit('sound.on.reaction', store.s.sound_reaction as any); + prefer.commit('defaultNoteVisibility', store.s.defaultNoteVisibility); + prefer.commit('defaultNoteLocalOnly', store.s.defaultNoteLocalOnly); + + window.setTimeout(() => { + unisonReload(); + }, 5000); + }); +} -- cgit v1.2.3-freya