fix TypeScript errors in modlog.MogLog.vue

This commit is contained in:
Hazelnoot 2025-01-28 11:19:55 -05:00
parent 935a62f5e5
commit 4f79f85703
6 changed files with 63 additions and 3 deletions

4
locales/index.d.ts vendored
View file

@ -10214,6 +10214,10 @@ export interface Locale extends ILocale {
* Approved
*/
"approve": string;
/**
* Declined
*/
"decline": string;
/**
* Set remote instance as NSFW
*/

View file

@ -93,7 +93,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<span v-else-if="log.type === 'deleteFlash'">: @{{ log.info.flashUserUsername }}</span>
<span v-else-if="log.type === 'deleteGalleryPost'">: @{{ log.info.postUserUsername }}</span>
</template>
<template #icon>
<template v-if="log.user" #icon>
<MkAvatar :user="log.user" :class="$style.avatar"/>
</template>
<template #suffix>

View file

@ -2609,6 +2609,12 @@ type ModerationLog = {
} | {
type: 'deleteUserAnnouncement';
info: ModerationLogPayloads['deleteUserAnnouncement'];
} | {
type: 'setRemoteInstanceNSFW';
info: ModerationLogPayloads['setRemoteInstanceNSFW'];
} | {
type: 'unsetRemoteInstanceNSFW';
info: ModerationLogPayloads['unsetRemoteInstanceNSFW'];
} | {
type: 'resetPassword';
info: ModerationLogPayloads['resetPassword'];
@ -2618,6 +2624,12 @@ type ModerationLog = {
} | {
type: 'unsuspendRemoteInstance';
info: ModerationLogPayloads['unsuspendRemoteInstance'];
} | {
type: 'rejectRemoteInstanceReports';
info: ModerationLogPayloads['rejectRemoteInstanceReports'];
} | {
type: 'acceptRemoteInstanceReports';
info: ModerationLogPayloads['acceptRemoteInstanceReports'];
} | {
type: 'updateRemoteInstanceNote';
info: ModerationLogPayloads['updateRemoteInstanceNote'];
@ -2696,7 +2708,7 @@ type ModerationLog = {
});
// @public (undocumented)
export const moderationLogTypes: readonly ["updateServerSettings", "suspend", "approve", "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", "forwardAbuseReport", "updateAbuseReportNote", "createInvitation", "createAd", "updateAd", "deleteAd", "createAvatarDecoration", "updateAvatarDecoration", "deleteAvatarDecoration", "unsetUserAvatar", "unsetUserBanner", "createSystemWebhook", "updateSystemWebhook", "deleteSystemWebhook", "createAbuseReportNotificationRecipient", "updateAbuseReportNotificationRecipient", "deleteAbuseReportNotificationRecipient", "deleteAccount", "deletePage", "deleteFlash", "deleteGalleryPost"];
export const moderationLogTypes: readonly ["updateServerSettings", "suspend", "approve", "decline", "unsuspend", "updateUserNote", "addCustomEmoji", "updateCustomEmoji", "deleteCustomEmoji", "assignRole", "unassignRole", "createRole", "updateRole", "deleteRole", "clearQueue", "promoteQueue", "deleteDriveFile", "deleteNote", "createGlobalAnnouncement", "createUserAnnouncement", "updateGlobalAnnouncement", "updateUserAnnouncement", "deleteGlobalAnnouncement", "deleteUserAnnouncement", "resetPassword", "setRemoteInstanceNSFW", "unsetRemoteInstanceNSFW", "suspendRemoteInstance", "unsuspendRemoteInstance", "rejectRemoteInstanceReports", "acceptRemoteInstanceReports", "updateRemoteInstanceNote", "markSensitiveDriveFile", "unmarkSensitiveDriveFile", "resolveAbuseReport", "forwardAbuseReport", "updateAbuseReportNote", "createInvitation", "createAd", "updateAd", "deleteAd", "createAvatarDecoration", "updateAvatarDecoration", "deleteAvatarDecoration", "unsetUserAvatar", "unsetUserBanner", "createSystemWebhook", "updateSystemWebhook", "deleteSystemWebhook", "createAbuseReportNotificationRecipient", "updateAbuseReportNotificationRecipient", "deleteAbuseReportNotificationRecipient", "deleteAccount", "deletePage", "deleteFlash", "deleteGalleryPost"];
// @public (undocumented)
type MuteCreateRequest = operations['mute___create']['requestBody']['content']['application/json'];

View file

@ -125,6 +125,7 @@ export const moderationLogTypes = [
'updateServerSettings',
'suspend',
'approve',
'decline',
'unsuspend',
'updateUserNote',
'addCustomEmoji',
@ -146,8 +147,12 @@ export const moderationLogTypes = [
'deleteGlobalAnnouncement',
'deleteUserAnnouncement',
'resetPassword',
'setRemoteInstanceNSFW',
'unsetRemoteInstanceNSFW',
'suspendRemoteInstance',
'unsuspendRemoteInstance',
'rejectRemoteInstanceReports',
'acceptRemoteInstanceReports',
'updateRemoteInstanceNote',
'markSensitiveDriveFile',
'unmarkSensitiveDriveFile',
@ -187,7 +192,14 @@ export const reversiUpdateKeys = [
export type ReversiUpdateKey = typeof reversiUpdateKeys[number];
type AvatarDecoration = UserLite['avatarDecorations'][number];
interface AvatarDecoration {
id: string;
updatedAt: string | null;
url: string;
name: string;
description: string;
roleIdsThatCanBeUsedThisDecoration: string[];
}
type ReceivedAbuseReport = {
reportId: AbuseReportNotificationRecipient['id'];
@ -323,6 +335,14 @@ export type ModerationLogPayloads = {
userUsername: string;
userHost: string | null;
};
setRemoteInstanceNSFW: {
id: string;
host: string;
};
unsetRemoteInstanceNSFW: {
id: string;
host: string;
};
suspendRemoteInstance: {
id: string;
host: string;
@ -331,6 +351,14 @@ export type ModerationLogPayloads = {
id: string;
host: string;
};
rejectRemoteInstanceReports: {
id: string;
host: string;
};
acceptRemoteInstanceReports: {
id: string;
host: string;
};
updateRemoteInstanceNote: {
id: string;
host: string;

View file

@ -120,12 +120,27 @@ export type ModerationLog = {
} | {
type: 'resetPassword';
info: ModerationLogPayloads['resetPassword'];
} | {
type: 'setRemoteInstanceNSFW';
info: ModerationLogPayloads['setRemoteInstanceNSFW'];
} | {
type: 'unsetRemoteInstanceNSFW';
info: ModerationLogPayloads['unsetRemoteInstanceNSFW'];
} | {
type: 'resetPassword';
info: ModerationLogPayloads['resetPassword'];
} | {
type: 'suspendRemoteInstance';
info: ModerationLogPayloads['suspendRemoteInstance'];
} | {
type: 'unsuspendRemoteInstance';
info: ModerationLogPayloads['unsuspendRemoteInstance'];
} | {
type: 'rejectRemoteInstanceReports';
info: ModerationLogPayloads['rejectRemoteInstanceReports'];
} | {
type: 'acceptRemoteInstanceReports';
info: ModerationLogPayloads['acceptRemoteInstanceReports'];
} | {
type: 'updateRemoteInstanceNote';
info: ModerationLogPayloads['updateRemoteInstanceNote'];

View file

@ -303,6 +303,7 @@ _abuseReport:
webhook: "Send a notification to the SystemWebhook when an abuse report is received or resolved."
_moderationLogTypes:
approve: "Approved"
decline: "Declined"
setRemoteInstanceNSFW: "Set remote instance as NSFW"
unsetRemoteInstanceNSFW: "Set remote instance as NSFW"
rejectRemoteInstanceReports: "Rejected reports from remote instance"