Merge upstream

This commit is contained in:
ASTRO:? 2025-03-31 16:22:07 +09:00
commit f761a454d3
63 changed files with 3131 additions and 3096 deletions

View file

@ -57,7 +57,7 @@ jobs:
- name: Install FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.2.0
uses: actions/setup-node@v4.3.0
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
@ -116,7 +116,7 @@ jobs:
with:
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.2.0
uses: actions/setup-node@v4.3.0
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

View file

@ -26,7 +26,7 @@ jobs:
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4.2.0
uses: actions/setup-node@v4.3.0
with:
node-version-file: '.node-version'
cache: 'pnpm'

View file

@ -29,7 +29,7 @@ jobs:
- uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4.2.0
- uses: actions/setup-node@v4.3.0
with:
node-version-file: '.node-version'
cache: 'pnpm'
@ -54,7 +54,7 @@ jobs:
- uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4.2.0
- uses: actions/setup-node@v4.3.0
with:
node-version-file: '.node-version'
cache: 'pnpm'
@ -78,7 +78,7 @@ jobs:
- uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4.2.0
- uses: actions/setup-node@v4.3.0
with:
node-version-file: '.node-version'
cache: 'pnpm'

View file

@ -37,7 +37,7 @@ jobs:
with:
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.2.0
uses: actions/setup-node@v4.3.0
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

View file

@ -36,7 +36,7 @@ jobs:
run_install: false
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.2.0
uses: actions/setup-node@v4.3.0
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

View file

@ -27,7 +27,7 @@ jobs:
with:
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.2.0
uses: actions/setup-node@v4.3.0
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

View file

@ -28,7 +28,7 @@ jobs:
with:
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.2.0
uses: actions/setup-node@v4.3.0
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

View file

@ -1,10 +1,8 @@
# syntax = docker/dockerfile:1.4
ARG NODE_VERSION=22
# build assets & compile TypeScript
FROM --platform=$BUILDPLATFORM node:${NODE_VERSION} AS native-builder
FROM --platform=$BUILDPLATFORM node:22 AS native-builder
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
@ -17,7 +15,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
WORKDIR /misskey
COPY --link pnpm-lock.yaml ./
RUN npm install -g pnpm
RUN npm install -g pnpm@10
RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \
pnpm fetch --ignore-scripts
@ -30,7 +28,7 @@ COPY --link ["packages/misskey-js/package.json", "./packages/misskey-js/"]
COPY --link ["packages/misskey-reversi/package.json", "./packages/misskey-reversi/"]
COPY --link ["packages/misskey-bubble-game/package.json", "./packages/misskey-bubble-game/"]
RUN pnpm i --frozen-lockfile --aggregate-output --offline \
RUN pnpm i --frozen-lockfile --aggregate-output --prefer-offline \
&& pnpm rebuild -r
COPY --link . ./
@ -39,7 +37,7 @@ RUN NODE_ENV=production pnpm build
# build native dependencies for target platform
FROM --platform=$TARGETPLATFORM node:${NODE_VERSION} AS target-builder
FROM --platform=$TARGETPLATFORM node:22 AS target-builder
RUN apt-get update \
&& apt-get install -yqq --no-install-recommends \
@ -48,7 +46,7 @@ RUN apt-get update \
WORKDIR /misskey
COPY --link pnpm-lock.yaml ./
RUN npm install -g pnpm
RUN npm install -g pnpm@10
RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \
pnpm fetch --ignore-scripts
@ -59,10 +57,10 @@ COPY --link ["packages/misskey-js/package.json", "./packages/misskey-js/"]
COPY --link ["packages/misskey-reversi/package.json", "./packages/misskey-reversi/"]
COPY --link ["packages/misskey-bubble-game/package.json", "./packages/misskey-bubble-game/"]
RUN pnpm i --frozen-lockfile --aggregate-output --offline \
RUN pnpm i --frozen-lockfile --aggregate-output --prefer-offline \
&& pnpm rebuild -r
FROM --platform=$TARGETPLATFORM node:${NODE_VERSION}-slim AS runner
FROM --platform=$TARGETPLATFORM node:22-slim AS runner
ARG UID="991"
ARG GID="991"
@ -81,7 +79,7 @@ RUN apt-get update \
WORKDIR /misskey
COPY --chown=misskey:misskey pnpm-lock.yaml ./
RUN npm install -g pnpm
RUN npm install -g pnpm@10
COPY --chown=misskey:misskey --from=target-builder /misskey/node_modules ./node_modules
COPY --chown=misskey:misskey --from=target-builder /misskey/packages/backend/node_modules ./packages/backend/node_modules

View file

@ -1354,6 +1354,10 @@ scheduled: "Scheduled"
unschedule: "Unschedule"
setScheduledTime: "Set scheduled time"
willBePostedAt: "Note will be posted at {x}"
sensitiveByModerator: "This file has been marked as sensitive by the administrator.\nFor more information, please check the [NSFW Guidelines](https://go.misskey.io/media-guideline)."
thisInfoIsNotVisibleOtherUser: "This information is not visible to other users."
flushItAway: "Let it go"
deleteNotWash: "Deleting this won't make everything let bygones be bygones, but..."
_bubbleGame:
howToPlay: "How to play"
@ -2544,6 +2548,7 @@ _notification:
renotedBySomeUsers: "Renote from {n} users"
followedBySomeUsers: "Followed by {n} users"
flushNotification: "Clear notifications"
sensitiveFlagAssigned: "Your file has been marked as sensitive"
_types:
all: "All"
note: "New notes"

21
locales/index.d.ts vendored
View file

