chore (backend): remove '_enum' suffix from enum types
This commit is contained in:
parent
7e40424b89
commit
55ed733df8
16 changed files with 172 additions and 98 deletions
|
@ -1,6 +1,7 @@
|
|||
BEGIN;
|
||||
|
||||
DELETE FROM "migrations" WHERE name IN (
|
||||
'RemoveEnumTypenameSuffix1716462794927',
|
||||
'CreateScheduledNote1714728200194',
|
||||
'AddBackTimezone1715351290096',
|
||||
'UserprofileJsonbToArray1714270605574',
|
||||
|
@ -32,6 +33,19 @@ DELETE FROM "migrations" WHERE name IN (
|
|||
'RemoveNativeUtilsMigration1705877093218'
|
||||
);
|
||||
|
||||
-- remove-enum-typename-suffix
|
||||
ALTER TYPE "antenna_src" RENAME TO "antenna_src_enum";
|
||||
ALTER TYPE "drive_file_usage_hint" RENAME TO "drive_file_usage_hint_enum";
|
||||
ALTER TYPE "muted_note_reason" RENAME TO "muted_note_reason_enum";
|
||||
ALTER TYPE "note_visibility" RENAME TO "note_visibility_enum";
|
||||
ALTER TYPE "notification_type" RENAME TO "notification_type_enum";
|
||||
ALTER TYPE "page_visibility" RENAME TO "page_visibility_enum";
|
||||
ALTER TYPE "poll_note_visibility" RENAME TO "poll_notevisibility_enum";
|
||||
ALTER TYPE "relay_status" RENAME TO "relay_status_enum";
|
||||
ALTER TYPE "user_emoji_mod_perm" RENAME TO "user_emojimodperm_enum";
|
||||
ALTER TYPE "user_profile_ffvisibility" RENAME TO "user_profile_ffvisibility_enum";
|
||||
ALTER TYPE "user_profile_muting_notification_types" RENAME TO "user_profile_mutingnotificationtypes_enum";
|
||||
|
||||
-- create-scheduled-note
|
||||
DROP TABLE "scheduled_note";
|
||||
|
||||
|
|
44
packages/backend-rs/index.d.ts
vendored
44
packages/backend-rs/index.d.ts
vendored
|
@ -369,7 +369,7 @@ export interface Antenna {
|
|||
createdAt: DateTimeWithTimeZone
|
||||
userId: string
|
||||
name: string
|
||||
src: AntennaSrcEnum
|
||||
src: AntennaSrc
|
||||
userListId: string | null
|
||||
withFile: boolean
|
||||
expression: string | null
|
||||
|
@ -475,7 +475,7 @@ export interface DriveFile {
|
|||
webpublicType: string | null
|
||||
requestHeaders: Json | null
|
||||
requestIp: string | null
|
||||
usageHint: DriveFileUsageHintEnum | null
|
||||
usageHint: DriveFileUsageHint | null
|
||||
}
|
||||
export interface DriveFolder {
|
||||
id: string
|
||||
|
@ -699,7 +699,7 @@ export interface MutedNote {
|
|||
id: string
|
||||
noteId: string
|
||||
userId: string
|
||||
reason: MutedNoteReasonEnum
|
||||
reason: MutedNoteReason
|
||||
}
|
||||
export interface Muting {
|
||||
id: string
|
||||
|
@ -721,7 +721,7 @@ export interface Note {
|
|||
renoteCount: number
|
||||
repliesCount: number
|
||||
reactions: Json
|
||||
visibility: NoteVisibilityEnum
|
||||
visibility: NoteVisibility
|
||||
uri: string | null
|
||||
score: number
|
||||
fileIds: Array<string>
|
||||
|
@ -802,7 +802,7 @@ export interface Notification {
|
|||
reaction: string | null
|
||||
choice: number | null
|
||||
followRequestId: string | null
|
||||
type: NotificationTypeEnum
|
||||
type: NotificationType
|
||||
userGroupInvitationId: string | null
|
||||
customBody: string | null
|
||||
customHeader: string | null
|
||||
|
@ -822,7 +822,7 @@ export interface Page {
|
|||
eyeCatchingImageId: string | null
|
||||
content: Json
|
||||
variables: Json
|
||||
visibility: PageVisibilityEnum
|
||||
visibility: PageVisibility
|
||||
visibleUserIds: Array<string>
|
||||
likedCount: number
|
||||
hideTitleWhenPinned: boolean
|
||||
|
@ -847,7 +847,7 @@ export interface Poll {
|
|||
multiple: boolean
|
||||
choices: Array<string>
|
||||
votes: Array<number>
|
||||
noteVisibility: PollNotevisibilityEnum
|
||||
noteVisibility: PollNoteVisibility
|
||||
userId: string
|
||||
userHost: string | null
|
||||
}
|
||||
|
@ -887,7 +887,7 @@ export interface RegistryItem {
|
|||
export interface Relay {
|
||||
id: string
|
||||
inbox: string
|
||||
status: RelayStatusEnum
|
||||
status: RelayStatus
|
||||
}
|
||||
export interface RenoteMuting {
|
||||
id: string
|
||||
|
@ -907,7 +907,7 @@ export interface ScheduledNote {
|
|||
userId: string
|
||||
scheduledAt: DateTimeWithTimeZone
|
||||
}
|
||||
export enum AntennaSrcEnum {
|
||||
export enum AntennaSrc {
|
||||
All = 'all',
|
||||
Group = 'group',
|
||||
Home = 'home',
|
||||
|
@ -915,24 +915,24 @@ export enum AntennaSrcEnum {
|
|||
List = 'list',
|
||||
Users = 'users'
|
||||
}
|
||||
export enum DriveFileUsageHintEnum {
|
||||
export enum DriveFileUsageHint {
|
||||
UserAvatar = 'userAvatar',
|
||||
UserBanner = 'userBanner'
|
||||
}
|
||||
export enum MutedNoteReasonEnum {
|
||||
export enum MutedNoteReason {
|
||||
Manual = 'manual',
|
||||
Other = 'other',
|
||||
Spam = 'spam',
|
||||
Word = 'word'
|
||||
}
|
||||
export enum NoteVisibilityEnum {
|
||||
export enum NoteVisibility {
|
||||
Followers = 'followers',
|
||||
Hidden = 'hidden',
|
||||
Home = 'home',
|
||||
Public = 'public',
|
||||
Specified = 'specified'
|
||||
}
|
||||
export enum NotificationTypeEnum {
|
||||
export enum NotificationType {
|
||||
App = 'app',
|
||||
Follow = 'follow',
|
||||
FollowRequestAccepted = 'followRequestAccepted',
|
||||
|
@ -946,34 +946,34 @@ export enum NotificationTypeEnum {
|
|||
Renote = 'renote',
|
||||
Reply = 'reply'
|
||||
}
|
||||
export enum PageVisibilityEnum {
|
||||
export enum PageVisibility {
|
||||
Followers = 'followers',
|
||||
Public = 'public',
|
||||
Specified = 'specified'
|
||||
}
|
||||
export enum PollNotevisibilityEnum {
|
||||
export enum PollNoteVisibility {
|
||||
Followers = 'followers',
|
||||
Home = 'home',
|
||||
Public = 'public',
|
||||
Specified = 'specified'
|
||||
}
|
||||
export enum RelayStatusEnum {
|
||||
export enum RelayStatus {
|
||||
Accepted = 'accepted',
|
||||
Rejected = 'rejected',
|
||||
Requesting = 'requesting'
|
||||
}
|
||||
export enum UserEmojimodpermEnum {
|
||||
export enum UserEmojiModPerm {
|
||||
Add = 'add',
|
||||
Full = 'full',
|
||||
Mod = 'mod',
|
||||
Unauthorized = 'unauthorized'
|
||||
}
|
||||
export enum UserProfileFfvisibilityEnum {
|
||||
export enum UserProfileFfvisibility {
|
||||
Followers = 'followers',
|
||||
Private = 'private',
|
||||
Public = 'public'
|
||||
}
|
||||
export enum UserProfileMutingnotificationtypesEnum {
|
||||
export enum UserProfileMutingNotificationTypes {
|
||||
App = 'app',
|
||||
Follow = 'follow',
|
||||
FollowRequestAccepted = 'followRequestAccepted',
|
||||
|
@ -1044,7 +1044,7 @@ export interface User {
|
|||
driveCapacityOverrideMb: number | null
|
||||
movedToUri: string | null
|
||||
speakAsCat: boolean
|
||||
emojiModPerm: UserEmojimodpermEnum
|
||||
emojiModPerm: UserEmojiModPerm
|
||||
isIndexable: boolean
|
||||
alsoKnownAs: Array<string> | null
|
||||
}
|
||||
|
@ -1133,12 +1133,12 @@ export interface UserProfile {
|
|||
pinnedPageId: string | null
|
||||
injectFeaturedNote: boolean
|
||||
enableWordMute: boolean
|
||||
mutingNotificationTypes: Array<UserProfileMutingnotificationtypesEnum>
|
||||
mutingNotificationTypes: Array<UserProfileMutingNotificationTypes>
|
||||
noCrawle: boolean
|
||||
receiveAnnouncementEmail: boolean
|
||||
emailNotificationTypes: Json
|
||||
publicReactions: boolean
|
||||
ffVisibility: UserProfileFfvisibilityEnum
|
||||
ffVisibility: UserProfileFfvisibility
|
||||
moderationNote: string
|
||||
preventAiLearning: boolean
|
||||
isIndexable: boolean
|
||||
|
|
|
@ -310,7 +310,7 @@ if (!nativeBinding) {
|
|||
throw new Error(`Failed to load native binding`)
|
||||
}
|
||||
|
||||
const { SECOND, MINUTE, HOUR, DAY, USER_ONLINE_THRESHOLD, USER_ACTIVE_THRESHOLD, FILE_TYPE_BROWSERSAFE, loadEnv, loadConfig, stringToAcct, acctToString, greet, initializeRustLogger, showServerInfo, isBlockedServer, isSilencedServer, isAllowedServer, checkWordMute, getFullApAccount, isSelfHost, isSameOrigin, extractHost, toPuny, isUnicodeEmoji, sqlLikeEscape, safeForSql, formatMilliseconds, getImageSizeFromUrl, getNoteSummary, isQuote, isSafeUrl, latestVersion, toMastodonId, fromMastodonId, fetchMeta, metaToPugArgs, nyaify, hashPassword, verifyPassword, isOldPasswordAlgorithm, decodeReaction, countReactions, toDbReaction, removeOldAttestationChallenges, cpuInfo, cpuUsage, memoryUsage, storageUsage, AntennaSrcEnum, DriveFileUsageHintEnum, MutedNoteReasonEnum, NoteVisibilityEnum, NotificationTypeEnum, PageVisibilityEnum, PollNotevisibilityEnum, RelayStatusEnum, UserEmojimodpermEnum, UserProfileFfvisibilityEnum, UserProfileMutingnotificationtypesEnum, updateAntennasOnNewNote, fetchNodeinfo, nodeinfo_2_1, nodeinfo_2_0, Protocol, Inbound, Outbound, watchNote, unwatchNote, PushNotificationKind, sendPushNotification, publishToChannelStream, ChatEvent, publishToChatStream, ChatIndexEvent, publishToChatIndexStream, publishToBroadcastStream, publishToGroupChatStream, publishToModerationStream, getTimestamp, genId, genIdAt, generateSecureRandomString, generateUserToken } = nativeBinding
|
||||
const { SECOND, MINUTE, HOUR, DAY, USER_ONLINE_THRESHOLD, USER_ACTIVE_THRESHOLD, FILE_TYPE_BROWSERSAFE, loadEnv, loadConfig, stringToAcct, acctToString, greet, initializeRustLogger, showServerInfo, isBlockedServer, isSilencedServer, isAllowedServer, checkWordMute, getFullApAccount, isSelfHost, isSameOrigin, extractHost, toPuny, isUnicodeEmoji, sqlLikeEscape, safeForSql, formatMilliseconds, getImageSizeFromUrl, getNoteSummary, isQuote, isSafeUrl, latestVersion, toMastodonId, fromMastodonId, fetchMeta, metaToPugArgs, nyaify, hashPassword, verifyPassword, isOldPasswordAlgorithm, decodeReaction, countReactions, toDbReaction, removeOldAttestationChallenges, cpuInfo, cpuUsage, memoryUsage, storageUsage, AntennaSrc, DriveFileUsageHint, MutedNoteReason, NoteVisibility, NotificationType, PageVisibility, PollNoteVisibility, RelayStatus, UserEmojiModPerm, UserProfileFfvisibility, UserProfileMutingNotificationTypes, updateAntennasOnNewNote, fetchNodeinfo, nodeinfo_2_1, nodeinfo_2_0, Protocol, Inbound, Outbound, watchNote, unwatchNote, PushNotificationKind, sendPushNotification, publishToChannelStream, ChatEvent, publishToChatStream, ChatIndexEvent, publishToChatIndexStream, publishToBroadcastStream, publishToGroupChatStream, publishToModerationStream, getTimestamp, genId, genIdAt, generateSecureRandomString, generateUserToken } = nativeBinding
|
||||
|
||||
module.exports.SECOND = SECOND
|
||||
module.exports.MINUTE = MINUTE
|
||||
|
@ -360,17 +360,17 @@ module.exports.cpuInfo = cpuInfo
|
|||
module.exports.cpuUsage = cpuUsage
|
||||
module.exports.memoryUsage = memoryUsage
|
||||
module.exports.storageUsage = storageUsage
|
||||
module.exports.AntennaSrcEnum = AntennaSrcEnum
|
||||
module.exports.DriveFileUsageHintEnum = DriveFileUsageHintEnum
|
||||
module.exports.MutedNoteReasonEnum = MutedNoteReasonEnum
|
||||
module.exports.NoteVisibilityEnum = NoteVisibilityEnum
|
||||
module.exports.NotificationTypeEnum = NotificationTypeEnum
|
||||
module.exports.PageVisibilityEnum = PageVisibilityEnum
|
||||
module.exports.PollNotevisibilityEnum = PollNotevisibilityEnum
|
||||
module.exports.RelayStatusEnum = RelayStatusEnum
|
||||
module.exports.UserEmojimodpermEnum = UserEmojimodpermEnum
|
||||
module.exports.UserProfileFfvisibilityEnum = UserProfileFfvisibilityEnum
|
||||
module.exports.UserProfileMutingnotificationtypesEnum = UserProfileMutingnotificationtypesEnum
|
||||
module.exports.AntennaSrc = AntennaSrc
|
||||
module.exports.DriveFileUsageHint = DriveFileUsageHint
|
||||
module.exports.MutedNoteReason = MutedNoteReason
|
||||
module.exports.NoteVisibility = NoteVisibility
|
||||
module.exports.NotificationType = NotificationType
|
||||
module.exports.PageVisibility = PageVisibility
|
||||
module.exports.PollNoteVisibility = PollNoteVisibility
|
||||
module.exports.RelayStatus = RelayStatus
|
||||
module.exports.UserEmojiModPerm = UserEmojiModPerm
|
||||
module.exports.UserProfileFfvisibility = UserProfileFfvisibility
|
||||
module.exports.UserProfileMutingNotificationTypes = UserProfileMutingNotificationTypes
|
||||
module.exports.updateAntennasOnNewNote = updateAntennasOnNewNote
|
||||
module.exports.fetchNodeinfo = fetchNodeinfo
|
||||
module.exports.nodeinfo_2_1 = nodeinfo_2_1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
|
||||
|
||||
use super::sea_orm_active_enums::AntennaSrcEnum;
|
||||
use super::sea_orm_active_enums::AntennaSrc;
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
|
||||
|
@ -18,7 +18,7 @@ pub struct Model {
|
|||
#[sea_orm(column_name = "userId")]
|
||||
pub user_id: String,
|
||||
pub name: String,
|
||||
pub src: AntennaSrcEnum,
|
||||
pub src: AntennaSrc,
|
||||
#[sea_orm(column_name = "userListId")]
|
||||
pub user_list_id: Option<String>,
|
||||
#[sea_orm(column_name = "withFile")]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
|
||||
|
||||
use super::sea_orm_active_enums::DriveFileUsageHintEnum;
|
||||
use super::sea_orm_active_enums::DriveFileUsageHint;
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
|
||||
|
@ -55,7 +55,7 @@ pub struct Model {
|
|||
#[sea_orm(column_name = "requestIp")]
|
||||
pub request_ip: Option<String>,
|
||||
#[sea_orm(column_name = "usageHint")]
|
||||
pub usage_hint: Option<DriveFileUsageHintEnum>,
|
||||
pub usage_hint: Option<DriveFileUsageHint>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
|
||||
|
||||
use super::sea_orm_active_enums::MutedNoteReasonEnum;
|
||||
use super::sea_orm_active_enums::MutedNoteReason;
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
|
||||
|
@ -17,7 +17,7 @@ pub struct Model {
|
|||
pub note_id: String,
|
||||
#[sea_orm(column_name = "userId")]
|
||||
pub user_id: String,
|
||||
pub reason: MutedNoteReasonEnum,
|
||||
pub reason: MutedNoteReason,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
|
||||
|
||||
use super::sea_orm_active_enums::NoteVisibilityEnum;
|
||||
use super::sea_orm_active_enums::NoteVisibility;
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
|
||||
|
@ -34,7 +34,7 @@ pub struct Model {
|
|||
pub replies_count: i16,
|
||||
#[sea_orm(column_type = "JsonBinary")]
|
||||
pub reactions: Json,
|
||||
pub visibility: NoteVisibilityEnum,
|
||||
pub visibility: NoteVisibility,
|
||||
pub uri: Option<String>,
|
||||
pub score: i32,
|
||||
#[sea_orm(column_name = "fileIds")]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
|
||||
|
||||
use super::sea_orm_active_enums::NotificationTypeEnum;
|
||||
use super::sea_orm_active_enums::NotificationType;
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
|
||||
|
@ -27,7 +27,7 @@ pub struct Model {
|
|||
pub choice: Option<i32>,
|
||||
#[sea_orm(column_name = "followRequestId")]
|
||||
pub follow_request_id: Option<String>,
|
||||
pub r#type: NotificationTypeEnum,
|
||||
pub r#type: NotificationType,
|
||||
#[sea_orm(column_name = "userGroupInvitationId")]
|
||||
pub user_group_invitation_id: Option<String>,
|
||||
#[sea_orm(column_name = "customBody")]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
|
||||
|
||||
use super::sea_orm_active_enums::PageVisibilityEnum;
|
||||
use super::sea_orm_active_enums::PageVisibility;
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
|
||||
|
@ -31,7 +31,7 @@ pub struct Model {
|
|||
pub content: Json,
|
||||
#[sea_orm(column_type = "JsonBinary")]
|
||||
pub variables: Json,
|
||||
pub visibility: PageVisibilityEnum,
|
||||
pub visibility: PageVisibility,
|
||||
#[sea_orm(column_name = "visibleUserIds")]
|
||||
pub visible_user_ids: Vec<String>,
|
||||
#[sea_orm(column_name = "likedCount")]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
|
||||
|
||||
use super::sea_orm_active_enums::PollNotevisibilityEnum;
|
||||
use super::sea_orm_active_enums::PollNoteVisibility;
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
|
||||
|
@ -19,7 +19,7 @@ pub struct Model {
|
|||
pub choices: Vec<String>,
|
||||
pub votes: Vec<i32>,
|
||||
#[sea_orm(column_name = "noteVisibility")]
|
||||
pub note_visibility: PollNotevisibilityEnum,
|
||||
pub note_visibility: PollNoteVisibility,
|
||||
#[sea_orm(column_name = "userId")]
|
||||
pub user_id: String,
|
||||
#[sea_orm(column_name = "userHost")]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
|
||||
|
||||
use super::sea_orm_active_enums::RelayStatusEnum;
|
||||
use super::sea_orm_active_enums::RelayStatus;
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
|
||||
|
@ -14,7 +14,7 @@ pub struct Model {
|
|||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub inbox: String,
|
||||
pub status: RelayStatusEnum,
|
||||
pub status: RelayStatus,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
|
|
|
@ -8,8 +8,8 @@ use sea_orm::entity::prelude::*;
|
|||
#[serde(rename_all = "camelCase")]
|
||||
#[cfg_attr(not(feature = "napi"), derive(Clone))]
|
||||
#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]
|
||||
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "antenna_src_enum")]
|
||||
pub enum AntennaSrcEnum {
|
||||
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "antenna_src")]
|
||||
pub enum AntennaSrc {
|
||||
#[sea_orm(string_value = "all")]
|
||||
All,
|
||||
#[sea_orm(string_value = "group")]
|
||||
|
@ -32,9 +32,9 @@ pub enum AntennaSrcEnum {
|
|||
#[sea_orm(
|
||||
rs_type = "String",
|
||||
db_type = "Enum",
|
||||
enum_name = "drive_file_usage_hint_enum"
|
||||
enum_name = "drive_file_usage_hint"
|
||||
)]
|
||||
pub enum DriveFileUsageHintEnum {
|
||||
pub enum DriveFileUsageHint {
|
||||
#[sea_orm(string_value = "userAvatar")]
|
||||
UserAvatar,
|
||||
#[sea_orm(string_value = "userBanner")]
|
||||
|
@ -46,12 +46,8 @@ pub enum DriveFileUsageHintEnum {
|
|||
#[serde(rename_all = "camelCase")]
|
||||
#[cfg_attr(not(feature = "napi"), derive(Clone))]
|
||||
#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]
|
||||
#[sea_orm(
|
||||
rs_type = "String",
|
||||
db_type = "Enum",
|
||||
enum_name = "muted_note_reason_enum"
|
||||
)]
|
||||
pub enum MutedNoteReasonEnum {
|
||||
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "muted_note_reason")]
|
||||
pub enum MutedNoteReason {
|
||||
#[sea_orm(string_value = "manual")]
|
||||
Manual,
|
||||
#[sea_orm(string_value = "other")]
|
||||
|
@ -67,12 +63,8 @@ pub enum MutedNoteReasonEnum {
|
|||
#[serde(rename_all = "camelCase")]
|
||||
#[cfg_attr(not(feature = "napi"), derive(Clone))]
|
||||
#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]
|
||||
#[sea_orm(
|
||||
rs_type = "String",
|
||||
db_type = "Enum",
|
||||
enum_name = "note_visibility_enum"
|
||||
)]
|
||||
pub enum NoteVisibilityEnum {
|
||||
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "note_visibility")]
|
||||
pub enum NoteVisibility {
|
||||
#[sea_orm(string_value = "followers")]
|
||||
Followers,
|
||||
#[sea_orm(string_value = "hidden")]
|
||||
|
@ -90,12 +82,8 @@ pub enum NoteVisibilityEnum {
|
|||
#[serde(rename_all = "camelCase")]
|
||||
#[cfg_attr(not(feature = "napi"), derive(Clone))]
|
||||
#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]
|
||||
#[sea_orm(
|
||||
rs_type = "String",
|
||||
db_type = "Enum",
|
||||
enum_name = "notification_type_enum"
|
||||
)]
|
||||
pub enum NotificationTypeEnum {
|
||||
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "notification_type")]
|
||||
pub enum NotificationType {
|
||||
#[sea_orm(string_value = "app")]
|
||||
App,
|
||||
#[sea_orm(string_value = "follow")]
|
||||
|
@ -127,12 +115,8 @@ pub enum NotificationTypeEnum {
|
|||
#[serde(rename_all = "camelCase")]
|
||||
#[cfg_attr(not(feature = "napi"), derive(Clone))]
|
||||
#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]
|
||||
#[sea_orm(
|
||||
rs_type = "String",
|
||||
db_type = "Enum",
|
||||
enum_name = "page_visibility_enum"
|
||||
)]
|
||||
pub enum PageVisibilityEnum {
|
||||
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "page_visibility")]
|
||||
pub enum PageVisibility {
|
||||
#[sea_orm(string_value = "followers")]
|
||||
Followers,
|
||||
#[sea_orm(string_value = "public")]
|
||||
|
@ -149,9 +133,9 @@ pub enum PageVisibilityEnum {
|
|||
#[sea_orm(
|
||||
rs_type = "String",
|
||||
db_type = "Enum",
|
||||
enum_name = "poll_notevisibility_enum"
|
||||
enum_name = "poll_note_visibility"
|
||||
)]
|
||||
pub enum PollNotevisibilityEnum {
|
||||
pub enum PollNoteVisibility {
|
||||
#[sea_orm(string_value = "followers")]
|
||||
Followers,
|
||||
#[sea_orm(string_value = "home")]
|
||||
|
@ -167,8 +151,8 @@ pub enum PollNotevisibilityEnum {
|
|||
#[serde(rename_all = "camelCase")]
|
||||
#[cfg_attr(not(feature = "napi"), derive(Clone))]
|
||||
#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]
|
||||
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "relay_status_enum")]
|
||||
pub enum RelayStatusEnum {
|
||||
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "relay_status")]
|
||||
pub enum RelayStatus {
|
||||
#[sea_orm(string_value = "accepted")]
|
||||
Accepted,
|
||||
#[sea_orm(string_value = "rejected")]
|
||||
|
@ -185,9 +169,9 @@ pub enum RelayStatusEnum {
|
|||
#[sea_orm(
|
||||
rs_type = "String",
|
||||
db_type = "Enum",
|
||||
enum_name = "user_emojimodperm_enum"
|
||||
enum_name = "user_emoji_mod_perm"
|
||||
)]
|
||||
pub enum UserEmojimodpermEnum {
|
||||
pub enum UserEmojiModPerm {
|
||||
#[sea_orm(string_value = "add")]
|
||||
Add,
|
||||
#[sea_orm(string_value = "full")]
|
||||
|
@ -206,9 +190,9 @@ pub enum UserEmojimodpermEnum {
|
|||
#[sea_orm(
|
||||
rs_type = "String",
|
||||
db_type = "Enum",
|
||||
enum_name = "user_profile_ffvisibility_enum"
|
||||
enum_name = "user_profile_ffvisibility"
|
||||
)]
|
||||
pub enum UserProfileFfvisibilityEnum {
|
||||
pub enum UserProfileFfvisibility {
|
||||
#[sea_orm(string_value = "followers")]
|
||||
Followers,
|
||||
#[sea_orm(string_value = "private")]
|
||||
|
@ -225,9 +209,9 @@ pub enum UserProfileFfvisibilityEnum {
|
|||
#[sea_orm(
|
||||
rs_type = "String",
|
||||
db_type = "Enum",
|
||||
enum_name = "user_profile_mutingnotificationtypes_enum"
|
||||
enum_name = "user_profile_muting_notification_types"
|
||||
)]
|
||||
pub enum UserProfileMutingnotificationtypesEnum {
|
||||
pub enum UserProfileMutingNotificationTypes {
|
||||
#[sea_orm(string_value = "app")]
|
||||
App,
|
||||
#[sea_orm(string_value = "follow")]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
|
||||
|
||||
use super::sea_orm_active_enums::UserEmojimodpermEnum;
|
||||
use super::sea_orm_active_enums::UserEmojiModPerm;
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
|
||||
|
@ -74,7 +74,7 @@ pub struct Model {
|
|||
#[sea_orm(column_name = "speakAsCat")]
|
||||
pub speak_as_cat: bool,
|
||||
#[sea_orm(column_name = "emojiModPerm")]
|
||||
pub emoji_mod_perm: UserEmojimodpermEnum,
|
||||
pub emoji_mod_perm: UserEmojiModPerm,
|
||||
#[sea_orm(column_name = "isIndexable")]
|
||||
pub is_indexable: bool,
|
||||
#[sea_orm(column_name = "alsoKnownAs")]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
|
||||
|
||||
use super::sea_orm_active_enums::UserProfileFfvisibilityEnum;
|
||||
use super::sea_orm_active_enums::UserProfileMutingnotificationtypesEnum;
|
||||
use super::sea_orm_active_enums::UserProfileFfvisibility;
|
||||
use super::sea_orm_active_enums::UserProfileMutingNotificationTypes;
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
|
||||
|
@ -51,7 +51,7 @@ pub struct Model {
|
|||
#[sea_orm(column_name = "enableWordMute")]
|
||||
pub enable_word_mute: bool,
|
||||
#[sea_orm(column_name = "mutingNotificationTypes")]
|
||||
pub muting_notification_types: Vec<UserProfileMutingnotificationtypesEnum>,
|
||||
pub muting_notification_types: Vec<UserProfileMutingNotificationTypes>,
|
||||
#[sea_orm(column_name = "noCrawle")]
|
||||
pub no_crawle: bool,
|
||||
#[sea_orm(column_name = "receiveAnnouncementEmail")]
|
||||
|
@ -61,7 +61,7 @@ pub struct Model {
|
|||
#[sea_orm(column_name = "publicReactions")]
|
||||
pub public_reactions: bool,
|
||||
#[sea_orm(column_name = "ffVisibility")]
|
||||
pub ff_visibility: UserProfileFfvisibilityEnum,
|
||||
pub ff_visibility: UserProfileFfvisibility,
|
||||
#[sea_orm(column_name = "moderationNote")]
|
||||
pub moderation_note: String,
|
||||
#[sea_orm(column_name = "preventAiLearning")]
|
||||
|
|
|
@ -33,7 +33,7 @@ pub async fn check_hit_antenna(
|
|||
note_all_texts: &[String],
|
||||
note_author: &Acct,
|
||||
) -> Result<bool, AntennaCheckError> {
|
||||
if note.visibility == NoteVisibilityEnum::Specified {
|
||||
if note.visibility == NoteVisibility::Specified {
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ pub async fn check_hit_antenna(
|
|||
return Ok(false);
|
||||
}
|
||||
|
||||
if antenna.src == AntennaSrcEnum::Users {
|
||||
if antenna.src == AntennaSrc::Users {
|
||||
let is_from_one_of_specified_authors = antenna
|
||||
.users
|
||||
.iter()
|
||||
|
@ -55,7 +55,7 @@ pub async fn check_hit_antenna(
|
|||
if !is_from_one_of_specified_authors {
|
||||
return Ok(false);
|
||||
}
|
||||
} else if antenna.src == AntennaSrcEnum::Instances {
|
||||
} else if antenna.src == AntennaSrc::Instances {
|
||||
let is_from_one_of_specified_servers = antenna.instances.iter().any(|host| {
|
||||
host.to_ascii_lowercase()
|
||||
== note_author
|
||||
|
@ -115,7 +115,7 @@ pub async fn check_hit_antenna(
|
|||
return Ok(false);
|
||||
}
|
||||
|
||||
if [NoteVisibilityEnum::Home, NoteVisibilityEnum::Followers].contains(¬e.visibility) {
|
||||
if [NoteVisibility::Home, NoteVisibility::Followers].contains(¬e.visibility) {
|
||||
let following_user_ids: Vec<String> =
|
||||
if let Some(ids) = cache::get_one(cache::Category::Follow, &antenna.user_id).await? {
|
||||
ids
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
import type { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class RemoveEnumTypenameSuffix1716462794927
|
||||
implements MigrationInterface
|
||||
{
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "antenna_src_enum" RENAME TO "antenna_src"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "drive_file_usage_hint_enum" RENAME TO "drive_file_usage_hint"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "muted_note_reason_enum" RENAME TO "muted_note_reason"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "note_visibility_enum" RENAME TO "note_visibility"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "notification_type_enum" RENAME TO "notification_type"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "page_visibility_enum" RENAME TO "page_visibility"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "poll_notevisibility_enum" RENAME TO "poll_note_visibility"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "relay_status_enum" RENAME TO "relay_status"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "user_emojimodperm_enum" RENAME TO "user_emoji_mod_perm"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "user_profile_ffvisibility_enum" RENAME TO "user_profile_ffvisibility"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "user_profile_mutingnotificationtypes_enum" RENAME TO "user_profile_muting_notification_types"`,
|
||||
);
|
||||
}
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "antenna_src" RENAME TO "antenna_src_enum"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "drive_file_usage_hint" RENAME TO "drive_file_usage_hint_enum"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "muted_note_reason" RENAME TO "muted_note_reason_enum"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "note_visibility" RENAME TO "note_visibility_enum"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "notification_type" RENAME TO "notification_type_enum"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "page_visibility" RENAME TO "page_visibility_enum"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "poll_note_visibility" RENAME TO "poll_notevisibility_enum"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "relay_status" RENAME TO "relay_status_enum"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "user_emoji_mod_perm" RENAME TO "user_emojimodperm_enum"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "user_profile_ffvisibility" RENAME TO "user_profile_ffvisibility_enum"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TYPE "user_profile_muting_notification_types" RENAME TO "user_profile_mutingnotificationtypes_enum"`,
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue