Merge upstream

This commit is contained in:
オスカー、 2024-10-28 15:23:29 +09:00
commit 9c40d0edda
Signed by: SWREI
GPG Key ID: 139D6573F92DA9F7
36 changed files with 5749 additions and 4582 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.0.4
uses: actions/setup-node@v4.1.0
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
@ -117,7 +117,7 @@ jobs:
with:
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.0.4
uses: actions/setup-node@v4.1.0
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

View File

@ -20,7 +20,7 @@ jobs:
- run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4.0.4
uses: actions/setup-node@v4.1.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.0.4
- uses: actions/setup-node@v4.1.0
with:
node-version-file: '.node-version'
cache: 'pnpm'
@ -55,7 +55,7 @@ jobs:
- uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4.0.4
- uses: actions/setup-node@v4.1.0
with:
node-version-file: '.node-version'
cache: 'pnpm'
@ -80,7 +80,7 @@ jobs:
- uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4.0.4
- uses: actions/setup-node@v4.1.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.0.4
uses: actions/setup-node@v4.1.0
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

View File

@ -30,7 +30,7 @@ jobs:
- run: corepack enable
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.0.4
uses: actions/setup-node@v4.1.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.0.4
uses: actions/setup-node@v4.1.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.0.4
uses: actions/setup-node@v4.1.0
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

View File

