Compare commits
7 Commits
10cc5cd361
...
a7250a0e30
Author | SHA1 | Date | |
---|---|---|---|
a7250a0e30 | |||
d0c42b9468 | |||
d34eadc8b0 | |||
|
30c5aa6b92 | ||
|
8706fa0747 | ||
|
227c85c2cf | ||
|
14d71e2064 |
@ -2003,8 +2003,8 @@ _permissions:
|
||||
"read:admin:show-user": "Veure informació privada de l'usuari "
|
||||
"read:admin:show-users": "Veure informació privada de l'usuari "
|
||||
"write:admin:suspend-user": "Suspendre usuari"
|
||||
"write:admin:unset-user-avatar": "Esborrar avatar d'usuari "
|
||||
"write:admin:unset-user-banner": "Esborrar bàner de l'usuari "
|
||||
"write:admin:user-avatar": "Esborrar avatar d'usuari "
|
||||
"write:admin:user-banner": "Esborrar bàner de l'usuari "
|
||||
"write:admin:unsuspend-user": "Treure la suspensió d'un usuari"
|
||||
"write:admin:meta": "Gestionar les metadades de la instància"
|
||||
"write:admin:user-note": "Gestionar les notes de moderació "
|
||||
|
@ -693,6 +693,7 @@ useGlobalSetting: "Use global settings"
|
||||
useGlobalSettingDesc: "If turned on, your account's notification settings will be used. If turned off, individual configurations can be made."
|
||||
other: "Other"
|
||||
regenerateLoginToken: "Regenerate login token"
|
||||
regenerateLoginTokenConfirm: "Are you sure you want to regenerate the login token? All devices will be logged out."
|
||||
regenerateLoginTokenDescription: "Regenerates the token used internally during login. Normally this action is not necessary. If regenerated, all devices will be logged out."
|
||||
theKeywordWhenSearchingForCustomEmoji: "This is the keyword when searching for custom emojis."
|
||||
setMultipleBySeparatingWithSpace: "Separate multiple entries with spaces."
|
||||
@ -1062,7 +1063,7 @@ likeOnlyForRemote: "All (Only likes for remote instances)"
|
||||
nonSensitiveOnly: "Non-sensitive only"
|
||||
nonSensitiveOnlyForLocalLikeOnlyForRemote: "Non-sensitive only (Only likes from remote)"
|
||||
rolesAssignedToMe: "Roles assigned to me"
|
||||
resetPasswordConfirm: "Really reset your password?"
|
||||
resetPasswordConfirm: "Are you sure you want to reset password?"
|
||||
sensitiveWords: "Sensitive words"
|
||||
sensitiveWordsDescription: "The visibility of all notes containing any of the configured words will be set to \"Home\" automatically. You can list multiple by separating them via line breaks."
|
||||
sensitiveWordsDescription2: "Using spaces will create AND expressions and surrounding keywords with slashes will turn them into a regular expression."
|
||||
@ -1282,6 +1283,7 @@ saveThisFile: "Save this file to Drive"
|
||||
autoRemoval: "Automatic note deletion"
|
||||
autoRemovalDescription: "You can delete your note when it exceeds period you set."
|
||||
CheckedByHIBP: "In addition to ensuring your passwords are secure, HIBP scans for password leaks."
|
||||
changeUserName: "Change name"
|
||||
_bubbleGame:
|
||||
howToPlay: "How to play"
|
||||
hold: "Hold"
|
||||
@ -2146,6 +2148,7 @@ _permissions:
|
||||
"read:admin:user-ips": "View user IP addresses"
|
||||
"read:admin:meta": "View instance metadata"
|
||||
"write:admin:reset-password": "Reset user password"
|
||||
"write:admin:regenerate-user-token": "Regenerate user login token"
|
||||
"write:admin:resolve-abuse-user-report": "Resolve user report"
|
||||
"write:admin:send-email": "Send email"
|
||||
"read:admin:server-info": "View server info"
|
||||
@ -2153,11 +2156,12 @@ _permissions:
|
||||
"read:admin:show-user": "View private user info"
|
||||
"read:admin:show-users": "View private user info"
|
||||
"write:admin:suspend-user": "Suspend user"
|
||||
"write:admin:unset-user-avatar": "Remove user avatar"
|
||||
"write:admin:unset-user-banner": "Remove user banner"
|
||||
"write:admin:unset-user-mutual-link": "Remove user mutual link"
|
||||
"write:admin:user-avatar": "Remove user avatar"
|
||||
"write:admin:user-banner": "Remove user banner"
|
||||
"write:admin:user-mutual-link": "Remove user mutual link"
|
||||
"write:admin:unsuspend-user": "Unsuspend user"
|
||||
"write:admin:meta": "Manage instance metadata"
|
||||
"write:admin:user-name": "Change user name"
|
||||
"write:admin:user-note": "Manage moderation note"
|
||||
"write:admin:roles": "Manage roles"
|
||||
"read:admin:roles": "View roles"
|
||||
|
@ -2031,8 +2031,8 @@ _permissions:
|
||||
"read:admin:show-user": "Ver información privada de usuario"
|
||||
"read:admin:show-users": "Ver información privada de usuario"
|
||||
"write:admin:suspend-user": "Suspender cuentas de usuario"
|
||||
"write:admin:unset-user-avatar": "Quitar avatares de usuario"
|
||||
"write:admin:unset-user-banner": "Quitar banner de usuarios"
|
||||
"write:admin:user-avatar": "Quitar avatares de usuario"
|
||||
"write:admin:user-banner": "Quitar banner de usuarios"
|
||||
"write:admin:unsuspend-user": "Quitar suspensión de cuentas de usuario"
|
||||
"write:admin:meta": "Edición de metadatos de la instancia"
|
||||
"write:admin:user-note": "Moderación de notas"
|
||||
|
@ -2034,8 +2034,8 @@ _permissions:
|
||||
"read:admin:show-user": "Lihat informasi pengguna privat"
|
||||
"read:admin:show-users": "Lihat informasi pengguna privat"
|
||||
"write:admin:suspend-user": "Tangguhkan pengguna"
|
||||
"write:admin:unset-user-avatar": "Hapus avatar pengguna"
|
||||
"write:admin:unset-user-banner": "Hapus banner pengguna"
|
||||
"write:admin:user-avatar": "Hapus avatar pengguna"
|
||||
"write:admin:user-banner": "Hapus banner pengguna"
|
||||
"write:admin:unsuspend-user": "Batalkan penangguhan pengguna"
|
||||
"write:admin:meta": "Kelola metadata instansi"
|
||||
"write:admin:user-note": "Kelola moderasi catatan"
|
||||
|
@ -2027,8 +2027,8 @@ _permissions:
|
||||
"read:admin:show-user": "Vedere le informazioni private degli account utente"
|
||||
"read:admin:show-users": "Vedere le informazioni private degli account utente"
|
||||
"write:admin:suspend-user": "Sospendere i profili"
|
||||
"write:admin:unset-user-avatar": "Rimuovere la foto profilo dai profili"
|
||||
"write:admin:unset-user-banner": "Rimuovere l'immagine testata dai profili"
|
||||
"write:admin:user-avatar": "Rimuovere la foto profilo dai profili"
|
||||
"write:admin:user-banner": "Rimuovere l'immagine testata dai profili"
|
||||
"write:admin:unsuspend-user": "Togliere la sospensione ai profili"
|
||||
"write:admin:meta": "Modificare i metadati dell'istanza"
|
||||
"write:admin:user-note": "Scrivere annotazioni di moderazione"
|
||||
|
@ -695,6 +695,7 @@ useGlobalSetting: "グローバル設定を使う"
|
||||
useGlobalSettingDesc: "オンにすると、アカウントの通知設定が使用されます。オフにすると、個別に設定できるようになります。"
|
||||
other: "その他"
|
||||
regenerateLoginToken: "ログイントークンを再生成"
|
||||
regenerateLoginTokenConfirm: "ログイントークンを再生成しますか?"
|
||||
regenerateLoginTokenDescription: "ログインに使用される内部トークンを再生成します。通常この操作を行う必要はありません。再生成すると、全てのデバイスでログアウトされます。"
|
||||
theKeywordWhenSearchingForCustomEmoji: "カスタム絵文字を検索する時のキーワードになります。"
|
||||
setMultipleBySeparatingWithSpace: "スペースで区切って複数設定できます。"
|
||||
@ -1068,7 +1069,7 @@ likeOnlyForRemote: "全て (リモートはいいねのみ)"
|
||||
nonSensitiveOnly: "非センシティブのみ"
|
||||
nonSensitiveOnlyForLocalLikeOnlyForRemote: "非センシティブのみ (リモートはいいねのみ)"
|
||||
rolesAssignedToMe: "自分に割り当てられたロール"
|
||||
resetPasswordConfirm: "パスワードリセットしますか?"
|
||||
resetPasswordConfirm: "パスワードをリセットしますか?"
|
||||
sensitiveWords: "センシティブワード"
|
||||
sensitiveWordsDescription: "設定したワードが含まれるノートの公開範囲をホームにします。改行で区切って複数設定できます。"
|
||||
sensitiveWordsDescription2: "スペースで区切るとAND指定になり、キーワードをスラッシュで囲むと正規表現になります。"
|
||||
@ -1312,6 +1313,7 @@ autoRemovalDescription: "ノート自動削除は、作成してから一定期
|
||||
dangerZone: "危険区域"
|
||||
dangerZoneDescription: "以下の機能を利用する際は、特にご注意ください。"
|
||||
checkedByHIBP: "パスワードの安全性に加え、HIBPを通じてパスワードの漏洩を検査します。"
|
||||
changeUserName: "名前を変更"
|
||||
|
||||
_bubbleGame:
|
||||
howToPlay: "遊び方"
|
||||
@ -2231,6 +2233,7 @@ _permissions:
|
||||
"read:admin:user-ips": "ユーザーのIPアドレスを見る"
|
||||
"read:admin:meta": "インスタンスのメタデータを見る"
|
||||
"write:admin:reset-password": "ユーザーのパスワードをリセットする"
|
||||
"write:admin:regenerate-user-token": "ユーザーのログイントークンを再生成する"
|
||||
"write:admin:resolve-abuse-user-report": "ユーザーからの通報を解決する"
|
||||
"write:admin:send-email": "メールを送る"
|
||||
"read:admin:server-info": "サーバーの情報を見る"
|
||||
@ -2238,11 +2241,12 @@ _permissions:
|
||||
"read:admin:show-user": "ユーザーのプライベートな情報を見る"
|
||||
"read:admin:show-users": "ユーザーのプライベートな情報を見る"
|
||||
"write:admin:suspend-user": "ユーザーを凍結する"
|
||||
"write:admin:unset-user-avatar": "ユーザーのアバターを削除する"
|
||||
"write:admin:unset-user-banner": "ユーザーのバーナーを削除する"
|
||||
"write:admin:unset-user-mutual-link": "ユーザーの相互リンクを削除する"
|
||||
"write:admin:user-avatar": "ユーザーのアバターを削除する"
|
||||
"write:admin:user-banner": "ユーザーのバーナーを削除する"
|
||||
"write:admin:user-mutual-link": "ユーザーの相互リンクを削除する"
|
||||
"write:admin:unsuspend-user": "ユーザーの凍結を解除する"
|
||||
"write:admin:meta": "インスタンスのメタデータを操作する"
|
||||
"write:admin:user-name": "ユーザーの名前を変更する"
|
||||
"write:admin:user-note": "モデレーションノートを操作する"
|
||||
"write:admin:roles": "ロールを操作する"
|
||||
"read:admin:roles": "ロールを見る"
|
||||
|
@ -2034,8 +2034,8 @@ _permissions:
|
||||
"read:admin:show-user": "ユーザーのプライベートな情報見る"
|
||||
"read:admin:show-users": "ユーザーのプライベートな情報見る"
|
||||
"write:admin:suspend-user": "ユーザーを凍結"
|
||||
"write:admin:unset-user-avatar": "ユーザーのアバターを削除"
|
||||
"write:admin:unset-user-banner": "ユーザーのバナーを削除"
|
||||
"write:admin:user-avatar": "ユーザーのアバターを削除"
|
||||
"write:admin:user-banner": "ユーザーのバナーを削除"
|
||||
"write:admin:unsuspend-user": "ユーザーの凍結解除"
|
||||
"write:admin:meta": "インスタンスのメタデータいじる"
|
||||
"write:admin:user-note": "モデレーションノートいじる"
|
||||
|
@ -692,6 +692,7 @@ useGlobalSetting: "글로벌 설정을 사용하기"
|
||||
useGlobalSettingDesc: "활성화하면 계정의 알림 설정이 적용됩니다. 비활성화하면 개별적으로 설정할 수 있게 됩니다."
|
||||
other: "기타"
|
||||
regenerateLoginToken: "로그인 토큰을 재생성"
|
||||
regenerateLoginTokenConfirm: "정말 로그인 토큰을 재생성하시겠습니까? 이 작업을 실행하면 이 계정으로 로그인한 모든 기기에서 로그아웃됩니다."
|
||||
regenerateLoginTokenDescription: "로그인할 때 사용되는 내부 토큰을 재생성합니다. 일반적으로 이 작업을 실행할 필요는 없습니다. 이 기능을 사용하면 이 계정으로 로그인한 모든 기기에서 로그아웃됩니다."
|
||||
theKeywordWhenSearchingForCustomEmoji: "맞춤 이모티콘을 검색할 때 키워드가 됩니다."
|
||||
setMultipleBySeparatingWithSpace: "공백으로 구분하여 여러 개 설정할 수 있습니다."
|
||||
@ -1302,6 +1303,7 @@ muteThisUser: "이 유저 뮤트하기"
|
||||
dangerZone: "위험한 것들"
|
||||
dangerZoneDescription: "함부로 실행하면 어딘가 고장날 수 있는 설정들이니, 실행할 때는 주의하세요."
|
||||
checkedByHIBP: "비밀번호의 안전성과 더불어, HIBP를 통해 비밀번호 유출을 검사합니다."
|
||||
changeUserName: "이름 변경"
|
||||
_bubbleGame:
|
||||
howToPlay: "설명"
|
||||
hold: "홀드"
|
||||
|
@ -2034,8 +2034,8 @@ _permissions:
|
||||
"read:admin:show-user": "ดูข้อมูลส่วนตัวของผู้ใช้"
|
||||
"read:admin:show-users": "ดูข้อมูลส่วนตัวของผู้ใช้"
|
||||
"write:admin:suspend-user": "ระงับผู้ใช้"
|
||||
"write:admin:unset-user-avatar": "ลบอวตารผู้ใช้"
|
||||
"write:admin:unset-user-banner": "ลบแบนเนอร์ผู้ใช้"
|
||||
"write:admin:user-avatar": "ลบอวตารผู้ใช้"
|
||||
"write:admin:user-banner": "ลบแบนเนอร์ผู้ใช้"
|
||||
"write:admin:unsuspend-user": "ยกเลิกการระงับผู้ใช้"
|
||||
"write:admin:meta": "จัดการข้อมูลเมตาของอินสแตนซ์"
|
||||
"write:admin:user-note": "จัดการโน้ตการกลั่นกรอง"
|
||||
|
@ -2052,8 +2052,8 @@ _permissions:
|
||||
"read:admin:show-user": "查看用户的非公开信息"
|
||||
"read:admin:show-users": "查看用户的非公开信息"
|
||||
"write:admin:suspend-user": "冻结用户"
|
||||
"write:admin:unset-user-avatar": "删除用户头像"
|
||||
"write:admin:unset-user-banner": "删除用户横幅"
|
||||
"write:admin:user-avatar": "删除用户头像"
|
||||
"write:admin:user-banner": "删除用户横幅"
|
||||
"write:admin:unsuspend-user": "解除用户冻结"
|
||||
"write:admin:meta": "编辑实例元数据"
|
||||
"write:admin:user-note": "编辑管理笔记"
|
||||
|
@ -2034,8 +2034,8 @@ _permissions:
|
||||
"read:admin:show-user": "查看使用者的私密資訊"
|
||||
"read:admin:show-users": "查看使用者的私密資訊"
|
||||
"write:admin:suspend-user": "凍結使用者"
|
||||
"write:admin:unset-user-avatar": "刪除使用者的頭像"
|
||||
"write:admin:unset-user-banner": "刪除使用者的橫幅"
|
||||
"write:admin:user-avatar": "刪除使用者的頭像"
|
||||
"write:admin:user-banner": "刪除使用者的橫幅"
|
||||
"write:admin:unsuspend-user": "解除凍結使用者"
|
||||
"write:admin:meta": "編輯實例的詮釋資料"
|
||||
"write:admin:user-note": "編輯審查筆記"
|
||||
|
@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "misskey",
|
||||
"version": "2024.5.0-oscar.15c",
|
||||
"version": "2024.5.0-oscar.16",
|
||||
"codename": "nasubi",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/SWREI/oscar_surf.git"
|
||||
"url": "https://git.psec.dev/oscar-surf/misskey.git"
|
||||
},
|
||||
"packageManager": "pnpm@9.7.1",
|
||||
"workspaces": [
|
||||
|
@ -50,7 +50,7 @@ type Source = {
|
||||
redisForJobQueue?: RedisOptionsSource;
|
||||
redisForSystemQueue?: RedisOptionsSource;
|
||||
redisForEndedPollNotificationQueue?: RedisOptionsSource;
|
||||
redisForDeliverQueue?: RedisOptionsSource;
|
||||
redisForDeliverQueues?: Array<RedisOptionsSource>;
|
||||
redisForInboxQueue?: RedisOptionsSource;
|
||||
redisForDbQueue?: RedisOptionsSource;
|
||||
redisForRelationshipQueue?: RedisOptionsSource;
|
||||
@ -220,7 +220,7 @@ export type Config = {
|
||||
redisForPubsub: RedisOptions & RedisOptionsSource;
|
||||
redisForSystemQueue: RedisOptions & RedisOptionsSource;
|
||||
redisForEndedPollNotificationQueue: RedisOptions & RedisOptionsSource;
|
||||
redisForDeliverQueue: RedisOptions & RedisOptionsSource;
|
||||
redisForDeliverQueues: Array<RedisOptions & RedisOptionsSource>;
|
||||
redisForInboxQueue: RedisOptions & RedisOptionsSource;
|
||||
redisForDbQueue: RedisOptions & RedisOptionsSource;
|
||||
redisForRelationshipQueue: RedisOptions & RedisOptionsSource;
|
||||
@ -296,7 +296,7 @@ export function loadConfig(): Config {
|
||||
redisForPubsub: config.redisForPubsub ? convertRedisOptions(config.redisForPubsub, host) : redis,
|
||||
redisForSystemQueue: config.redisForSystemQueue ? convertRedisOptions(config.redisForSystemQueue, host) : redisForJobQueue,
|
||||
redisForEndedPollNotificationQueue: config.redisForEndedPollNotificationQueue ? convertRedisOptions(config.redisForEndedPollNotificationQueue, host) : redisForJobQueue,
|
||||
redisForDeliverQueue: config.redisForDeliverQueue ? convertRedisOptions(config.redisForDeliverQueue, host) : redisForJobQueue,
|
||||
redisForDeliverQueues: config.redisForDeliverQueues ? config.redisForDeliverQueues.map(config => convertRedisOptions(config, host)) : [redisForJobQueue],
|
||||
redisForInboxQueue: config.redisForInboxQueue ? convertRedisOptions(config.redisForInboxQueue, host) : redisForJobQueue,
|
||||
redisForDbQueue: config.redisForDbQueue ? convertRedisOptions(config.redisForDbQueue, host) : redisForJobQueue,
|
||||
redisForRelationshipQueue: config.redisForRelationshipQueue ? convertRedisOptions(config.redisForRelationshipQueue, host) : redisForJobQueue,
|
||||
|
@ -9,12 +9,13 @@ import { DI } from '@/di-symbols.js';
|
||||
import type { Config } from '@/config.js';
|
||||
import { QUEUE, baseQueueOptions } from '@/queue/const.js';
|
||||
import { allSettled } from '@/misc/promise-tracker.js';
|
||||
import { Queues } from '@/misc/queues.js';
|
||||
import type { Provider } from '@nestjs/common';
|
||||
import type { DeliverJobData, InboxJobData, EndedPollNotificationJobData, WebhookDeliverJobData, RelationshipJobData } from '../queue/types.js';
|
||||
|
||||
export type SystemQueue = Bull.Queue<Record<string, unknown>>;
|
||||
export type EndedPollNotificationQueue = Bull.Queue<EndedPollNotificationJobData>;
|
||||
export type DeliverQueue = Bull.Queue<DeliverJobData>;
|
||||
export type DeliverQueue = Queues<DeliverJobData>;
|
||||
export type InboxQueue = Bull.Queue<InboxJobData>;
|
||||
export type DbQueue = Bull.Queue;
|
||||
export type RelationshipQueue = Bull.Queue<RelationshipJobData>;
|
||||
@ -35,7 +36,7 @@ const $endedPollNotification: Provider = {
|
||||
|
||||
const $deliver: Provider = {
|
||||
provide: 'queue:deliver',
|
||||
useFactory: (config: Config) => new Bull.Queue(QUEUE.DELIVER, baseQueueOptions(config.redisForDeliverQueue, config.bullmqQueueOptions, QUEUE.DELIVER)),
|
||||
useFactory: (config: Config) => new Queues(config.redisForDeliverQueues.map(queueConfig => new Bull.Queue(QUEUE.DELIVER, baseQueueOptions(queueConfig, config.bullmqQueueOptions, QUEUE.DELIVER)))),
|
||||
inject: [DI.config],
|
||||
};
|
||||
|
||||
|
69
packages/backend/src/misc/queues.ts
Normal file
69
packages/backend/src/misc/queues.ts
Normal file
@ -0,0 +1,69 @@
|
||||
import { EventEmitter } from 'node:events';
|
||||
import * as Bull from 'bullmq';
|
||||
|
||||
export class Queues<DataType = any, ResultType = any, NameType extends string = string> {
|
||||
public readonly queues: ReadonlyArray<Bull.Queue<DataType, ResultType, NameType>>;
|
||||
|
||||
constructor(queues: Bull.Queue<DataType, ResultType, NameType>[]) {
|
||||
if (queues.length === 0) {
|
||||
throw new Error('queues cannot be empty.');
|
||||
}
|
||||
this.queues = queues;
|
||||
}
|
||||
|
||||
getRandomQueue(): Bull.Queue<DataType, ResultType, NameType> {
|
||||
return this.queues[Math.floor(Math.random() * this.queues.length)];
|
||||
}
|
||||
|
||||
add(name: NameType, data: DataType, opts?: Bull.JobsOptions): Promise<Bull.Job<DataType, ResultType, NameType>> {
|
||||
return this.getRandomQueue().add(name, data, opts);
|
||||
}
|
||||
|
||||
async addBulk(jobs: { name: NameType; data: DataType; opts?: Bull.BulkJobOptions }[]): Promise<Bull.Job<DataType, ResultType, NameType>[]> {
|
||||
return (await Promise.allSettled(jobs.map(job => this.add(job.name, job.data, job.opts))))
|
||||
.filter((value): value is PromiseFulfilledResult<Bull.Job<DataType, ResultType, NameType>> => value.status === 'fulfilled')
|
||||
.flatMap(value => value.value);
|
||||
}
|
||||
|
||||
async close(): Promise<void> {
|
||||
await Promise.allSettled(this.queues.map(queue => queue.close()));
|
||||
}
|
||||
|
||||
async getDelayed(start?: number, end?: number): Promise<Bull.Job<DataType, ResultType, NameType>[]> {
|
||||
return (await Promise.allSettled(this.queues.map(queue => queue.getDelayed(start, end))))
|
||||
.filter((value): value is PromiseFulfilledResult<Bull.Job<DataType, ResultType, NameType>[]> => value.status === 'fulfilled')
|
||||
.flatMap(value => value.value);
|
||||
}
|
||||
|
||||
async getJobCounts(...types: Bull.JobType[]): Promise<{ [p: string]: number }> {
|
||||
return (await Promise.allSettled(this.queues.map(queue => queue.getJobCounts(...types))))
|
||||
.filter((value): value is PromiseFulfilledResult<Record<string, number>> => value.status === 'fulfilled')
|
||||
.reduce((previousValue, currentValue) => {
|
||||
for (const key in currentValue.value) {
|
||||
previousValue[key] = (previousValue[key] || 0) + currentValue.value[key];
|
||||
}
|
||||
return previousValue;
|
||||
}, {} as Record<string, number>);
|
||||
}
|
||||
|
||||
once<U extends keyof Bull.QueueListener<DataType, ResultType, NameType>>(event: U, listener: Bull.QueueListener<DataType, ResultType, NameType>[U]): void {
|
||||
const e = new EventEmitter();
|
||||
e.once(event, listener);
|
||||
|
||||
const listener1 = (...args: any[]) => e.emit(event, ...args);
|
||||
this.queues.forEach(queue => queue.once(event, listener1));
|
||||
e.once(event, () => this.queues.forEach(queue => queue.off(event, listener1)));
|
||||
}
|
||||
|
||||
async clean(grace: number, limit: number, type?: 'completed' | 'wait' | 'active' | 'paused' | 'prioritized' | 'delayed' | 'failed'): Promise<NameType[]> {
|
||||
return (await Promise.allSettled(this.queues.map(queue => queue.clean(grace, limit, type))))
|
||||
.filter((value): value is PromiseFulfilledResult<NameType[]> => value.status === 'fulfilled')
|
||||
.flatMap(value => value.value);
|
||||
}
|
||||
|
||||
async getJobs(types?: Bull.JobType[] | Bull.JobType, start?: number, end?: number, asc?: boolean): Promise<Bull.Job<DataType, ResultType, NameType>[]> {
|
||||
return (await Promise.allSettled(this.queues.map(queue => queue.getJobs(types, start, end, asc))))
|
||||
.filter((value): value is PromiseFulfilledResult<Bull.Job<DataType, ResultType, NameType>[]> => value.status === 'fulfilled')
|
||||
.flatMap(value => value.value);
|
||||
}
|
||||
}
|
@ -78,7 +78,7 @@ export class QueueProcessorService implements OnApplicationShutdown {
|
||||
private logger: Logger;
|
||||
private systemQueueWorker: Bull.Worker;
|
||||
private dbQueueWorker: Bull.Worker;
|
||||
private deliverQueueWorker: Bull.Worker;
|
||||
private deliverQueueWorkers: Bull.Worker[];
|
||||
private inboxQueueWorker: Bull.Worker;
|
||||
private webhookDeliverQueueWorker: Bull.Worker;
|
||||
private relationshipQueueWorker: Bull.Worker;
|
||||
@ -215,8 +215,10 @@ export class QueueProcessorService implements OnApplicationShutdown {
|
||||
//#endregion
|
||||
|
||||
//#region deliver
|
||||
this.deliverQueueWorker = new Bull.Worker(QUEUE.DELIVER, (job) => this.deliverProcessorService.process(job), {
|
||||
...baseWorkerOptions(this.config.redisForDeliverQueue, this.config.bullmqWorkerOptions, QUEUE.DELIVER),
|
||||
this.deliverQueueWorkers = this.config.redisForDeliverQueues
|
||||
.filter((_, index) => process.env.QUEUE_WORKER_INDEX == null || index === Number.parseInt(process.env.QUEUE_WORKER_INDEX, 10))
|
||||
.map(config => new Bull.Worker(QUEUE.DELIVER, (job) => this.deliverProcessorService.process(job), {
|
||||
...baseWorkerOptions(config, this.config.bullmqWorkerOptions, QUEUE.DELIVER),
|
||||
autorun: false,
|
||||
concurrency: this.config.deliverJobConcurrency ?? 128,
|
||||
limiter: {
|
||||
@ -226,16 +228,18 @@ export class QueueProcessorService implements OnApplicationShutdown {
|
||||
settings: {
|
||||
backoffStrategy: httpRelatedBackoff,
|
||||
},
|
||||
});
|
||||
}));
|
||||
|
||||
const deliverLogger = this.logger.createSubLogger('deliver');
|
||||
this.deliverQueueWorkers.forEach((worker, index) => {
|
||||
const deliverLogger = this.logger.createSubLogger(`deliver-${index}`);
|
||||
|
||||
this.deliverQueueWorker
|
||||
worker
|
||||
.on('active', (job) => deliverLogger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`))
|
||||
.on('completed', (job, result) => deliverLogger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`))
|
||||
.on('failed', (job, err) => deliverLogger.warn(`failed(${err.stack}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`))
|
||||
.on('error', (err: Error) => deliverLogger.error(`error ${err.stack}`, { error: renderError(err) }))
|
||||
.on('stalled', (jobId) => deliverLogger.warn(`stalled id=${jobId}`));
|
||||
});
|
||||
//#endregion
|
||||
|
||||
//#region inbox
|
||||
@ -351,7 +355,7 @@ export class QueueProcessorService implements OnApplicationShutdown {
|
||||
await Promise.all([
|
||||
this.systemQueueWorker.run(),
|
||||
this.dbQueueWorker.run(),
|
||||
this.deliverQueueWorker.run(),
|
||||
...this.deliverQueueWorkers.map(worker => worker.run()),
|
||||
this.inboxQueueWorker.run(),
|
||||
this.webhookDeliverQueueWorker.run(),
|
||||
this.relationshipQueueWorker.run(),
|
||||
@ -365,7 +369,7 @@ export class QueueProcessorService implements OnApplicationShutdown {
|
||||
await Promise.all([
|
||||
this.systemQueueWorker.close(),
|
||||
this.dbQueueWorker.close(),
|
||||
this.deliverQueueWorker.close(),
|
||||
...this.deliverQueueWorkers.map(worker => worker.close()),
|
||||
this.inboxQueueWorker.close(),
|
||||
this.webhookDeliverQueueWorker.close(),
|
||||
this.relationshipQueueWorker.close(),
|
||||
|
@ -75,6 +75,7 @@ import * as ep___admin_relays_add from './endpoints/admin/relays/add.js';
|
||||
import * as ep___admin_relays_list from './endpoints/admin/relays/list.js';
|
||||
import * as ep___admin_relays_remove from './endpoints/admin/relays/remove.js';
|
||||
import * as ep___admin_resetPassword from './endpoints/admin/reset-password.js';
|
||||
import * as ep___admin_regenerateUserToken from './endpoints/admin/regenerate-user-token.js';
|
||||
import * as ep___admin_resolveAbuseUserReport from './endpoints/admin/resolve-abuse-user-report.js';
|
||||
import * as ep___admin_sendEmail from './endpoints/admin/send-email.js';
|
||||
import * as ep___admin_serverInfo from './endpoints/admin/server-info.js';
|
||||
@ -85,6 +86,7 @@ import * as ep___admin_showUsers from './endpoints/admin/show-users.js';
|
||||
import * as ep___admin_suspendUser from './endpoints/admin/suspend-user.js';
|
||||
import * as ep___admin_unsuspendUser from './endpoints/admin/unsuspend-user.js';
|
||||
import * as ep___admin_updateMeta from './endpoints/admin/update-meta.js';
|
||||
import * as ep___admin_updateUserName from './endpoints/admin/update-user-name.js';
|
||||
import * as ep___admin_updateUserNote from './endpoints/admin/update-user-note.js';
|
||||
import * as ep___admin_roles_create from './endpoints/admin/roles/create.js';
|
||||
import * as ep___admin_roles_delete from './endpoints/admin/roles/delete.js';
|
||||
@ -471,6 +473,7 @@ const $admin_relays_add: Provider = { provide: 'ep:admin/relays/add', useClass:
|
||||
const $admin_relays_list: Provider = { provide: 'ep:admin/relays/list', useClass: ep___admin_relays_list.default };
|
||||
const $admin_relays_remove: Provider = { provide: 'ep:admin/relays/remove', useClass: ep___admin_relays_remove.default };
|
||||
const $admin_resetPassword: Provider = { provide: 'ep:admin/reset-password', useClass: ep___admin_resetPassword.default };
|
||||
const $admin_regenerateUserToken: Provider = { provide: 'ep:admin/regenerate-user-token', useClass: ep___admin_regenerateUserToken.default };
|
||||
const $admin_resolveAbuseUserReport: Provider = { provide: 'ep:admin/resolve-abuse-user-report', useClass: ep___admin_resolveAbuseUserReport.default };
|
||||
const $admin_sendEmail: Provider = { provide: 'ep:admin/send-email', useClass: ep___admin_sendEmail.default };
|
||||
const $admin_serverInfo: Provider = { provide: 'ep:admin/server-info', useClass: ep___admin_serverInfo.default };
|
||||
@ -481,6 +484,7 @@ const $admin_showUsers: Provider = { provide: 'ep:admin/show-users', useClass: e
|
||||
const $admin_suspendUser: Provider = { provide: 'ep:admin/suspend-user', useClass: ep___admin_suspendUser.default };
|
||||
const $admin_unsuspendUser: Provider = { provide: 'ep:admin/unsuspend-user', useClass: ep___admin_unsuspendUser.default };
|
||||
const $admin_updateMeta: Provider = { provide: 'ep:admin/update-meta', useClass: ep___admin_updateMeta.default };
|
||||
const $admin_updateUserName: Provider = { provide: 'ep:admin/update-user-name', useClass: ep___admin_updateUserName.default };
|
||||
const $admin_updateUserNote: Provider = { provide: 'ep:admin/update-user-note', useClass: ep___admin_updateUserNote.default };
|
||||
const $admin_roles_create: Provider = { provide: 'ep:admin/roles/create', useClass: ep___admin_roles_create.default };
|
||||
const $admin_roles_delete: Provider = { provide: 'ep:admin/roles/delete', useClass: ep___admin_roles_delete.default };
|
||||
@ -871,6 +875,7 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__
|
||||
$admin_relays_list,
|
||||
$admin_relays_remove,
|
||||
$admin_resetPassword,
|
||||
$admin_regenerateUserToken,
|
||||
$admin_resolveAbuseUserReport,
|
||||
$admin_sendEmail,
|
||||
$admin_serverInfo,
|
||||
@ -881,6 +886,7 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__
|
||||
$admin_suspendUser,
|
||||
$admin_unsuspendUser,
|
||||
$admin_updateMeta,
|
||||
$admin_updateUserName,
|
||||
$admin_updateUserNote,
|
||||
$admin_roles_create,
|
||||
$admin_roles_delete,
|
||||
@ -1265,6 +1271,7 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__
|
||||
$admin_relays_list,
|
||||
$admin_relays_remove,
|
||||
$admin_resetPassword,
|
||||
$admin_regenerateUserToken,
|
||||
$admin_resolveAbuseUserReport,
|
||||
$admin_sendEmail,
|
||||
$admin_serverInfo,
|
||||
@ -1275,6 +1282,7 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__
|
||||
$admin_suspendUser,
|
||||
$admin_unsuspendUser,
|
||||
$admin_updateMeta,
|
||||
$admin_updateUserName,
|
||||
$admin_updateUserNote,
|
||||
$admin_roles_create,
|
||||
$admin_roles_delete,
|
||||
|
@ -75,6 +75,7 @@ import * as ep___admin_relays_add from './endpoints/admin/relays/add.js';
|
||||
import * as ep___admin_relays_list from './endpoints/admin/relays/list.js';
|
||||
import * as ep___admin_relays_remove from './endpoints/admin/relays/remove.js';
|
||||
import * as ep___admin_resetPassword from './endpoints/admin/reset-password.js';
|
||||
import * as ep___admin_regenerateUserToken from './endpoints/admin/regenerate-user-token.js';
|
||||
import * as ep___admin_resolveAbuseUserReport from './endpoints/admin/resolve-abuse-user-report.js';
|
||||
import * as ep___admin_sendEmail from './endpoints/admin/send-email.js';
|
||||
import * as ep___admin_serverInfo from './endpoints/admin/server-info.js';
|
||||
@ -85,6 +86,7 @@ import * as ep___admin_showUsers from './endpoints/admin/show-users.js';
|
||||
import * as ep___admin_suspendUser from './endpoints/admin/suspend-user.js';
|
||||
import * as ep___admin_unsuspendUser from './endpoints/admin/unsuspend-user.js';
|
||||
import * as ep___admin_updateMeta from './endpoints/admin/update-meta.js';
|
||||
import * as ep___admin_updateUserName from './endpoints/admin/update-user-name.js';
|
||||
import * as ep___admin_updateUserNote from './endpoints/admin/update-user-note.js';
|
||||
import * as ep___admin_roles_create from './endpoints/admin/roles/create.js';
|
||||
import * as ep___admin_roles_delete from './endpoints/admin/roles/delete.js';
|
||||
@ -469,6 +471,7 @@ const eps = [
|
||||
['admin/relays/list', ep___admin_relays_list],
|
||||
['admin/relays/remove', ep___admin_relays_remove],
|
||||
['admin/reset-password', ep___admin_resetPassword],
|
||||
['admin/regenerate-user-token', ep___admin_regenerateUserToken],
|
||||
['admin/resolve-abuse-user-report', ep___admin_resolveAbuseUserReport],
|
||||
['admin/send-email', ep___admin_sendEmail],
|
||||
['admin/server-info', ep___admin_serverInfo],
|
||||
@ -479,6 +482,7 @@ const eps = [
|
||||
['admin/suspend-user', ep___admin_suspendUser],
|
||||
['admin/unsuspend-user', ep___admin_unsuspendUser],
|
||||
['admin/update-meta', ep___admin_updateMeta],
|
||||
['admin/update-user-name', ep___admin_updateUserName],
|
||||
['admin/update-user-note', ep___admin_updateUserNote],
|
||||
['admin/roles/create', ep___admin_roles_create],
|
||||
['admin/roles/delete', ep___admin_roles_delete],
|
||||
|
@ -0,0 +1,61 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||
import type { UsersRepository } from '@/models/_.js';
|
||||
import generateUserToken from '@/misc/generate-native-user-token.js';
|
||||
import { GlobalEventService } from '@/core/GlobalEventService.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import { ModerationLogService } from '@/core/ModerationLogService.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
kind: 'write:admin:regenerate-user-token',
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
userId: { type: 'string', format: 'misskey:id' },
|
||||
},
|
||||
required: ['userId'],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
@Injectable()
|
||||
export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||
constructor(
|
||||
@Inject(DI.usersRepository)
|
||||
private usersRepository: UsersRepository,
|
||||
|
||||
private globalEventService: GlobalEventService,
|
||||
private moderationLogService: ModerationLogService,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
const user = await this.usersRepository.findOneBy({ id: ps.userId });
|
||||
|
||||
if (user == null) {
|
||||
throw new Error('user not found');
|
||||
}
|
||||
|
||||
const oldToken = user.token;
|
||||
if (oldToken == null) return;
|
||||
|
||||
const newToken = generateUserToken();
|
||||
await this.usersRepository.update(user.id, {
|
||||
token: newToken,
|
||||
});
|
||||
|
||||
// Publish event
|
||||
this.globalEventService.publishInternalEvent('userTokenRegenerated', { id: user.id, oldToken, newToken });
|
||||
this.globalEventService.publishMainStream(user.id, 'myTokenRegenerated');
|
||||
|
||||
this.moderationLogService.log(me, 'regenerateUserToken', {
|
||||
userId: user.id,
|
||||
userUsername: user.username,
|
||||
userHost: user.host,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@ export const meta = {
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
kind: 'write:admin:unset-user-avatar',
|
||||
kind: 'write:admin:user-avatar',
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
@ -14,7 +14,7 @@ export const meta = {
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
kind: 'write:admin:unset-user-banner',
|
||||
kind: 'write:admin:user-banner',
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
@ -12,7 +12,7 @@ export const meta = {
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
kind: 'write:admin:unset-user-mutual-link',
|
||||
kind: 'write:admin:user-mutual-link',
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
@ -0,0 +1,53 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import type { UsersRepository } from '@/models/_.js';
|
||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import { ModerationLogService } from '@/core/ModerationLogService.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
kind: 'write:admin:user-name',
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
userId: { type: 'string', format: 'misskey:id' },
|
||||
name: { type: 'string' },
|
||||
},
|
||||
required: ['userId'],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
@Injectable()
|
||||
export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||
constructor(
|
||||
@Inject(DI.usersRepository)
|
||||
private usersRepository: UsersRepository,
|
||||
|
||||
private moderationLogService: ModerationLogService,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
const user = await this.usersRepository.findOneBy({ id: ps.userId });
|
||||
|
||||
if (user == null) {
|
||||
throw new Error('user not found');
|
||||
}
|
||||
|
||||
await this.usersRepository.update(user.id, {
|
||||
name: ps.name ?? null,
|
||||
});
|
||||
|
||||
this.moderationLogService.log(me, 'updateUserName', {
|
||||
userId: user.id,
|
||||
userUsername: user.username,
|
||||
userHost: user.host,
|
||||
before: user.name,
|
||||
after: ps.name ?? null,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
@ -203,7 +203,7 @@ export class JWTIdentifyProviderService {
|
||||
.setIssuer(ssoServiceProvider.issuer)
|
||||
.setAudience(ssoServiceProvider.audience)
|
||||
.setIssuedAt()
|
||||
.setExpirationTime('10m')
|
||||
.setExpirationTime('2w')
|
||||
.setJti(randomUUID())
|
||||
.setSubject(user.id)
|
||||
.encrypt(key);
|
||||
@ -220,7 +220,7 @@ export class JWTIdentifyProviderService {
|
||||
.setIssuer(ssoServiceProvider.issuer)
|
||||
.setAudience(ssoServiceProvider.audience)
|
||||
.setIssuedAt()
|
||||
.setExpirationTime('10m')
|
||||
.setExpirationTime('2w')
|
||||
.setJti(randomUUID())
|
||||
.setSubject(user.id)
|
||||
.sign(key);
|
||||
|
@ -235,12 +235,12 @@ export class ClientServerService {
|
||||
queues: [
|
||||
this.systemQueue,
|
||||
this.endedPollNotificationQueue,
|
||||
this.deliverQueue,
|
||||
this.inboxQueue,
|
||||
this.dbQueue,
|
||||
this.objectStorageQueue,
|
||||
this.webhookDeliverQueue,
|
||||
].map(q => new BullMQAdapter(q)),
|
||||
].map(q => new BullMQAdapter(q))
|
||||
.concat(this.deliverQueue.queues.map((q, index) => new BullMQAdapter(q, { prefix: `${index}-` }))),
|
||||
serverAdapter,
|
||||
});
|
||||
|
||||
|
@ -55,6 +55,7 @@ export const moderationLogTypes = [
|
||||
'updateServerSettings',
|
||||
'suspend',
|
||||
'unsuspend',
|
||||
'updateUserName',
|
||||
'updateUserNote',
|
||||
'addCustomEmoji',
|
||||
'updateCustomEmoji',
|
||||
@ -75,6 +76,7 @@ export const moderationLogTypes = [
|
||||
'deleteGlobalAnnouncement',
|
||||
'deleteUserAnnouncement',
|
||||
'resetPassword',
|
||||
'regenerateUserToken',
|
||||
'suspendRemoteInstance',
|
||||
'unsuspendRemoteInstance',
|
||||
'updateRemoteInstanceNote',
|
||||
@ -114,6 +116,13 @@ export type ModerationLogPayloads = {
|
||||
userUsername: string;
|
||||
userHost: string | null;
|
||||
};
|
||||
updateUserName: {
|
||||
userId: string;
|
||||
userUsername: string;
|
||||
userHost: string | null;
|
||||
before: string | null;
|
||||
after: string | null;
|
||||
};
|
||||
updateUserNote: {
|
||||
userId: string;
|
||||
userUsername: string;
|
||||
@ -217,6 +226,11 @@ export type ModerationLogPayloads = {
|
||||
userUsername: string;
|
||||
userHost: string | null;
|
||||
};
|
||||
regenerateUserToken: {
|
||||
userId: string;
|
||||
userUsername: string;
|
||||
userHost: string | null;
|
||||
};
|
||||
suspendRemoteInstance: {
|
||||
id: string;
|
||||
host: string;
|
||||
|
@ -63,7 +63,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<template #label>{{ i18n.ts.moderation }}</template>
|
||||
<div class="_gaps">
|
||||
<MkSwitch v-model="suspended" @update:modelValue="toggleSuspend">{{ i18n.ts.suspend }}</MkSwitch>
|
||||
<MkButton v-if="user?.host == null" @click="resetPassword"><i class="ti ti-key"></i> {{ i18n.ts.resetPassword }}</MkButton>
|
||||
<div v-if="user?.host == null" class="_buttons">
|
||||
<MkButton @click="resetPassword"><i class="ti ti-key"></i> {{ i18n.ts.resetPassword }}</MkButton>
|
||||
<MkButton danger @click="regenerateLoginToken"><i class="ti ti-refresh"></i> {{ i18n.ts.regenerateLoginToken }}</MkButton>
|
||||
</div>
|
||||
<MkButton inline danger @click="updateUserName"><i class="ti ti-user-edit"></i> {{ i18n.ts.changeUserName }}</MkButton>
|
||||
<MkButton inline danger @click="unsetUserAvatar"><i class="ti ti-user-circle"></i> {{ i18n.ts.unsetUserAvatar }}</MkButton>
|
||||
<MkButton inline danger @click="unsetUserBanner"><i class="ti ti-photo"></i> {{ i18n.ts.unsetUserBanner }}</MkButton>
|
||||
<MkFolder v-if="user?.mutualLinkSections && user?.mutualLinkSections.reduce((acc, section) => acc + section.mutualLinks.length, 0) > 0">
|
||||
@ -339,6 +343,18 @@ async function resetPassword() {
|
||||
}
|
||||
}
|
||||
|
||||
async function regenerateLoginToken() {
|
||||
const confirm = await os.confirm({
|
||||
type: 'warning',
|
||||
text: i18n.ts.regenerateLoginTokenConfirm,
|
||||
});
|
||||
if (confirm.canceled) return;
|
||||
|
||||
await os.apiWithDialog('admin/regenerate-user-token', {
|
||||
userId: user.value.id,
|
||||
}).then(refreshUser);
|
||||
}
|
||||
|
||||
async function toggleSuspend(v) {
|
||||
const confirm = await os.confirm({
|
||||
type: 'warning',
|
||||
@ -353,6 +369,20 @@ async function toggleSuspend(v) {
|
||||
}
|
||||
}
|
||||
|
||||
async function updateUserName() {
|
||||
const { canceled, result: name } = await os.inputText({
|
||||
type: 'text',
|
||||
title: i18n.ts.enterUsername,
|
||||
default: '',
|
||||
});
|
||||
if (canceled) return;
|
||||
|
||||
await os.apiWithDialog('admin/update-user-name', {
|
||||
userId: user.value.id,
|
||||
name: name || undefined,
|
||||
}).then(refreshUser);
|
||||
}
|
||||
|
||||
async function unsetUserAvatar() {
|
||||
const confirm = await os.confirm({
|
||||
type: 'warning',
|
||||
|
@ -9,14 +9,19 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<b
|
||||
:class="{
|
||||
[$style.logGreen]: ['createRole', 'addCustomEmoji', 'createGlobalAnnouncement', 'createUserAnnouncement', 'createAd', 'createInvitation', 'createAvatarDecoration'].includes(log.type),
|
||||
[$style.logYellow]: ['markSensitiveDriveFile', 'resetPassword'].includes(log.type),
|
||||
[$style.logYellow]: ['markSensitiveDriveFile', 'resetPassword', 'regenerateUserToken', 'updateUserName', 'unsetUserAvatar', 'unsetUserBanner', 'unsetUserMutualLink'].includes(log.type),
|
||||
[$style.logRed]: ['suspend', 'deleteRole', 'suspendRemoteInstance', 'deleteGlobalAnnouncement', 'deleteUserAnnouncement', 'deleteCustomEmoji', 'deleteNote', 'deleteDriveFile', 'deleteAd', 'deleteAvatarDecoration'].includes(log.type)
|
||||
}"
|
||||
>{{ i18n.ts._moderationLogTypes[log.type] }}</b>
|
||||
<span v-if="log.type === 'updateUserNote'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
||||
<span v-else-if="log.type === 'updateUserName'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
||||
<span v-else-if="log.type === 'unsetUserAvatar'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
||||
<span v-else-if="log.type === 'unsetUserBanner'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
||||
<span v-else-if="log.type === 'unsetUserMutualLink'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
||||
<span v-else-if="log.type === 'suspend'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
||||
<span v-else-if="log.type === 'unsuspend'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
||||
<span v-else-if="log.type === 'resetPassword'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
||||
<span v-else-if="log.type === 'regenerateUserToken'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
||||
<span v-else-if="log.type === 'assignRole'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }} <i class="ti ti-arrow-right"></i> {{ log.info.roleName }}</span>
|
||||
<span v-else-if="log.type === 'unassignRole'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }} <i class="ti ti-equal-not"></i> {{ log.info.roleName }}</span>
|
||||
<span v-else-if="log.type === 'createRole'">: {{ log.info.role.name }}</span>
|
||||
@ -59,6 +64,12 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<CodeDiff :context="5" :hideHeader="true" :oldString="JSON5.stringify(log.info.before, null, '\t')" :newString="JSON5.stringify(log.info.after, null, '\t')" language="javascript" maxHeight="300px"/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="log.type === 'updateUserName'">
|
||||
<div>{{ i18n.ts.user }}: {{ log.info.userId }}</div>
|
||||
<div :class="$style.diff">
|
||||
<CodeDiff :context="5" :hideHeader="true" :oldString="log.info.before ?? ''" :newString="log.info.after ?? ''" maxHeight="300px"/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="log.type === 'updateUserNote'">
|
||||
<div>{{ i18n.ts.user }}: {{ log.info.userId }}</div>
|
||||
<div :class="$style.diff">
|
||||
|
@ -53,6 +53,7 @@ const devConfig = {
|
||||
'/cli': httpUrl,
|
||||
'/inbox': httpUrl,
|
||||
'/emoji/': httpUrl,
|
||||
'/queue': httpUrl,
|
||||
'/notes': {
|
||||
target: httpUrl,
|
||||
headers: {
|
||||
|
@ -268,6 +268,9 @@ type AdminQueuePromoteRequest = operations['admin___queue___promote']['requestBo
|
||||
// @public (undocumented)
|
||||
type AdminQueueStatsResponse = operations['admin___queue___stats']['responses']['200']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type AdminRegenerateUserTokenRequest = operations['admin___regenerate-user-token']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type AdminRelaysAddRequest = operations['admin___relays___add']['requestBody']['content']['application/json'];
|
||||
|
||||
@ -391,6 +394,9 @@ type AdminUnsuspendUserRequest = operations['admin___unsuspend-user']['requestBo
|
||||
// @public (undocumented)
|
||||
type AdminUpdateMetaRequest = operations['admin___update-meta']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type AdminUpdateUserNameRequest = operations['admin___update-user-name']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type AdminUpdateUserNoteRequest = operations['admin___update-user-note']['requestBody']['content']['application/json'];
|
||||
|
||||
@ -1296,6 +1302,7 @@ declare namespace entities {
|
||||
AdminRelaysRemoveRequest,
|
||||
AdminResetPasswordRequest,
|
||||
AdminResetPasswordResponse,
|
||||
AdminRegenerateUserTokenRequest,
|
||||
AdminResolveAbuseUserReportRequest,
|
||||
AdminSendEmailRequest,
|
||||
AdminServerInfoResponse,
|
||||
@ -1310,6 +1317,7 @@ declare namespace entities {
|
||||
AdminSuspendUserRequest,
|
||||
AdminUnsuspendUserRequest,
|
||||
AdminUpdateMetaRequest,
|
||||
AdminUpdateUserNameRequest,
|
||||
AdminUpdateUserNoteRequest,
|
||||
AdminRolesCreateRequest,
|
||||
AdminRolesCreateResponse,
|
||||
@ -2414,6 +2422,9 @@ type ModerationLog = {
|
||||
} | {
|
||||
type: 'unsuspend';
|
||||
info: ModerationLogPayloads['unsuspend'];
|
||||
} | {
|
||||
type: 'updateUserName';
|
||||
info: ModerationLogPayloads['updateUserName'];
|
||||
} | {
|
||||
type: 'updateUserNote';
|
||||
info: ModerationLogPayloads['updateUserNote'];
|
||||
@ -2474,6 +2485,9 @@ type ModerationLog = {
|
||||
} | {
|
||||
type: 'resetPassword';
|
||||
info: ModerationLogPayloads['resetPassword'];
|
||||
} | {
|
||||
type: 'regenerateUserToken';
|
||||
info: ModerationLogPayloads['regenerateUserToken'];
|
||||
} | {
|
||||
type: 'suspendRemoteInstance';
|
||||
info: ModerationLogPayloads['suspendRemoteInstance'];
|
||||
@ -2531,7 +2545,7 @@ type ModerationLog = {
|
||||
});
|
||||
|
||||
// @public (undocumented)
|
||||
export const moderationLogTypes: readonly ["updateServerSettings", "suspend", "unsuspend", "updateUserNote", "addCustomEmoji", "updateCustomEmoji", "deleteCustomEmoji", "assignRole", "unassignRole", "createRole", "updateRole", "deleteRole", "clearQueue", "promoteQueue", "deleteDriveFile", "deleteNote", "createGlobalAnnouncement", "createUserAnnouncement", "updateGlobalAnnouncement", "updateUserAnnouncement", "deleteGlobalAnnouncement", "deleteUserAnnouncement", "resetPassword", "suspendRemoteInstance", "unsuspendRemoteInstance", "updateRemoteInstanceNote", "markSensitiveDriveFile", "unmarkSensitiveDriveFile", "resolveAbuseReport", "createInvitation", "createAd", "updateAd", "deleteAd", "createIndieAuthClient", "updateIndieAuthClient", "deleteIndieAuthClient", "createSSOServiceProvider", "updateSSOServiceProvider", "deleteSSOServiceProvider", "createAvatarDecoration", "updateAvatarDecoration", "deleteAvatarDecoration", "unsetUserAvatar", "unsetUserBanner", "unsetUserMutualBanner"];
|
||||
export const moderationLogTypes: readonly ["updateServerSettings", "suspend", "unsuspend", "updateUserName", "updateUserNote", "addCustomEmoji", "updateCustomEmoji", "deleteCustomEmoji", "assignRole", "unassignRole", "createRole", "updateRole", "deleteRole", "clearQueue", "promoteQueue", "deleteDriveFile", "deleteNote", "createGlobalAnnouncement", "createUserAnnouncement", "updateGlobalAnnouncement", "updateUserAnnouncement", "deleteGlobalAnnouncement", "deleteUserAnnouncement", "resetPassword", "regenerateUserToken", "suspendRemoteInstance", "unsuspendRemoteInstance", "updateRemoteInstanceNote", "markSensitiveDriveFile", "unmarkSensitiveDriveFile", "resolveAbuseReport", "createInvitation", "createAd", "updateAd", "deleteAd", "createIndieAuthClient", "updateIndieAuthClient", "deleteIndieAuthClient", "createSSOServiceProvider", "updateSSOServiceProvider", "deleteSSOServiceProvider", "createAvatarDecoration", "updateAvatarDecoration", "deleteAvatarDecoration", "unsetUserAvatar", "unsetUserBanner", "unsetUserMutualBanner"];
|
||||
|
||||
// @public (undocumented)
|
||||
type MuteCreateRequest = operations['mute___create']['requestBody']['content']['application/json'];
|
||||
@ -2783,7 +2797,7 @@ type PagesUpdateRequest = operations['pages___update']['requestBody']['content']
|
||||
function parse(acct: string): Acct;
|
||||
|
||||
// @public (undocumented)
|
||||
export const permissions: readonly ["read:account", "write:account", "read:blocks", "write:blocks", "read:drive", "write:drive", "read:favorites", "write:favorites", "read:following", "write:following", "read:messaging", "write:messaging", "read:mutes", "write:mutes", "write:notes", "read:notifications", "write:notifications", "read:reactions", "write:reactions", "write:votes", "read:pages", "write:pages", "write:page-likes", "read:page-likes", "read:user-groups", "write:user-groups", "read:channels", "write:channels", "read:gallery", "write:gallery", "read:gallery-likes", "write:gallery-likes", "read:flash", "write:flash", "read:flash-likes", "write:flash-likes", "read:admin:abuse-user-reports", "read:admin:abuse-report-resolvers", "write:admin:abuse-report-resolvers", "read:admin:index-stats", "read:admin:table-stats", "read:admin:user-ips", "read:admin:meta", "write:admin:reset-password", "write:admin:resolve-abuse-user-report", "write:admin:send-email", "read:admin:server-info", "read:admin:show-moderation-log", "read:admin:show-account-move-log", "read:admin:show-user", "read:admin:show-users", "write:admin:suspend-user", "write:admin:unset-user-avatar", "write:admin:unset-user-banner", "write:admin:unset-user-mutual-link", "write:admin:unsuspend-user", "write:admin:meta", "write:admin:user-note", "write:admin:roles", "read:admin:roles", "write:admin:relays", "read:admin:relays", "write:admin:invite-codes", "read:admin:invite-codes", "write:admin:announcements", "read:admin:announcements", "write:admin:avatar-decorations", "read:admin:avatar-decorations", "write:admin:federation", "write:admin:indie-auth", "read:admin:indie-auth", "write:admin:account", "read:admin:account", "write:admin:emoji", "read:admin:emoji", "write:admin:queue", "read:admin:queue", "write:admin:promo", "write:admin:drive", "read:admin:drive", "write:admin:sso", "read:admin:sso", "write:admin:ad", "read:admin:ad", "write:invite-codes", "read:invite-codes", "write:clip-favorite", "read:clip-favorite", "read:federation", "write:report-abuse"];
|
||||
export const permissions: readonly ["read:account", "write:account", "read:blocks", "write:blocks", "read:drive", "write:drive", "read:favorites", "write:favorites", "read:following", "write:following", "read:messaging", "write:messaging", "read:mutes", "write:mutes", "write:notes", "read:notifications", "write:notifications", "read:reactions", "write:reactions", "write:votes", "read:pages", "write:pages", "write:page-likes", "read:page-likes", "read:user-groups", "write:user-groups", "read:channels", "write:channels", "read:gallery", "write:gallery", "read:gallery-likes", "write:gallery-likes", "read:flash", "write:flash", "read:flash-likes", "write:flash-likes", "read:admin:abuse-user-reports", "read:admin:abuse-report-resolvers", "write:admin:abuse-report-resolvers", "read:admin:index-stats", "read:admin:table-stats", "read:admin:user-ips", "read:admin:meta", "write:admin:reset-password", "write:admin:regenerate-user-token", "write:admin:resolve-abuse-user-report", "write:admin:send-email", "read:admin:server-info", "read:admin:show-moderation-log", "read:admin:show-account-move-log", "read:admin:show-user", "read:admin:show-users", "write:admin:suspend-user", "write:admin:unsuspend-user", "write:admin:meta", "write:admin:user-name", "write:admin:user-note", "write:admin:user-avatar", "write:admin:user-banner", "write:admin:user-mutual-link", "write:admin:roles", "read:admin:roles", "write:admin:relays", "read:admin:relays", "write:admin:invite-codes", "read:admin:invite-codes", "write:admin:announcements", "read:admin:announcements", "write:admin:avatar-decorations", "read:admin:avatar-decorations", "write:admin:federation", "write:admin:indie-auth", "read:admin:indie-auth", "write:admin:account", "read:admin:account", "write:admin:emoji", "read:admin:emoji", "write:admin:queue", "read:admin:queue", "write:admin:promo", "write:admin:drive", "read:admin:drive", "write:admin:sso", "read:admin:sso", "write:admin:ad", "read:admin:ad", "write:invite-codes", "read:invite-codes", "write:clip-favorite", "read:clip-favorite", "read:federation", "write:report-abuse"];
|
||||
|
||||
// @public (undocumented)
|
||||
type PingResponse = operations['ping']['responses']['200']['content']['application/json'];
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"type": "module",
|
||||
"name": "misskey-js",
|
||||
"version": "2024.5.0-oscar.15c",
|
||||
"version": "2024.5.0-oscar.16",
|
||||
"description": "Misskey SDK for JavaScript",
|
||||
"types": "./built/dts/index.d.ts",
|
||||
"exports": {
|
||||
|
@ -259,7 +259,7 @@ declare module '../api.js' {
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:unset-user-avatar*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:user-avatar*
|
||||
*/
|
||||
request<E extends 'admin/unset-user-avatar', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
@ -270,7 +270,7 @@ declare module '../api.js' {
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:unset-user-banner*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:user-banner*
|
||||
*/
|
||||
request<E extends 'admin/unset-user-banner', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
@ -293,7 +293,7 @@ declare module '../api.js' {
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:unset-user-mutual-link*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:user-mutual-link*
|
||||
*/
|
||||
request<E extends 'admin/unset-user-mutual-link', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
@ -766,6 +766,17 @@ declare module '../api.js' {
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:regenerate-user-token*
|
||||
*/
|
||||
request<E extends 'admin/regenerate-user-token', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
@ -876,6 +887,17 @@ declare module '../api.js' {
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:user-name*
|
||||
*/
|
||||
request<E extends 'admin/update-user-name', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
|
@ -89,6 +89,7 @@ import type {
|
||||
AdminRelaysRemoveRequest,
|
||||
AdminResetPasswordRequest,
|
||||
AdminResetPasswordResponse,
|
||||
AdminRegenerateUserTokenRequest,
|
||||
AdminResolveAbuseUserReportRequest,
|
||||
AdminSendEmailRequest,
|
||||
AdminServerInfoResponse,
|
||||
@ -103,6 +104,7 @@ import type {
|
||||
AdminSuspendUserRequest,
|
||||
AdminUnsuspendUserRequest,
|
||||
AdminUpdateMetaRequest,
|
||||
AdminUpdateUserNameRequest,
|
||||
AdminUpdateUserNoteRequest,
|
||||
AdminRolesCreateRequest,
|
||||
AdminRolesCreateResponse,
|
||||
@ -658,6 +660,7 @@ export type Endpoints = {
|
||||
'admin/relays/list': { req: EmptyRequest; res: AdminRelaysListResponse };
|
||||
'admin/relays/remove': { req: AdminRelaysRemoveRequest; res: EmptyResponse };
|
||||
'admin/reset-password': { req: AdminResetPasswordRequest; res: AdminResetPasswordResponse };
|
||||
'admin/regenerate-user-token': { req: AdminRegenerateUserTokenRequest; res: EmptyResponse };
|
||||
'admin/resolve-abuse-user-report': { req: AdminResolveAbuseUserReportRequest; res: EmptyResponse };
|
||||
'admin/send-email': { req: AdminSendEmailRequest; res: EmptyResponse };
|
||||
'admin/server-info': { req: EmptyRequest; res: AdminServerInfoResponse };
|
||||
@ -668,6 +671,7 @@ export type Endpoints = {
|
||||
'admin/suspend-user': { req: AdminSuspendUserRequest; res: EmptyResponse };
|
||||
'admin/unsuspend-user': { req: AdminUnsuspendUserRequest; res: EmptyResponse };
|
||||
'admin/update-meta': { req: AdminUpdateMetaRequest; res: EmptyResponse };
|
||||
'admin/update-user-name': { req: AdminUpdateUserNameRequest; res: EmptyResponse };
|
||||
'admin/update-user-note': { req: AdminUpdateUserNoteRequest; res: EmptyResponse };
|
||||
'admin/roles/create': { req: AdminRolesCreateRequest; res: AdminRolesCreateResponse };
|
||||
'admin/roles/delete': { req: AdminRolesDeleteRequest; res: EmptyResponse };
|
||||
|
@ -92,6 +92,7 @@ export type AdminRelaysListResponse = operations['admin___relays___list']['respo
|
||||
export type AdminRelaysRemoveRequest = operations['admin___relays___remove']['requestBody']['content']['application/json'];
|
||||
export type AdminResetPasswordRequest = operations['admin___reset-password']['requestBody']['content']['application/json'];
|
||||
export type AdminResetPasswordResponse = operations['admin___reset-password']['responses']['200']['content']['application/json'];
|
||||
export type AdminRegenerateUserTokenRequest = operations['admin___regenerate-user-token']['requestBody']['content']['application/json'];
|
||||
export type AdminResolveAbuseUserReportRequest = operations['admin___resolve-abuse-user-report']['requestBody']['content']['application/json'];
|
||||
export type AdminSendEmailRequest = operations['admin___send-email']['requestBody']['content']['application/json'];
|
||||
export type AdminServerInfoResponse = operations['admin___server-info']['responses']['200']['content']['application/json'];
|
||||
@ -106,6 +107,7 @@ export type AdminShowUsersResponse = operations['admin___show-users']['responses
|
||||
export type AdminSuspendUserRequest = operations['admin___suspend-user']['requestBody']['content']['application/json'];
|
||||
export type AdminUnsuspendUserRequest = operations['admin___unsuspend-user']['requestBody']['content']['application/json'];
|
||||
export type AdminUpdateMetaRequest = operations['admin___update-meta']['requestBody']['content']['application/json'];
|
||||
export type AdminUpdateUserNameRequest = operations['admin___update-user-name']['requestBody']['content']['application/json'];
|
||||
export type AdminUpdateUserNoteRequest = operations['admin___update-user-note']['requestBody']['content']['application/json'];
|
||||
export type AdminRolesCreateRequest = operations['admin___roles___create']['requestBody']['content']['application/json'];
|
||||
export type AdminRolesCreateResponse = operations['admin___roles___create']['responses']['200']['content']['application/json'];
|
||||
|
@ -224,7 +224,7 @@ export type paths = {
|
||||
* admin/unset-user-avatar
|
||||
* @description No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:unset-user-avatar*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:user-avatar*
|
||||
*/
|
||||
post: operations['admin___unset-user-avatar'];
|
||||
};
|
||||
@ -233,7 +233,7 @@ export type paths = {
|
||||
* admin/unset-user-banner
|
||||
* @description No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:unset-user-banner*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:user-banner*
|
||||
*/
|
||||
post: operations['admin___unset-user-banner'];
|
||||
};
|
||||
@ -252,7 +252,7 @@ export type paths = {
|
||||
* admin/unset-user-mutual-link
|
||||
* @description No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:unset-user-mutual-link*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:user-mutual-link*
|
||||
*/
|
||||
post: operations['admin___unset-user-mutual-link'];
|
||||
};
|
||||
@ -637,6 +637,15 @@ export type paths = {
|
||||
*/
|
||||
post: operations['admin___reset-password'];
|
||||
};
|
||||
'/admin/regenerate-user-token': {
|
||||
/**
|
||||
* admin/regenerate-user-token
|
||||
* @description No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:regenerate-user-token*
|
||||
*/
|
||||
post: operations['admin___regenerate-user-token'];
|
||||
};
|
||||
'/admin/resolve-abuse-user-report': {
|
||||
/**
|
||||
* admin/resolve-abuse-user-report
|
||||
@ -727,6 +736,15 @@ export type paths = {
|
||||
*/
|
||||
post: operations['admin___update-meta'];
|
||||
};
|
||||
'/admin/update-user-name': {
|
||||
/**
|
||||
* admin/update-user-name
|
||||
* @description No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:user-name*
|
||||
*/
|
||||
post: operations['admin___update-user-name'];
|
||||
};
|
||||
'/admin/update-user-note': {
|
||||
/**
|
||||
* admin/update-user-note
|
||||
@ -6827,7 +6845,7 @@ export type operations = {
|
||||
* admin/unset-user-avatar
|
||||
* @description No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:unset-user-avatar*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:user-avatar*
|
||||
*/
|
||||
'admin___unset-user-avatar': {
|
||||
requestBody: {
|
||||
@ -6879,7 +6897,7 @@ export type operations = {
|
||||
* admin/unset-user-banner
|
||||
* @description No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:unset-user-banner*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:user-banner*
|
||||
*/
|
||||
'admin___unset-user-banner': {
|
||||
requestBody: {
|
||||
@ -6976,7 +6994,7 @@ export type operations = {
|
||||
* admin/unset-user-mutual-link
|
||||
* @description No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:unset-user-mutual-link*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:user-mutual-link*
|
||||
*/
|
||||
'admin___unset-user-mutual-link': {
|
||||
requestBody: {
|
||||
@ -9367,6 +9385,58 @@ export type operations = {
|
||||
};
|
||||
};
|
||||
};
|
||||
/**
|
||||
* admin/regenerate-user-token
|
||||
* @description No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:regenerate-user-token*
|
||||
*/
|
||||
'admin___regenerate-user-token': {
|
||||
requestBody: {
|
||||
content: {
|
||||
'application/json': {
|
||||
/** Format: misskey:id */
|
||||
userId: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
responses: {
|
||||
/** @description OK (without any results) */
|
||||
204: {
|
||||
content: never;
|
||||
};
|
||||
/** @description Client error */
|
||||
400: {
|
||||
content: {
|
||||
'application/json': components['schemas']['Error'];
|
||||
};
|
||||
};
|
||||
/** @description Authentication error */
|
||||
401: {
|
||||
content: {
|
||||
'application/json': components['schemas']['Error'];
|
||||
};
|
||||
};
|
||||
/** @description Forbidden error */
|
||||
403: {
|
||||
content: {
|
||||
'application/json': components['schemas']['Error'];
|
||||
};
|
||||
};
|
||||
/** @description I'm Ai */
|
||||
418: {
|
||||
content: {
|
||||
'application/json': components['schemas']['Error'];
|
||||
};
|
||||
};
|
||||
/** @description Internal server error */
|
||||
500: {
|
||||
content: {
|
||||
'application/json': components['schemas']['Error'];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
/**
|
||||
* admin/resolve-abuse-user-report
|
||||
* @description No description provided.
|
||||
@ -10243,6 +10313,59 @@ export type operations = {
|
||||
};
|
||||
};
|
||||
};
|
||||
/**
|
||||
* admin/update-user-name
|
||||
* @description No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:user-name*
|
||||
*/
|
||||
'admin___update-user-name': {
|
||||
requestBody: {
|
||||
content: {
|
||||
'application/json': {
|
||||
/** Format: misskey:id */
|
||||
userId: string;
|
||||
name?: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
responses: {
|
||||
/** @description OK (without any results) */
|
||||
204: {
|
||||
content: never;
|
||||
};
|
||||
/** @description Client error */
|
||||
400: {
|
||||
content: {
|
||||
'application/json': components['schemas']['Error'];
|
||||
};
|
||||
};
|
||||
/** @description Authentication error */
|
||||
401: {
|
||||
content: {
|
||||
'application/json': components['schemas']['Error'];
|
||||
};
|
||||
};
|
||||
/** @description Forbidden error */
|
||||
403: {
|
||||
content: {
|
||||
'application/json': components['schemas']['Error'];
|
||||
};
|
||||
};
|
||||
/** @description I'm Ai */
|
||||
418: {
|
||||
content: {
|
||||
'application/json': components['schemas']['Error'];
|
||||
};
|
||||
};
|
||||
/** @description Internal server error */
|
||||
500: {
|
||||
content: {
|
||||
'application/json': components['schemas']['Error'];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
/**
|
||||
* admin/update-user-note
|
||||
* @description No description provided.
|
||||
|
@ -53,6 +53,7 @@ export const permissions = [
|
||||
'read:admin:user-ips',
|
||||
'read:admin:meta',
|
||||
'write:admin:reset-password',
|
||||
'write:admin:regenerate-user-token',
|
||||
'write:admin:resolve-abuse-user-report',
|
||||
'write:admin:send-email',
|
||||
'read:admin:server-info',
|
||||
@ -61,12 +62,13 @@ export const permissions = [
|
||||
'read:admin:show-user',
|
||||
'read:admin:show-users',
|
||||
'write:admin:suspend-user',
|
||||
'write:admin:unset-user-avatar',
|
||||
'write:admin:unset-user-banner',
|
||||
'write:admin:unset-user-mutual-link',
|
||||
'write:admin:unsuspend-user',
|
||||
'write:admin:meta',
|
||||
'write:admin:user-name',
|
||||
'write:admin:user-note',
|
||||
'write:admin:user-avatar',
|
||||
'write:admin:user-banner',
|
||||
'write:admin:user-mutual-link',
|
||||
'write:admin:roles',
|
||||
'read:admin:roles',
|
||||
'write:admin:relays',
|
||||
@ -105,6 +107,7 @@ export const moderationLogTypes = [
|
||||
'updateServerSettings',
|
||||
'suspend',
|
||||
'unsuspend',
|
||||
'updateUserName',
|
||||
'updateUserNote',
|
||||
'addCustomEmoji',
|
||||
'updateCustomEmoji',
|
||||
@ -125,6 +128,7 @@ export const moderationLogTypes = [
|
||||
'deleteGlobalAnnouncement',
|
||||
'deleteUserAnnouncement',
|
||||
'resetPassword',
|
||||
'regenerateUserToken',
|
||||
'suspendRemoteInstance',
|
||||
'unsuspendRemoteInstance',
|
||||
'updateRemoteInstanceNote',
|
||||
@ -164,6 +168,13 @@ export type ModerationLogPayloads = {
|
||||
userUsername: string;
|
||||
userHost: string | null;
|
||||
};
|
||||
updateUserName: {
|
||||
userId: string;
|
||||
userUsername: string;
|
||||
userHost: string | null;
|
||||
before: string | null;
|
||||
after: string | null;
|
||||
}
|
||||
updateUserNote: {
|
||||
userId: string;
|
||||
userUsername: string;
|
||||
@ -267,6 +278,11 @@ export type ModerationLogPayloads = {
|
||||
userUsername: string;
|
||||
userHost: string | null;
|
||||
};
|
||||
regenerateUserToken: {
|
||||
userId: string;
|
||||
userUsername: string;
|
||||
userHost: string | null;
|
||||
};
|
||||
suspendRemoteInstance: {
|
||||
id: string;
|
||||
host: string;
|
||||
|
@ -29,6 +29,9 @@ export type ModerationLog = {
|
||||
} | {
|
||||
type: 'unsuspend';
|
||||
info: ModerationLogPayloads['unsuspend'];
|
||||
} | {
|
||||
type: 'updateUserName';
|
||||
info: ModerationLogPayloads['updateUserName'];
|
||||
} | {
|
||||
type: 'updateUserNote';
|
||||
info: ModerationLogPayloads['updateUserNote'];
|
||||
@ -89,6 +92,9 @@ export type ModerationLog = {
|
||||
} | {
|
||||
type: 'resetPassword';
|
||||
info: ModerationLogPayloads['resetPassword'];
|
||||
} | {
|
||||
type: 'regenerateUserToken';
|
||||
info: ModerationLogPayloads['regenerateUserToken'];
|
||||
} | {
|
||||
type: 'suspendRemoteInstance';
|
||||
info: ModerationLogPayloads['suspendRemoteInstance'];
|
||||
|
Loading…
Reference in New Issue
Block a user