@ -5564,6 +5564,23 @@ export interface Locale extends ILocale {
* {x}稿
*/
"willBePostedAt": ParameterizedString<"x">;
/**
*
* [NSFWガイドライン](https://go.misskey.io/media-guideline)を確認してください。
*/
"sensitiveByModerator": string;
/**
*
*/
"thisInfoIsNotVisibleOtherUser": string;
/**
*
*/
"flushItAway": string;
/**
*
*/
"deleteNotWash": string;
"_bubbleGame": {
/**
*
@ -10089,6 +10106,10 @@ export interface Locale extends ILocale {
*
*/
"flushNotification": string;
/**
*
*/
"sensitiveFlagAssigned": string;
"_types": {
/**
*

View file

@ -1384,6 +1384,10 @@ scheduled: "予約済み"
unschedule: "予約を解除"
setScheduledTime: "予約日時を設定"
willBePostedAt: "{x}に投稿されます"
sensitiveByModerator: "管理者によって、ドライブのファイルがセンシティブとして設定されました。\n詳細については、[NSFWガイドライン](https://go.misskey.io/media-guideline)を確認してください。"
thisInfoIsNotVisibleOtherUser: "この情報は他のユーザーには公開されません。"
flushItAway: "水に流す"
deleteNotWash: "削除をしても全てが水に流れるわけではありませんが…"
_bubbleGame:
howToPlay: "遊び方"
@ -2651,6 +2655,7 @@ _notification:
renotedBySomeUsers: "{n}人がリノートしました"
followedBySomeUsers: "{n}人にフォローされました"
flushNotification: "通知の履歴をリセットする"
sensitiveFlagAssigned: "ファイルがセンシティブとして設定されました"
_types:
all: "すべて"

View file

@ -1374,6 +1374,10 @@ scheduled: "예약됨"
unschedule: "예약 취소"
setScheduledTime: "예약 시간 설정"
willBePostedAt: "{x}에 게시됩니다"
sensitiveByModerator: "관리자에 의해 드라이브의 파일이 열람주의로 설정되었습니다.\n자세한 내용은 [NSFW 가이드라인](https://go.misskey.io/media-guideline)을 확인해 주세요."
thisInfoIsNotVisibleOtherUser: "이 정보는 다른 사용자에게 공개되지 않습니다."
flushItAway: "묻어두기"
deleteNotWash: "삭제해도 모든 것이 없었던 일이 되는 것은 아닙니다만..."
_bubbleGame:
howToPlay: "설명"
@ -2574,6 +2578,7 @@ _notification:
renotedBySomeUsers: "{n}명이 리노트함"
followedBySomeUsers: "{n}명이 팔로우함"
flushNotification: "알림 이력을 초기화"
sensitiveFlagAssigned: "파일이 열람주의로 설정되었습니다"
_types:
all: "전부"
note: "유저의 새 글"

View file

@ -6,7 +6,7 @@
"type": "git",
"url": "https://git.psec.dev/oscar-surf/misskey.git"
},
"packageManager": "pnpm@9.15.4",
"packageManager": "pnpm@10.7.0",
"workspaces": [
"packages/frontend",
"packages/backend",
@ -46,38 +46,42 @@
"cleanall": "pnpm clean-all"
},
"resolutions": {
"@aiscript-dev/aiscript-languageserver": "github:aiscript-dev/aiscript-languageserver#0.1.6",
"@tensorflow/tfjs-core": "4.22.0",
"axios": "1.7.9",
"axios": "1.8.4",
"chokidar": "4.0.3",
"cookie": "1.0.2",
"cookie-signature": "1.2.2",
"debug": "4.4.0",
"esbuild": "0.24.2",
"esbuild": "0.25.2",
"jpeg-js": "0.4.4",
"lodash": "4.17.21",
"sharp": "0.33.5",
"tough-cookie": "5.1.0",
"tough-cookie": "5.1.2",
"web-streams-polyfill": "4.1.0"
},
"dependencies": {
"cssnano": "7.0.6",
"execa": "9.5.2",
"js-yaml": "4.1.0",
"postcss": "8.5.1",
"terser": "5.37.0",
"typescript": "5.7.3"
"postcss": "8.5.3",
"terser": "5.39.0",
"typescript": "5.8.2"
},
"devDependencies": {
"@types/node": "22.10.7",
"@types/node": "22.13.14",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"cross-env": "7.0.3",
"cypress": "13.17.0",
"cypress": "14.2.1",
"eslint": "8.57.1",
"ncp": "2.0.0",
"start-server-and-test": "2.0.10"
"start-server-and-test": "2.0.11"
},
"optionalDependencies": {
"@tensorflow/tfjs-core": "4.22.0"
},
"pnpm": {
"neverBuiltDependencies": []
}
}

View file

@ -0,0 +1,13 @@
export class SensitiveFlag1739335129758 {
name = 'SensitiveFlag1739335129758'
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "drive_file" ADD "isSensitiveByModerator" boolean NOT NULL DEFAULT false`);
await queryRunner.query(`CREATE INDEX "IDX_e779d1afdfa44dc3d64213cd2e" ON "drive_file" ("isSensitiveByModerator") `);
}
async down(queryRunner) {
await queryRunner.query(`DROP INDEX "public"."IDX_e779d1afdfa44dc3d64213cd2e"`);
await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "isSensitiveByModerator"`);
}
}

View file

@ -33,16 +33,16 @@
"generate-api-json": "pnpm build && node ./scripts/generate_api_json.js"
},
"optionalDependencies": {
"@swc/core-darwin-arm64": "1.10.12",
"@swc/core-darwin-x64": "1.10.12",
"@swc/core-linux-arm-gnueabihf": "1.10.12",
"@swc/core-linux-arm64-gnu": "1.10.12",
"@swc/core-linux-arm64-musl": "1.10.12",
"@swc/core-linux-x64-gnu": "1.10.12",
"@swc/core-linux-x64-musl": "1.10.12",
"@swc/core-win32-arm64-msvc": "1.10.12",
"@swc/core-win32-ia32-msvc": "1.10.12",
"@swc/core-win32-x64-msvc": "1.10.12",
"@swc/core-darwin-arm64": "1.11.13",
"@swc/core-darwin-x64": "1.11.13",
"@swc/core-linux-arm-gnueabihf": "1.11.13",
"@swc/core-linux-arm64-gnu": "1.11.13",
"@swc/core-linux-arm64-musl": "1.11.13",
"@swc/core-linux-x64-gnu": "1.11.13",
"@swc/core-linux-x64-musl": "1.11.13",
"@swc/core-win32-arm64-msvc": "1.11.13",
"@swc/core-win32-ia32-msvc": "1.11.13",
"@swc/core-win32-x64-msvc": "1.11.13",
"@tensorflow/tfjs": "4.22.0",
"@tensorflow/tfjs-node": "4.22.0",
"bufferutil": "4.0.9",
@ -63,94 +63,94 @@
},
"dependencies": {
"@authenio/samlify-node-xmllint": "2.0.0",
"@aws-sdk/client-s3": "3.740.0",
"@aws-sdk/lib-storage": "3.740.0",
"@bull-board/api": "6.7.4",
"@bull-board/fastify": "6.7.4",
"@bull-board/ui": "6.7.4",
"@aws-sdk/client-s3": "3.777.0",
"@aws-sdk/lib-storage": "3.777.0",
"@bull-board/api": "6.7.10",
"@bull-board/fastify": "6.7.10",
"@bull-board/ui": "6.7.10",
"@discordapp/twemoji": "15.1.0",
"@elastic/elasticsearch": "8.17.0",
"@elastic/elasticsearch": "8.17.1",
"@fastify/accepts": "5.0.2",
"@fastify/cookie": "11.0.2",
"@fastify/cors": "10.0.2",
"@fastify/cors": "11.0.1",
"@fastify/express": "4.0.2",
"@fastify/formbody": "8.0.2",
"@fastify/http-proxy": "11.0.1",
"@fastify/http-proxy": "11.1.2",
"@fastify/multipart": "9.0.3",
"@fastify/static": "8.0.4",
"@fastify/view": "10.0.2",
"@fastify/static": "8.1.1",
"@fastify/view": "11.0.0",
"@misskey-dev/sharp-read-bmp": "1.2.0",
"@misskey-dev/summaly": "github:MisskeyIO/summaly#5.1.3",
"@napi-rs/canvas": "0.1.65",
"@nestjs/common": "11.0.7",
"@nestjs/core": "11.0.7",
"@nestjs/testing": "11.0.7",
"@napi-rs/canvas": "0.1.68",
"@nestjs/common": "11.0.12",
"@nestjs/core": "11.0.12",
"@nestjs/testing": "11.0.12",
"@peertube/http-signature": "1.7.0",
"@simplewebauthn/server": "13.1.1",
"@sinonjs/fake-timers": "11.3.1",
"@smithy/node-http-handler": "4.0.2",
"@smithy/node-http-handler": "4.0.4",
"@swc/cli": "0.6.0",
"@swc/core": "1.10.12",
"@swc/core": "1.11.13",
"@twemoji/parser": "15.1.1",
"accepts": "1.3.8",
"ajv": "8.17.1",
"archiver": "7.0.1",
"async-mutex": "0.5.0",
"bcryptjs": "2.4.3",
"bcryptjs": "3.0.2",
"blurhash": "2.0.5",
"body-parser": "1.20.3",
"bullmq": "5.39.1",
"body-parser": "2.2.0",
"bullmq": "5.45.2",
"cacheable-lookup": "7.0.0",
"cbor": "10.0.3",
"chalk": "5.4.1",
"chalk-template": "1.1.0",
"chokidar": "4.0.3",
"cli-highlight": "2.1.11",
"color-convert": "2.0.1",
"color-convert": "3.0.1",
"content-disposition": "0.5.4",
"date-fns": "4.1.0",
"deep-email-validator": "0.1.21",
"fastify": "5.2.1",
"fastify": "5.2.2",
"fastify-http-errors-enhanced": "6.0.1",
"fastify-raw-body": "5.0.0",
"feed": "4.2.2",
"file-type": "20.0.1",
"file-type": "20.4.1",
"fluent-ffmpeg": "2.1.3",
"form-data": "4.0.1",
"got": "14.4.5",
"form-data": "4.0.2",
"got": "14.4.6",
"hpagent": "1.2.0",
"htmlescape": "1.1.1",
"http-link-header": "1.1.3",
"ioredis": "5.4.2",
"ioredis": "5.6.0",
"ip-cidr": "4.0.2",
"ipaddr.js": "2.2.0",
"is-svg": "5.1.0",
"jose": "5.9.6",
"jose": "6.0.10",
"js-yaml": "4.1.0",
"jsdom": "26.0.0",
"json5": "2.2.3",
"jsonld": "8.3.3",
"jsrsasign": "11.1.0",
"meilisearch": "0.48.2",
"meilisearch": "0.49.0",
"mfm-js": "0.24.0",
"microformats-parser": "2.0.2",
"mime-types": "2.1.35",
"mime-types": "3.0.1",
"misskey-js": "workspace:*",
"misskey-reversi": "workspace:*",
"ms": "3.0.0-canary.1",
"nanoid": "5.0.9",
"nanoid": "5.1.5",
"nested-property": "4.0.0",
"node-fetch": "3.3.2",
"node-forge": "1.3.1",
"nodemailer": "6.10.0",
"nsfwjs": "4.2.0",
"oauth": "0.10.0",
"oauth": "0.10.2",
"oauth2orize": "1.12.0",
"oauth2orize-pkce": "0.1.2",
"os-utils": "0.0.14",
"otpauth": "9.3.6",
"otpauth": "9.4.0",
"parse5": "7.2.1",
"pg": "8.13.1",
"pg": "8.14.1",
"pino": "9.6.0",
"pino-pretty": "13.0.0",
"pkce-challenge": "4.1.0",
@ -166,10 +166,10 @@
"reflect-metadata": "0.2.2",
"rename": "1.0.4",
"rss-parser": "3.13.0",
"rxjs": "7.8.1",
"samlify": "2.8.11",
"sanitize-html": "2.14.0",
"secure-json-parse": "3.0.2",
"rxjs": "7.8.2",
"samlify": "2.9.1",
"sanitize-html": "2.15.0",
"secure-json-parse": "4.0.0",
"sharp": "0.33.5",
"slacc": "0.0.10",
"strict-event-emitter-types": "2.0.0",
@ -177,25 +177,24 @@
"systeminformation": "5.25.11",
"tinycolor2": "1.6.0",
"tmp": "0.2.3",
"tsc-alias": "1.8.10",
"tsc-alias": "1.8.13",
"tsconfig-paths": "4.2.0",
"typeorm": "0.3.20",
"typescript": "5.7.3",
"ulid": "2.3.0",
"typeorm": "0.3.21",
"typescript": "5.8.2",
"ulid": "3.0.0",
"vary": "1.1.2",
"web-push": "3.6.7",
"ws": "8.18.0",
"ws": "8.18.1",
"xev": "3.0.2",
"xmlbuilder": "15.1.1"
},
"devDependencies": {
"@jest/globals": "29.7.0",
"@misskey-dev/eslint-plugin": "1.0.0",
"@nestjs/platform-express": "11.0.7",
"@nestjs/platform-express": "11.0.12",
"@swc/jest": "0.2.37",
"@types/accepts": "1.3.7",
"@types/archiver": "6.0.3",
"@types/bcryptjs": "2.4.6",
"@types/body-parser": "1.19.5",
"@types/color-convert": "2.0.4",
"@types/content-disposition": "0.5.8",
@ -209,7 +208,7 @@
"@types/jsrsasign": "10.5.15",
"@types/mime-types": "2.1.4",
"@types/ms": "2.1.0",
"@types/node": "22.13.0",
"@types/node": "22.13.14",
"@types/node-forge": "1.3.11",
"@types/nodemailer": "6.4.17",
"@types/oauth": "0.9.6",
@ -223,15 +222,15 @@
"@types/random-seed": "0.3.5",
"@types/ratelimiter": "3.4.6",
"@types/rename": "1.0.7",
"@types/sanitize-html": "2.13.0",
"@types/semver": "7.5.8",
"@types/sanitize-html": "2.15.0",
"@types/semver": "7.7.0",
"@types/simple-oauth2": "5.0.7",
"@types/sinonjs__fake-timers": "8.1.5",
"@types/tinycolor2": "1.4.6",
"@types/tmp": "0.2.6",
"@types/vary": "1.1.3",
"@types/web-push": "3.6.4",
"@types/ws": "8.5.14",
"@types/ws": "8.18.0",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"aws-sdk-client-mock": "4.1.0",

View file

@ -44,6 +44,7 @@ import { correctFilename } from '@/misc/correct-filename.js';
import { isMimeImage } from '@/misc/is-mime-image.js';
import { ModerationLogService } from '@/core/ModerationLogService.js';
import { LoggerService } from '@/core/LoggerService.js';
import { NotificationService } from '@/core/NotificationService.js';
type AddFileArgs = {
/** User who wish to add file */
@ -129,6 +130,7 @@ export class DriveService {
private driveChart: DriveChart,
private perUserDriveChart: PerUserDriveChart,
private instanceChart: InstanceChart,
private notificationService: NotificationService,
) {
const logger = this.loggerService.getLogger('drive', 'blue');
this.registerLogger = logger.createSubLogger('register', 'yellow');
@ -146,8 +148,10 @@ export class DriveService {
*/
@bindThis
private async save(file: MiDriveFile, path: string, name: string, type: string, hash: string, size: number): Promise<MiDriveFile> {
// thunbnail, webpublic を必要なら生成
const alts = await this.generateAlts(path, type, !file.uri);
const fileType = type.split(';')[0];
// thunbnail, webpublic を必要なら生成
const alts = await this.generateAlts(path, fileType, !file.uri);
const meta = await this.metaService.fetch();
@ -156,17 +160,17 @@ export class DriveService {
let [ext] = (name.match(/\.([a-zA-Z0-9_-]+)$/) ?? ['']);
if (ext === '') {
if (type === 'image/jpeg') ext = '.jpg';
if (type === 'image/png') ext = '.png';
if (type === 'image/webp') ext = '.webp';
if (type === 'image/avif') ext = '.avif';
if (type === 'image/apng') ext = '.apng';
if (type === 'image/vnd.mozilla.apng') ext = '.apng';
if (fileType === 'image/jpeg') ext = '.jpg';
if (fileType === 'image/png') ext = '.png';
if (fileType === 'image/webp') ext = '.webp';
if (fileType === 'image/avif') ext = '.avif';
if (fileType === 'image/apng') ext = '.apng';
if (fileType === 'image/vnd.mozilla.apng') ext = '.apng';
}
// 拡張子からContent-Typeを設定してそうな挙動を示すオブジェクトストレージ (upcloud?) も存在するので、
// 許可されているファイル形式でしかURLに拡張子をつけない
if (!FILE_TYPE_BROWSERSAFE.includes(type)) {
if (!FILE_TYPE_BROWSERSAFE.includes(fileType)) {
ext = '';
}
@ -373,8 +377,10 @@ export class DriveService {
*/
@bindThis
private async upload(key: string, stream: fs.ReadStream | Buffer, type: string, ext?: string | null, filename?: string) {
if (type === 'image/apng') type = 'image/png';
if (!FILE_TYPE_BROWSERSAFE.includes(type)) type = 'application/octet-stream';
const fileType = type.split(';')[0];
if (fileType === 'image/apng') type = 'image/png';
if (!FILE_TYPE_BROWSERSAFE.includes(fileType)) type = 'application/octet-stream';
const meta = await this.metaService.fetch();
@ -660,13 +666,15 @@ export class DriveService {
@bindThis
public async updateFile(file: MiDriveFile, values: Partial<MiDriveFile>, updater: MiUser) {
const alwaysMarkNsfw = (await this.roleService.getUserPolicies(file.userId)).alwaysMarkNsfw;
const isModerator = await this.roleService.isModerator(updater);
if (values.name != null && !this.driveFileEntityService.validateFileName(values.name)) {
throw new DriveService.InvalidFileNameError();
}
if (values.isSensitive !== undefined && values.isSensitive !== file.isSensitive && alwaysMarkNsfw && !values.isSensitive) {
throw new DriveService.CannotUnmarkSensitiveError();
if (values.isSensitive !== undefined && values.isSensitive !== file.isSensitive && !values.isSensitive) {
if (alwaysMarkNsfw) throw new DriveService.CannotUnmarkSensitiveError();
if (file.isSensitiveByModerator && (file.userId === updater.id)) throw new DriveService.CannotUnmarkSensitiveError();
}
if (values.folderId != null) {
@ -680,6 +688,10 @@ export class DriveService {
}
}
if (isModerator && file.userId !== updater.id) {
values.isSensitiveByModerator = values.isSensitive;
}
await this.driveFilesRepository.update(file.id, values);
const fileObj = await this.driveFileEntityService.pack(file.id, updater, { self: true });
@ -689,7 +701,7 @@ export class DriveService {
this.globalEventService.publishDriveStream(file.userId, 'fileUpdated', fileObj);
}
if (await this.roleService.isModerator(updater) && (file.userId !== updater.id)) {
if (isModerator && (file.userId !== updater.id)) {
if (values.isSensitive !== undefined && values.isSensitive !== file.isSensitive) {
const user = file.userId ? await this.usersRepository.findOneByOrFail({ id: file.userId }) : null;
if (values.isSensitive) {
@ -699,6 +711,11 @@ export class DriveService {
fileUserUsername: user?.username ?? null,
fileUserHost: user?.host ?? null,
});
if (file.userId) {
this.notificationService.createNotification(file.userId, 'sensitiveFlagAssigned', {
fileId: file.id,
});
}
} else {
this.moderationLogService.log(updater, 'unmarkSensitiveDriveFile', {
fileId: file.id,

View file

@ -69,7 +69,8 @@ function compileQuery(q: Q): string {
export class SearchService {
private readonly meilisearchIndexScope: 'local' | 'global' | string[] = 'local';
private meilisearchNoteIndex: Index | null = null;
private elasticsearchNoteIndex: string | null = null;
private readonly elasticsearchNoteIndex: string;
private readonly elasticsearchIdField: string;
private logger: Logger;
constructor(
@ -121,7 +122,9 @@ export class SearchService {
},
});*/
} else if (this.elasticsearch) {
this.elasticsearchNoteIndex = `${config.elasticsearch!.index}---notes`;
this.elasticsearchNoteIndex = `${config.elasticsearch!.index}`;
this.elasticsearchIdField = `${config.host}_id`;
/* index
this.elasticsearch.indices.exists({
index: this.elasticsearchNoteIndex,
}).then((indexExists: boolean) => {
@ -175,6 +178,7 @@ export class SearchService {
}).catch((error: any) => {
this.logger.error('Error while checking if index exists', error);
});
*/
}
}
@ -213,6 +217,7 @@ export class SearchService {
primaryKey: 'id',
});
} else if (this.elasticsearch) {
/* index
const body = {
createdAt: createdAt.getTime(),
userId: note.userId,
@ -229,6 +234,7 @@ export class SearchService {
}).catch((error: any) => {
this.logger.error(error);
});
*/
}
}
@ -239,12 +245,14 @@ export class SearchService {
if (this.meilisearch) {
await this.meilisearchNoteIndex?.deleteDocument(note.id);
} else if (this.elasticsearch) {
/* index
await this.elasticsearch.delete({
index: `${this.elasticsearchNoteIndex}-${this.idService.parse(note.id).date.toISOString().slice(0, 7).replace(/-/g, '')}`,
id: note.id,
}).catch((error) => {
this.logger.error(error);
});
*/
}
}
@ -346,7 +354,7 @@ export class SearchService {
if (opts.channelId) esFilter.bool.must.push({ term: { channelId: opts.channelId } });
if (opts.host) {
if (opts.host === '.') {
esFilter.bool.must.push({ bool: { must_not: [{ exists: { field: 'userHost' } }] } });
esFilter.bool.must.push({ term: { userHost: this.config.host } });
} else {
esFilter.bool.must.push({ term: { userHost: opts.host } });
}
@ -358,8 +366,6 @@ export class SearchService {
should: [
{ wildcard: { 'text': { value: q } } },
{ simple_query_string: { fields: ['text'], 'query': q, default_operator: 'and' } },
{ wildcard: { 'cw': { value: q } } },
{ simple_query_string: { fields: ['cw'], 'query': q, default_operator: 'and' } },
],
minimum_should_match: 1,
},
@ -368,15 +374,16 @@ export class SearchService {
const res = await (this.elasticsearch.search)({
index: this.elasticsearchNoteIndex + '*' as string,
body: {
query: esFilter,
sort: [{ createdAt: { order: 'desc' } }],
},
_source: ['id', 'createdAt'],
query: esFilter,
sort: [{ createdAt: { order: 'desc' } }],
_source: ['id', 'createdAt', this.elasticsearchIdField],
size: pagination.limit,
});
const noteIds = res.hits.hits.map((hit: any) => hit._id);
const noteIds = res.hits.hits.map((hit) => {
const source = hit._source as Record<string, unknown>;
return (source[this.elasticsearchIdField] as string) || null;
}).filter((id): id is string => id !== null);
if (noteIds.length === 0) return [];
const notes = await this.notesRepository.findBy({
id: In(noteIds),

View file

@ -210,6 +210,9 @@ export class DriveFileEntityService {
md5: file.md5,
size: file.size,
isSensitive: file.isSensitive,
...(opts.detail ? {
isSensitiveByModerator: file.isSensitiveByModerator,
} : {}),
blurhash: file.blurhash,
properties: opts.self ? file.properties : this.getPublicProperties(file),
url: opts.self ? file.url : this.getPublicUrl(file),
@ -246,6 +249,9 @@ export class DriveFileEntityService {
md5: file.md5,
size: file.size,
isSensitive: file.isSensitive,
...(opts.detail ? {
isSensitiveByModerator: file.isSensitiveByModerator,
} : {}),
blurhash: file.blurhash,
properties: opts.self ? file.properties : this.getPublicProperties(file),
url: opts.self ? file.url : this.getPublicUrl(file),

View file

@ -183,6 +183,9 @@ export class NotificationEntityService implements OnModuleInit {
header: notification.customHeader,
icon: notification.customIcon,
} : {}),
...(notification.type === 'sensitiveFlagAssigned' ? {
fileId: notification.fileId,
} : {}),
});
}

View file

@ -4,6 +4,7 @@
*/
import * as fs from 'node:fs/promises';
import { WritableStream } from 'node:stream/web';
import type { PathLike } from 'node:fs';
/**

View file

@ -18,13 +18,13 @@ export async function genX509CertFromJWK(
cert.setIssuer(attrs);
cert.publicKey = await jose
.importJWK(JSON.parse(publicKey))
.then((k) => jose.exportSPKI(k as jose.KeyLike))
.then((k) => jose.exportSPKI(k as jose.CryptoKey))
.then((k) => forge.pki.publicKeyFromPem(k));
cert.sign(
await jose
.importJWK(JSON.parse(privateKey))
.then((k) => jose.exportPKCS8(k as jose.KeyLike))
.then((k) => jose.exportPKCS8(k as jose.CryptoKey))
.then((k) => forge.pki.privateKeyFromPem(k)),
forge.md.sha256.create(),
);

View file

@ -162,6 +162,12 @@ export class MiDriveFile {
})
public isSensitive: boolean;
@Index()
@Column('boolean', {
default: false,
})
public isSensitiveByModerator: boolean;
@Index()
@Column('boolean', {
default: false,

View file

@ -93,6 +93,11 @@ export type MiNotification = {
id: string;
createdAt: string;
draftId: MiScheduledNote['id'];
} | {
type: 'sensitiveFlagAssigned'
id: string;
fileId: string;
createdAt: string;
} | {
type: 'app';
id: string;

View file

@ -42,6 +42,10 @@ export const packedDriveFileSchema = {
type: 'boolean',
optional: false, nullable: false,
},
isSensitiveByModerator: {
type: 'boolean',
optional: true, nullable: true,
},
blurhash: {
type: 'string',
optional: false, nullable: true,

View file

@ -309,8 +309,8 @@ export const packedNotificationSchema = {
type: 'object',
ref: 'NoteDraft',
optional: false, nullable: false,
}
}
},
},
}, {
type: 'object',
properties: {
@ -324,8 +324,8 @@ export const packedNotificationSchema = {
type: 'object',
ref: 'Note',
optional: false, nullable: false,
}
}
},
},
}, {
type: 'object',
properties: {
@ -339,8 +339,21 @@ export const packedNotificationSchema = {
type: 'object',
ref: 'NoteDraft',
optional: false, nullable: false,
}
}
},
},
}, {
type: 'object',
properties: {
...baseSchema.properties,
type: {
type: 'string',
optional: false, nullable: false,
enum: ['sensitiveFlagAssigned'],
},
fileId: {
optional: false, nullable: false,
},
},
}, {
type: 'object',
properties: {

View file

@ -349,7 +349,7 @@ export class FileServerService {
return reply.redirect(
redirectUrl,
301,
302,
);
}

View file

@ -186,7 +186,7 @@ export class ServerService implements OnApplicationShutdown {
return reply.redirect(
url,
301,
302,
);
});

View file

@ -51,6 +51,12 @@ export const meta = {
code: 'RESTRICTED_BY_ROLE',
id: '7f59dccb-f465-75ab-5cf4-3ce44e3282f7',
},
restrictedByModerator: {
message: 'The isSensitive specified by the administrator cannot be changed.',
code: 'RESTRICTED_BY_ADMINISTRATOR',
id: '20e6c501-e579-400d-97e4-1c7efc286f35',
},
},
res: {
type: 'object',
@ -105,7 +111,11 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
} else if (e instanceof DriveService.NoSuchFolderError) {
throw new ApiError(meta.errors.noSuchFolder);
} else if (e instanceof DriveService.CannotUnmarkSensitiveError) {
throw new ApiError(meta.errors.restrictedByRole);
if (file.isSensitiveByModerator) {
throw new ApiError(meta.errors.restrictedByModerator);
} else {
throw new ApiError(meta.errors.restrictedByRole);
}
} else {
throw e;
}

View file

@ -105,7 +105,7 @@ export default abstract class Channel {
});
}
public abstract init(params: any): void;
public abstract init(params: any): Promise<void> | void;
public dispose?(): void;

View file

@ -215,7 +215,7 @@ class OAuth2Store {
}
async load(req: OAuth2DecisionRequest, cb: (err: Error | null, txn?: OAuth2) => void): Promise<void> {
const { transaction_id } = req.body;
const { transaction_id } = req.body ?? {};
if (!transaction_id) {
cb(new AuthorizationError('Missing transaction ID', 'invalid_request'));
return;

View file

@ -239,7 +239,7 @@ export class SAMLIdentifyProviderService {
metadata: await this.createIdPMetadataXml(ssoServiceProvider),
privateKey: await jose
.importJWK(JSON.parse(ssoServiceProvider.privateKey ?? '{}'))
.then(k => jose.exportPKCS8(k as jose.KeyLike)),
.then(k => jose.exportPKCS8(k as jose.CryptoKey)),
});
const sp = saml.ServiceProvider({
@ -393,7 +393,7 @@ export class SAMLIdentifyProviderService {
metadata: await this.createIdPMetadataXml(ssoServiceProvider),
privateKey: await jose
.importJWK(JSON.parse(ssoServiceProvider.privateKey ?? '{}'))
.then(k => jose.exportPKCS8(k as jose.KeyLike)),
.then(k => jose.exportPKCS8(k as jose.CryptoKey)),
loginResponseTemplate: { context: 'ignored' },
});

View file

@ -26,6 +26,7 @@ import type { MiNote } from '@/models/Note.js';
* noteScheduled - 稿
* scheduledNotePosted - 稿稿
* scheduledNoteError - 稿
* sensitiveFlagAssigned -
* app -
* test -
*/
@ -45,6 +46,7 @@ export const notificationTypes = [
'noteScheduled',
'scheduledNotePosted',
'scheduledNoteError',
'sensitiveFlagAssigned',
'app',
'test',
] as const;

View file

@ -119,6 +119,7 @@ describe('Timelines', () => {
const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]);
await api('following/create', { userId: bob.id }, alice);
await api('following/create', { userId: carol.id }, bob);
await api('following/update', { userId: bob.id, withReplies: true }, alice);
await sleep(1000);
const carolNote = await post(carol, { text: 'hi', visibility: 'followers' });

View file

@ -802,10 +802,10 @@ describe('ユーザー', () => {
{ label: '「見つけやすくする」がOFFのユーザーが含まれる', user: () => userNotExplorable },
{ label: 'ミュートユーザーが含まれない', user: () => userMutedByAlice, excluded: true },
{ label: 'ブロックされているユーザーが含まれる', user: () => userBlockedByAlice },
{ label: 'ブロックしてきているユーザーが含まれない', user: () => userBlockingAlice, excluded: true },
// 無効なテスト { label: 'ブロックしてきているユーザーが含まれない', user: () => userBlockingAlice, excluded: true },
{ label: '承認制ユーザーが含まれる', user: () => userLocking },
{ label: 'サイレンスユーザーが含まれる', user: () => userSilenced },
//{ label: 'サスペンドユーザーが含まれない', user: () => userSuspended, excluded: true },
// 無効なテスト { label: 'サスペンドユーザーが含まれない', user: () => userSuspended, excluded: true },
{ label: '削除済ユーザーが含まれる', user: () => userDeletedBySelf },
{ label: '削除済(byAdmin)ユーザーが含まれる', user: () => userDeletedByAdmin },
] as const)('がよくリプライをするユーザーのリストを取得でき、結果に$label', async ({ user, excluded }) => {

View file

@ -95,6 +95,7 @@ describe('NoteCreateService', () => {
folderId: null,
folder: null,
isSensitive: false,
isSensitiveByModerator: false,
maybeSensitive: false,
maybePorn: false,
isLink: false,

View file

@ -141,7 +141,10 @@ export const post = async (user: UserToken, params: misskey.Endpoints['notes/cre
const res = await api('notes/create', q, user);
return res.body ? res.body.createdNote : null;
assert.strictEqual(res.status, 200);
assert.notEqual(res.body, null);
return res.body.createdNote;
};
export const createAppToken = async (user: UserToken, permissions: (typeof misskey.permissions)[number][]) => {

View file

@ -1,14 +0,0 @@
declare module 'vue-gtag' {
export type GtagConsent = (command: 'consent', arg: 'default' | 'update', params: GtagConsentParams) => void;
export interface GtagConsentParams {
ad_storage?: 'granted' | 'denied',
ad_user_data?: 'granted' | 'denied',
ad_personalization?: 'granted' | 'denied',
analytics_storage?: 'granted' | 'denied',
functionality_storage?: 'granted' | 'denied',
personalization_storage?: 'granted' | 'denied',
security_storage?: 'granted' | 'denied',
wait_for_update?: number
}
}

Binary file not shown.

View file

@ -26,23 +26,23 @@
"@rollup/plugin-typescript": "12.1.2",
"@rollup/pluginutils": "5.1.4",
"@syuilo/aiscript": "0.19.0",
"@tabler/icons-webfont": "3.29.0",
"@tabler/icons-webfont": "3.31.0",
"@twemoji/parser": "15.1.1",
"@vitejs/plugin-vue": "5.2.1",
"@vitejs/plugin-vue": "5.2.3",
"@vue/compiler-sfc": "3.5.13",
"aiscript-vscode": "github:aiscript-dev/aiscript-vscode#v0.1.15",
"astring": "1.9.0",
"broadcast-channel": "7.0.0",
"broadcast-channel": "7.1.0",
"buraha": "0.0.1",
"canvas-confetti": "1.9.3",
"chart.js": "4.4.7",
"chart.js": "4.4.8",
"chartjs-adapter-date-fns": "3.0.0",
"chartjs-chart-matrix": "2.0.1",
"chartjs-chart-matrix": "3.0.0",
"chartjs-plugin-gradient": "0.6.1",
"chartjs-plugin-zoom": "2.2.0",
"chromatic": "11.25.2",
"chromatic": "11.27.0",
"compare-versions": "6.1.1",
"cropperjs": "2.0.0-rc.0",
"cropperjs": "2.0.0",
"date-fns": "4.1.0",
"escape-regexp": "0.0.1",
"estree-walker": "3.0.3",
@ -58,88 +58,88 @@
"misskey-reversi": "workspace:*",
"photoswipe": "5.4.4",
"punycode.js": "2.3.1",
"rollup": "4.34.0",
"sanitize-html": "2.14.0",
"sass": "1.83.4",
"shiki": "2.2.0",
"rollup": "4.38.0",
"sanitize-html": "2.15.0",
"sass": "1.86.0",
"shiki": "3.2.1",
"strict-event-emitter-types": "2.0.0",
"textarea-caret": "3.1.0",
"three": "0.173.0",
"three": "0.175.0",
"throttle-debounce": "5.0.2",
"tinycolor2": "1.6.0",
"tsc-alias": "1.8.10",
"tsc-alias": "1.8.13",
"tsconfig-paths": "4.2.0",
"typescript": "5.7.3",
"uuid": "11.0.5",
"typescript": "5.8.2",
"uuid": "11.1.0",
"v-code-diff": "1.13.1",
"vite": "6.0.11",
"vite": "6.2.3",
"vue": "3.5.13",
"vue-gtag": "2.0.1",
"vue-gtag": "3.1.1",
"vuedraggable": "next",
"webgl-audiovisualizer": "github:tar-bin/webgl-audiovisualizer"
},
"devDependencies": {
"@misskey-dev/eslint-plugin": "1.0.0",
"@misskey-dev/summaly": "github:MisskeyIO/summaly#5.1.3",
"@storybook/addon-actions": "8.5.2",
"@storybook/addon-essentials": "8.5.2",
"@storybook/addon-interactions": "8.5.2",
"@storybook/addon-links": "8.5.2",
"@storybook/addon-mdx-gfm": "8.5.2",
"@storybook/addon-storysource": "8.5.2",
"@storybook/blocks": "8.5.2",
"@storybook/components": "8.5.2",
"@storybook/core-events": "8.5.2",
"@storybook/manager-api": "8.5.2",
"@storybook/preview-api": "8.5.2",
"@storybook/react": "8.5.2",
"@storybook/react-vite": "8.5.2",
"@storybook/test": "8.5.2",
"@storybook/theming": "8.5.2",
"@storybook/types": "8.5.2",
"@storybook/vue3": "8.5.2",
"@storybook/vue3-vite": "8.5.2",
"@storybook/addon-actions": "8.6.11",
"@storybook/addon-essentials": "8.6.11",
"@storybook/addon-interactions": "8.6.11",
"@storybook/addon-links": "8.6.11",
"@storybook/addon-mdx-gfm": "8.6.11",
"@storybook/addon-storysource": "8.6.11",
"@storybook/blocks": "8.6.11",
"@storybook/components": "8.6.11",
"@storybook/core-events": "8.6.11",
"@storybook/manager-api": "8.6.11",
"@storybook/preview-api": "8.6.11",
"@storybook/react": "8.6.11",
"@storybook/react-vite": "8.6.11",
"@storybook/test": "8.6.11",
"@storybook/theming": "8.6.11",
"@storybook/types": "8.6.11",
"@storybook/vue3": "8.6.11",
"@storybook/vue3-vite": "8.6.11",
"@testing-library/vue": "8.1.0",
"@types/canvas-confetti": "^1.6.4",
"@types/escape-regexp": "0.0.3",
"@types/estree": "1.0.6",
"@types/estree": "1.0.7",
"@types/matter-js": "0.19.8",
"@types/micromatch": "4.0.9",
"@types/node": "22.13.0",
"@types/node": "22.13.14",
"@types/punycode.js": "npm:@types/punycode@2.1.4",
"@types/sanitize-html": "2.13.0",
"@types/three": "0.173.0",
"@types/sanitize-html": "2.15.0",
"@types/three": "0.175.0",
"@types/throttle-debounce": "5.0.2",
"@types/tinycolor2": "1.4.6",
"@types/ws": "8.5.14",
"@types/ws": "8.18.0",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"@vitest/coverage-v8": "3.0.4",
"@vitest/coverage-v8": "3.0.9",
"@vue/runtime-core": "3.5.13",
"acorn": "8.14.0",
"acorn": "8.14.1",
"cross-env": "7.0.3",
"cypress": "14.0.1",
"cypress": "14.2.1",
"eslint": "8.57.1",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-vue": "9.32.0",
"fast-glob": "3.3.3",
"happy-dom": "16.8.1",
"happy-dom": "17.4.4",
"intersection-observer": "0.12.2",
"micromatch": "4.0.8",
"msw": "2.7.0",
"msw": "2.7.3",
"msw-storybook-addon": "2.0.4",
"nodemon": "3.1.9",
"prettier": "3.4.2",
"react": "19.0.0",
"react-dom": "19.0.0",
"start-server-and-test": "2.0.10",
"storybook": "8.5.2",
"prettier": "3.5.3",
"react": "19.1.0",
"react-dom": "19.1.0",
"start-server-and-test": "2.0.11",
"storybook": "8.6.11",
"storybook-addon-misskey-theme": "github:misskey-dev/storybook-addon-misskey-theme",
"vite-plugin-turbosnap": "1.0.3",
"vitest": "3.0.4",
"vitest": "3.0.9",
"vitest-fetch-mock": "0.3.0",
"vue-component-type-helpers": "2.2.0",
"vue-component-type-helpers": "2.2.8",
"vue-eslint-parser": "9.4.3",
"vue-tsc": "2.2.0"
"vue-tsc": "2.2.8"
}
}

View file

@ -25,7 +25,8 @@ import { miLocalStorage } from '@/local-storage.js';
import { fetchCustomEmojis } from '@/custom-emojis.js';
import { setupRouter } from '@/router/definition.js';
import { mainRouter } from '@/router/main.js';
import VueGtag, { bootstrap as gtagBootstrap, GtagConsent, GtagConsentParams } from 'vue-gtag';
import { createGtag, addGtag, consent as gtagConsent } from 'vue-gtag';
import type { GtagConsentParams } from '@/types/gtag.js';
export async function common(createVue: () => App<Element>) {
console.info(`Misskey v${version}`);
@ -283,21 +284,21 @@ export async function common(createVue: () => App<Element>) {
components(app);
if (instance.googleAnalyticsId) {
app.use(VueGtag, {
bootstrap: false,
appName: `Misskey v${version}`,
pageTrackerEnabled: true,
pageTrackerScreenviewEnabled: true,
app.use(createGtag( {
tagId: instance.googleAnalyticsId,
config: {
id: instance.googleAnalyticsId,
params: {
anonymize_ip: false,
send_page_view: true,
},
anonymize_ip: false,
send_page_view: true,
},
}, mainRouter);
pageTracker: {
router: mainRouter,
useScreenview: true,
},
initMode: 'manual',
appName: `Misskey v${version}`,
}));
const gtagConsent = miLocalStorage.getItemAsJson('gtagConsent') as GtagConsentParams ?? {
const gtagConsentParams = miLocalStorage.getItemAsJson('gtagConsent') as GtagConsentParams ?? {
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
@ -306,13 +307,12 @@ export async function common(createVue: () => App<Element>) {
personalization_storage: 'denied',
security_storage: 'granted',
};
miLocalStorage.setItemAsJson('gtagConsent', gtagConsent);
if (typeof window['gtag'] === 'function') (window['gtag'] as GtagConsent)('consent', 'default', gtagConsent);
miLocalStorage.setItemAsJson('gtagConsent', gtagConsentParams);
gtagConsent('default', gtagConsentParams);
if (miLocalStorage.getItem('gaConsent') === 'true') {
// noinspection ES6MissingAwait
gtagBootstrap();
addGtag();
}
}

View file

@ -11,6 +11,7 @@ import { i18n } from '@/i18n.js';
import * as os from '@/os.js';
import { defaultStore } from '@/store.js';
import { MisskeyEntity } from '@/types/date-separated-list.js';
import { isAprilFoolsDay } from '@/scripts/seasonal-events';
export default defineComponent({
props: {
@ -136,14 +137,15 @@ export default defineComponent({
[$style['date-separated-list-nogap']]: props.noGap,
[$style['direction-down']]: props.direction === 'down',
[$style['direction-up']]: props.direction === 'up',
[$style['april-fool']]: defaultStore.state.animation ? isAprilFoolsDay() : false,
};
return () => defaultStore.state.animation ? h(TransitionGroup, {
class: classes,
name: 'list',
tag: 'div',
onBeforeLeave,
onLeaveCancelled,
onBeforeLeave: !isAprilFoolsDay() ? onBeforeLeave : undefined,
onLeaveCancelled: !isAprilFoolsDay() ? onLeaveCancelled : undefined,
}, { default: renderChildren }) : h('div', {
class: classes,
}, { default: renderChildren });
@ -210,6 +212,13 @@ export default defineComponent({
}
}
.april-fool {
&:global > .list-enter-from,
&:global > .list-leave-to {
animation: global-spin-shrink 3s ease-in forwards;
}
}
.separator {
text-align: center;
}

View file

@ -8,6 +8,14 @@ SPDX-License-Identifier: AGPL-3.0-only
<div :class="$style.head">
<MkAvatar v-if="['pollEnded', 'note'].includes(notification.type) && notification.note" :class="$style.icon" :user="notification.note.user" link preview/>
<MkAvatar v-else-if="['roleAssigned', 'achievementEarned', 'noteScheduled', 'scheduledNotePosted', 'scheduledNoteError'].includes(notification.type)" :class="$style.icon" :user="$i" link preview/>
<div
v-else-if="notification.type === 'sensitiveFlagAssigned'"
:class="$style.iconFrame"
>
<div :class="[$style.iconInner]">
<img :class="$style.iconImg" src="/fluent-emoji/1f6a9.png">
</div>
</div>
<div v-else-if="notification.type === 'reaction:grouped' && notification.note.reactionAcceptance === 'likeOnly'" :class="[$style.icon, $style.icon_reactionGroupHeart]"><i class="ti ti-heart" style="line-height: 1;"></i></div>
<div v-else-if="notification.type === 'reaction:grouped'" :class="[$style.icon, $style.icon_reactionGroup]"><i class="ti ti-plus" style="line-height: 1;"></i></div>
<div v-else-if="notification.type === 'renote:grouped'" :class="[$style.icon, $style.icon_renoteGroup]"><i class="ti ti-repeat" style="line-height: 1;"></i></div>
@ -71,6 +79,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<span v-else-if="notification.type === 'reaction:grouped'" :class="$style.headerName">{{ i18n.tsx._notification.reactedBySomeUsers({ n: getActualReactedUsersCount(notification) }) }}</span>
<span v-else-if="notification.type === 'renote:grouped'" :class="$style.headerName">{{ i18n.tsx._notification.renotedBySomeUsers({ n: notification.users.length }) }}</span>
<span v-else-if="notification.type === 'app'" :class="$style.headerName">{{ notification.header }}</span>
<MkA v-else-if="notification.type === 'sensitiveFlagAssigned'" :to="'/my/drive/file/'+notification.fileId" :class="$style.headerName">{{ i18n.ts._notification.sensitiveFlagAssigned }}</MkA>
<MkTime v-if="withTime" :time="notification.createdAt" :class="$style.headerTime"/>
</header>
<div>
@ -159,6 +168,10 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkAvatar :class="$style.reactionsItemAvatar" :user="user" link preview/>
</div>
</div>
<Mfm v-else-if="notification.type === 'sensitiveFlagAssigned'" :text="i18n.ts.sensitiveByModerator"/>
<span v-if="['sensitiveFlagAssigned'].includes(notification.type)" :class="$style.text" style="opacity: 0.6;">
{{ i18n.ts.thisInfoIsNotVisibleOtherUser }}
</span>
</div>
</div>
</div>
@ -341,6 +354,12 @@ function getActualReactedUsersCount(notification: Misskey.entities.Notification)
pointer-events: none;
}
.t_sensitiveFlagAssigned {
padding: 3px;
background: var(--eventOther);
pointer-events: none;
}
.tail {
flex: 1;
min-width: 0;
@ -430,6 +449,42 @@ function getActualReactedUsersCount(notification: Misskey.entities.Notification)
color: #fff;
}
.iconFrame {
position: relative;
width: 100%;
height: 100%;
padding: 4px;
border-radius: 100%;
box-sizing: border-box;
pointer-events: none;
user-select: none;
filter: drop-shadow(0px 2px 2px #00000044);
box-shadow: 0 1px 0px #ffffff88 inset;
overflow: clip;
background: linear-gradient(0deg, #703827, #d37566);
}
.iconImg {
width: calc(100% - 12px);
height: calc(100% - 12px);
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
filter: drop-shadow(0px 1px 2px #000000aa);
}
.iconInner {
position: relative;
width: 100%;
height: 100%;
border-radius: 100%;
box-shadow: 0 1px 0px #ffffff88 inset;
background: linear-gradient(0deg, #d37566, #703827);
}
@container (max-width: 600px) {
.root {
padding: 16px;

View file

@ -24,7 +24,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<script lang="ts" setup>
import { onUnmounted, onMounted, computed, shallowRef, onActivated } from 'vue';
import { onUnmounted, onMounted, computed, ref, shallowRef, onActivated } from 'vue';
import MkPagination from '@/components/MkPagination.vue';
import XNotification from '@/components/MkNotification.vue';
import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue';
@ -43,6 +43,7 @@ const props = defineProps<{
}>();
const pagingComponent = shallowRef<InstanceType<typeof MkPagination>>();
const hasNewNotificationWhileTabHidden = ref(false);
const pagination = computed(() => defaultStore.reactiveState.useGroupedNotifications.value ? {
endpoint: 'i/notifications-grouped' as const,
@ -64,9 +65,13 @@ function onNotification(notification) {
useStream().send('readNotification');
}
if (!isMuted && filterMutedNotification(notification)) {
if (!document.hidden && !isMuted && filterMutedNotification(notification)) {
pagingComponent.value?.prepend(notification);
}
if (document.hidden && !hasNewNotificationWhileTabHidden.value) {
hasNewNotificationWhileTabHidden.value = true;
}
}
function reload() {
@ -77,12 +82,22 @@ function reload() {
});
}
function onVisibilityChange() {
if (document.visibilityState === 'visible') {
if (hasNewNotificationWhileTabHidden.value) {
hasNewNotificationWhileTabHidden.value = false;
reload();
}
}
}
let connection: Misskey.ChannelConnection<Misskey.Channels['main']>;
onMounted(() => {
connection = useStream().useChannel('main');
connection.on('notification', onNotification);
connection.on('notificationFlushed', reload);
document.addEventListener('visibilitychange', onVisibilityChange);
});
onActivated(() => {
@ -91,6 +106,7 @@ onActivated(() => {
onUnmounted(() => {
if (connection) connection.dispose();
document.removeEventListener('visibilitychange', onVisibilityChange);
});
defineExpose({

View file

@ -209,6 +209,10 @@ const reload = (): Promise<void> => {
return init();
};
const deleteItem = () => {
items.value = [];
};
const fetchMore = async (): Promise<void> => {
if (!more.value || fetching.value || moreFetching.value || items.value.length === 0) return;
moreFetching.value = true;
@ -414,9 +418,16 @@ defineExpose({
more,
reload,
prepend,
deleteItem,
append: appendItem,
removeItem,
updateItem,
stopFetch: () => {
more.value = false;
},
startFetch: () => {
more.value = true;
},
});
</script>

View file

@ -17,7 +17,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<script lang="ts" setup>
import { computed, watch, onUnmounted, provide, shallowRef } from 'vue';
import { computed, watch, onUnmounted, provide, shallowRef, onMounted } from 'vue';
import * as Misskey from 'misskey-js';
import MkNotes from '@/components/MkNotes.vue';
import MkPullToRefresh from '@/components/MkPullToRefresh.vue';
@ -69,35 +69,44 @@ const prComponent = shallowRef<InstanceType<typeof MkPullToRefresh>>();
const tlComponent = shallowRef<InstanceType<typeof MkNotes>>();
let tlNotesCount = 0;
const notVisibleNoteData = new Array<object>();
async function prepend(data) {
if (tlComponent.value == null) return;
let note = data;
//
// minimizeid
if (!data.visibility) {
const res = await window.fetch(`/notes/${data.id}.json`, {
method: 'GET',
credentials: 'omit',
headers: {
'Authorization': 'anonymous',
'X-Client-Transaction-Id': generateClientTransactionId('misskey'),
},
});
if (!res.ok) return;
note = deepMerge(data, await res.json());
if (!document.hidden) {
//
// minimizeid
if (!data.visibility) {
const res = await window.fetch(`/notes/${data.id}.json`, {
method: 'GET',
credentials: 'omit',
headers: {
'Authorization': 'anonymous',
'X-Client-Transaction-Id': generateClientTransactionId('misskey'),
},
});
if (!res.ok) return;
note = deepMerge(data, await res.json());
}
tlNotesCount++;
if (instance.notesPerOneAd > 0 && tlNotesCount % instance.notesPerOneAd === 0) {
note._shouldInsertAd_ = true;
}
tlComponent.value.pagingComponent?.prepend(note);
} else {
notVisibleNoteData.push(data);
if (notVisibleNoteData.length > 10) {
notVisibleNoteData.shift();
}
}
tlNotesCount++;
if (instance.notesPerOneAd > 0 && tlNotesCount % instance.notesPerOneAd === 0) {
note._shouldInsertAd_ = true;
}
tlComponent.value.pagingComponent?.prepend(note);
emit('note');
if (props.sound) {
@ -105,6 +114,23 @@ async function prepend(data) {
}
}
async function loadUnloadedNotes() {
if (document.hidden) return;
if (tlComponent.value == null) return;
if (notVisibleNoteData.length === 0) return;
if (notVisibleNoteData.length >= 10) {
tlComponent.value.pagingComponent?.deleteItem();
tlComponent.value.pagingComponent?.stopFetch();
}
while (notVisibleNoteData.length > 0) {
await prepend(notVisibleNoteData.shift());
}
tlComponent.value.pagingComponent?.startFetch();
}
let connection: Misskey.ChannelConnection | null = null;
let connection2: Misskey.ChannelConnection | null = null;
let paginationQuery: Paging | null = null;
@ -291,8 +317,13 @@ watch(() => [props.list, props.antenna, props.channel, props.role, props.withRen
//
refreshEndpointAndChannel();
onMounted(() => {
document.addEventListener('visibilitychange', loadUnloadedNotes);
});
onUnmounted(() => {
disconnectChannel();
document.removeEventListener('visibilitychange', loadUnloadedNotes);
});
function reloadTimeline() {

View file

@ -59,12 +59,8 @@ import { host } from '@/config.js';
import { i18n } from '@/i18n.js';
import { $i } from '@/account.js';
import * as os from '@/os.js';
import {
bootstrap as gtagBootstrap,
GtagConsent,
GtagConsentParams,
set as gtagSet
} from 'vue-gtag';
import { addGtag, consent as gtagConsent, set as gtagSet } from 'vue-gtag';
import type { GtagConsentParams } from '@/types/gtag.js';
const emit = defineEmits<(ev: 'closed') => void>();
@ -76,7 +72,7 @@ const gtagConsentPersonalization = ref(false);
function consentAll() {
miLocalStorage.setItem('gaConsent', 'true');
const gtagConsent = <GtagConsentParams>{
const params = <GtagConsentParams>{
ad_storage: 'granted',
ad_user_data: 'granted',
ad_personalization: 'granted',
@ -85,9 +81,8 @@ function consentAll() {
personalization_storage: 'granted',
security_storage: 'granted',
};
miLocalStorage.setItemAsJson('gtagConsent', gtagConsent);
if (typeof window['gtag'] === 'function') (window['gtag'] as GtagConsent)('consent', 'update', gtagConsent);
miLocalStorage.setItemAsJson('gtagConsent', params);
gtagConsent('update', params);
bootstrap();
emit('closed');
@ -95,7 +90,7 @@ function consentAll() {
function consentEssential() {
miLocalStorage.setItem('gaConsent', 'true');
const gtagConsent = <GtagConsentParams>{
const params = <GtagConsentParams>{
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
@ -104,9 +99,8 @@ function consentEssential() {
personalization_storage: 'denied',
security_storage: 'granted',
};
miLocalStorage.setItemAsJson('gtagConsent', gtagConsent);
if (typeof window['gtag'] === 'function') (window['gtag'] as GtagConsent)('consent', 'update', gtagConsent);
miLocalStorage.setItemAsJson('gtagConsent', params);
gtagConsent('update', params);
bootstrap();
emit('closed');
@ -114,7 +108,7 @@ function consentEssential() {
function consentSelected() {
miLocalStorage.setItem('gaConsent', 'true');
const gtagConsent = <GtagConsentParams>{
const params = <GtagConsentParams>{
ad_storage: gtagConsentAnalytics.value ? 'granted' : 'denied',
ad_user_data: gtagConsentFunctionality.value ? 'granted' : 'denied',
ad_personalization: gtagConsentPersonalization.value ? 'granted' : 'denied',
@ -123,16 +117,15 @@ function consentSelected() {
personalization_storage: gtagConsentPersonalization.value ? 'granted' : 'denied',
security_storage: 'granted',
};
miLocalStorage.setItemAsJson('gtagConsent', gtagConsent);
if (typeof window['gtag'] === 'function') (window['gtag'] as GtagConsent)('consent', 'update', gtagConsent);
miLocalStorage.setItemAsJson('gtagConsent', params);
gtagConsent('update', params);
bootstrap();
emit('closed');
}
function bootstrap() {
gtagBootstrap();
addGtag();
gtagSet({
'client_id': miLocalStorage.getItem('id'),
'user_id': $i?.id,

View file

@ -70,6 +70,7 @@ export const notificationTypes = [
'noteScheduled',
'scheduledNotePosted',
'scheduledNoteError',
'sensitiveFlagAssigned',
'app',
] as const;
export const obsoleteNotificationTypes = ['pollVote', 'groupInvited'] as const;

View file

@ -6,6 +6,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<div class="_gaps">
<MkInfo>{{ i18n.ts._fileViewer.thisPageCanBeSeenFromTheAuthor }}</MkInfo>
<MkInfo v-if="file && file.isSensitiveByModerator" :warn="true">
<Mfm :text="i18n.ts.sensitiveByModerator"/>
</MkInfo>
<MkLoading v-if="fetching"/>
<div v-else-if="file" class="_gaps">
<div :class="$style.filePreviewRoot">
@ -23,12 +26,14 @@ SPDX-License-Identifier: AGPL-3.0-only
<button v-if="isImage" v-tooltip="i18n.ts.cropImage" class="_button" :class="$style.fileQuickActionsOthersButton" @click="crop()">
<i class="ti ti-crop"></i>
</button>
<button v-if="file.isSensitive" v-tooltip="i18n.ts.unmarkAsSensitive" class="_button" :class="$style.fileQuickActionsOthersButton" @click="toggleSensitive()">
<i class="ti ti-eye"></i>
</button>
<button v-else v-tooltip="i18n.ts.markAsSensitive" class="_button" :class="$style.fileQuickActionsOthersButton" @click="toggleSensitive()">
<i class="ti ti-eye-exclamation"></i>
</button>
<span v-if="!file.isSensitiveByModerator">
<button v-if="file.isSensitive" v-tooltip="i18n.ts.unmarkAsSensitive" class="_button" :class="$style.fileQuickActionsOthersButton" @click="toggleSensitive()">
<i class="ti ti-eye"></i>
</button>
<button v-else v-tooltip="i18n.ts.markAsSensitive" class="_button" :class="$style.fileQuickActionsOthersButton" @click="toggleSensitive()">
<i class="ti ti-eye-exclamation"></i>
</button>
</span>
<a v-tooltip="i18n.ts.download" :href="file.url" :download="file.name" class="_button" :class="$style.fileQuickActionsOthersButton">
<i class="ti ti-download"></i>
</a>

View file

@ -21,6 +21,9 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
<div class="_margin _gaps_s">
<MkRemoteCaution v-if="note.user.host != null" :href="note.url ?? note.uri"/>
<MkInfo v-if="hasSensitiveFiles" :warn="true">
<Mfm :text="i18n.ts.sensitiveByModerator"/>
</MkInfo>
<MkNoteDetailed :key="note.id" v-model:note="note" :initialTab="initialTab" :class="$style.note"/>
</div>
<div v-if="clips && clips.length > 0" class="_margin">
@ -63,7 +66,8 @@ import { dateString } from '@/filters/date.js';
import MkClipPreview from '@/components/MkClipPreview.vue';
import { defaultStore } from '@/store.js';
import MkNoteNotFound from '@/components/MkNoteNotFound.vue';
import { iAmModerator } from '@/account.js';
import { $i, iAmModerator } from '@/account.js';
import MkInfo from '@/components/MkInfo.vue';
const props = defineProps<{
noteId: string;
@ -72,6 +76,7 @@ const props = defineProps<{
const note = ref<null | Misskey.entities.Note>();
const clips = ref<Misskey.entities.Clip[]>();
const hasSensitiveFiles = ref(false);
const showPrev = ref<'user' | 'channel' | false>(false);
const showNext = ref<'user' | 'channel' | false>(false);
const error = ref();
@ -125,6 +130,15 @@ function fetchNote() {
noteId: props.noteId,
}).then(res => {
note.value = res;
if (note.value.userId === $i?.id && note.value.fileIds) {
Promise.all(note.value.fileIds.map(fileId =>
misskeyApi('drive/files/show', { fileId: fileId }),
)).then(files => {
hasSensitiveFiles.value = files.some(file => file.isSensitiveByModerator);
});
}
// 2023-10-01notes/clips
if (note.value.clippedCount > 0 || new Date(note.value.createdAt).getTime() < new Date('2023-10-01').getTime()) {
misskeyApi('notes/clips', {

View file

@ -109,7 +109,8 @@ import { unisonReload } from '@/scripts/unison-reload.js';
import { miLocalStorage } from '@/local-storage.js';
import { instance } from '@/instance.js';
import { host } from '@/config.js';
import { GtagConsent, GtagConsentParams } from 'vue-gtag';
import { consent as gtagConsent } from 'vue-gtag';
import type { GtagConsentParams } from '@/types/gtag.js';
const $i = signinRequired();
@ -136,18 +137,17 @@ const gaConsent = computed({
gaConsentInternal.value = value;
},
});
const gtagConsentInternal = ref(
(miLocalStorage.getItemAsJson('gtagConsent') as GtagConsentParams) ?? {
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
analytics_storage: 'denied',
functionality_storage: 'denied',
personalization_storage: 'denied',
security_storage: 'granted',
},
);
const gtagConsent = computed({
const gtagConsentInternal = ref({
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
analytics_storage: 'denied',
functionality_storage: 'denied',
personalization_storage: 'denied',
security_storage: 'granted',
...(miLocalStorage.getItemAsJson('gtagConsent') as GtagConsentParams),
});
const gtagConsentParams = computed({
get: () => gtagConsentInternal.value,
set: (value: GtagConsentParams) => {
miLocalStorage.setItemAsJson('gtagConsent', value);
@ -155,10 +155,10 @@ const gtagConsent = computed({
},
});
const gtagConsentAnalytics = computed({
get: () => gtagConsent.value.analytics_storage === 'granted',
get: () => gtagConsentParams.value.analytics_storage === 'granted',
set: (value: boolean) => {
gtagConsent.value = {
...gtagConsent.value,
gtagConsentParams.value = {
...gtagConsentParams.value,
ad_storage: value ? 'granted' : 'denied',
ad_user_data: value ? 'granted' : 'denied',
analytics_storage: value ? 'granted' : 'denied',
@ -166,19 +166,19 @@ const gtagConsentAnalytics = computed({
},
});
const gtagConsentFunctionality = computed({
get: () => gtagConsent.value.functionality_storage === 'granted',
get: () => gtagConsentParams.value.functionality_storage === 'granted',
set: (value: boolean) => {
gtagConsent.value = {
...gtagConsent.value,
gtagConsentParams.value = {
...gtagConsentParams.value,
functionality_storage: value ? 'granted' : 'denied',
};
},
});
const gtagConsentPersonalization = computed({
get: () => gtagConsent.value.personalization_storage === 'granted',
get: () => gtagConsentParams.value.personalization_storage === 'granted',
set: (value: boolean) => {
gtagConsent.value = {
...gtagConsent.value,
gtagConsentParams.value = {
...gtagConsentParams.value,
ad_personalization: value ? 'granted' : 'denied',
personalization_storage: value ? 'granted' : 'denied',
};
@ -199,8 +199,8 @@ watch(gaConsent, async () => {
await reloadAsk();
});
watch(gtagConsent, async () => {
if (typeof window['gtag'] === 'function') (window['gtag'] as GtagConsent)('consent', 'update', gtagConsent.value);
watch(gtagConsentParams, async () => {
gtagConsent('update', gtagConsentParams.value as GtagConsentParams);
});
function save() {

View file

@ -20,6 +20,8 @@ import { clipsCache } from '@/cache.js';
import { MenuItem } from '@/types/menu.js';
import MkRippleEffect from '@/components/MkRippleEffect.vue';
import { isSupportShare } from '@/scripts/navigator.js';
import { isMute, playUrl } from '@/scripts/sound.js';
import { isAprilFoolsDay } from '@/scripts/seasonal-events.js';
export async function getNoteClipMenu(props: {
note: Misskey.entities.Note;
@ -180,10 +182,14 @@ export function getNoteMenu(props: {
function del(): void {
os.confirm({
type: 'warning',
text: i18n.ts.noteDeleteConfirm,
text: isAprilFoolsDay() ? i18n.ts.deleteNotWash + '\n' + i18n.ts.noteDeleteConfirm : i18n.ts.noteDeleteConfirm,
}).then(({ canceled }) => {
if (canceled) return;
if (isAprilFoolsDay() && !isMute()) {
playUrl('/client-assets/sounds/flush.mp3', { volume: defaultStore.state.sound_masterVolume });
}
misskeyApi('notes/delete', {
noteId: appearNote.id,
});
@ -456,8 +462,8 @@ export function getNoteMenu(props: {
action: delEdit,
} : undefined,
{
icon: 'ti ti-trash',
text: i18n.ts.delete,
icon: isAprilFoolsDay() ? 'ti ti-whirl' : 'ti ti-trash',
text: isAprilFoolsDay() ? i18n.ts.flushItAway : i18n.ts.delete,
disabled: !appearNote.isDeletable,
danger: true,
action: del,

View file

@ -0,0 +1,47 @@
enum EventTypes {
Christmas = 0,
NewYear = 1,
ValentinesDay = 2,
Halloween = 3,
AprilFoolsDay = 4,
Unknown = 5
}
export const isEventDay = (): EventTypes => {
const date = new Date();
const month = date.getMonth();
const day = date.getDate();
// jsで月を0から始まる
// 例えば4月は月の値が3になる
if (month === 11 && day === 25) return EventTypes.Christmas;
if (month === 0 && day === 1) return EventTypes.NewYear;
if (month === 1 && day === 14) return EventTypes.ValentinesDay;
if (month === 9 && day === 31) return EventTypes.Halloween;
if (month === 3 && day === 1) return EventTypes.AprilFoolsDay;
return EventTypes.Unknown;
};
export const isAprilFoolsDay = (): boolean => {
return isEventDay() === EventTypes.AprilFoolsDay;
};
export const isChristmas = (): boolean => {
return isEventDay() === EventTypes.Christmas;
};
export const isNewYear = (): boolean => {
return isEventDay() === EventTypes.NewYear;
};
export const isValentinesDay = (): boolean => {
return isEventDay() === EventTypes.ValentinesDay;
};
export const isHalloween = (): boolean => {
return isEventDay() === EventTypes.Halloween;
};
export const isUnknown = (): boolean => {
return isEventDay() === EventTypes.Unknown;
};

View file

@ -8,8 +8,8 @@
import { generateClientTransactionId } from '@/scripts/misskey-api.js';
import { miLocalStorage } from '@/local-storage.js';
import { GtagConsentParams } from 'vue-gtag';
import { instance } from '@/instance.js';
import type { GtagConsentParams } from '@/types/gtag.js';
export interface UsageReport {
t: number;

View file

@ -534,6 +534,17 @@ html[data-color-mode=dark] ._woodenFrame {
}
}
@keyframes global-spin-shrink {
0% {
transform: rotate(0deg) scale(1);
opacity: 1;
}
100% {
transform: rotate(2160deg) scale(0);
opacity: 0;
}
}
._anime_bounce {
will-change: transform;
animation: global-bounce ease 0.7s;

View file

@ -0,0 +1,11 @@
export interface GtagConsentParams {
ad_storage?: 'granted' | 'denied',
ad_user_data?: 'granted' | 'denied',
ad_personalization?: 'granted' | 'denied',
analytics_storage?: 'granted' | 'denied',
functionality_storage?: 'granted' | 'denied',
personalization_storage?: 'granted' | 'denied',
security_storage?: 'granted' | 'denied',
wait_for_update?: number,
region?: string[],
}

View file

@ -26,19 +26,19 @@
"devDependencies": {
"@misskey-dev/eslint-plugin": "1.0.0",
"@types/matter-js": "0.19.8",
"@types/node": "22.13.0",
"@types/node": "22.13.14",
"@types/seedrandom": "3.0.8",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"eslint": "8.57.1",
"nodemon": "3.1.9",
"typescript": "5.7.3"
"typescript": "5.8.2"
},
"files": [
"built"
],
"dependencies": {
"esbuild": "0.24.2",
"esbuild": "0.25.2",
"eventemitter3": "5.0.1",
"glob": "11.0.1",
"matter-js": "0.20.0",

View file

@ -8,16 +8,16 @@
},
"devDependencies": {
"@misskey-dev/eslint-plugin": "1.0.0",
"@readme/openapi-parser": "2.7.0",
"@types/node": "22.13.0",
"@readme/openapi-parser": "3.0.1",
"@types/node": "22.13.14",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"eslint": "8.57.1",
"openapi-types": "12.1.3",
"openapi-typescript": "6.7.6",
"ts-case-convert": "2.1.0",
"tsx": "4.19.2",
"typescript": "5.7.3"
"tsx": "4.19.3",
"typescript": "5.8.2"
},
"files": [
"built"

View file

@ -1,7 +1,7 @@
import { mkdir, writeFile } from 'fs/promises';
import { OpenAPIV3_1 } from 'openapi-types';
import { toPascal } from 'ts-case-convert';
import OpenAPIParser from '@readme/openapi-parser';
import { parse as OpenAPIParser } from '@readme/openapi-parser';
import openapiTS from 'openapi-typescript';
async function generateBaseTypes(
@ -319,7 +319,7 @@ async function main() {
await mkdir(generatePath, { recursive: true });
const openApiJsonPath = './api.json';
const openApiDocs = await OpenAPIParser.parse(openApiJsonPath) as OpenAPIV3_1.Document;
const openApiDocs = await OpenAPIParser(openApiJsonPath) as OpenAPIV3_1.Document;
const typeFileName = './built/autogen/types.ts';
await generateBaseTypes(openApiDocs, openApiJsonPath, typeFileName);

View file

@ -35,11 +35,11 @@
"url": "git+https://github.com/misskey-dev/misskey.js.git"
},
"devDependencies": {
"@microsoft/api-extractor": "7.49.1",
"@microsoft/api-extractor": "7.52.2",
"@misskey-dev/eslint-plugin": "1.0.0",
"@swc/jest": "0.2.37",
"@types/jest": "29.5.14",
"@types/node": "22.10.7",
"@types/node": "22.13.14",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"eslint": "8.57.1",
@ -50,7 +50,7 @@
"ncp": "2.0.0",
"nodemon": "3.1.9",
"tsd": "0.31.2",
"typescript": "5.7.3"
"typescript": "5.8.2"
},
"files": [
"built",
@ -59,7 +59,7 @@
],
"dependencies": {
"@swc/cli": "0.6.0",
"@swc/core": "1.10.7",
"@swc/core": "1.11.13",
"eventemitter3": "5.0.1",
"reconnecting-websocket": "4.4.0"
}

View file

@ -4616,6 +4616,14 @@ export type components = {
/** @enum {string} */
type: 'scheduledNoteError';
draft: components['schemas']['NoteDraft'];
} | {
/** Format: id */
id: string;
/** Format: date-time */
createdAt: string;
/** @enum {string} */
type: 'sensitiveFlagAssigned';
fileId: unknown;
} | {
/** Format: id */
id: string;
@ -4675,6 +4683,7 @@ export type components = {
/** @example 51469 */
size: number;
isSensitive: boolean;
isSensitiveByModerator?: boolean | null;
blurhash: string | null;
properties: {
/** @example 1280 */
@ -20781,8 +20790,8 @@ export type operations = {
untilId?: string;
/** @default true */
markAsRead?: boolean;
includeTypes?: ('note' | 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollEnded' | 'receiveFollowRequest' | 'followRequestAccepted' | 'roleAssigned' | 'achievementEarned' | 'noteScheduled' | 'scheduledNotePosted' | 'scheduledNoteError' | 'app' | 'test' | 'pollVote' | 'groupInvited')[];
excludeTypes?: ('note' | 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollEnded' | 'receiveFollowRequest' | 'followRequestAccepted' | 'roleAssigned' | 'achievementEarned' | 'noteScheduled' | 'scheduledNotePosted' | 'scheduledNoteError' | 'app' | 'test' | 'pollVote' | 'groupInvited')[];
includeTypes?: ('note' | 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollEnded' | 'receiveFollowRequest' | 'followRequestAccepted' | 'roleAssigned' | 'achievementEarned' | 'noteScheduled' | 'scheduledNotePosted' | 'scheduledNoteError' | 'sensitiveFlagAssigned' | 'app' | 'test' | 'pollVote' | 'groupInvited')[];
excludeTypes?: ('note' | 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollEnded' | 'receiveFollowRequest' | 'followRequestAccepted' | 'roleAssigned' | 'achievementEarned' | 'noteScheduled' | 'scheduledNotePosted' | 'scheduledNoteError' | 'sensitiveFlagAssigned' | 'app' | 'test' | 'pollVote' | 'groupInvited')[];
};
};
};
@ -20849,8 +20858,8 @@ export type operations = {
untilId?: string;
/** @default true */
markAsRead?: boolean;
includeTypes?: ('note' | 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollEnded' | 'receiveFollowRequest' | 'followRequestAccepted' | 'roleAssigned' | 'achievementEarned' | 'noteScheduled' | 'scheduledNotePosted' | 'scheduledNoteError' | 'app' | 'test' | 'reaction:grouped' | 'renote:grouped' | 'pollVote' | 'groupInvited')[];
excludeTypes?: ('note' | 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollEnded' | 'receiveFollowRequest' | 'followRequestAccepted' | 'roleAssigned' | 'achievementEarned' | 'noteScheduled' | 'scheduledNotePosted' | 'scheduledNoteError' | 'app' | 'test' | 'reaction:grouped' | 'renote:grouped' | 'pollVote' | 'groupInvited')[];
includeTypes?: ('note' | 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollEnded' | 'receiveFollowRequest' | 'followRequestAccepted' | 'roleAssigned' | 'achievementEarned' | 'noteScheduled' | 'scheduledNotePosted' | 'scheduledNoteError' | 'sensitiveFlagAssigned' | 'app' | 'test' | 'reaction:grouped' | 'renote:grouped' | 'pollVote' | 'groupInvited')[];
excludeTypes?: ('note' | 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollEnded' | 'receiveFollowRequest' | 'followRequestAccepted' | 'roleAssigned' | 'achievementEarned' | 'noteScheduled' | 'scheduledNotePosted' | 'scheduledNoteError' | 'sensitiveFlagAssigned' | 'app' | 'test' | 'reaction:grouped' | 'renote:grouped' | 'pollVote' | 'groupInvited')[];
};
};
};

View file

@ -25,16 +25,16 @@
},
"devDependencies": {
"@misskey-dev/eslint-plugin": "1.0.0",
"@types/node": "22.13.0",
"@types/node": "22.13.14",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"eslint": "8.57.1",
"nodemon": "3.1.9",
"typescript": "5.7.3"
"typescript": "5.8.2"
},
"dependencies": {
"crc-32": "1.2.2",
"esbuild": "0.24.2",
"esbuild": "0.25.2",
"glob": "11.0.1"
},
"files": [

View file

@ -9,18 +9,18 @@
"lint": "pnpm typecheck && pnpm eslint"
},
"dependencies": {
"esbuild": "0.24.2",
"esbuild": "0.25.2",
"idb-keyval": "6.2.1",
"misskey-js": "workspace:*"
},
"devDependencies": {
"@misskey-dev/eslint-plugin": "1.0.0",
"@types/serviceworker": "0.0.118",
"@types/serviceworker": "0.0.127",
"@typescript-eslint/parser": "7.10.0",
"eslint": "8.57.1",
"eslint-plugin-import": "2.31.0",
"nodemon": "3.1.9",
"typescript": "5.7.3"
"typescript": "5.8.2"
},
"type": "module"
}

5259
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff