diff --git a/packages/backend/migration/1696604572677-poll-vote-poll.js b/packages/backend/migration/1696604572677-poll-vote-poll.js index da52904565..4c9c786435 100644 --- a/packages/backend/migration/1696604572677-poll-vote-poll.js +++ b/packages/backend/migration/1696604572677-poll-vote-poll.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: syuilo and misskey-project and cherrypick-contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class PollVotePoll1696604572677 { name = 'PollVotePoll1696604572677'; diff --git a/packages/backend/migration/1697737204579-deleteCreatedAt.js b/packages/backend/migration/1697737204579-deleteCreatedAt.js index 8f801e7913..4f29d9e1b4 100644 --- a/packages/backend/migration/1697737204579-deleteCreatedAt.js +++ b/packages/backend/migration/1697737204579-deleteCreatedAt.js @@ -1,3 +1,7 @@ +/* + * SPDX-FileCopyrightText: syuilo and misskey-project and cherrypick-contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ export class DeleteCreatedAt1697737204579 { name = 'DeleteCreatedAt1697737204579' diff --git a/packages/backend/migration/1699432324194-remoteAvaterDecoration.js b/packages/backend/migration/1699432324194-remoteAvaterDecoration.js index 5b2762b476..3b6a6f7608 100644 --- a/packages/backend/migration/1699432324194-remoteAvaterDecoration.js +++ b/packages/backend/migration/1699432324194-remoteAvaterDecoration.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: syuilo and misskey-project and cherrypick-contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class RemoteAvaterDecoration1699432324194 { name = 'RemoteAvaterDecoration1699432324194' diff --git a/packages/backend/migration/1704185628000-note-updated-at2.js b/packages/backend/migration/1704185628000-note-updated-at2.js index b3fee061e4..b37746aab4 100644 --- a/packages/backend/migration/1704185628000-note-updated-at2.js +++ b/packages/backend/migration/1704185628000-note-updated-at2.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: syuilo and misskey-project and cherrypick-contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class NoteUpdatedAt1704185628000 { name = 'NoteUpdatedAt1704185628000' diff --git a/packages/backend/package.json b/packages/backend/package.json index c281fe1061..f6d26b55b4 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -19,7 +19,7 @@ "watch": "node ./scripts/watch.mjs", "restart": "pnpm build && pnpm start", "dev": "node ./scripts/dev.mjs", - "typecheck": "tsc --noEmit && tsc -p test --noEmit", + "typecheck": "tsc --noEmit", "eslint": "eslint --quiet \"src/**/*.ts\"", "lint": "pnpm typecheck && pnpm eslint", "jest": "cross-env NODE_ENV=test node --experimental-vm-modules --experimental-import-meta-resolve node_modules/jest/bin/jest.js --forceExit --config jest.config.unit.cjs", @@ -66,8 +66,8 @@ "utf-8-validate": "6.0.3" }, "dependencies": { - "@aws-sdk/client-s3": "3.412.0", - "@aws-sdk/lib-storage": "3.412.0", + "@aws-sdk/client-s3": "3.540.0", + "@aws-sdk/lib-storage": "3.413.0", "@bull-board/api": "5.14.2", "@bull-board/fastify": "5.14.2", "@bull-board/ui": "5.14.2", diff --git a/packages/backend/src/core/AntennaService.ts b/packages/backend/src/core/AntennaService.ts index 20903130b7..1ff4ca4d86 100644 --- a/packages/backend/src/core/AntennaService.ts +++ b/packages/backend/src/core/AntennaService.ts @@ -18,6 +18,7 @@ import { bindThis } from '@/decorators.js'; import type { GlobalEvents } from '@/core/GlobalEventService.js'; import { FanoutTimelineService } from '@/core/FanoutTimelineService.js'; import type { OnApplicationShutdown } from '@nestjs/common'; +import { deserializeAntenna } from './deserializeAntenna.js'; @Injectable() export class AntennaService implements OnApplicationShutdown { @@ -58,30 +59,14 @@ export class AntennaService implements OnApplicationShutdown { const { type, body } = obj.message as GlobalEvents['internal']['payload']; switch (type) { case 'antennaCreated': - this.antennas.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい - ...body, - lastUsedAt: new Date(body.lastUsedAt), - user: null, // joinなカラムは通常取ってこないので - userList: null, // joinなカラムは通常取ってこないので - }); + this.antennas.push(deserializeAntenna(body)); break; case 'antennaUpdated': { const idx = this.antennas.findIndex(a => a.id === body.id); if (idx >= 0) { - this.antennas[idx] = { // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい - ...body, - lastUsedAt: new Date(body.lastUsedAt), - user: null, // joinなカラムは通常取ってこないので - userList: null, // joinなカラムは通常取ってこないので - }; + this.antennas[idx] = deserializeAntenna(body); } else { - // サーバ起動時にactiveじゃなかった場合、リストに持っていないので追加する必要あり - this.antennas.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい - ...body, - lastUsedAt: new Date(body.lastUsedAt), - user: null, // joinなカラムは通常取ってこないので - userList: null, // joinなカラムは通常取ってこないので - }); + this.antennas.push(deserializeAntenna(body)); } } break; diff --git a/packages/backend/src/core/deserializeAntenna.ts b/packages/backend/src/core/deserializeAntenna.ts new file mode 100644 index 0000000000..0afe079bea --- /dev/null +++ b/packages/backend/src/core/deserializeAntenna.ts @@ -0,0 +1,15 @@ +/* + * SPDX-FileCopyrightText: cherrypick-contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import type { MiAntenna } from '@/models/Antenna.js'; + +export function deserializeAntenna(body: any): MiAntenna { + return { + ...body, + lastUsedAt: new Date(body.lastUsedAt), + user: null, + userList: null, + }; +} diff --git a/packages/backend/src/models/json-schema/role.ts b/packages/backend/src/models/json-schema/role.ts index c770250503..dfa941b29b 100644 --- a/packages/backend/src/models/json-schema/role.ts +++ b/packages/backend/src/models/json-schema/role.ts @@ -251,6 +251,10 @@ export const packedRolePoliciesSchema = { type: 'integer', optional: false, nullable: false, }, + canEditNote: { + type: 'boolean', + optional: false, nullable: false, + }, }, } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/create.ts b/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/create.ts index 8530d69480..7432b23c40 100644 --- a/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/create.ts @@ -13,41 +13,45 @@ import { IdService } from '@/core/IdService.js'; export const meta = { tags: ['admin'], - requireCredential: true, - + secure: true, requireAdmin: true, - + kind: 'arr-create', // ここにkindプロパティを追加 res: { type: 'object', properties: { name: { type: 'string', - nullable: false, optional: false, + nullable: false, + optional: false, }, targetUserPattern: { type: 'string', - nullable: true, optional: false, + nullable: true, + optional: false, }, reporterPattern: { type: 'string', - nullable: true, optional: false, + nullable: true, + optional: false, }, reportContentPattern: { type: 'string', - nullable: true, optional: false, + nullable: true, + optional: false, }, expiresAt: { type: 'string', - nullable: false, optional: false, + nullable: false, + optional: false, }, forward: { type: 'boolean', - nullable: false, optional: false, + nullable: false, + optional: false, }, }, }, - errors: { invalidRegularExpressionForTargetUser: { message: 'Invalid regular expression for target user.', @@ -116,12 +120,12 @@ export default class extends Endpoint { const previousMonth = expirationDate.getUTCMonth(); (ps.expiresAt === '1hour' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 hour')); } : ps.expiresAt === '12hours' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('12 hours')); } : - ps.expiresAt === '1day' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 day')); } : - ps.expiresAt === '1week' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 week')); } : - ps.expiresAt === '1month' ? function () { expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 1 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 1 + 1) / 12))); } : - ps.expiresAt === '3months' ? function () {expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 3 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 3 + 1) / 12))); } : - ps.expiresAt === '6months' ? function () { expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 6 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 6 + 1) / 12))); } : - ps.expiresAt === '1year' ? function () { expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + 1); } : function () { expirationDate = null; })(); + ps.expiresAt === '1day' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 day')); } : + ps.expiresAt === '1week' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 week')); } : + ps.expiresAt === '1month' ? function () { expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 1 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 1 + 1) / 12))); } : + ps.expiresAt === '3months' ? function () {expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 3 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 3 + 1) / 12))); } : + ps.expiresAt === '6months' ? function () { expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 6 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 6 + 1) / 12))); } : + ps.expiresAt === '1year' ? function () { expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + 1); } : function () { expirationDate = null; })(); return await this.abuseReportResolverRepository.insert({ id: this.idService.gen(), diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/delete.ts b/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/delete.ts index eedd2cfe1c..ea32124320 100644 --- a/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/delete.ts @@ -11,8 +11,9 @@ import { ApiError } from '../../../error.js'; export const meta = { requireCrendential: true, - + kind: 'arr-delete', // ここにkindプロパティを追加 requireAdmin: true, + secure: true, errors: { resolverNotFound: { diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/list.ts b/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/list.ts index defe1319d8..a5a6f3c54c 100644 --- a/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/list.ts @@ -12,7 +12,8 @@ import type { AbuseReportResolversRepository } from '@/models/_.js'; export const meta = { requireCredential: true, - + kind: 'arr-list', // ここにkindプロパティを追加 + secure: true, requireAdmin: true, res: { diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/update.ts b/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/update.ts index 355e688dfe..beece140a7 100644 --- a/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/update.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../../error.js'; export const meta = { requireCredential: true, - + kind: 'arr-update', // ここにkindプロパティを追加 + secure: true, requireAdmin: true, errors: { @@ -102,12 +103,12 @@ export default class extends Endpoint { const previousMonth = expirationDate.getUTCMonth(); (ps.expiresAt === '1hour' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 hour')); } : ps.expiresAt === '12hours' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('12 hours')); } : - ps.expiresAt === '1day' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 day')); } : - ps.expiresAt === '1week' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 week')); } : - ps.expiresAt === '1month' ? function () { expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 1 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 1 + 1) / 12))); } : - ps.expiresAt === '3months' ? function () {expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 3 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 3 + 1) / 12))); } : - ps.expiresAt === '6months' ? function () { expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 6 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 6 + 1) / 12))); } : - ps.expiresAt === '1year' ? function () { expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + 1); } : function () { expirationDate = null; })(); + ps.expiresAt === '1day' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 day')); } : + ps.expiresAt === '1week' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 week')); } : + ps.expiresAt === '1month' ? function () { expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 1 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 1 + 1) / 12))); } : + ps.expiresAt === '3months' ? function () {expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 3 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 3 + 1) / 12))); } : + ps.expiresAt === '6months' ? function () { expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 6 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 6 + 1) / 12))); } : + ps.expiresAt === '1year' ? function () { expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + 1); } : function () { expirationDate = null; })(); properties.expiresAt = ps.expiresAt; properties.expirationDate = expirationDate; diff --git a/packages/backend/src/server/api/endpoints/messaging/messages.ts b/packages/backend/src/server/api/endpoints/messaging/messages.ts index 718cd65d23..9208cb503e 100644 --- a/packages/backend/src/server/api/endpoints/messaging/messages.ts +++ b/packages/backend/src/server/api/endpoints/messaging/messages.ts @@ -128,7 +128,7 @@ export default class extends Endpoint { // eslint- } } - return await Promise.all(messages.map(message => this.messagingMessageEntityService.pack(message, me, { + return Promise.all(messages.map(message => this.messagingMessageEntityService.pack(message, me, { populateRecipient: false, }))); } else if (ps.groupId != null) { @@ -160,13 +160,17 @@ export default class extends Endpoint { // eslint- // Mark all as read if (ps.markAsRead) { - this.messagingService.readGroupMessagingMessage(me.id, recipientGroup.id, messages.map(x => x.id)); + await this.messagingService.readGroupMessagingMessage(me.id, recipientGroup.id, messages.map(x => x.id)); } - return await Promise.all(messages.map(message => this.messagingMessageEntityService.pack(message, me, { + return Promise.all(messages.map(message => this.messagingMessageEntityService.pack(message, me, { populateGroup: false, }))); } + + // 必要に応じて適切な戻り値を提供する + return []; // デフォルトの戻り値を返す }); } } + diff --git a/packages/backend/src/server/api/endpoints/notes/translate.ts b/packages/backend/src/server/api/endpoints/notes/translate.ts index 0b450afc44..a1a135601e 100644 --- a/packages/backend/src/server/api/endpoints/notes/translate.ts +++ b/packages/backend/src/server/api/endpoints/notes/translate.ts @@ -126,9 +126,9 @@ export default class extends Endpoint { // eslint- translator: translatorServices, }; } else if (instance.translatorType === 'ctav3') { - if (instance.ctav3SaKey == null) return 204; - else if (instance.ctav3ProjectId == null) return 204; - else if (instance.ctav3Location == null) return 204; + if (instance.ctav3SaKey == null) return Promise.resolve(204); + else if (instance.ctav3ProjectId == null) return Promise.resolve(204); + else if (instance.ctav3Location == null) return Promise.resolve(204); translationResult = await this.apiCloudTranslationAdvanced( (note.cw ? note.cw + '\n' : '') + note.text, targetLang, instance.ctav3SaKey, instance.ctav3ProjectId, instance.ctav3Location, instance.ctav3Model, instance.ctav3Glossary, instance.translatorType, ); @@ -136,11 +136,11 @@ export default class extends Endpoint { // eslint- throw new Error('Unsupported translator type'); } - return { - sourceLang: translationResult.sourceLang, - text: translationResult.text, - translator: translationResult.translator, - }; + return Promise.resolve({ + sourceLang: translationResult.sourceLang || '', + text: translationResult.text || '', + translator: translationResult.translator || [], + }); }); } @@ -162,11 +162,11 @@ export default class extends Endpoint { // eslint- }); const json = (await res.json()) as { - translations: { - detected_source_language: string; - text: string; - }[]; - }; + translations: { + detected_source_language: string; + text: string; + }[]; + }; return { sourceLang: json.translations[0].detected_source_language, diff --git a/packages/backend/src/server/api/endpoints/notes/update.ts b/packages/backend/src/server/api/endpoints/notes/update.ts index 282f1fe537..cf2041e1f7 100644 --- a/packages/backend/src/server/api/endpoints/notes/update.ts +++ b/packages/backend/src/server/api/endpoints/notes/update.ts @@ -95,7 +95,7 @@ export const paramDef = { } as const; @Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export +export default class extends Endpoint { constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, @@ -104,7 +104,10 @@ export default class extends Endpoint { // eslint- private noteEntityService: NoteEntityService, private noteUpdateService: NoteUpdateService, ) { - super(meta, paramDef, async (ps, me) => { + super({ + ...meta, + requireRolePolicy: "canEditNote", // 修正された部分 + }, paramDef, async (ps, me) => { const note = await this.getterService.getNote(ps.noteId).catch(err => { if (err.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote); throw err; diff --git a/packages/backend/src/server/api/endpoints/users/translate.ts b/packages/backend/src/server/api/endpoints/users/translate.ts index 516e88e313..01c23c09cc 100644 --- a/packages/backend/src/server/api/endpoints/users/translate.ts +++ b/packages/backend/src/server/api/endpoints/users/translate.ts @@ -72,31 +72,31 @@ export default class extends Endpoint { // eslint- if (!policies.canUseTranslator) { throw new ApiError(meta.errors.unavailable); } - + const target = await this.getterService.getUserProfiles(ps.userId).catch(err => { if (err.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchDescription); throw err; }); - + if (target.description == null) { return; } - + const instance = await this.metaService.fetch(); - + const translatorServices = [ 'deepl', 'google_no_api', 'ctav3', ]; - + if (instance.translatorType == null || !translatorServices.includes(instance.translatorType)) { - throw new ApiError(meta.errors.noTranslateService); + return Promise.resolve(204); // Promise.resolveで204をラップする } - + let targetLang = ps.targetLang; if (targetLang.includes('-')) targetLang = targetLang.split('-')[0]; - + let translationResult; if (instance.translatorType === 'deepl') { if (instance.deeplAuthKey == null) { @@ -106,31 +106,31 @@ export default class extends Endpoint { // eslint- } else if (instance.translatorType === 'google_no_api') { let targetLang = ps.targetLang; if (targetLang.includes('-')) targetLang = targetLang.split('-')[0]; - + const { text, raw } = await translate(target.description, { to: targetLang }); - + return { sourceLang: raw.src, text: text, - translator: translatorServices, + translator: instance.translatorType, // 修正点: 配列ではなく単一の文字列 }; } else if (instance.translatorType === 'ctav3') { - if (instance.ctav3SaKey == null) return 204; - else if (instance.ctav3ProjectId == null) return 204; - else if (instance.ctav3Location == null) return 204; + if (instance.ctav3SaKey == null) return Promise.resolve(204); + else if (instance.ctav3ProjectId == null) return Promise.resolve(204); + else if (instance.ctav3Location == null) return Promise.resolve(204); translationResult = await this.apiCloudTranslationAdvanced( target.description, targetLang, instance.ctav3SaKey, instance.ctav3ProjectId, instance.ctav3Location, instance.ctav3Model, instance.ctav3Glossary, instance.translatorType, ); } else { throw new Error('Unsupported translator type'); } - - return { - sourceLang: translationResult.sourceLang, - text: translationResult.text, - translator: translationResult.translator, - }; - }); + + return Promise.resolve({ + sourceLang: translationResult.sourceLang || '', + text: translationResult.text || '', + translator: translationResult.translator || [], + }); + }); } private async translateDeepL(text: string, targetLang: string, authKey: string, isPro: boolean, provider: string) { diff --git a/packages/backend/src/server/api/stream/channels/channel.ts b/packages/backend/src/server/api/stream/channels/channel.ts index 20a6f3e39d..e8fc2ebd0c 100644 --- a/packages/backend/src/server/api/stream/channels/channel.ts +++ b/packages/backend/src/server/api/stream/channels/channel.ts @@ -87,7 +87,7 @@ class ChannelChannel extends Channel { if (now.getTime() - date.getTime() > 5000) delete this.typers[userId]; } - const users = await this.userEntityService.packMany(Object.keys(this.typers), null, { detail: false }); + const users = await this.userEntityService.packMany(Object.keys(this.typers), null, { schema: 'UserLite' }); this.send({ type: 'typers', diff --git a/packages/backend/src/server/api/stream/channels/messaging-index.ts b/packages/backend/src/server/api/stream/channels/messaging-index.ts index 7f26b37353..22d5e52d51 100644 --- a/packages/backend/src/server/api/stream/channels/messaging-index.ts +++ b/packages/backend/src/server/api/stream/channels/messaging-index.ts @@ -25,10 +25,9 @@ class MessagingIndexChannel extends Channel { export class MessagingIndexChannelService { public readonly shouldShare = MessagingIndexChannel.shouldShare; public readonly requireCredential = MessagingIndexChannel.requireCredential; + public readonly kind: string = 'messagingIndex'; // kind の型を string に変更し、適切な値を代入する - constructor( - ) { - } + constructor() {} @bindThis public create(id: string, connection: Channel['connection']): MessagingIndexChannel { diff --git a/packages/backend/src/server/api/stream/channels/messaging.ts b/packages/backend/src/server/api/stream/channels/messaging.ts index e198aec4e6..2d082c7fa2 100644 --- a/packages/backend/src/server/api/stream/channels/messaging.ts +++ b/packages/backend/src/server/api/stream/channels/messaging.ts @@ -113,7 +113,7 @@ class MessagingChannel extends Channel { if (now.getTime() - date.getTime() > 5000) delete this.typers[userId]; } - const users = await this.userEntityService.packMany(Object.keys(this.typers), null, { detail: false }); + const users = await this.userEntityService.packMany(Object.keys(this.typers), null, { schema: "UserLite" }); this.send({ type: 'typers', @@ -133,6 +133,7 @@ class MessagingChannel extends Channel { export class MessagingChannelService { public readonly shouldShare = MessagingChannel.shouldShare; public readonly requireCredential = MessagingChannel.requireCredential; + public readonly kind: string = 'messaging'; // kind の型を string に変更し、適切な値に設定する constructor( @Inject(DI.usersRepository) diff --git a/packages/frontend/src/components/MkMfmCheatSheetDialog.vue b/packages/frontend/src/components/MkMfmCheatSheetDialog.vue index dbec743ac8..7e42c1e291 100644 --- a/packages/frontend/src/components/MkMfmCheatSheetDialog.vue +++ b/packages/frontend/src/components/MkMfmCheatSheetDialog.vue @@ -1,3 +1,8 @@ + +