@ -28,7 +28,8 @@ const primaries = {
const clean = (text) => text.replace(new RegExp(String.fromCodePoint(0x08), 'g'), '');
export function build() {
const locales = languages.reduce((a, c) => (a[c] = yaml.load(clean(fs.readFileSync(new URL(`${c}.yml`, import.meta.url), 'utf-8'))) || {}, a), {});
const metaUrl = import.meta.url;
const locales = languages.reduce((a, c) => (a[c] = yaml.load(clean(fs.readFileSync(new URL(`${c}.yml`, metaUrl), 'utf-8'))) || {}, a), {});
// 空文字列が入ることがあり、フォールバックが動作しなくなるのでプロパティごと消す
const removeEmpty = (obj) => {

View File

@ -34,20 +34,18 @@
"generate-api-json": "pnpm build && node ./scripts/generate_api_json.js"
},
"optionalDependencies": {
"@swc/core-android-arm64": "1.3.11",
"@swc/core-darwin-arm64": "1.5.7",
"@swc/core-darwin-x64": "1.5.7",
"@swc/core-freebsd-x64": "1.3.11",
"@swc/core-linux-arm-gnueabihf": "1.5.7",
"@swc/core-linux-arm64-gnu": "1.5.7",
"@swc/core-linux-arm64-musl": "1.5.7",
"@swc/core-linux-x64-gnu": "1.5.7",
"@swc/core-linux-x64-musl": "1.5.7",
"@swc/core-win32-arm64-msvc": "1.5.7",
"@swc/core-win32-ia32-msvc": "1.5.7",
"@swc/core-win32-x64-msvc": "1.5.7",
"@tensorflow/tfjs": "4.19.0",
"@tensorflow/tfjs-node": "4.19.0",
"@swc/core-darwin-arm64": "1.7.39",
"@swc/core-darwin-x64": "1.7.39",
"@swc/core-linux-arm-gnueabihf": "1.7.39",
"@swc/core-linux-arm64-gnu": "1.7.39",
"@swc/core-linux-arm64-musl": "1.7.39",
"@swc/core-linux-x64-gnu": "1.7.39",
"@swc/core-linux-x64-musl": "1.7.39",
"@swc/core-win32-arm64-msvc": "1.7.39",
"@swc/core-win32-ia32-msvc": "1.7.39",
"@swc/core-win32-x64-msvc": "1.7.39",
"@tensorflow/tfjs": "4.22.0",
"@tensorflow/tfjs-node": "4.22.0",
"bufferutil": "4.0.8",
"slacc-android-arm-eabi": "0.0.10",
"slacc-android-arm64": "0.0.10",
@ -66,34 +64,34 @@
},
"dependencies": {
"@authenio/samlify-node-xmllint": "2.0.0",
"@aws-sdk/client-s3": "3.627.0",
"@aws-sdk/lib-storage": "3.627.0",
"@bull-board/api": "5.21.3",
"@bull-board/fastify": "5.21.3",
"@bull-board/ui": "5.21.3",
"@discordapp/twemoji": "15.0.3",
"@elastic/elasticsearch": "^8.14.0",
"@fastify/accepts": "4.3.0",
"@fastify/cookie": "9.3.1",
"@fastify/cors": "9.0.1",
"@fastify/express": "3.0.0",
"@fastify/formbody": "7.4.0",
"@fastify/http-proxy": "9.5.0",
"@fastify/multipart": "8.3.0",
"@fastify/static": "7.0.4",
"@fastify/view": "9.1.0",
"@aws-sdk/client-s3": "3.676.0",
"@aws-sdk/lib-storage": "3.676.0",
"@bull-board/api": "6.2.4",
"@bull-board/fastify": "6.2.4",
"@bull-board/ui": "6.2.4",
"@discordapp/twemoji": "15.1.0",
"@elastic/elasticsearch": "8.15.1",
"@fastify/accepts": "5.0.1",
"@fastify/cookie": "11.0.1",
"@fastify/cors": "10.0.1",
"@fastify/express": "4.0.1",
"@fastify/formbody": "8.0.1",
"@fastify/http-proxy": "10.0.1",
"@fastify/multipart": "9.0.1",
"@fastify/static": "8.0.2",
"@fastify/view": "10.0.1",
"@misskey-dev/sharp-read-bmp": "1.2.0",
"@misskey-dev/summaly": "5.1.0",
"@napi-rs/canvas": "0.1.53",
"@nestjs/common": "10.3.10",
"@nestjs/core": "10.3.10",
"@nestjs/testing": "10.3.10",
"@napi-rs/canvas": "0.1.58",
"@nestjs/common": "10.4.5",
"@nestjs/core": "10.4.5",
"@nestjs/testing": "10.4.5",
"@peertube/http-signature": "1.7.0",
"@simplewebauthn/server": "10.0.1",
"@sinonjs/fake-timers": "11.2.2",
"@smithy/node-http-handler": "3.1.4",
"@swc/cli": "0.3.12",
"@swc/core": "1.5.7",
"@simplewebauthn/server": "11.0.0",
"@sinonjs/fake-timers": "11.3.1",
"@smithy/node-http-handler": "3.2.5",
"@swc/cli": "0.4.0",
"@swc/core": "1.7.39",
"@twemoji/parser": "15.1.1",
"accepts": "1.3.8",
"ajv": "8.17.1",
@ -101,41 +99,41 @@
"async-mutex": "0.5.0",
"bcryptjs": "2.4.3",
"blurhash": "2.0.5",
"body-parser": "1.20.2",
"bullmq": "5.12.3",
"body-parser": "1.20.3",
"bullmq": "5.21.2",
"cacheable-lookup": "7.0.0",
"cbor": "9.0.2",
"chalk": "5.3.0",
"chalk-template": "1.1.0",
"chokidar": "3.6.0",
"chokidar": "4.0.1",
"cli-highlight": "2.1.11",
"color-convert": "2.0.1",
"content-disposition": "0.5.4",
"date-fns": "3.6.0",
"date-fns": "4.1.0",
"deep-email-validator": "0.1.21",
"fastify": "4.28.1",
"fastify-http-errors-enhanced": "5.0.4",
"fastify-raw-body": "4.3.0",
"fastify": "5.0.0",
"fastify-http-errors-enhanced": "6.0.0",
"fastify-raw-body": "5.0.0",
"feed": "4.2.2",
"file-type": "19.4.0",
"file-type": "19.6.0",
"fluent-ffmpeg": "2.1.3",
"form-data": "4.0.0",
"got": "14.4.2",
"happy-dom": "14.12.3",
"form-data": "4.0.1",
"got": "14.4.3",
"happy-dom": "15.7.4",
"hpagent": "1.2.0",
"htmlescape": "1.1.1",
"http-link-header": "1.1.3",
"ioredis": "5.4.1",
"ip-cidr": "3.1.0",
"ip-cidr": "4.0.2",
"ipaddr.js": "2.2.0",
"is-svg": "5.1.0",
"jose": "5.6.3",
"jose": "5.9.6",
"js-yaml": "4.1.0",
"jsdom": "24.1.1",
"jsdom": "25.0.1",
"json5": "2.2.3",
"jsonld": "8.3.2",
"jsrsasign": "11.1.0",
"meilisearch": "0.41.0",
"meilisearch": "0.44.1",
"mfm-js": "0.24.0",
"microformats-parser": "2.0.2",
"mime-types": "2.1.35",
@ -146,17 +144,17 @@
"nested-property": "4.0.0",
"node-fetch": "3.3.2",
"node-forge": "1.3.1",
"nodemailer": "6.9.14",
"nodemailer": "6.9.15",
"nsfwjs": "2.4.2",
"oauth": "0.10.0",
"oauth2orize": "1.12.0",
"oauth2orize-pkce": "0.1.2",
"os-utils": "0.0.14",
"otpauth": "9.3.1",
"parse5": "7.1.2",
"pg": "8.12.0",
"pino": "9.3.2",
"pino-pretty": "11.2.2",
"otpauth": "9.3.4",
"parse5": "7.2.0",
"pg": "8.13.0",
"pino": "9.5.0",
"pino-pretty": "11.3.0",
"pkce-challenge": "4.1.0",
"probe-image-size": "7.2.3",
"promise-limit": "2.7.0",
@ -165,26 +163,26 @@
"qrcode": "1.5.4",
"random-seed": "0.3.0",
"ratelimiter": "3.4.1",
"re2": "1.21.3",
"re2": "1.21.4",
"redis-lock": "0.1.4",
"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.13.0",
"sanitize-html": "2.13.1",
"secure-json-parse": "2.7.0",
"sharp": "0.33.4",
"sharp": "0.33.5",
"slacc": "0.0.10",
"strict-event-emitter-types": "2.0.0",
"stringz": "2.1.0",
"systeminformation": "5.23.4",
"systeminformation": "5.23.5",
"tinycolor2": "1.6.0",
"tmp": "0.2.3",
"tsc-alias": "1.8.10",
"tsconfig-paths": "4.2.0",
"typeorm": "0.3.20",
"typescript": "5.5.4",
"typescript": "5.6.3",
"ulid": "2.3.0",
"vary": "1.1.2",
"web-push": "3.6.7",
@ -195,58 +193,58 @@
"devDependencies": {
"@jest/globals": "29.7.0",
"@misskey-dev/eslint-plugin": "1.0.0",
"@nestjs/platform-express": "10.3.10",
"@simplewebauthn/types": "10.0.0",
"@nestjs/platform-express": "10.4.5",
"@simplewebauthn/types": "11.0.0",
"@swc/jest": "0.2.36",
"@types/accepts": "1.3.7",
"@types/archiver": "6.0.2",
"@types/bcryptjs": "2.4.6",
"@types/body-parser": "1.19.5",
"@types/color-convert": "2.0.3",
"@types/color-convert": "2.0.4",
"@types/content-disposition": "0.5.8",
"@types/fluent-ffmpeg": "2.1.25",
"@types/fluent-ffmpeg": "2.1.26",
"@types/htmlescape": "^1.1.3",
"@types/http-link-header": "1.0.7",
"@types/jest": "29.5.12",
"@types/jest": "29.5.13",
"@types/js-yaml": "4.0.9",
"@types/jsdom": "21.1.7",
"@types/jsonld": "1.5.15",
"@types/jsrsasign": "10.5.14",
"@types/mime-types": "2.1.4",
"@types/ms": "0.7.34",
"@types/node": "22.2.0",
"@types/node": "22.7.8",
"@types/node-forge": "1.3.11",
"@types/nodemailer": "6.4.15",
"@types/oauth": "0.9.5",
"@types/nodemailer": "6.4.16",
"@types/oauth": "0.9.6",
"@types/oauth2orize": "1.11.5",
"@types/oauth2orize-pkce": "0.1.2",
"@types/pg": "8.11.6",
"@types/pg": "8.11.10",
"@types/pug": "2.0.10",
"@types/punycode": "2.1.4",
"@types/qrcode": "1.5.5",
"@types/random-seed": "0.3.5",
"@types/ratelimiter": "3.4.6",
"@types/rename": "1.0.7",
"@types/sanitize-html": "2.11.0",
"@types/sanitize-html": "2.13.0",
"@types/semver": "7.5.8",
"@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.3",
"@types/web-push": "3.6.4",
"@types/ws": "8.5.12",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"aws-sdk-client-mock": "4.0.1",
"aws-sdk-client-mock": "4.1.0",
"cross-env": "7.0.3",
"eslint": "8.57.0",
"eslint-plugin-import": "2.29.1",
"execa": "9.3.0",
"eslint": "8.57.1",
"eslint-plugin-import": "2.31.0",
"execa": "9.4.1",
"fkill": "^9.0.0",
"jest": "29.7.0",
"jest-mock": "29.7.0",
"nodemon": "3.1.4",
"nodemon": "3.1.7",
"pid-port": "1.0.0",
"simple-oauth2": "5.1.0"
}

View File

@ -266,10 +266,7 @@ export class FileInfoService {
}
private async *asyncIterateFrames(cwd: string, command: FFmpeg.FfmpegCommand): AsyncGenerator<string, void> {
const watcher = new FSWatcher({
cwd,
disableGlobbing: true,
});
const watcher = new FSWatcher({ cwd });
let finished = false;
command.once('end', () => {
finished = true;

View File

@ -96,8 +96,8 @@ export class WebAuthnService {
@bindThis
public async verifyRegistration(userId: MiUser['id'], response: RegistrationResponseJSON): Promise<{
credentialID: string;
credentialPublicKey: Uint8Array;
id: string;
publicKey: Uint8Array;
attestationObject: Uint8Array;
fmt: AttestationFormat;
counter: number;
@ -139,15 +139,15 @@ export class WebAuthnService {
const { registrationInfo } = verification;
return {
credentialID: registrationInfo.credentialID,
credentialPublicKey: registrationInfo.credentialPublicKey,
id: registrationInfo.credential.id,
publicKey: registrationInfo.credential.publicKey,
attestationObject: registrationInfo.attestationObject,
fmt: registrationInfo.fmt,
counter: registrationInfo.counter,
counter: registrationInfo.credential.counter,
userVerified: registrationInfo.userVerified,
credentialDeviceType: registrationInfo.credentialDeviceType,
credentialBackedUp: registrationInfo.credentialBackedUp,
transports: response.response.transports,
transports: registrationInfo.credential.transports,
};
}
@ -228,9 +228,9 @@ export class WebAuthnService {
expectedChallenge: challenge,
expectedOrigin: relyingParty.origin,
expectedRPID: relyingParty.rpId,
authenticator: {
credentialID: key.id,
credentialPublicKey: Buffer.from(key.publicKey, 'base64url'),
credential: {
id: key.id,
publicKey: Buffer.from(key.publicKey, 'base64url'),
counter: key.counter,
transports: key.transports ? key.transports as AuthenticatorTransportFuture[] : undefined,
},

View File

@ -8,7 +8,7 @@ import type { onRequestHookHandler } from 'fastify';
export const handleRequestRedirectToOmitSearch: onRequestHookHandler = (request, reply, done) => {
const index = request.url.indexOf('?');
if (~index) {
reply.redirect(301, request.url.slice(0, index));
reply.redirect(request.url.slice(0, index), 301);
}
done();
};

View File

@ -82,7 +82,7 @@ export class FileServerService {
.catch(err => this.errorHandler(request, reply, err));
});
fastify.get<{ Params: { key: string; } }>('/files/:key/*', async (request, reply) => {
return await reply.redirect(301, `${this.config.url}/files/${request.params.key}`);
return reply.redirect(`${this.config.url}/files/${request.params.key}`, 301);
});
done();
});
@ -147,12 +147,12 @@ export class FileServerService {
url.searchParams.set('static', '1');
file.cleanup();
return await reply.redirect(301, url.toString());
return await reply.redirect(url.toString(), 301);
} else if (file.mime.startsWith('video/')) {
const externalThumbnail = this.videoProcessingService.getExternalVideoThumbnailUrl(file.url);
if (externalThumbnail) {
file.cleanup();
return await reply.redirect(301, externalThumbnail);
return await reply.redirect(externalThumbnail, 301);
}
image = await this.videoProcessingService.generateVideoThumbnail(file.path);
@ -167,7 +167,7 @@ export class FileServerService {
url.searchParams.set('url', file.url);
file.cleanup();
return await reply.redirect(301, url.toString());
return await reply.redirect(url.toString(), 301);
}
}
@ -313,12 +313,18 @@ export class FileServerService {
url.searchParams.append(key, value);
}
return await reply.redirect(
301,
return reply.redirect(
url.toString(),
301,
);
}
if (!request.headers['user-agent']) {
throw new StatusError('User-Agent is required', 400, 'User-Agent is required');
} else if (request.headers['user-agent'].toLowerCase().indexOf('misskey/') !== -1) {
throw new StatusError('Refusing to proxy a request from another proxy', 403, 'Proxy is recursive');
}
// Create temp file
const file = await this.getStreamAndTypeFromUrl(url);
if (file === '404') {

View File

@ -155,7 +155,7 @@ export class ServerService implements OnApplicationShutdown {
if (emoji == null) {
if ('fallback' in request.query) {
return await reply.redirect('/static-assets/emoji-unknown.png');
return reply.redirect('/static-assets/emoji-unknown.png');
} else {
reply.code(404);
return;
@ -176,9 +176,9 @@ export class ServerService implements OnApplicationShutdown {
if ('static' in request.query) url.searchParams.set('static', '1');
}
return await reply.redirect(
301,
return reply.redirect(
url.toString(),
301,
);
});

View File

@ -96,13 +96,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
}
const keyInfo = await this.webAuthnService.verifyRegistration(me.id, ps.credential);
const keyId = keyInfo.credentialID;
const keyId = keyInfo.id;
await this.userSecurityKeysRepository.insert({
id: keyId,
userId: me.id,
name: ps.name,
publicKey: Buffer.from(keyInfo.credentialPublicKey).toString('base64url'),
publicKey: Buffer.from(keyInfo.publicKey).toString('base64url'),
counter: keyInfo.counter,
credentialDeviceType: keyInfo.credentialDeviceType,
credentialBackedUp: keyInfo.credentialBackedUp,

View File

@ -211,7 +211,10 @@ export function genOpenapiSpec(config: Config, includeSelfRef = false) {
spec.paths['/' + endpoint.name] = {
...(endpoint.meta.allowGet ? {
get: info,
get: {
...info,
operationId: info.operationId + '_get',
},
} : {}),
post: info,
};

View File

@ -17,34 +17,34 @@
"lint": "pnpm typecheck && pnpm eslint"
},
"dependencies": {
"@discordapp/twemoji": "15.0.3",
"@discordapp/twemoji": "15.1.0",
"@github/webauthn-json": "2.1.1",
"@isaacs/ttlcache": "1.4.1",
"@mcaptcha/vanilla-glue": "0.1.0-alpha-3",
"@misskey-dev/browser-image-resizer": "2024.1.0",
"@rollup/plugin-json": "6.1.0",
"@rollup/plugin-replace": "5.0.7",
"@rollup/plugin-typescript": "11.1.6",
"@rollup/pluginutils": "5.1.0",
"@syuilo/aiscript": "0.18.0",
"@tabler/icons-webfont": "3.12.0",
"@rollup/plugin-replace": "6.0.1",
"@rollup/plugin-typescript": "12.1.1",
"@rollup/pluginutils": "5.1.2",
"@syuilo/aiscript": "0.19.0",
"@tabler/icons-webfont": "3.19.0",
"@twemoji/parser": "15.1.1",
"@vitejs/plugin-vue": "5.1.2",
"@vue/compiler-sfc": "3.4.15",
"@vitejs/plugin-vue": "5.1.4",
"@vue/compiler-sfc": "3.5.12",
"aiscript-vscode": "github:aiscript-dev/aiscript-vscode#v0.1.9",
"astring": "1.8.6",
"astring": "1.9.0",
"broadcast-channel": "7.0.0",
"buraha": "0.0.1",
"canvas-confetti": "1.9.3",
"chart.js": "4.4.3",
"chart.js": "4.4.5",
"chartjs-adapter-date-fns": "3.0.0",
"chartjs-chart-matrix": "2.0.1",
"chartjs-plugin-gradient": "0.6.1",
"chartjs-plugin-zoom": "2.0.1",
"chromatic": "11.7.0",
"chromatic": "11.14.0",
"compare-versions": "6.1.1",
"cropperjs": "2.0.0-rc.0",
"date-fns": "3.6.0",
"date-fns": "4.1.0",
"escape-regexp": "0.0.1",
"estree-walker": "3.0.3",
"eventemitter3": "5.0.1",
@ -59,86 +59,86 @@
"misskey-reversi": "workspace:*",
"photoswipe": "5.4.4",
"punycode": "2.3.1",
"rollup": "4.20.0",
"sanitize-html": "2.13.0",
"sass": "1.77.8",
"shiki": "1.12.1",
"rollup": "4.24.0",
"sanitize-html": "2.13.1",
"sass": "1.80.3",
"shiki": "1.22.0",
"strict-event-emitter-types": "2.0.0",
"textarea-caret": "3.1.0",
"three": "0.167.1",
"three": "0.169.0",
"throttle-debounce": "5.0.2",
"tinycolor2": "1.6.0",
"tsc-alias": "1.8.10",
"tsconfig-paths": "4.2.0",
"typescript": "5.5.4",
"typescript": "5.6.3",
"uuid": "10.0.0",
"v-code-diff": "1.12.1",
"vite": "5.4.0",
"vue": "3.4.15",
"v-code-diff": "1.13.1",
"vite": "5.4.9",
"vue": "3.5.12",
"vuedraggable": "next"
},
"devDependencies": {
"@misskey-dev/eslint-plugin": "1.0.0",
"@misskey-dev/summaly": "5.1.0",
"@storybook/addon-actions": "8.2.8",
"@storybook/addon-essentials": "8.2.8",
"@storybook/addon-interactions": "8.2.8",
"@storybook/addon-links": "8.2.8",
"@storybook/addon-mdx-gfm": "8.2.8",
"@storybook/addon-storysource": "8.2.8",
"@storybook/blocks": "8.2.8",
"@storybook/components": "8.2.8",
"@storybook/core-events": "8.2.8",
"@storybook/manager-api": "8.2.8",
"@storybook/preview-api": "8.2.8",
"@storybook/react": "8.2.8",
"@storybook/react-vite": "8.2.8",
"@storybook/test": "8.2.8",
"@storybook/theming": "8.2.8",
"@storybook/types": "8.2.8",
"@storybook/vue3": "8.2.8",
"@storybook/vue3-vite": "8.2.8",
"@storybook/addon-actions": "8.3.6",
"@storybook/addon-essentials": "8.3.6",
"@storybook/addon-interactions": "8.3.6",
"@storybook/addon-links": "8.3.6",
"@storybook/addon-mdx-gfm": "8.3.6",
"@storybook/addon-storysource": "8.3.6",
"@storybook/blocks": "8.3.6",
"@storybook/components": "8.3.6",
"@storybook/core-events": "8.3.6",
"@storybook/manager-api": "8.3.6",
"@storybook/preview-api": "8.3.6",
"@storybook/react": "8.3.6",
"@storybook/react-vite": "8.3.6",
"@storybook/test": "8.3.6",
"@storybook/theming": "8.3.6",
"@storybook/types": "8.3.6",
"@storybook/vue3": "8.3.6",
"@storybook/vue3-vite": "8.3.6",
"@testing-library/vue": "8.1.0",
"@types/canvas-confetti": "^1.6.4",
"@types/escape-regexp": "0.0.3",
"@types/estree": "1.0.5",
"@types/estree": "1.0.6",
"@types/matter-js": "0.19.7",
"@types/micromatch": "4.0.9",
"@types/node": "22.2.0",
"@types/node": "22.7.8",
"@types/punycode": "2.1.4",
"@types/sanitize-html": "2.11.0",
"@types/sanitize-html": "2.13.0",
"@types/throttle-debounce": "5.0.2",
"@types/tinycolor2": "1.4.6",
"@types/uuid": "10.0.0",
"@types/ws": "8.5.12",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"@vitest/coverage-v8": "0.34.6",
"@vue/runtime-core": "3.4.15",
"acorn": "8.12.1",
"@vitest/coverage-v8": "2.1.3",
"@vue/runtime-core": "3.5.12",
"acorn": "8.13.0",
"cross-env": "7.0.3",
"cypress": "13.13.2",
"eslint": "8.57.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-vue": "9.27.0",
"cypress": "13.15.0",
"eslint": "8.57.1",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-vue": "9.29.1",
"fast-glob": "3.3.2",
"happy-dom": "14.12.3",
"happy-dom": "15.7.4",
"intersection-observer": "0.12.2",
"micromatch": "4.0.7",
"msw": "2.3.5",
"micromatch": "4.0.8",
"msw": "2.5.0",
"msw-storybook-addon": "2.0.3",
"nodemon": "3.1.4",
"nodemon": "3.1.7",
"prettier": "3.3.3",
"react": "18.3.1",
"react-dom": "18.3.1",
"start-server-and-test": "2.0.5",
"storybook": "8.2.8",
"start-server-and-test": "2.0.8",
"storybook": "8.3.6",
"storybook-addon-misskey-theme": "github:misskey-dev/storybook-addon-misskey-theme",
"vite-plugin-turbosnap": "1.0.3",
"vitest": "0.34.6",
"vitest-fetch-mock": "0.2.2",
"vue-component-type-helpers": "2.0.29",
"vitest": "2.1.3",
"vitest-fetch-mock": "0.3.0",
"vue-component-type-helpers": "2.1.6",
"vue-eslint-parser": "9.4.3",
"vue-tsc": "2.0.29"
"vue-tsc": "2.1.6"
}
}

View File

@ -100,8 +100,8 @@ async function requestRender() {
sitekey: props.sitekey,
theme: defaultStore.state.darkMode ? 'dark' : 'light',
callback: callback,
'expired-callback': callback,
'error-callback': callback,
'expired-callback': () => callback(undefined),
'error-callback': () => callback(undefined),
});
} else if (props.provider === 'mcaptcha' && props.instanceUrl && props.sitekey) {
const { default: Widget } = await import('@mcaptcha/vanilla-glue');

View File

@ -175,7 +175,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</button>
</div>
<MkButton v-if="reactionTabType" :class="$style.reactionMuteButton" @click="reactionMuteToggle(reactionTabTypeTrimLocal)">
<i :class="!mutedReactions.includes(reactionTabTypeTrimLocal) ? 'ti ti-mood-happy' : 'ti ti-mood-off'"/>
<i :class="!mutedReactions.includes(reactionTabTypeTrimLocal) ? 'ti ti-mood-off' : 'ti ti-mood-happy'"/>
{{ !mutedReactions.includes(reactionTabTypeTrimLocal) ? i18n.ts.muteThisReaction : i18n.ts.unmuteThisReaction }}
</MkButton>
<MkPagination v-if="reactionTabType" :key="reactionTabType" :pagination="reactionsPagination" :disableAutoLoad="true">

View File

@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<MkPullToRefresh :refresher="() => reload()">
<MkPagination ref="pagingComponent" :pagination="pagination">
<MkPagination ref="pagingComponent" :pagination="pagination" :filter="filterMutedNotification">
<template #empty>
<div class="_fullinfo">
<img :src="infoImageUrl" class="_ghost"/>
@ -34,6 +34,7 @@ import { i18n } from '@/i18n.js';
import { notificationTypes } from '@/const.js';
import { infoImageUrl } from '@/instance.js';
import { defaultStore } from '@/store.js';
import { filterMutedNotification } from '@/scripts/filter-muted-notification.js';
import MkPullToRefresh from '@/components/MkPullToRefresh.vue';
import * as Misskey from 'misskey-js';
@ -63,7 +64,7 @@ function onNotification(notification) {
useStream().send('readNotification');
}
if (!isMuted) {
if (!isMuted && filterMutedNotification(notification)) {
pagingComponent.value?.prepend(notification);
}
}

View File

@ -84,6 +84,7 @@ const props = withDefaults(defineProps<{
pagination: Paging;
disableAutoLoad?: boolean;
displayLimit?: number;
filter?: (item: MisskeyEntity) => boolean;
}>(), {
displayLimit: 20,
});
@ -178,6 +179,8 @@ async function init(): Promise<void> {
limit: props.pagination.limit ?? 10,
allowPartial: true,
}).then(res => {
res = res.filter(item => !props.filter || props.filter(item));
for (let i = 0; i < res.length; i++) {
const item = res[i];
if (i === 3) item._shouldInsertAd_ = true;
@ -219,6 +222,8 @@ const fetchMore = async (): Promise<void> => {
untilId: items.value[items.value.length - 1].id,
}),
}).then(res => {
res = res.filter(item => !props.filter || props.filter(item));
for (let i = 0; i < res.length; i++) {
const item = res[i];
if (i === 10) item._shouldInsertAd_ = true;
@ -283,6 +288,8 @@ const fetchMoreAhead = async (): Promise<void> => {
sinceId: items.value[0].id,
}),
}).then(res => {
res = res.filter(item => !props.filter || props.filter(item));
if (res.length === 0) {
items.value = res.concat(items.value);
more.value = false;

View File

@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<MkCustomEmoji v-if="reaction[0] === ':'" ref="elRef" :name="reaction" :normal="true" :noStyle="noStyle" :url="emojiUrl"/>
<MkCustomEmoji v-if="reaction[0] === ':'" ref="elRef" :name="reaction" :normal="true" :noStyle="noStyle" :url="emojiUrl" :fallbackToImage="true"/>
<MkEmoji v-else ref="elRef" :emoji="reaction" :normal="true" :noStyle="noStyle"/>
</template>

View File

@ -120,6 +120,7 @@ async function done(): Promise<void> {
imageUrl: null,
display: display.value,
needConfirmationToRead: needConfirmationToRead.value,
needEnrollmentTutorialToRead: needEnrollmentTutorialToRead.value,
closeDuration: closeDuration.value,
displayOrder: displayOrder.value,
silence: silence.value,

View File

@ -4,7 +4,8 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<img v-if="errored" src="/client-assets/dummy.png" :alt="alt" :title="alt" decoding="async" :class="[$style.root, { [$style.normal]: normal, [$style.noStyle]: noStyle }]"/>
<span v-if="errored && !fallbackToImage">:{{ customEmojiName }}:</span>
<img v-else-if="errored" src="/client-assets/dummy.png" :alt="alt" :title="alt" decoding="async" :class="[$style.root, { [$style.normal]: normal, [$style.noStyle]: noStyle }]"/>
<img
v-else
:class="[$style.root, { [$style.normal]: normal, [$style.noStyle]: noStyle }]"
@ -39,6 +40,7 @@ const props = defineProps<{
useOriginalSize?: boolean;
menu?: boolean;
menuReaction?: boolean;
fallbackToImage?: boolean;
}>();
const react = inject<((name: string) => void) | null>('react', null);

View File

@ -0,0 +1,16 @@
import * as Misskey from 'misskey-js';
import { defaultStore } from '@/store.js';
export function filterMutedNotification(notification: Misskey.entities.Notification): boolean {
switch (notification.type) {
case 'reaction':
if (defaultStore.state.mutedReactions.includes(notification.reaction.replace('@.', ''))) return false;
break;
case 'reaction:grouped':
notification.reactions = notification.reactions.filter(reaction => !defaultStore.state.mutedReactions.includes(reaction.reaction.replace('@.', '')));
if (notification.reactions.length === 0) return false;
break;
}
return true;
}

View File

@ -51,6 +51,7 @@ import { swInject } from './sw-inject.js';
import XNotification from './notification.vue';
import { popups } from '@/os.js';
import { pendingApiRequestsCount } from '@/scripts/misskey-api.js';
import { filterMutedNotification } from '@/scripts/filter-muted-notification.js';
import { uploads } from '@/scripts/upload.js';
import * as sound from '@/scripts/sound.js';
import { $i } from '@/account.js';
@ -73,6 +74,8 @@ function onNotification(notification: Misskey.entities.Notification, isClient =
useStream().send('readNotification');
}
if (!filterMutedNotification(notification)) return;
notifications.value.unshift(notification);
window.setTimeout(() => {
if (notifications.value.length > 3) notifications.value.pop();

View File

@ -107,6 +107,11 @@ export function getConfig(): UserConfig {
}
},
},
preprocessorOptions: {
scss: {
api: 'modern-compiler',
},
},
},
define: {

View File

@ -26,19 +26,19 @@
"devDependencies": {
"@misskey-dev/eslint-plugin": "1.0.0",
"@types/matter-js": "0.19.7",
"@types/node": "22.2.0",
"@types/node": "22.7.8",
"@types/seedrandom": "3.0.8",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"eslint": "8.57.0",
"nodemon": "3.1.4",
"typescript": "5.5.4"
"eslint": "8.57.1",
"nodemon": "3.1.7",
"typescript": "5.6.3"
},
"files": [
"built"
],
"dependencies": {
"esbuild": "0.23.0",
"esbuild": "0.24.0",
"eventemitter3": "5.0.1",
"glob": "11.0.0",
"matter-js": "0.20.0",

View File

@ -9,15 +9,15 @@
"devDependencies": {
"@misskey-dev/eslint-plugin": "^1.0.0",
"@readme/openapi-parser": "2.6.0",
"@types/node": "22.2.0",
"@types/node": "22.7.8",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"eslint": "8.57.0",
"eslint": "8.57.1",
"openapi-types": "12.1.3",
"openapi-typescript": "6.7.6",
"ts-case-convert": "2.0.7",
"tsx": "4.17.0",
"typescript": "5.5.4"
"ts-case-convert": "2.1.0",
"tsx": "4.19.1",
"typescript": "5.6.3"
},
"files": [
"built"

View File

@ -1,7 +1,7 @@
{
"type": "module",
"name": "misskey-js",
"version": "2024.5.0-oscar.16a`",
"version": "2024.5.0-oscar.16a",
"description": "Misskey SDK for JavaScript",
"types": "./built/dts/index.d.ts",
"exports": {

View File

@ -58,7 +58,7 @@ export class APIClient {
this.fetch(`${this.origin}/api/${endpoint}`, {
method: 'POST',
body: JSON.stringify({
...params,
...(params ?? {}),
i: credential !== undefined ? credential : this.credential,
}),
headers: {

File diff suppressed because it is too large Load Diff

View File

@ -25,16 +25,16 @@
},
"devDependencies": {
"@misskey-dev/eslint-plugin": "1.0.0",
"@types/node": "22.2.0",
"@types/node": "22.7.8",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"eslint": "8.57.0",
"nodemon": "3.1.4",
"typescript": "5.5.4"
"eslint": "8.57.1",
"nodemon": "3.1.7",
"typescript": "5.6.3"
},
"dependencies": {
"crc-32": "1.2.2",
"esbuild": "0.23.0",
"esbuild": "0.24.0",
"glob": "11.0.0"
},
"files": [

View File

@ -9,18 +9,18 @@
"lint": "pnpm typecheck && pnpm eslint"
},
"dependencies": {
"esbuild": "0.23.0",
"esbuild": "0.24.0",
"idb-keyval": "6.2.1",
"misskey-js": "workspace:*"
},
"devDependencies": {
"@misskey-dev/eslint-plugin": "1.0.0",
"@types/serviceworker": "0.0.92",
"@types/serviceworker": "0.0.101",
"@typescript-eslint/parser": "7.10.0",
"eslint": "8.57.0",
"eslint-plugin-import": "2.29.1",
"nodemon": "3.1.4",
"typescript": "5.5.4"
"eslint": "8.57.1",
"eslint-plugin-import": "2.31.0",
"nodemon": "3.1.7",
"typescript": "5.6.3"
},
"type": "module"
}

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,7 @@
"mdast-util-to-string": "4.0.0",
"remark": "15.0.1",
"remark-parse": "11.0.0",
"typescript": "5.3.3",
"typescript": "5.6.3",
"unified": "11.0.4",
"vite": "5.0.12",
"vite-node": "1.1.3",