diff --git a/CHANGELOG.md b/CHANGELOG.md index a7f914bd4..77df0d292 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ You should also include the user name that made the change. --> + +## 13.5.3 (2023/02/09) + +### Improvements +- Client: デッキにチャンネルカラムを追加 + ## 13.5.2 (2023/02/08) ### Changes diff --git a/ROADMAP.md b/ROADMAP.md index b2c5c8757..c95bb8d92 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -6,16 +6,13 @@ Also, the later tasks are more indefinite and are subject to change as developme This is the phase we are at now. We need to make a high-maintenance environment that can withstand future development. - Make the number of type errors zero (backend) - - Probably need to switch some libraries to others that make it difficult to reduce type errors - - e.g. koa to fastify https://github.com/misskey-dev/misskey/issues/7537 - Improve CI - Fix tests - - mocha, jest, etc. do not support the combination of `TypeScript + ESM + Path alias`, and the tests currently do not work. - Fix random test failures - https://github.com/misskey-dev/misskey/issues/7985 and https://github.com/misskey-dev/misskey/issues/7986 - Add more tests - - May need to implement a mechanism that allows for DI + - ~~May need to implement a mechanism that allows for DI~~ → Done ✔️ - https://github.com/misskey-dev/misskey/pull/9085 - - Measure coverage + - ~~Measure coverage~~ → Done ✔️ - https://github.com/misskey-dev/misskey/pull/9081 - Improve documentation - Refactoring diff --git a/locales/ar-SA.yml b/locales/ar-SA.yml index 1ff72668e..5542e09b1 100644 --- a/locales/ar-SA.yml +++ b/locales/ar-SA.yml @@ -1345,5 +1345,6 @@ _deck: tl: "الخيط الزمني" antenna: "الهوائيات" list: "القوائم" + channel: "القنوات" mentions: "الإشارات" direct: "مباشرة" diff --git a/locales/bn-BD.yml b/locales/bn-BD.yml index c6e94896e..6f5d67639 100644 --- a/locales/bn-BD.yml +++ b/locales/bn-BD.yml @@ -1441,5 +1441,6 @@ _deck: tl: "টাইমলাইন" antenna: "অ্যান্টেনা" list: "লিস্ট" + channel: "চ্যানেলগুলি" mentions: "উল্লেখসমূহ" direct: "ডাইরেক্ট নোটগুলি" diff --git a/locales/cs-CZ.yml b/locales/cs-CZ.yml index eb9ae6f87..926c173f8 100644 --- a/locales/cs-CZ.yml +++ b/locales/cs-CZ.yml @@ -804,4 +804,5 @@ _deck: tl: "Časová osa" antenna: "Antény" list: "Seznamy" + channel: "Kanály" mentions: "Zmínění" diff --git a/locales/de-DE.yml b/locales/de-DE.yml index dd1494fb2..fa5818af0 100644 --- a/locales/de-DE.yml +++ b/locales/de-DE.yml @@ -1869,5 +1869,6 @@ _deck: tl: "Chronik" antenna: "Antennen" list: "Listen" + channel: "Kanäle" mentions: "Erwähnungen" direct: "Direktnachrichten" diff --git a/locales/en-US.yml b/locales/en-US.yml index 0c39a5e35..1aa4fd738 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1869,5 +1869,6 @@ _deck: tl: "Timeline" antenna: "Antennas" list: "List" + channel: "Channels" mentions: "Mentions" direct: "Direct notes" diff --git a/locales/es-ES.yml b/locales/es-ES.yml index ba1c717f8..2464fb124 100644 --- a/locales/es-ES.yml +++ b/locales/es-ES.yml @@ -1869,5 +1869,6 @@ _deck: tl: "Linea de tiempo" antenna: "Antenas" list: "Listas" + channel: "Canal" mentions: "Menciones" direct: "Mensaje directo" diff --git a/locales/fr-FR.yml b/locales/fr-FR.yml index 462b561e4..8a9476e91 100644 --- a/locales/fr-FR.yml +++ b/locales/fr-FR.yml @@ -1541,5 +1541,6 @@ _deck: tl: "Fil" antenna: "Antennes" list: "Listes" + channel: "Canaux" mentions: "Mentions" direct: "Direct" diff --git a/locales/id-ID.yml b/locales/id-ID.yml index 6a2ccfd8d..7332e030c 100644 --- a/locales/id-ID.yml +++ b/locales/id-ID.yml @@ -1673,5 +1673,6 @@ _deck: tl: "Linimasa" antenna: "Antena" list: "Daftar" + channel: "Kanal" mentions: "Sebutan" direct: "Langsung" diff --git a/locales/it-IT.yml b/locales/it-IT.yml index 701fb7eef..12bbc78d6 100644 --- a/locales/it-IT.yml +++ b/locales/it-IT.yml @@ -1869,5 +1869,6 @@ _deck: tl: "Timeline" antenna: "Antenne" list: "Liste" + channel: "Canale" mentions: "Menzioni" direct: "Diretta" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 6286367b5..8e8fddfb8 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -129,6 +129,7 @@ unblockConfirm: "ブロック解除しますか?" suspendConfirm: "凍結しますか?" unsuspendConfirm: "解凍しますか?" selectList: "リストを選択" +selectChannel: "チャンネルを選択" selectAntenna: "アンテナを選択" selectWidget: "ウィジェットを選択" editWidgets: "ウィジェットを編集" @@ -1922,5 +1923,6 @@ _deck: tl: "タイムライン" antenna: "アンテナ" list: "リスト" + channel: "チャンネル" mentions: "あなた宛て" direct: "ダイレクト" diff --git a/locales/ja-KS.yml b/locales/ja-KS.yml index 40d28b196..05de911be 100644 --- a/locales/ja-KS.yml +++ b/locales/ja-KS.yml @@ -1628,5 +1628,6 @@ _deck: tl: "タイムライン" antenna: "アンテナ" list: "リスト" + channel: "チャンネル" mentions: "あんた宛て" direct: "ダイレクト" diff --git a/locales/ko-KR.yml b/locales/ko-KR.yml index 265f14ec5..23814208a 100644 --- a/locales/ko-KR.yml +++ b/locales/ko-KR.yml @@ -1866,5 +1866,6 @@ _deck: tl: "타임라인" antenna: "안테나" list: "리스트" + channel: "채널" mentions: "받은 멘션" direct: "다이렉트" diff --git a/locales/pl-PL.yml b/locales/pl-PL.yml index d78185be8..d8c7739f6 100644 --- a/locales/pl-PL.yml +++ b/locales/pl-PL.yml @@ -1438,5 +1438,6 @@ _deck: tl: "Oś czasu" antenna: "Anteny" list: "Listy" + channel: "Kanały" mentions: "Wspomnienia" direct: "Bezpośredni" diff --git a/locales/ro-RO.yml b/locales/ro-RO.yml index b1ec5426a..f354801d5 100644 --- a/locales/ro-RO.yml +++ b/locales/ro-RO.yml @@ -721,4 +721,5 @@ _deck: tl: "Cronologie" antenna: "Antene" list: "Liste" + channel: "Canale" mentions: "Mențiuni" diff --git a/locales/ru-RU.yml b/locales/ru-RU.yml index 2085cb2be..26e9ad0e9 100644 --- a/locales/ru-RU.yml +++ b/locales/ru-RU.yml @@ -1845,5 +1845,6 @@ _deck: tl: "Лента" antenna: "Антенны" list: "Списки" + channel: "Каналы" mentions: "Упоминания" direct: "Личное" diff --git a/locales/sk-SK.yml b/locales/sk-SK.yml index ee2ca11fa..369f1af36 100644 --- a/locales/sk-SK.yml +++ b/locales/sk-SK.yml @@ -1545,5 +1545,6 @@ _deck: tl: "Časová os" antenna: "Antény" list: "Zoznam" + channel: "Kanály" mentions: "Zmienky" direct: "Priame poznámky" diff --git a/locales/th-TH.yml b/locales/th-TH.yml index 98ac29151..3311db39f 100644 --- a/locales/th-TH.yml +++ b/locales/th-TH.yml @@ -1869,5 +1869,6 @@ _deck: tl: "ไทม์ไลน์" antenna: "เสาอากาศ" list: "รายการ" + channel: "แชนแนล" mentions: "พูดถึง" direct: "ไดเร็ค" diff --git a/locales/uk-UA.yml b/locales/uk-UA.yml index d38cab9d1..68e949f92 100644 --- a/locales/uk-UA.yml +++ b/locales/uk-UA.yml @@ -1689,5 +1689,6 @@ _deck: tl: "Стрічка" antenna: "Антени" list: "Списки" + channel: "Канали" mentions: "Згадки" direct: "Особисте" diff --git a/locales/vi-VN.yml b/locales/vi-VN.yml index b460b5e83..26527c74c 100644 --- a/locales/vi-VN.yml +++ b/locales/vi-VN.yml @@ -1520,5 +1520,6 @@ _deck: tl: "Bảng tin" antenna: "Trạm phát sóng" list: "Danh sách" + channel: "Kênh" mentions: "Lượt nhắc" direct: "Nhắn riêng" diff --git a/locales/zh-CN.yml b/locales/zh-CN.yml index 7796dc3de..9a63bdec4 100644 --- a/locales/zh-CN.yml +++ b/locales/zh-CN.yml @@ -1869,5 +1869,6 @@ _deck: tl: "时间线" antenna: "天线" list: "列表" + channel: "频道" mentions: "提及" direct: "指定用户" diff --git a/locales/zh-TW.yml b/locales/zh-TW.yml index ed1e7d8bc..9cf656316 100644 --- a/locales/zh-TW.yml +++ b/locales/zh-TW.yml @@ -1869,5 +1869,6 @@ _deck: tl: "時間軸" antenna: "天線" list: "清單" + channel: "頻道" mentions: "提及" direct: "指定使用者" diff --git a/package.json b/package.json index 37a106ce7..cbf67dc0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "13.5.2", + "version": "13.5.3", "codename": "nasubi", "repository": { "type": "git", @@ -54,8 +54,8 @@ "devDependencies": { "@types/gulp": "4.0.10", "@types/gulp-rename": "2.0.1", - "@typescript-eslint/eslint-plugin": "5.50.0", - "@typescript-eslint/parser": "5.50.0", + "@typescript-eslint/eslint-plugin": "5.51.0", + "@typescript-eslint/parser": "5.51.0", "cross-env": "7.0.3", "cypress": "12.5.1", "eslint": "8.33.0", diff --git a/packages/backend/package.json b/packages/backend/package.json index 762cb4b4d..6ec2ef4b7 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -23,9 +23,9 @@ "@tensorflow/tfjs-node": "4.2.0" }, "dependencies": { - "@bull-board/api": "4.11.0", - "@bull-board/fastify": "4.11.0", - "@bull-board/ui": "4.11.0", + "@bull-board/api": "4.11.1", + "@bull-board/fastify": "4.11.1", + "@bull-board/ui": "4.11.1", "@discordapp/twemoji": "14.0.2", "@fastify/accepts": "4.1.0", "@fastify/cookie": "8.3.0", @@ -34,9 +34,9 @@ "@fastify/multipart": "7.4.0", "@fastify/static": "6.8.0", "@fastify/view": "7.4.1", - "@nestjs/common": "9.3.1", - "@nestjs/core": "9.3.1", - "@nestjs/testing": "9.3.1", + "@nestjs/common": "9.3.7", + "@nestjs/core": "9.3.7", + "@nestjs/testing": "9.3.7", "@peertube/http-signature": "1.7.0", "@sinonjs/fake-timers": "10.0.2", "accepts": "1.3.8", @@ -46,7 +46,7 @@ "aws-sdk": "2.1295.0", "bcryptjs": "2.4.3", "blurhash": "2.0.4", - "bull": "4.10.2", + "bull": "4.10.3", "cacheable-lookup": "6.1.0", "cbor": "8.1.0", "chalk": "5.2.0", @@ -90,7 +90,7 @@ "promise-limit": "2.7.0", "pug": "3.0.2", "punycode": "2.3.0", - "pureimage": "0.3.15", + "pureimage": "0.3.17", "qrcode": "1.5.1", "random-seed": "0.3.0", "ratelimiter": "3.4.1", @@ -111,12 +111,12 @@ "stringz": "2.1.0", "summaly": "2.7.0", "systeminformation": "5.17.8", - "tinycolor2": "1.5.2", + "tinycolor2": "1.6.0", "tmp": "0.2.1", "tsc-alias": "1.8.2", "tsconfig-paths": "4.1.2", "twemoji-parser": "14.0.0", - "typeorm": "0.3.11", + "typeorm": "0.3.12", "typescript": "4.9.5", "ulid": "2.3.0", "unzipper": "0.10.11", @@ -128,10 +128,10 @@ "xev": "3.0.2" }, "devDependencies": { - "@jest/globals": "29.4.1", + "@jest/globals": "29.4.2", "@redocly/openapi-core": "1.0.0-beta.123", "@swc/cli": "0.1.61", - "@swc/core": "1.3.32", + "@swc/core": "1.3.34", "@swc/jest": "0.2.24", "@types/accepts": "1.3.5", "@types/archiver": "5.3.1", @@ -145,11 +145,11 @@ "@types/ioredis": "4.28.10", "@types/jest": "29.4.0", "@types/js-yaml": "4.0.5", - "@types/jsdom": "20.0.1", + "@types/jsdom": "21.1.0", "@types/jsonld": "1.5.8", "@types/jsrsasign": "10.5.5", "@types/mime-types": "2.1.1", - "@types/node": "18.11.18", + "@types/node": "18.13.0", "@types/node-fetch": "3.0.3", "@types/nodemailer": "6.4.7", "@types/oauth": "0.9.1", @@ -174,13 +174,13 @@ "@types/web-push": "3.3.2", "@types/websocket": "1.0.5", "@types/ws": "8.5.4", - "@typescript-eslint/eslint-plugin": "5.50.0", - "@typescript-eslint/parser": "5.50.0", + "@typescript-eslint/eslint-plugin": "5.51.0", + "@typescript-eslint/parser": "5.51.0", "cross-env": "7.0.3", "eslint": "8.33.0", "eslint-plugin-import": "2.27.5", "execa": "6.1.0", - "jest": "29.4.1", - "jest-mock": "29.4.1" + "jest": "29.4.2", + "jest-mock": "29.4.2" } } diff --git a/packages/backend/src/core/AchievementService.ts b/packages/backend/src/core/AchievementService.ts index 5fd9c451c..2ebee0f7e 100644 --- a/packages/backend/src/core/AchievementService.ts +++ b/packages/backend/src/core/AchievementService.ts @@ -5,7 +5,7 @@ import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; import { CreateNotificationService } from '@/core/CreateNotificationService.js'; -const ACHIEVEMENT_TYPES = [ +export const ACHIEVEMENT_TYPES = [ 'notes1', 'notes10', 'notes100', diff --git a/packages/backend/src/core/QueryService.ts b/packages/backend/src/core/QueryService.ts index 4cc844cce..c334d749e 100644 --- a/packages/backend/src/core/QueryService.ts +++ b/packages/backend/src/core/QueryService.ts @@ -1,10 +1,10 @@ import { Inject, Injectable } from '@nestjs/common'; -import { Brackets } from 'typeorm'; +import { Brackets, ObjectLiteral } from 'typeorm'; import { DI } from '@/di-symbols.js'; import type { User } from '@/models/entities/User.js'; import type { UserProfilesRepository, FollowingsRepository, ChannelFollowingsRepository, MutedNotesRepository, BlockingsRepository, NoteThreadMutingsRepository, MutingsRepository } from '@/models/index.js'; -import type { SelectQueryBuilder } from 'typeorm'; import { bindThis } from '@/decorators.js'; +import type { SelectQueryBuilder } from 'typeorm'; @Injectable() export class QueryService { @@ -32,7 +32,7 @@ export class QueryService { ) { } - public makePaginationQuery(q: SelectQueryBuilder, sinceId?: string, untilId?: string, sinceDate?: number, untilDate?: number): SelectQueryBuilder { + public makePaginationQuery(q: SelectQueryBuilder, sinceId?: string, untilId?: string, sinceDate?: number, untilDate?: number): SelectQueryBuilder { if (sinceId && untilId) { q.andWhere(`${q.alias}.id > :sinceId`, { sinceId: sinceId }); q.andWhere(`${q.alias}.id < :untilId`, { untilId: untilId }); diff --git a/packages/backend/src/decorators.ts b/packages/backend/src/decorators.ts index 94b1c4be8..db23317ee 100644 --- a/packages/backend/src/decorators.ts +++ b/packages/backend/src/decorators.ts @@ -5,7 +5,7 @@ * The getter will return a .bind version of the function * and memoize the result against a symbol on the instance */ -export function bindThis(target, key, descriptor) { +export function bindThis(target: any, key: string, descriptor: any) { let fn = descriptor.value; if (typeof fn !== 'function') { @@ -34,7 +34,7 @@ export function bindThis(target, key, descriptor) { }); return boundFn; }, - set(value) { + set(value: any) { fn = value; }, }; diff --git a/packages/backend/src/logger.ts b/packages/backend/src/logger.ts index 87f9b1231..91039098f 100644 --- a/packages/backend/src/logger.ts +++ b/packages/backend/src/logger.ts @@ -45,7 +45,7 @@ export default class Logger { } const time = dateFormat(new Date(), 'HH:mm:ss'); - const worker = cluster.isPrimary ? '*' : cluster.worker.id; + const worker = cluster.isPrimary ? '*' : cluster.worker!.id; const l = level === 'error' ? important ? chalk.bgRed.white('ERR ') : chalk.red('ERR ') : level === 'warning' ? chalk.yellow('WARN') : diff --git a/packages/backend/src/misc/gen-identicon.ts b/packages/backend/src/misc/gen-identicon.ts index 4a70d7a4b..b40745973 100644 --- a/packages/backend/src/misc/gen-identicon.ts +++ b/packages/backend/src/misc/gen-identicon.ts @@ -51,7 +51,7 @@ export function genIdenticon(seed: string, stream: WriteStream): Promise { bg.addColorStop(0, bgColors[0]); bg.addColorStop(1, bgColors[1]); - ctx.fillStyle = bg; + ctx.fillStyle = bg as any; ctx.beginPath(); ctx.fillRect(0, 0, size, size); diff --git a/packages/backend/src/misc/i18n.ts b/packages/backend/src/misc/i18n.ts index e304a8ada..b1c727827 100644 --- a/packages/backend/src/misc/i18n.ts +++ b/packages/backend/src/misc/i18n.ts @@ -11,10 +11,9 @@ export class I18n> { // string にしているのは、ドット区切りでのパス指定を許可するため // なるべくこのメソッド使うよりもlocale直接参照の方がvueのキャッシュ効いてパフォーマンスが良いかも - @bindThis public t(key: string, args?: Record): string { try { - let str = key.split('.').reduce((o, i) => o[i], this.locale) as string; + let str = key.split('.').reduce((o, i) => o[i], this.locale as any) as string; if (args) { for (const [k, v] of Object.entries(args)) { diff --git a/packages/backend/src/server/ActivityPubServerService.ts b/packages/backend/src/server/ActivityPubServerService.ts index bdd2e9750..186d3822d 100644 --- a/packages/backend/src/server/ActivityPubServerService.ts +++ b/packages/backend/src/server/ActivityPubServerService.ts @@ -1,3 +1,4 @@ +import { IncomingMessage } from 'node:http'; import { Inject, Injectable } from '@nestjs/common'; import fastifyAccepts from '@fastify/accepts'; import httpSignature from '@peertube/http-signature'; @@ -19,6 +20,7 @@ import { QueryService } from '@/core/QueryService.js'; import { UtilityService } from '@/core/UtilityService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { bindThis } from '@/decorators.js'; +import { IActivity } from '@/core/activitypub/type.js'; import type { FastifyInstance, FastifyRequest, FastifyReply, FastifyPluginOptions } from 'fastify'; import type { FindOptionsWhere } from 'typeorm'; @@ -97,7 +99,8 @@ export class ActivityPubServerService { return; } - this.queueService.inbox(request.body, signature); + // TODO: request.bodyのバリデーション? + this.queueService.inbox(request.body as IActivity, signature); reply.code(202); } @@ -413,20 +416,21 @@ export class ActivityPubServerService { @bindThis public createServer(fastify: FastifyInstance, options: FastifyPluginOptions, done: (err?: Error) => void) { - fastify.addConstraintStrategy({ + // addConstraintStrategy の型定義がおかしいため + (fastify.addConstraintStrategy as any)({ name: 'apOrHtml', storage() { - const store = {}; + const store = {} as any; return { - get(key) { + get(key: string) { return store[key] ?? null; }, - set(key, value) { + set(key: string, value: any) { store[key] = value; }, }; }, - deriveConstraint(request, ctx) { + deriveConstraint(request: IncomingMessage) { const accepted = accepts(request).type(['html', ACTIVITY_JSON, LD_JSON]); const isAp = typeof accepted === 'string' && !accepted.match(/html/); return isAp ? 'ap' : 'html'; @@ -536,6 +540,7 @@ export class ActivityPubServerService { return (this.apRendererService.renderActivity(this.apRendererService.renderKey(user, keypair))); } else { reply.code(400); + return; } }); diff --git a/packages/backend/src/server/ServerService.ts b/packages/backend/src/server/ServerService.ts index c7a2c99f9..f76871c60 100644 --- a/packages/backend/src/server/ServerService.ts +++ b/packages/backend/src/server/ServerService.ts @@ -166,6 +166,7 @@ export class ServerService { return 'Verify succeeded!'; } else { reply.code(404); + return; } }); diff --git a/packages/backend/src/server/api/RateLimiterService.ts b/packages/backend/src/server/api/RateLimiterService.ts index a9c34e363..1f8915ecc 100644 --- a/packages/backend/src/server/api/RateLimiterService.ts +++ b/packages/backend/src/server/api/RateLimiterService.ts @@ -34,7 +34,7 @@ export class RateLimiterService { const min = (): void => { const minIntervalLimiter = new Limiter({ id: `${actor}:${limitation.key}:min`, - duration: limitation.minInterval * factor, + duration: limitation.minInterval! * factor, max: 1, db: this.redisClient, }); @@ -62,8 +62,8 @@ export class RateLimiterService { const max = (): void => { const limiter = new Limiter({ id: `${actor}:${limitation.key}`, - duration: limitation.duration * factor, - max: limitation.max / factor, + duration: limitation.duration! * factor, + max: limitation.max! / factor, db: this.redisClient, }); diff --git a/packages/backend/src/server/api/SigninApiService.ts b/packages/backend/src/server/api/SigninApiService.ts index 10f8423d4..d490097de 100644 --- a/packages/backend/src/server/api/SigninApiService.ts +++ b/packages/backend/src/server/api/SigninApiService.ts @@ -10,9 +10,9 @@ import { getIpHash } from '@/misc/get-ip-hash.js'; import type { ILocalUser } from '@/models/entities/User.js'; import { IdService } from '@/core/IdService.js'; import { TwoFactorAuthenticationService } from '@/core/TwoFactorAuthenticationService.js'; +import { bindThis } from '@/decorators.js'; import { RateLimiterService } from './RateLimiterService.js'; import { SigninService } from './SigninService.js'; -import { bindThis } from '@/decorators.js'; import type { FastifyRequest, FastifyReply } from 'fastify'; @Injectable() @@ -131,7 +131,7 @@ export class SigninApiService { createdAt: new Date(), userId: user.id, ip: request.ip, - headers: request.headers, + headers: request.headers as any, success: false, }); diff --git a/packages/backend/src/server/api/SigninService.ts b/packages/backend/src/server/api/SigninService.ts index 89a8a9ff1..c78d9f85c 100644 --- a/packages/backend/src/server/api/SigninService.ts +++ b/packages/backend/src/server/api/SigninService.ts @@ -25,7 +25,7 @@ export class SigninService { } @bindThis - public signin(request: FastifyRequest, reply: FastifyReply, user: ILocalUser, redirect = false) { + public signin(request: FastifyRequest, reply: FastifyReply, user: ILocalUser) { setImmediate(async () => { // Append signin history const record = await this.signinsRepository.insert({ @@ -33,7 +33,7 @@ export class SigninService { createdAt: new Date(), userId: user.id, ip: request.ip, - headers: request.headers, + headers: request.headers as any, success: true, }).then(x => this.signinsRepository.findOneByOrFail(x.identifiers[0])); @@ -41,25 +41,11 @@ export class SigninService { this.globalEventService.publishMainStream(user.id, 'signin', await this.signinEntityService.pack(record)); }); - if (redirect) { - //#region Cookie - reply.setCookie('igi', user.token!, { - path: '/', - // SEE: https://github.com/koajs/koa/issues/974 - // When using a SSL proxy it should be configured to add the "X-Forwarded-Proto: https" header - secure: this.config.url.startsWith('https'), - httpOnly: false, - }); - //#endregion - - reply.redirect(this.config.url); - } else { - reply.code(200); - return { - id: user.id, - i: user.token, - }; - } + reply.code(200); + return { + id: user.id, + i: user.token, + }; } } diff --git a/packages/backend/src/server/api/SignupApiService.ts b/packages/backend/src/server/api/SignupApiService.ts index 4b676bb8b..ffd7e203e 100644 --- a/packages/backend/src/server/api/SignupApiService.ts +++ b/packages/backend/src/server/api/SignupApiService.ts @@ -146,6 +146,7 @@ export class SignupApiService { `To complete signup, please click this link: ${link}`); reply.code(204); + return; } else { try { const { account, secret } = await this.signupService.signup({ @@ -162,7 +163,7 @@ export class SignupApiService { token: secret, }; } catch (err) { - throw new FastifyReplyError(400, err); + throw new FastifyReplyError(400, typeof err === 'string' ? err : (err as Error).toString()); } } } @@ -195,7 +196,7 @@ export class SignupApiService { return this.signinService.signin(request, reply, account as ILocalUser); } catch (err) { - throw new FastifyReplyError(400, err); + throw new FastifyReplyError(400, typeof err === 'string' ? err : (err as Error).toString()); } } } diff --git a/packages/backend/src/server/api/endpoints/admin/roles/create.ts b/packages/backend/src/server/api/endpoints/admin/roles/create.ts index 1a2a9fb74..df60c6be9 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/create.ts @@ -20,7 +20,7 @@ export const paramDef = { description: { type: 'string' }, color: { type: 'string', nullable: true }, iconUrl: { type: 'string', nullable: true }, - target: { type: 'string' }, + target: { type: 'string', enum: ['manual', 'conditional'] }, condFormula: { type: 'object' }, isPublic: { type: 'boolean' }, isModerator: { type: 'boolean' }, diff --git a/packages/backend/src/server/api/endpoints/admin/roles/update.ts b/packages/backend/src/server/api/endpoints/admin/roles/update.ts index c9f4a9fed..b939ccdbf 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/update.ts @@ -28,7 +28,7 @@ export const paramDef = { description: { type: 'string' }, color: { type: 'string', nullable: true }, iconUrl: { type: 'string', nullable: true }, - target: { type: 'string' }, + target: { type: 'string', enum: ['manual', 'conditional'] }, condFormula: { type: 'object' }, isPublic: { type: 'boolean' }, isModerator: { type: 'boolean' }, diff --git a/packages/backend/src/server/api/endpoints/charts/user/pv.ts b/packages/backend/src/server/api/endpoints/charts/user/pv.ts index c920e0f57..33652c3ad 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/pv.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/pv.ts @@ -2,7 +2,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { getJsonSchema } from '@/core/chart/core.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import PerUserPvChart from '@/core/chart/charts/per-user-pv.js'; -import { schema } from '@/core/chart/charts/entities/per-user-notes.js'; +import { schema } from '@/core/chart/charts/entities/per-user-pv.js'; export const meta = { tags: ['charts', 'users'], diff --git a/packages/backend/src/server/api/endpoints/endpoint.ts b/packages/backend/src/server/api/endpoints/endpoint.ts index a337a05f8..13b91685a 100644 --- a/packages/backend/src/server/api/endpoints/endpoint.ts +++ b/packages/backend/src/server/api/endpoints/endpoint.ts @@ -27,7 +27,7 @@ export default class extends Endpoint { return { params: Object.entries(ep.params.properties ?? {}).map(([k, v]) => ({ name: k, - type: v.type.charAt(0).toUpperCase() + v.type.slice(1), + type: v.type ? v.type.charAt(0).toUpperCase() + v.type.slice(1) : 'string', })), }; }); diff --git a/packages/backend/src/server/api/endpoints/i/claim-achievement.ts b/packages/backend/src/server/api/endpoints/i/claim-achievement.ts index 52ae5475b..d7109c695 100644 --- a/packages/backend/src/server/api/endpoints/i/claim-achievement.ts +++ b/packages/backend/src/server/api/endpoints/i/claim-achievement.ts @@ -1,7 +1,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; -import { AchievementService } from '@/core/AchievementService.js'; +import { AchievementService, ACHIEVEMENT_TYPES } from '@/core/AchievementService.js'; export const meta = { requireCredential: true, @@ -10,7 +10,7 @@ export const meta = { export const paramDef = { type: 'object', properties: { - name: { type: 'string' }, + name: { type: 'string', enum: ACHIEVEMENT_TYPES }, }, required: ['name'], } as const; diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts index 2a764a25b..1fa8950d7 100644 --- a/packages/backend/src/server/web/ClientServerService.ts +++ b/packages/backend/src/server/web/ClientServerService.ts @@ -155,7 +155,7 @@ export class ClientServerService { }); serverAdapter.setBasePath(bullBoardPath); - fastify.register(serverAdapter.registerPlugin(), { prefix: bullBoardPath }); + (fastify.register as any)(serverAdapter.registerPlugin(), { prefix: bullBoardPath }); //#endregion fastify.register(fastifyView, { @@ -372,6 +372,7 @@ export class ClientServerService { return feed.atom1(); } else { reply.code(404); + return; } }); @@ -384,6 +385,7 @@ export class ClientServerService { return feed.rss2(); } else { reply.code(404); + return; } }); @@ -396,6 +398,7 @@ export class ClientServerService { return feed.json1(); } else { reply.code(404); + return; } }); diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 40183d64c..bf22f7aaa 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -12,7 +12,7 @@ "@rollup/plugin-json": "6.0.0", "@rollup/pluginutils": "5.0.2", "@syuilo/aiscript": "0.12.4", - "@tabler/icons-webfont": "2.1.2", + "@tabler/icons-webfont": "2.2.0", "@vitejs/plugin-vue": "4.0.0", "@vue/compiler-sfc": "3.2.47", "autobind-decorator": "2.4.0", @@ -23,7 +23,7 @@ "canvas-confetti": "1.6.0", "chart.js": "4.2.0", "chartjs-adapter-date-fns": "3.0.0", - "chartjs-chart-matrix": "1.3.0", + "chartjs-chart-matrix": "2.0.1", "chartjs-plugin-gradient": "0.6.1", "chartjs-plugin-zoom": "2.0.0", "compare-versions": "5.0.1", @@ -44,7 +44,7 @@ "punycode": "2.3.0", "querystring": "0.2.1", "rndstr": "1.0.0", - "rollup": "3.12.1", + "rollup": "3.14.0", "s-age": "1.1.2", "sanitize-html": "2.9.0", "sass": "1.58.0", @@ -55,7 +55,7 @@ "textarea-caret": "3.1.0", "three": "0.149.0", "throttle-debounce": "5.0.0", - "tinycolor2": "1.5.2", + "tinycolor2": "1.6.0", "tsc-alias": "1.8.2", "tsconfig-paths": "4.1.2", "twemoji-parser": "14.0.0", @@ -74,7 +74,7 @@ "@types/gulp": "4.0.10", "@types/gulp-rename": "2.0.1", "@types/matter-js": "0.18.2", - "@types/node": "18.11.18", + "@types/node": "18.13.0", "@types/punycode": "2.1.0", "@types/sanitize-html": "2.8.0", "@types/seedrandom": "3.0.4", @@ -83,8 +83,8 @@ "@types/uuid": "9.0.0", "@types/websocket": "1.0.5", "@types/ws": "8.5.4", - "@typescript-eslint/eslint-plugin": "5.50.0", - "@typescript-eslint/parser": "5.50.0", + "@typescript-eslint/eslint-plugin": "5.51.0", + "@typescript-eslint/parser": "5.51.0", "@vue/runtime-core": "3.2.47", "cross-env": "7.0.3", "cypress": "12.5.1", diff --git a/packages/frontend/src/account.ts b/packages/frontend/src/account.ts index 31c125d3a..610212b6e 100644 --- a/packages/frontend/src/account.ts +++ b/packages/frontend/src/account.ts @@ -61,8 +61,6 @@ export async function signout() { } catch (err) {} //#endregion - document.cookie = 'igi=; path=/'; - if (accounts.length > 0) login(accounts[0].token); else unisonReload('/'); } diff --git a/packages/frontend/src/components/MkCropperDialog.vue b/packages/frontend/src/components/MkCropperDialog.vue index 84adb790f..7e4d2016b 100644 --- a/packages/frontend/src/components/MkCropperDialog.vue +++ b/packages/frontend/src/components/MkCropperDialog.vue @@ -18,7 +18,7 @@
- +
diff --git a/packages/frontend/src/components/MkMediaImage.vue b/packages/frontend/src/components/MkMediaImage.vue index c0638c0fe..6ac56f3ce 100644 --- a/packages/frontend/src/components/MkMediaImage.vue +++ b/packages/frontend/src/components/MkMediaImage.vue @@ -1,22 +1,23 @@ @@ -49,82 +50,77 @@ watch(() => props.image, () => { }); - diff --git a/packages/frontend/src/components/MkNotification.vue b/packages/frontend/src/components/MkNotification.vue index e7a951dd2..8c7114eac 100644 --- a/packages/frontend/src/components/MkNotification.vue +++ b/packages/frontend/src/components/MkNotification.vue @@ -215,7 +215,7 @@ useTooltip(reactionRef, (showing) => { border-radius: 100%; background: var(--panel); box-shadow: 0 0 0 3px var(--panel); - font-size: 12px; + font-size: 11px; text-align: center; color: #fff; diff --git a/packages/frontend/src/pages/channel.vue b/packages/frontend/src/pages/channel.vue index 96340a36b..0fb33e30f 100644 --- a/packages/frontend/src/pages/channel.vue +++ b/packages/frontend/src/pages/channel.vue @@ -23,7 +23,7 @@ - + @@ -34,7 +34,7 @@ diff --git a/packages/frontend/src/ui/deck/column-core.vue b/packages/frontend/src/ui/deck/column-core.vue index 30c0dc5e1..083e91bb0 100644 --- a/packages/frontend/src/ui/deck/column-core.vue +++ b/packages/frontend/src/ui/deck/column-core.vue @@ -6,6 +6,7 @@ + @@ -17,6 +18,7 @@ import XMainColumn from './main-column.vue'; import XTlColumn from './tl-column.vue'; import XAntennaColumn from './antenna-column.vue'; import XListColumn from './list-column.vue'; +import XChannelColumn from './channel-column.vue'; import XNotificationsColumn from './notifications-column.vue'; import XWidgetsColumn from './widgets-column.vue'; import XMentionsColumn from './mentions-column.vue'; diff --git a/packages/frontend/src/ui/deck/deck-store.ts b/packages/frontend/src/ui/deck/deck-store.ts index 56db7398e..80c202a2e 100644 --- a/packages/frontend/src/ui/deck/deck-store.ts +++ b/packages/frontend/src/ui/deck/deck-store.ts @@ -14,7 +14,7 @@ type ColumnWidget = { export type Column = { id: string; - type: 'main' | 'widgets' | 'notifications' | 'tl' | 'antenna' | 'list' | 'mentions' | 'direct'; + type: 'main' | 'widgets' | 'notifications' | 'tl' | 'antenna' | 'channel' | 'list' | 'mentions' | 'direct'; name: string | null; width: number; widgets?: ColumnWidget[]; @@ -22,6 +22,7 @@ export type Column = { flexible?: boolean; antennaId?: string; listId?: string; + channelId?: string; includingTypes?: typeof notificationTypes[number][]; tl?: 'home' | 'local' | 'social' | 'global'; }; diff --git a/packages/frontend/src/widgets/WidgetPostForm.vue b/packages/frontend/src/widgets/WidgetPostForm.vue index 54226c1db..f8bebcbf9 100644 --- a/packages/frontend/src/widgets/WidgetPostForm.vue +++ b/packages/frontend/src/widgets/WidgetPostForm.vue @@ -1,12 +1,12 @@