1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-19 00:45:27 +02:00

Merge branch 'develop' into copilot/add-user-mute-settings

This commit is contained in:
kakkokari-gtyih
2025-11-24 00:49:31 +09:00
60 changed files with 1010 additions and 138 deletions

View File

@@ -8,6 +8,7 @@
},
"scripts": {
"start": "node ./built/boot/entry.js",
"start:inspect": "node --inspect ./built/boot/entry.js",
"start:test": "cross-env NODE_ENV=test node ./built/boot/entry.js",
"migrate": "pnpm typeorm migration:run -d ormconfig.js",
"revert": "pnpm typeorm migration:revert -d ormconfig.js",

View File

@@ -46,7 +46,7 @@ export const paramDef = {
type: 'object',
properties: {
name: { type: 'string', minLength: 1, maxLength: 128 },
description: { type: 'string', nullable: true, minLength: 1, maxLength: 2048 },
description: { type: 'string', nullable: true, maxLength: 2048 },
bannerId: { type: 'string', format: 'misskey:id', nullable: true },
color: { type: 'string', minLength: 1, maxLength: 16 },
isSensitive: { type: 'boolean', nullable: true },

View File

@@ -50,7 +50,7 @@ export const paramDef = {
properties: {
channelId: { type: 'string', format: 'misskey:id' },
name: { type: 'string', minLength: 1, maxLength: 128 },
description: { type: 'string', nullable: true, minLength: 1, maxLength: 2048 },
description: { type: 'string', nullable: true, maxLength: 2048 },
bannerId: { type: 'string', format: 'misskey:id', nullable: true },
isArchived: { type: 'boolean', nullable: true },
pinnedNoteIds: {

View File

@@ -5,6 +5,7 @@
import { Inject, Injectable } from '@nestjs/common';
import { Endpoint } from '@/server/api/endpoint-base.js';
import { QueryService } from '@/core/QueryService.js';
import type { ClipFavoritesRepository } from '@/models/_.js';
import { DI } from '@/di-symbols.js';
import { ClipEntityService } from '@/core/entities/ClipEntityService.js';
@@ -30,6 +31,11 @@ export const meta = {
export const paramDef = {
type: 'object',
properties: {
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
},
required: [],
} as const;
@@ -40,14 +46,16 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
@Inject(DI.clipFavoritesRepository)
private clipFavoritesRepository: ClipFavoritesRepository,
private queryService: QueryService,
private clipEntityService: ClipEntityService,
) {
super(meta, paramDef, async (ps, me) => {
const query = this.clipFavoritesRepository.createQueryBuilder('favorite')
const query = this.queryService.makePaginationQuery(this.clipFavoritesRepository.createQueryBuilder('favorite'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('favorite.userId = :meId', { meId: me.id })
.leftJoinAndSelect('favorite.clip', 'clip');
const favorites = await query
.limit(ps.limit)
.getMany();
return this.clipEntityService.packMany(favorites.map(x => x.clip!), me);

View File

@@ -506,10 +506,10 @@ describe('クリップ', () => {
});
};
const myFavorites = async (request: Partial<ApiRequest<'clips/my-favorites'>> = {}): Promise<Misskey.entities.Clip[]> => {
const myFavorites = async (parameters: Misskey.entities.ClipsMyFavoritesRequest, request: Partial<ApiRequest<'clips/my-favorites'>> = {}): Promise<Misskey.entities.Clip[]> => {
return successfulApiCall({
endpoint: 'clips/my-favorites',
parameters: {},
parameters,
user: alice,
...request,
});
@@ -562,8 +562,9 @@ describe('クリップ', () => {
await favorite({ clipId: clip.id });
}
// pagenationはない。全部一気にとれる。
const favorited = await myFavorites();
const favorited = await myFavorites({
limit: 30,
});
assert.strictEqual(favorited.length, clips.length);
for (const clip of favorited) {
assert.strictEqual(clip.favoritedCount, 1);
@@ -617,7 +618,7 @@ describe('クリップ', () => {
const clip = await show({ clipId: aliceClip.id });
assert.strictEqual(clip.favoritedCount, 0);
assert.strictEqual(clip.isFavorited, false);
assert.deepStrictEqual(await myFavorites(), []);
assert.deepStrictEqual(await myFavorites({}), []);
});
test.each([
@@ -651,13 +652,13 @@ describe('クリップ', () => {
test('を取得できる。', async () => {
await favorite({ clipId: aliceClip.id });
const favorited = await myFavorites();
const favorited = await myFavorites({});
assert.deepStrictEqual(favorited, [await show({ clipId: aliceClip.id })]);
});
test('を取得したとき他人のお気に入りは含まない。', async () => {
await favorite({ clipId: aliceClip.id });
const favorited = await myFavorites({ user: bob });
const favorited = await myFavorites({}, { user: bob });
assert.deepStrictEqual(favorited, []);
});
});

View File

@@ -158,11 +158,15 @@ describe('RoleService', () => {
afterEach(async () => {
clock.uninstall();
/**
* Delete meta and roleAssignment first to avoid deadlock due to schema dependencies
* https://github.com/misskey-dev/misskey/issues/16783
*/
await app.get(DI.metasRepository).createQueryBuilder().delete().execute();
await roleAssignmentsRepository.createQueryBuilder().delete().execute();
await Promise.all([
app.get(DI.metasRepository).createQueryBuilder().delete().execute(),
usersRepository.createQueryBuilder().delete().execute(),
rolesRepository.createQueryBuilder().delete().execute(),
roleAssignmentsRepository.createQueryBuilder().delete().execute(),
]);
await app.close();

View File

@@ -608,11 +608,30 @@ async function toggleReactionAcceptance() {
//#region その他の設定メニューpopup
function showOtherSettings() {
let reactionAcceptanceIcon = 'ti ti-icons';
let reactionAcceptanceCaption = '';
if (reactionAcceptance.value === 'likeOnly') {
reactionAcceptanceIcon = 'ti ti-heart _love';
} else if (reactionAcceptance.value === 'likeOnlyForRemote') {
reactionAcceptanceIcon = 'ti ti-heart-plus';
switch (reactionAcceptance.value) {
case 'likeOnly':
reactionAcceptanceIcon = 'ti ti-heart _love';
reactionAcceptanceCaption = i18n.ts.likeOnly;
break;
case 'likeOnlyForRemote':
reactionAcceptanceIcon = 'ti ti-heart-plus';
reactionAcceptanceCaption = i18n.ts.likeOnlyForRemote;
break;
case 'nonSensitiveOnly':
reactionAcceptanceCaption = i18n.ts.nonSensitiveOnly;
break;
case 'nonSensitiveOnlyForLocalLikeOnlyForRemote':
reactionAcceptanceCaption = i18n.ts.nonSensitiveOnlyForLocalLikeOnlyForRemote;
break;
default:
reactionAcceptanceCaption = i18n.ts.all;
break;
}
const menuItems = [{
@@ -624,6 +643,7 @@ function showOtherSettings() {
}, { type: 'divider' }, {
icon: reactionAcceptanceIcon,
text: i18n.ts.reactionAcceptance,
caption: reactionAcceptanceCaption,
action: () => {
toggleReactionAcceptance();
},
@@ -1465,6 +1485,7 @@ defineExpose({
width: 28px;
height: 28px;
margin: auto;
object-fit: cover;
}
.headerRight {

View File

@@ -5,31 +5,31 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<svg v-if="type === 'info'" :class="[$style.icon, $style.info]" viewBox="0 0 160 160">
<path d="M80,108L80,72" style="--l:37;" :class="[$style.line, $style.animLine]"/>
<path d="M80,108L80,72" pathLength="1" :class="[$style.line, $style.animLine]"/>
<path d="M80,52L80,52" :class="[$style.line, $style.animFade]"/>
<circle cx="80" cy="80" r="56" style="--l:350;" :class="[$style.line, $style.animCircle]"/>
<circle cx="80" cy="80" r="56" pathLength="1" :class="[$style.line, $style.animCircle]"/>
</svg>
<svg v-else-if="type === 'question'" :class="[$style.icon, $style.question]" viewBox="0 0 160 160">
<path d="M80,92L79.991,84C88.799,83.98 96,76.962 96,68C96,59.038 88.953,52 79.991,52C71.03,52 64,59.038 64,68" style="--l:85;" :class="[$style.line, $style.animLine]"/>
<path d="M80,92L79.991,84C88.799,83.98 96,76.962 96,68C96,59.038 88.953,52 79.991,52C71.03,52 64,59.038 64,68" pathLength="1" :class="[$style.line, $style.animLine]"/>
<path d="M80,108L80,108" :class="[$style.line, $style.animFade]"/>
<circle cx="80" cy="80" r="56" style="--l:350;" :class="[$style.line, $style.animCircle]"/>
<circle cx="80" cy="80" r="56" pathLength="1" :class="[$style.line, $style.animCircle]"/>
</svg>
<svg v-else-if="type === 'success'" :class="[$style.icon, $style.success]" viewBox="0 0 160 160">
<path d="M62,80L74,92L98,68" style="--l:50;" :class="[$style.line, $style.animLine]"/>
<circle cx="80" cy="80" r="56" style="--l:350;" :class="[$style.line, $style.animCircle]"/>
<path d="M62,80L74,92L98,68" pathLength="1" :class="[$style.line, $style.animLine]"/>
<circle cx="80" cy="80" r="56" pathLength="1" :class="[$style.line, $style.animCircle]"/>
</svg>
<svg v-else-if="type === 'warn'" :class="[$style.icon, $style.warn]" viewBox="0 0 160 160">
<path d="M80,64L80,88" style="--l:27;" :class="[$style.line, $style.animLine]"/>
<path d="M80,64L80,88" pathLength="1" :class="[$style.line, $style.animLine]"/>
<path d="M80,108L80,108" :class="[$style.line, $style.animFade]"/>
<path d="M92,28L144,116C148.709,124.65 144.083,135.82 136,136L24,136C15.917,135.82 11.291,124.65 16,116L68,28C73.498,19.945 86.771,19.945 92,28Z" style="--l:395;" :class="[$style.line, $style.animLine]"/>
<path d="M92,28L144,116C148.709,124.65 144.083,135.82 136,136L24,136C15.917,135.82 11.291,124.65 16,116L68,28C73.498,19.945 86.771,19.945 92,28Z" pathLength="1" :class="[$style.line, $style.animLine]"/>
</svg>
<svg v-else-if="type === 'error'" :class="[$style.icon, $style.error]" viewBox="0 0 160 160">
<path d="M63,63L96,96" style="--l:47;--duration:0.3s;" :class="[$style.line, $style.animLine]"/>
<path d="M96,63L63,96" style="--l:47;--duration:0.3s;--delay:0.2s;" :class="[$style.line, $style.animLine]"/>
<circle cx="80" cy="80" r="56" style="--l:350;" :class="[$style.line, $style.animCircle]"/>
<path d="M63,63L96,96" pathLength="1" style="--duration:0.3s;" :class="[$style.line, $style.animLine]"/>
<path d="M96,63L63,96" pathLength="1" style="--duration:0.3s;--delay:0.2s;" :class="[$style.line, $style.animLine]"/>
<circle cx="80" cy="80" r="56" pathLength="1" :class="[$style.line, $style.animCircle]"/>
</svg>
<svg v-else-if="type === 'waiting'" :class="[$style.icon, $style.waiting]" viewBox="0 0 160 160">
<circle cx="80" cy="80" r="56" style="--l:350;" :class="[$style.line, $style.animCircleWaiting]"/>
<circle cx="80" cy="80" r="56" pathLength="1" :class="[$style.line, $style.animCircleWaiting]"/>
<circle cx="80" cy="80" r="56" style="opacity: 0.25;" :class="[$style.line]"/>
</svg>
</template>
@@ -80,15 +80,15 @@ const props = defineProps<{
}
.animLine {
stroke-dasharray: var(--l);
stroke-dashoffset: var(--l);
stroke-dasharray: 1;
stroke-dashoffset: 1;
animation: line var(--duration, 0.5s) cubic-bezier(0,0,.25,1) 1 forwards;
animation-delay: var(--delay, 0s);
}
.animCircle {
stroke-dasharray: var(--l);
stroke-dashoffset: var(--l);
stroke-dasharray: 1;
stroke-dashoffset: 1;
animation: line var(--duration, 0.5s) cubic-bezier(0,0,.25,1) 1 forwards;
animation-delay: var(--delay, 0s);
transform-origin: center;
@@ -96,8 +96,8 @@ const props = defineProps<{
}
.animCircleWaiting {
stroke-dasharray: var(--l);
stroke-dashoffset: calc(var(--l) / 1.5);
stroke-dasharray: 1;
stroke-dashoffset: calc(1 / 1.5);
animation: waiting 0.75s linear infinite;
transform-origin: center;
}
@@ -110,7 +110,7 @@ const props = defineProps<{
@keyframes line {
0% {
stroke-dashoffset: var(--l);
stroke-dashoffset: 1;
opacity: 0;
}
100% {

View File

@@ -600,16 +600,12 @@ const headerActions = computed(() => [{
</script>
<style module lang="scss">
.violationRow {
background-color: var(--MI_THEME-infoWarnBg);
}
.changedRow {
background-color: var(--MI_THEME-infoBg);
background-color: var(--MI_THEME-infoBg) !important;
}
.editedRow {
background-color: var(--MI_THEME-infoBg);
.violationRow {
background-color: var(--MI_THEME-infoWarnBg) !important;
}
.main {

View File

@@ -419,7 +419,7 @@ onMounted(async () => {
}
.changedRow {
background-color: var(--MI_THEME-infoBg);
background-color: var(--MI_THEME-infoBg) !important;
}
.searchArea {

View File

@@ -447,7 +447,6 @@ const headerTabs = computed(() => room.value ? [{
const headerActions = computed<PageHeaderItem[]>(() => [{
icon: 'ti ti-dots',
text: '',
handler: showMenu,
}]);

View File

@@ -465,6 +465,7 @@ definePage(() => ({
}
.pageContent {
contain: content;
margin-bottom: 1.5rem;
}

View File

@@ -163,7 +163,7 @@ async function chooseChannel(ev: MouseEvent): Promise<void> {
type: 'link',
icon: 'ti ti-plus',
text: i18n.ts.createNew,
to: '/channels',
to: '/channels/new',
},
];
os.popupMenu(items.filter(i => i != null), ev.currentTarget ?? ev.target);

View File

@@ -186,6 +186,7 @@ export async function restoreFromCloudBackup() {
const select = await os.select({
title: i18n.ts._preferencesBackup.selectBackupToRestore,
text: ' ' + i18n.ts._preferencesProfile.shareSameProfileBetweenDevicesIsNotRecommended + ' ' + i18n.ts._preferencesProfile.useSyncBetweenDevicesOptionIfYouWantToSyncSetting,
items: backups.map(backup => ({
label: backup.name,
value: backup.name,

View File

@@ -4,8 +4,8 @@
*/
export type PageHeaderItem = {
text: string;
icon: string;
highlighted?: boolean;
handler: (ev: MouseEvent) => void;
text?: string;
icon: string;
highlighted?: boolean;
handler: (ev: MouseEvent) => void;
};

View File

@@ -1223,6 +1223,9 @@ type ClipsListRequest = operations['clips___list']['requestBody']['content']['ap
// @public (undocumented)
type ClipsListResponse = operations['clips___list']['responses']['200']['content']['application/json'];
// @public (undocumented)
type ClipsMyFavoritesRequest = operations['clips___my-favorites']['requestBody']['content']['application/json'];
// @public (undocumented)
type ClipsMyFavoritesResponse = operations['clips___my-favorites']['responses']['200']['content']['application/json'];
@@ -1774,6 +1777,7 @@ declare namespace entities {
ClipsFavoriteRequest,
ClipsListRequest,
ClipsListResponse,
ClipsMyFavoritesRequest,
ClipsMyFavoritesResponse,
ClipsNotesRequest,
ClipsNotesResponse,

View File

@@ -1,7 +1,7 @@
{
"type": "module",
"name": "misskey-js",
"version": "2025.11.0-alpha.3",
"version": "2025.11.0",
"description": "Misskey SDK for JavaScript",
"license": "MIT",
"main": "./built/index.js",

View File

@@ -269,6 +269,7 @@ import type {
ClipsFavoriteRequest,
ClipsListRequest,
ClipsListResponse,
ClipsMyFavoritesRequest,
ClipsMyFavoritesResponse,
ClipsNotesRequest,
ClipsNotesResponse,
@@ -838,7 +839,7 @@ export type Endpoints = {
'clips/delete': { req: ClipsDeleteRequest; res: EmptyResponse };
'clips/favorite': { req: ClipsFavoriteRequest; res: EmptyResponse };
'clips/list': { req: ClipsListRequest; res: ClipsListResponse };
'clips/my-favorites': { req: EmptyRequest; res: ClipsMyFavoritesResponse };
'clips/my-favorites': { req: ClipsMyFavoritesRequest; res: ClipsMyFavoritesResponse };
'clips/notes': { req: ClipsNotesRequest; res: ClipsNotesResponse };
'clips/remove-note': { req: ClipsRemoveNoteRequest; res: EmptyResponse };
'clips/show': { req: ClipsShowRequest; res: ClipsShowResponse };

View File

@@ -272,6 +272,7 @@ export type ClipsDeleteRequest = operations['clips___delete']['requestBody']['co
export type ClipsFavoriteRequest = operations['clips___favorite']['requestBody']['content']['application/json'];
export type ClipsListRequest = operations['clips___list']['requestBody']['content']['application/json'];
export type ClipsListResponse = operations['clips___list']['responses']['200']['content']['application/json'];
export type ClipsMyFavoritesRequest = operations['clips___my-favorites']['requestBody']['content']['application/json'];
export type ClipsMyFavoritesResponse = operations['clips___my-favorites']['responses']['200']['content']['application/json'];
export type ClipsNotesRequest = operations['clips___notes']['requestBody']['content']['application/json'];
export type ClipsNotesResponse = operations['clips___notes']['responses']['200']['content']['application/json'];

View File

@@ -18640,6 +18640,20 @@ export interface operations {
};
};
'clips___my-favorites': {
requestBody: {
content: {
'application/json': {
/** @default 10 */
limit?: number;
/** Format: misskey:id */
sinceId?: string;
/** Format: misskey:id */
untilId?: string;
sinceDate?: number;
untilDate?: number;
};
};
};
responses: {
/** @description OK (with results) */
200: {