diff --git a/typescript/db/src/generated/Database.ts b/typescript/db/src/generated/Database.ts index 8fa64f8c7..2fa99407d 100644 --- a/typescript/db/src/generated/Database.ts +++ b/typescript/db/src/generated/Database.ts @@ -1,7 +1,7 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as PublicSchema } from "./public/PublicSchema"; +import type { default as PublicSchema } from './public/PublicSchema'; type Database = PublicSchema; diff --git a/typescript/db/src/generated/index.ts b/typescript/db/src/generated/index.ts index aa249b13a..d596da09a 100644 --- a/typescript/db/src/generated/index.ts +++ b/typescript/db/src/generated/index.ts @@ -1,462 +1,78 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -export { - type priv_svc_cg_card_info_service, - type default as PrivSvcCgCardInfoTable, - type PrivSvcCgCardInfo, - type NewPrivSvcCgCardInfo, - type PrivSvcCgCardInfoUpdate, -} from "./public/PrivSvcCgCardInfo"; -export { - type class_achievement_row_id, - type default as ClassAchievementTable, - type ClassAchievement, - type NewClassAchievement, - type ClassAchievementUpdate, -} from "./public/ClassAchievement"; -export { - type account_id, - type default as AccountTable, - type Account, - type NewAccount, - type AccountUpdate, -} from "./public/Account"; -export { - type import_tracker_import_id, - type default as ImportTrackerTable, - type ImportTracker, - type NewImportTracker, - type ImportTrackerUpdate, -} from "./public/ImportTracker"; -export { - type default as SvcFerSettingsTable, - type SvcFerSettings, - type NewSvcFerSettings, - type SvcFerSettingsUpdate, -} from "./public/SvcFerSettings"; -export { - type default as InviteLockTable, - type InviteLock, - type NewInviteLock, - type InviteLockUpdate, -} from "./public/InviteLock"; -export { - type orphan_chart_id, - type default as OrphanChartTable, - type OrphanChart, - type NewOrphanChart, - type OrphanChartUpdate, -} from "./public/OrphanChart"; -export { - type game_rival_game, - type default as GameRivalTable, - type GameRival, - type NewGameRival, - type GameRivalUpdate, -} from "./public/GameRival"; -export { - type goal_id, - type default as GoalTable, - type Goal, - type NewGoal, - type GoalUpdate, -} from "./public/Goal"; -export { - type game_settings_game, - type default as GameSettingsTable, - type GameSettings, - type NewGameSettings, - type GameSettingsUpdate, -} from "./public/GameSettings"; -export { - type import_quest_row_id, - type default as ImportQuestTable, - type ImportQuest, - type NewImportQuest, - type ImportQuestUpdate, -} from "./public/ImportQuest"; -export { - type cron_task_execution_id, - type default as CronTaskExecutionTable, - type CronTaskExecution, - type NewCronTaskExecution, - type CronTaskExecutionUpdate, -} from "./public/CronTaskExecution"; -export { - type notification_row_id, - type default as NotificationTable, - type Notification, - type NewNotification, - type NotificationUpdate, -} from "./public/Notification"; -export { - type default as ImportLockTable, - type ImportLock, - type NewImportLock, - type ImportLockUpdate, -} from "./public/ImportLock"; -export { - type score_blacklist_row_id, - type default as ScoreBlacklistTable, - type ScoreBlacklist, - type NewScoreBlacklist, - type ScoreBlacklistUpdate, -} from "./public/ScoreBlacklist"; -export { - type default as TableFolderTable, - type TableFolder, - type NewTableFolder, - type TableFolderUpdate, -} from "./public/TableFolder"; -export { - type game_stats_game, - type default as GameStatsTable, - type GameStats, - type NewGameStats, - type GameStatsUpdate, -} from "./public/GameStats"; -export { - type priv_oauth2_auth_token_token, - type default as PrivOauth2AuthTokenTable, - type PrivOauth2AuthToken, - type NewPrivOauth2AuthToken, - type PrivOauth2AuthTokenUpdate, -} from "./public/PrivOauth2AuthToken"; -export { - type import_session_row_id, - type default as ImportSessionTable, - type ImportSession, - type NewImportSession, - type ImportSessionUpdate, -} from "./public/ImportSession"; -export { - type priv_svc_fer_card_card_id, - type default as PrivSvcFerCardTable, - type PrivSvcFerCard, - type NewPrivSvcFerCard, - type PrivSvcFerCardUpdate, -} from "./public/PrivSvcFerCard"; -export { - type default as PbComposedFromTable, - type PbComposedFrom, - type NewPbComposedFrom, - type PbComposedFromUpdate, -} from "./public/PbComposedFrom"; -export { - type bms_course_lookup_md5sums, - type default as BmsCourseLookupTable, - type BmsCourseLookup, - type NewBmsCourseLookup, - type BmsCourseLookupUpdate, -} from "./public/BmsCourseLookup"; -export { - type song_search_term_search_term, - type default as SongSearchTermTable, - type SongSearchTerm, - type NewSongSearchTerm, - type SongSearchTermUpdate, -} from "./public/SongSearchTerm"; -export { - type import_game_game, - type default as ImportGameTable, - type ImportGame, - type NewImportGame, - type ImportGameUpdate, -} from "./public/ImportGame"; -export { - type import_goal_row_id, - type default as ImportGoalTable, - type ImportGoal, - type NewImportGoal, - type ImportGoalUpdate, -} from "./public/ImportGoal"; -export { - type default as OrphanChartUserTable, - type OrphanChartUser, - type NewOrphanChartUser, - type OrphanChartUserUpdate, -} from "./public/OrphanChartUser"; -export { - type priv_verify_email_token_token, - type default as PrivVerifyEmailTokenTable, - type PrivVerifyEmailToken, - type NewPrivVerifyEmailToken, - type PrivVerifyEmailTokenUpdate, -} from "./public/PrivVerifyEmailToken"; -export { - type priv_invite_code, - type default as PrivInviteTable, - type PrivInvite, - type NewPrivInvite, - type PrivInviteUpdate, -} from "./public/PrivInvite"; -export { - type session_id, - type default as SessionTable, - type Session, - type NewSession, - type SessionUpdate, -} from "./public/Session"; -export { - type priv_password_reset_token_token, - type default as PrivPasswordResetTokenTable, - type PrivPasswordResetToken, - type NewPrivPasswordResetToken, - type PrivPasswordResetTokenUpdate, -} from "./public/PrivPasswordResetToken"; -export { - type song_id, - type default as SongTable, - type Song, - type NewSong, - type SongUpdate, -} from "./public/Song"; -export { - type account_username_change_row_id, - type default as AccountUsernameChangeTable, - type AccountUsernameChange, - type NewAccountUsernameChange, - type AccountUsernameChangeUpdate, -} from "./public/AccountUsernameChange"; -export { - type default as MigrationTable, - type Migration, - type NewMigration, - type MigrationUpdate, -} from "./public/Migration"; -export { - type account_badge_badge, - type default as AccountBadgeTable, - type AccountBadge, - type NewAccountBadge, - type AccountBadgeUpdate, -} from "./public/AccountBadge"; -export { - type action_row_id, - type default as ActionTable, - type Action, - type NewAction, - type ActionUpdate, -} from "./public/Action"; -export { - type priv_svc_kai_auth_token_service, - type default as PrivSvcKaiAuthTokenTable, - type PrivSvcKaiAuthToken, - type NewPrivSvcKaiAuthToken, - type PrivSvcKaiAuthTokenUpdate, -} from "./public/PrivSvcKaiAuthToken"; -export { - type chart_id, - type default as ChartTable, - type Chart, - type NewChart, - type ChartUpdate, -} from "./public/Chart"; -export { - type game_settings_showcase_game, - type default as GameSettingsShowcaseTable, - type GameSettingsShowcase, - type NewGameSettingsShowcase, - type GameSettingsShowcaseUpdate, -} from "./public/GameSettingsShowcase"; -export { - type default as AccountFollowingTable, - type AccountFollowing, - type NewAccountFollowing, - type AccountFollowingUpdate, -} from "./public/AccountFollowing"; -export { - type import_id, - type default as ImportTable, - type Import, - type NewImport, - type ImportUpdate, -} from "./public/Import"; -export { - type folder_id, - type default as FolderTable, - type Folder, - type NewFolder, - type FolderUpdate, -} from "./public/Folder"; -export { - type default as PrivAccountCredentialTable, - type PrivAccountCredential, - type NewPrivAccountCredential, - type PrivAccountCredentialUpdate, -} from "./public/PrivAccountCredential"; -export { - type score_id, - type default as ScoreTable, - type Score, - type NewScore, - type ScoreUpdate, -} from "./public/Score"; -export { - type default as ImportTimingTable, - type ImportTiming, - type NewImportTiming, - type ImportTimingUpdate, -} from "./public/ImportTiming"; -export { - type default as QuestSubTable, - type QuestSub, - type NewQuestSub, - type QuestSubUpdate, -} from "./public/QuestSub"; -export { - type orphan_score_row_id, - type default as OrphanScoreTable, - type OrphanScore, - type NewOrphanScore, - type OrphanScoreUpdate, -} from "./public/OrphanScore"; -export { - type default as FolderViewTable, - type FolderView, - type NewFolderView, - type FolderViewUpdate, -} from "./public/FolderView"; -export { - type table_id, - type default as TableTable, - type Table, - type NewTable, - type TableUpdate, -} from "./public/Table"; -export { - type chart_version_version, - type default as ChartVersionTable, - type ChartVersion, - type NewChartVersion, - type ChartVersionUpdate, -} from "./public/ChartVersion"; -export { - type default as GoalSubTable, - type GoalSub, - type NewGoalSub, - type GoalSubUpdate, -} from "./public/GoalSub"; -export { - type folder_search_term_search_term, - type default as FolderSearchTermTable, - type FolderSearchTerm, - type NewFolderSearchTerm, - type FolderSearchTermUpdate, -} from "./public/FolderSearchTerm"; -export { - type job_queue_row_id, - type default as JobQueueTable, - type JobQueue, - type NewJobQueue, - type JobQueueUpdate, -} from "./public/JobQueue"; -export { - type priv_api_client_client_id, - type default as PrivApiClientTable, - type PrivApiClient, - type NewPrivApiClient, - type PrivApiClientUpdate, -} from "./public/PrivApiClient"; -export { - type priv_api_token_token, - type default as PrivApiTokenTable, - type PrivApiToken, - type NewPrivApiToken, - type PrivApiTokenUpdate, -} from "./public/PrivApiToken"; -export { - type default as SvcKshookSv6cSettingsTable, - type SvcKshookSv6cSettings, - type NewSvcKshookSv6cSettings, - type SvcKshookSv6cSettingsUpdate, -} from "./public/SvcKshookSv6cSettings"; -export { - type import_error_row_id, - type default as ImportErrorTable, - type ImportError, - type NewImportError, - type ImportErrorUpdate, -} from "./public/ImportError"; -export { - type quest_id, - type default as QuestTable, - type Quest, - type NewQuest, - type QuestUpdate, -} from "./public/Quest"; -export { - type default as AccountSettingsTable, - type AccountSettings, - type NewAccountSettings, - type AccountSettingsUpdate, -} from "./public/AccountSettings"; -export { - type pb_row_id, - type default as PbTable, - type Pb, - type NewPb, - type PbUpdate, -} from "./public/Pb"; -export { - type priv_svc_myt_card_info_card_access_code, - type default as PrivSvcMytCardInfoTable, - type PrivSvcMytCardInfo, - type NewPrivSvcMytCardInfo, - type PrivSvcMytCardInfoUpdate, -} from "./public/PrivSvcMytCardInfo"; -export { - type default as QuestlineQuestTable, - type QuestlineQuest, - type NewQuestlineQuest, - type QuestlineQuestUpdate, -} from "./public/QuestlineQuest"; -export { - type questline_id, - type default as QuestlineTable, - type Questline, - type NewQuestline, - type QuestlineUpdate, -} from "./public/Questline"; -export { - type cron_task_id, - type default as CronTaskTable, - type CronTask, - type NewCronTask, - type CronTaskUpdate, -} from "./public/CronTask"; -export { - type import_class_row_id, - type default as ImportClassTable, - type ImportClass, - type NewImportClass, - type ImportClassUpdate, -} from "./public/ImportClass"; -export { - type song_alt_title_alt_title, - type default as SongAltTitleTable, - type SongAltTitle, - type NewSongAltTitle, - type SongAltTitleUpdate, -} from "./public/SongAltTitle"; -export { - type game_stats_snapshot_game, - type game_stats_snapshot_timestamp, - type default as GameStatsSnapshotTable, - type GameStatsSnapshot, - type NewGameStatsSnapshot, - type GameStatsSnapshotUpdate, -} from "./public/GameStatsSnapshot"; -export { - type default as ChartLeaderboardTable, - type ChartLeaderboard, -} from "./public/ChartLeaderboard"; -export { type default as AuthLevel } from "./public/AuthLevel"; -export { type default as AccountBadgeKind } from "./public/AccountBadgeKind"; -export { type default as Game } from "./public/Game"; -export { type default as ActionResult } from "./public/ActionResult"; -export { type default as GameGroup } from "./public/GameGroup"; -export { type default as ImportType } from "./public/ImportType"; -export { type default as PublicSchema } from "./public/PublicSchema"; -export { type default as Database } from "./Database"; +export { type priv_svc_cg_card_info_service, type default as PrivSvcCgCardInfoTable, type PrivSvcCgCardInfo, type NewPrivSvcCgCardInfo, type PrivSvcCgCardInfoUpdate } from './public/PrivSvcCgCardInfo'; +export { type class_achievement_row_id, type default as ClassAchievementTable, type ClassAchievement, type NewClassAchievement, type ClassAchievementUpdate } from './public/ClassAchievement'; +export { type account_id, type default as AccountTable, type Account, type NewAccount, type AccountUpdate } from './public/Account'; +export { type import_tracker_import_id, type default as ImportTrackerTable, type ImportTracker, type NewImportTracker, type ImportTrackerUpdate } from './public/ImportTracker'; +export { type default as SvcFerSettingsTable, type SvcFerSettings, type NewSvcFerSettings, type SvcFerSettingsUpdate } from './public/SvcFerSettings'; +export { type default as InviteLockTable, type InviteLock, type NewInviteLock, type InviteLockUpdate } from './public/InviteLock'; +export { type orphan_chart_id, type default as OrphanChartTable, type OrphanChart, type NewOrphanChart, type OrphanChartUpdate } from './public/OrphanChart'; +export { type game_rival_game, type default as GameRivalTable, type GameRival, type NewGameRival, type GameRivalUpdate } from './public/GameRival'; +export { type goal_id, type default as GoalTable, type Goal, type NewGoal, type GoalUpdate } from './public/Goal'; +export { type game_settings_game, type default as GameSettingsTable, type GameSettings, type NewGameSettings, type GameSettingsUpdate } from './public/GameSettings'; +export { type import_quest_row_id, type default as ImportQuestTable, type ImportQuest, type NewImportQuest, type ImportQuestUpdate } from './public/ImportQuest'; +export { type cron_task_execution_id, type default as CronTaskExecutionTable, type CronTaskExecution, type NewCronTaskExecution, type CronTaskExecutionUpdate } from './public/CronTaskExecution'; +export { type notification_row_id, type default as NotificationTable, type Notification, type NewNotification, type NotificationUpdate } from './public/Notification'; +export { type default as ImportLockTable, type ImportLock, type NewImportLock, type ImportLockUpdate } from './public/ImportLock'; +export { type score_blacklist_row_id, type default as ScoreBlacklistTable, type ScoreBlacklist, type NewScoreBlacklist, type ScoreBlacklistUpdate } from './public/ScoreBlacklist'; +export { type default as TableFolderTable, type TableFolder, type NewTableFolder, type TableFolderUpdate } from './public/TableFolder'; +export { type game_stats_game, type default as GameStatsTable, type GameStats, type NewGameStats, type GameStatsUpdate } from './public/GameStats'; +export { type priv_oauth2_auth_token_token, type default as PrivOauth2AuthTokenTable, type PrivOauth2AuthToken, type NewPrivOauth2AuthToken, type PrivOauth2AuthTokenUpdate } from './public/PrivOauth2AuthToken'; +export { type import_session_row_id, type default as ImportSessionTable, type ImportSession, type NewImportSession, type ImportSessionUpdate } from './public/ImportSession'; +export { type priv_svc_fer_card_card_id, type default as PrivSvcFerCardTable, type PrivSvcFerCard, type NewPrivSvcFerCard, type PrivSvcFerCardUpdate } from './public/PrivSvcFerCard'; +export { type default as PbComposedFromTable, type PbComposedFrom, type NewPbComposedFrom, type PbComposedFromUpdate } from './public/PbComposedFrom'; +export { type bms_course_lookup_md5sums, type default as BmsCourseLookupTable, type BmsCourseLookup, type NewBmsCourseLookup, type BmsCourseLookupUpdate } from './public/BmsCourseLookup'; +export { type song_search_term_search_term, type default as SongSearchTermTable, type SongSearchTerm, type NewSongSearchTerm, type SongSearchTermUpdate } from './public/SongSearchTerm'; +export { type import_game_game, type default as ImportGameTable, type ImportGame, type NewImportGame, type ImportGameUpdate } from './public/ImportGame'; +export { type import_goal_row_id, type default as ImportGoalTable, type ImportGoal, type NewImportGoal, type ImportGoalUpdate } from './public/ImportGoal'; +export { type default as OrphanChartUserTable, type OrphanChartUser, type NewOrphanChartUser, type OrphanChartUserUpdate } from './public/OrphanChartUser'; +export { type priv_verify_email_token_token, type default as PrivVerifyEmailTokenTable, type PrivVerifyEmailToken, type NewPrivVerifyEmailToken, type PrivVerifyEmailTokenUpdate } from './public/PrivVerifyEmailToken'; +export { type priv_invite_code, type default as PrivInviteTable, type PrivInvite, type NewPrivInvite, type PrivInviteUpdate } from './public/PrivInvite'; +export { type session_id, type default as SessionTable, type Session, type NewSession, type SessionUpdate } from './public/Session'; +export { type priv_password_reset_token_token, type default as PrivPasswordResetTokenTable, type PrivPasswordResetToken, type NewPrivPasswordResetToken, type PrivPasswordResetTokenUpdate } from './public/PrivPasswordResetToken'; +export { type song_id, type default as SongTable, type Song, type NewSong, type SongUpdate } from './public/Song'; +export { type account_username_change_row_id, type default as AccountUsernameChangeTable, type AccountUsernameChange, type NewAccountUsernameChange, type AccountUsernameChangeUpdate } from './public/AccountUsernameChange'; +export { type default as MigrationTable, type Migration, type NewMigration, type MigrationUpdate } from './public/Migration'; +export { type account_badge_badge, type default as AccountBadgeTable, type AccountBadge, type NewAccountBadge, type AccountBadgeUpdate } from './public/AccountBadge'; +export { type action_row_id, type default as ActionTable, type Action, type NewAction, type ActionUpdate } from './public/Action'; +export { type priv_svc_kai_auth_token_service, type default as PrivSvcKaiAuthTokenTable, type PrivSvcKaiAuthToken, type NewPrivSvcKaiAuthToken, type PrivSvcKaiAuthTokenUpdate } from './public/PrivSvcKaiAuthToken'; +export { type chart_id, type default as ChartTable, type Chart, type NewChart, type ChartUpdate } from './public/Chart'; +export { type game_settings_showcase_game, type default as GameSettingsShowcaseTable, type GameSettingsShowcase, type NewGameSettingsShowcase, type GameSettingsShowcaseUpdate } from './public/GameSettingsShowcase'; +export { type default as AccountFollowingTable, type AccountFollowing, type NewAccountFollowing, type AccountFollowingUpdate } from './public/AccountFollowing'; +export { type import_id, type default as ImportTable, type Import, type NewImport, type ImportUpdate } from './public/Import'; +export { type folder_id, type default as FolderTable, type Folder, type NewFolder, type FolderUpdate } from './public/Folder'; +export { type default as PrivAccountCredentialTable, type PrivAccountCredential, type NewPrivAccountCredential, type PrivAccountCredentialUpdate } from './public/PrivAccountCredential'; +export { type score_id, type default as ScoreTable, type Score, type NewScore, type ScoreUpdate } from './public/Score'; +export { type default as ImportTimingTable, type ImportTiming, type NewImportTiming, type ImportTimingUpdate } from './public/ImportTiming'; +export { type default as QuestSubTable, type QuestSub, type NewQuestSub, type QuestSubUpdate } from './public/QuestSub'; +export { type orphan_score_row_id, type default as OrphanScoreTable, type OrphanScore, type NewOrphanScore, type OrphanScoreUpdate } from './public/OrphanScore'; +export { type default as FolderViewTable, type FolderView, type NewFolderView, type FolderViewUpdate } from './public/FolderView'; +export { type table_id, type default as TableTable, type Table, type NewTable, type TableUpdate } from './public/Table'; +export { type chart_version_version, type default as ChartVersionTable, type ChartVersion, type NewChartVersion, type ChartVersionUpdate } from './public/ChartVersion'; +export { type default as GoalSubTable, type GoalSub, type NewGoalSub, type GoalSubUpdate } from './public/GoalSub'; +export { type folder_search_term_search_term, type default as FolderSearchTermTable, type FolderSearchTerm, type NewFolderSearchTerm, type FolderSearchTermUpdate } from './public/FolderSearchTerm'; +export { type job_queue_row_id, type default as JobQueueTable, type JobQueue, type NewJobQueue, type JobQueueUpdate } from './public/JobQueue'; +export { type priv_api_client_client_id, type default as PrivApiClientTable, type PrivApiClient, type NewPrivApiClient, type PrivApiClientUpdate } from './public/PrivApiClient'; +export { type priv_api_token_token, type default as PrivApiTokenTable, type PrivApiToken, type NewPrivApiToken, type PrivApiTokenUpdate } from './public/PrivApiToken'; +export { type default as SvcKshookSv6cSettingsTable, type SvcKshookSv6cSettings, type NewSvcKshookSv6cSettings, type SvcKshookSv6cSettingsUpdate } from './public/SvcKshookSv6cSettings'; +export { type import_error_row_id, type default as ImportErrorTable, type ImportError, type NewImportError, type ImportErrorUpdate } from './public/ImportError'; +export { type quest_id, type default as QuestTable, type Quest, type NewQuest, type QuestUpdate } from './public/Quest'; +export { type default as AccountSettingsTable, type AccountSettings, type NewAccountSettings, type AccountSettingsUpdate } from './public/AccountSettings'; +export { type pb_row_id, type default as PbTable, type Pb, type NewPb, type PbUpdate } from './public/Pb'; +export { type priv_svc_myt_card_info_card_access_code, type default as PrivSvcMytCardInfoTable, type PrivSvcMytCardInfo, type NewPrivSvcMytCardInfo, type PrivSvcMytCardInfoUpdate } from './public/PrivSvcMytCardInfo'; +export { type default as QuestlineQuestTable, type QuestlineQuest, type NewQuestlineQuest, type QuestlineQuestUpdate } from './public/QuestlineQuest'; +export { type questline_id, type default as QuestlineTable, type Questline, type NewQuestline, type QuestlineUpdate } from './public/Questline'; +export { type cron_task_id, type default as CronTaskTable, type CronTask, type NewCronTask, type CronTaskUpdate } from './public/CronTask'; +export { type import_class_row_id, type default as ImportClassTable, type ImportClass, type NewImportClass, type ImportClassUpdate } from './public/ImportClass'; +export { type song_alt_title_alt_title, type default as SongAltTitleTable, type SongAltTitle, type NewSongAltTitle, type SongAltTitleUpdate } from './public/SongAltTitle'; +export { type game_stats_snapshot_game, type game_stats_snapshot_timestamp, type default as GameStatsSnapshotTable, type GameStatsSnapshot, type NewGameStatsSnapshot, type GameStatsSnapshotUpdate } from './public/GameStatsSnapshot'; +export { type default as ChartLeaderboardTable, type ChartLeaderboard } from './public/ChartLeaderboard'; +export { type default as AuthLevel } from './public/AuthLevel'; +export { type default as AccountBadgeKind } from './public/AccountBadgeKind'; +export { type default as Game } from './public/Game'; +export { type default as ActionResult } from './public/ActionResult'; +export { type default as GameGroup } from './public/GameGroup'; +export { type default as ImportType } from './public/ImportType'; +export { type default as PublicSchema } from './public/PublicSchema'; +export { type default as Database } from './Database'; diff --git a/typescript/db/src/generated/public/Account.ts b/typescript/db/src/generated/public/Account.ts index ea9125715..7cc6eb5e8 100644 --- a/typescript/db/src/generated/public/Account.ts +++ b/typescript/db/src/generated/public/Account.ts @@ -1,45 +1,45 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as AuthLevel } from "./AuthLevel"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { default as AuthLevel } from './AuthLevel'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.account */ export type account_id = number; /** Represents the table public.account */ export default interface AccountTable { - id: ColumnType; + id: ColumnType; - username: ColumnType; + username: ColumnType; - normalized_username: ColumnType; + normalized_username: ColumnType; - sm_discord: ColumnType; + sm_discord: ColumnType; - sm_twitter: ColumnType; + sm_twitter: ColumnType; - sm_github: ColumnType; + sm_github: ColumnType; - sm_steam: ColumnType; + sm_steam: ColumnType; - sm_youtube: ColumnType; + sm_youtube: ColumnType; - sm_twitch: ColumnType; + sm_twitch: ColumnType; - joined: ColumnType; + joined: ColumnType; - about: ColumnType; + about: ColumnType; - status: ColumnType; + status: ColumnType; - custom_pfp_location: ColumnType; + custom_pfp_location: ColumnType; - custom_banner_location: ColumnType; + custom_banner_location: ColumnType; - last_seen: ColumnType; + last_seen: ColumnType; - auth_level: ColumnType; + auth_level: ColumnType; } export type Account = Selectable; diff --git a/typescript/db/src/generated/public/AccountBadge.ts b/typescript/db/src/generated/public/AccountBadge.ts index e7f5bae15..305269afc 100644 --- a/typescript/db/src/generated/public/AccountBadge.ts +++ b/typescript/db/src/generated/public/AccountBadge.ts @@ -1,18 +1,18 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as AccountBadgeKind } from "./AccountBadgeKind"; -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { default as AccountBadgeKind } from './AccountBadgeKind'; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.account_badge */ export type account_badge_badge = AccountBadgeKind; /** Represents the table public.account_badge */ export default interface AccountBadgeTable { - user_id: ColumnType; + user_id: ColumnType; - badge: ColumnType; + badge: ColumnType; } export type AccountBadge = Selectable; diff --git a/typescript/db/src/generated/public/AccountBadgeKind.ts b/typescript/db/src/generated/public/AccountBadgeKind.ts index 253bca4b2..edf9807eb 100644 --- a/typescript/db/src/generated/public/AccountBadgeKind.ts +++ b/typescript/db/src/generated/public/AccountBadgeKind.ts @@ -2,6 +2,9 @@ // This file is automatically generated by Kanel. Do not modify manually. /** Represents the enum public.account_badge_kind */ -type AccountBadgeKind = "beta" | "alpha" | "dev-team"; +type AccountBadgeKind = + | 'beta' + | 'alpha' + | 'dev-team'; export default AccountBadgeKind; diff --git a/typescript/db/src/generated/public/AccountFollowing.ts b/typescript/db/src/generated/public/AccountFollowing.ts index 556aa0dc4..eac2914d6 100644 --- a/typescript/db/src/generated/public/AccountFollowing.ts +++ b/typescript/db/src/generated/public/AccountFollowing.ts @@ -1,14 +1,14 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Represents the table public.account_following */ export default interface AccountFollowingTable { - user_id: ColumnType; + user_id: ColumnType; - followee: ColumnType; + followee: ColumnType; } export type AccountFollowing = Selectable; diff --git a/typescript/db/src/generated/public/AccountSettings.ts b/typescript/db/src/generated/public/AccountSettings.ts index 9a9594311..645968047 100644 --- a/typescript/db/src/generated/public/AccountSettings.ts +++ b/typescript/db/src/generated/public/AccountSettings.ts @@ -1,22 +1,22 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Represents the table public.account_settings */ export default interface AccountSettingsTable { - user_id: ColumnType; + user_id: ColumnType; - pf_invisible: ColumnType; + pf_invisible: ColumnType; - pf_developer_mode: ColumnType; + pf_developer_mode: ColumnType; - pf_advanced_mode: ColumnType; + pf_advanced_mode: ColumnType; - pf_contentious_content: ColumnType; + pf_contentious_content: ColumnType; - pf_deletable_scores: ColumnType; + pf_deletable_scores: ColumnType; } export type AccountSettings = Selectable; diff --git a/typescript/db/src/generated/public/AccountUsernameChange.ts b/typescript/db/src/generated/public/AccountUsernameChange.ts index 0cd127cb0..adccffdc1 100644 --- a/typescript/db/src/generated/public/AccountUsernameChange.ts +++ b/typescript/db/src/generated/public/AccountUsernameChange.ts @@ -1,27 +1,23 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.account_username_change */ export type account_username_change_row_id = string; /** Represents the table public.account_username_change */ export default interface AccountUsernameChangeTable { - row_id: ColumnType< - account_username_change_row_id, - account_username_change_row_id | undefined, - account_username_change_row_id - >; + row_id: ColumnType; - user_id: ColumnType; + user_id: ColumnType; - username: ColumnType; + username: ColumnType; - previous_username: ColumnType; + previous_username: ColumnType; - timestamp: ColumnType; + timestamp: ColumnType; } export type AccountUsernameChange = Selectable; diff --git a/typescript/db/src/generated/public/Action.ts b/typescript/db/src/generated/public/Action.ts index f33621c12..5293fbaf3 100644 --- a/typescript/db/src/generated/public/Action.ts +++ b/typescript/db/src/generated/public/Action.ts @@ -1,32 +1,32 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { default as ActionResult } from "./ActionResult"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { default as ActionResult } from './ActionResult'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.action */ export type action_row_id = string; /** Represents the table public.action */ export default interface ActionTable { - row_id: ColumnType; + row_id: ColumnType; - user_id: ColumnType; + user_id: ColumnType; - ip: ColumnType; + ip: ColumnType; - kind: ColumnType; + kind: ColumnType; - result: ColumnType; + result: ColumnType; - input: ColumnType; + input: ColumnType; - output: ColumnType; + output: ColumnType; - ts_start: ColumnType; + ts_start: ColumnType; - ts_end: ColumnType; + ts_end: ColumnType; } export type Action = Selectable; diff --git a/typescript/db/src/generated/public/ActionResult.ts b/typescript/db/src/generated/public/ActionResult.ts index df7172209..c20262d57 100644 --- a/typescript/db/src/generated/public/ActionResult.ts +++ b/typescript/db/src/generated/public/ActionResult.ts @@ -2,6 +2,9 @@ // This file is automatically generated by Kanel. Do not modify manually. /** Represents the enum public.action_result */ -type ActionResult = "GOOD" | "BAD" | "THROW"; +type ActionResult = + | 'GOOD' + | 'BAD' + | 'THROW'; export default ActionResult; diff --git a/typescript/db/src/generated/public/AuthLevel.ts b/typescript/db/src/generated/public/AuthLevel.ts index a18f8ffb6..8893ccb9a 100644 --- a/typescript/db/src/generated/public/AuthLevel.ts +++ b/typescript/db/src/generated/public/AuthLevel.ts @@ -2,6 +2,9 @@ // This file is automatically generated by Kanel. Do not modify manually. /** Represents the enum public.auth_level */ -type AuthLevel = "banned" | "user" | "admin"; +type AuthLevel = + | 'banned' + | 'user' + | 'admin'; export default AuthLevel; diff --git a/typescript/db/src/generated/public/BmsCourseLookup.ts b/typescript/db/src/generated/public/BmsCourseLookup.ts index 44c8be658..47fb35712 100644 --- a/typescript/db/src/generated/public/BmsCourseLookup.ts +++ b/typescript/db/src/generated/public/BmsCourseLookup.ts @@ -1,26 +1,22 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.bms_course_lookup */ export type bms_course_lookup_md5sums = string; /** Represents the table public.bms_course_lookup */ export default interface BmsCourseLookupTable { - md5sums: ColumnType< - bms_course_lookup_md5sums, - bms_course_lookup_md5sums, - bms_course_lookup_md5sums - >; + md5sums: ColumnType; - title: ColumnType; + title: ColumnType; - set: ColumnType; + set: ColumnType; - playtype: ColumnType; + playtype: ColumnType; - value: ColumnType; + value: ColumnType; } export type BmsCourseLookup = Selectable; diff --git a/typescript/db/src/generated/public/Chart.ts b/typescript/db/src/generated/public/Chart.ts index c5b82b949..c02b91d71 100644 --- a/typescript/db/src/generated/public/Chart.ts +++ b/typescript/db/src/generated/public/Chart.ts @@ -1,32 +1,32 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as Game } from "./Game"; -import type { song_id } from "./Song"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { default as Game } from './Game'; +import type { song_id } from './Song'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.chart */ export type chart_id = string; /** Represents the table public.chart */ export default interface ChartTable { - id: ColumnType; + id: ColumnType; - legacy_id: ColumnType; + legacy_id: ColumnType; - game: ColumnType; + game: ColumnType; - song_id: ColumnType; + song_id: ColumnType; - level: ColumnType; + level: ColumnType; - level_num: ColumnType; + level_num: ColumnType; - is_primary: ColumnType; + is_primary: ColumnType; - difficulty: ColumnType; + difficulty: ColumnType; - data: ColumnType; + data: ColumnType; } export type Chart = Selectable; diff --git a/typescript/db/src/generated/public/ChartLeaderboard.ts b/typescript/db/src/generated/public/ChartLeaderboard.ts index a3c9caee7..de92e456a 100644 --- a/typescript/db/src/generated/public/ChartLeaderboard.ts +++ b/typescript/db/src/generated/public/ChartLeaderboard.ts @@ -1,44 +1,44 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { pb_row_id } from "./Pb"; -import type { account_id } from "./Account"; -import type { chart_id } from "./Chart"; -import type { ColumnType, Selectable } from "kysely"; +import type { pb_row_id } from './Pb'; +import type { account_id } from './Account'; +import type { chart_id } from './Chart'; +import type { ColumnType, Selectable } from 'kysely'; /** Represents the view public.chart_leaderboard */ export default interface ChartLeaderboardTable { - row_id: ColumnType; + row_id: ColumnType; - user_id: ColumnType; + user_id: ColumnType; - chart_id: ColumnType; + chart_id: ColumnType; - lens: ColumnType; + lens: ColumnType; - data: ColumnType; + data: ColumnType; - derived_data: ColumnType; + derived_data: ColumnType; - calculated_data: ColumnType; + calculated_data: ColumnType; - ranking_value: ColumnType; + ranking_value: ColumnType; - ranking_value_tb1: ColumnType; + ranking_value_tb1: ColumnType; - ranking_value_tb2: ColumnType; + ranking_value_tb2: ColumnType; - ranking_value_tb3: ColumnType; + ranking_value_tb3: ColumnType; - ranking_value_tb4: ColumnType; + ranking_value_tb4: ColumnType; - ranking_value_tb5: ColumnType; + ranking_value_tb5: ColumnType; - highlight: ColumnType; + highlight: ColumnType; - time_achieved: ColumnType; + time_achieved: ColumnType; - rank: ColumnType; + rank: ColumnType; } export type ChartLeaderboard = Selectable; diff --git a/typescript/db/src/generated/public/ChartVersion.ts b/typescript/db/src/generated/public/ChartVersion.ts index ba6549ab1..6c81acc7f 100644 --- a/typescript/db/src/generated/public/ChartVersion.ts +++ b/typescript/db/src/generated/public/ChartVersion.ts @@ -1,17 +1,17 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { chart_id } from "./Chart"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { chart_id } from './Chart'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.chart_version */ export type chart_version_version = string; /** Represents the table public.chart_version */ export default interface ChartVersionTable { - chart_id: ColumnType; + chart_id: ColumnType; - version: ColumnType; + version: ColumnType; } export type ChartVersion = Selectable; diff --git a/typescript/db/src/generated/public/ClassAchievement.ts b/typescript/db/src/generated/public/ClassAchievement.ts index 11f67e881..6eaa81ac8 100644 --- a/typescript/db/src/generated/public/ClassAchievement.ts +++ b/typescript/db/src/generated/public/ClassAchievement.ts @@ -1,32 +1,28 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as Game } from "./Game"; -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { default as Game } from './Game'; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.class_achievement */ export type class_achievement_row_id = string; /** Represents the table public.class_achievement */ export default interface ClassAchievementTable { - row_id: ColumnType< - class_achievement_row_id, - class_achievement_row_id | undefined, - class_achievement_row_id - >; + row_id: ColumnType; - game: ColumnType; + game: ColumnType; - user_id: ColumnType; + user_id: ColumnType; - class_set: ColumnType; + class_set: ColumnType; - class_prev_value: ColumnType; + class_prev_value: ColumnType; - class_value: ColumnType; + class_value: ColumnType; - timestamp: ColumnType; + timestamp: ColumnType; } export type ClassAchievement = Selectable; diff --git a/typescript/db/src/generated/public/CronTask.ts b/typescript/db/src/generated/public/CronTask.ts index 6c0b2db1f..31083429a 100644 --- a/typescript/db/src/generated/public/CronTask.ts +++ b/typescript/db/src/generated/public/CronTask.ts @@ -1,24 +1,24 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.cron_task */ export type cron_task_id = string; /** Represents the table public.cron_task */ export default interface CronTaskTable { - id: ColumnType; + id: ColumnType; - schedule: ColumnType; + schedule: ColumnType; - description: ColumnType; + description: ColumnType; - created_at: ColumnType; + created_at: ColumnType; - updated_at: ColumnType; + updated_at: ColumnType; - last_scheduled_at: ColumnType; + last_scheduled_at: ColumnType; } export type CronTask = Selectable; diff --git a/typescript/db/src/generated/public/CronTaskExecution.ts b/typescript/db/src/generated/public/CronTaskExecution.ts index 077ac5aca..19b232dd9 100644 --- a/typescript/db/src/generated/public/CronTaskExecution.ts +++ b/typescript/db/src/generated/public/CronTaskExecution.ts @@ -1,32 +1,28 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.cron_task_execution */ export type cron_task_execution_id = number; /** Represents the table public.cron_task_execution */ export default interface CronTaskExecutionTable { - id: ColumnType< - cron_task_execution_id, - cron_task_execution_id | undefined, - cron_task_execution_id - >; + id: ColumnType; - task_id: ColumnType; + task_id: ColumnType; - scheduled_at: ColumnType; + scheduled_at: ColumnType; - started_at: ColumnType; + started_at: ColumnType; - completed_at: ColumnType; + completed_at: ColumnType; - status: ColumnType; + status: ColumnType; - output: ColumnType; + output: ColumnType; - error: ColumnType; + error: ColumnType; } export type CronTaskExecution = Selectable; diff --git a/typescript/db/src/generated/public/Folder.ts b/typescript/db/src/generated/public/Folder.ts index 2c374594e..d1812a81d 100644 --- a/typescript/db/src/generated/public/Folder.ts +++ b/typescript/db/src/generated/public/Folder.ts @@ -1,27 +1,27 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as Game } from "./Game"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { default as Game } from './Game'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.folder */ export type folder_id = string; /** Represents the table public.folder */ export default interface FolderTable { - id: ColumnType; + id: ColumnType; - legacy_id: ColumnType; + legacy_id: ColumnType; - game: ColumnType; + game: ColumnType; - inactive: ColumnType; + inactive: ColumnType; - title: ColumnType; + title: ColumnType; - slug: ColumnType; + slug: ColumnType; - query: ColumnType; + query: ColumnType; } export type Folder = Selectable; diff --git a/typescript/db/src/generated/public/FolderSearchTerm.ts b/typescript/db/src/generated/public/FolderSearchTerm.ts index 4f284eb0a..4f42c98f4 100644 --- a/typescript/db/src/generated/public/FolderSearchTerm.ts +++ b/typescript/db/src/generated/public/FolderSearchTerm.ts @@ -1,21 +1,17 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { folder_id } from "./Folder"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { folder_id } from './Folder'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.folder_search_term */ export type folder_search_term_search_term = string; /** Represents the table public.folder_search_term */ export default interface FolderSearchTermTable { - id: ColumnType; + id: ColumnType; - search_term: ColumnType< - folder_search_term_search_term, - folder_search_term_search_term, - folder_search_term_search_term - >; + search_term: ColumnType; } export type FolderSearchTerm = Selectable; diff --git a/typescript/db/src/generated/public/FolderView.ts b/typescript/db/src/generated/public/FolderView.ts index a03e10b67..abcba228d 100644 --- a/typescript/db/src/generated/public/FolderView.ts +++ b/typescript/db/src/generated/public/FolderView.ts @@ -1,17 +1,17 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { folder_id } from "./Folder"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { folder_id } from './Folder'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Represents the table public.folder_view */ export default interface FolderViewTable { - user_id: ColumnType; + user_id: ColumnType; - folder_id: ColumnType; + folder_id: ColumnType; - last_viewed: ColumnType; + last_viewed: ColumnType; } export type FolderView = Selectable; diff --git a/typescript/db/src/generated/public/Game.ts b/typescript/db/src/generated/public/Game.ts index 88e160d77..96584dd99 100644 --- a/typescript/db/src/generated/public/Game.ts +++ b/typescript/db/src/generated/public/Game.ts @@ -2,29 +2,29 @@ // This file is automatically generated by Kanel. Do not modify manually. /** Represents the enum public.game */ -type Game = - | "iidx-sp" - | "iidx-dp" - | "museca" - | "sdvx" - | "bms-14k" - | "bms-7k" - | "gitadora-dora" - | "gitadora-gita" - | "chunithm" - | "wacca" - | "jubeat" - | "popn" - | "maimai" - | "maimaidx" - | "pms-controller" - | "pms-keyboard" - | "usc-controller" - | "usc-keyboard" - | "itg-stamina" - | "arcaea" - | "ongeki" - | "ddr-sp" - | "ddr-dp"; +type Game = + | 'iidx-sp' + | 'iidx-dp' + | 'museca' + | 'sdvx' + | 'bms-14k' + | 'bms-7k' + | 'gitadora-dora' + | 'gitadora-gita' + | 'chunithm' + | 'wacca' + | 'jubeat' + | 'popn' + | 'maimai' + | 'maimaidx' + | 'pms-controller' + | 'pms-keyboard' + | 'usc-controller' + | 'usc-keyboard' + | 'itg-stamina' + | 'arcaea' + | 'ongeki' + | 'ddr-sp' + | 'ddr-dp'; export default Game; diff --git a/typescript/db/src/generated/public/GameGroup.ts b/typescript/db/src/generated/public/GameGroup.ts index dc570a4d2..e5c8b91c5 100644 --- a/typescript/db/src/generated/public/GameGroup.ts +++ b/typescript/db/src/generated/public/GameGroup.ts @@ -2,23 +2,23 @@ // This file is automatically generated by Kanel. Do not modify manually. /** Represents the enum public.game_group */ -type GameGroup = - | "iidx" - | "museca" - | "chunithm" - | "bms" - | "gitadora" - | "jubeat" - | "maimai" - | "maimaidx" - | "popn" - | "sdvx" - | "usc" - | "wacca" - | "pms" - | "itg" - | "arcaea" - | "ongeki" - | "ddr"; +type GameGroup = + | 'iidx' + | 'museca' + | 'chunithm' + | 'bms' + | 'gitadora' + | 'jubeat' + | 'maimai' + | 'maimaidx' + | 'popn' + | 'sdvx' + | 'usc' + | 'wacca' + | 'pms' + | 'itg' + | 'arcaea' + | 'ongeki' + | 'ddr'; export default GameGroup; diff --git a/typescript/db/src/generated/public/GameRival.ts b/typescript/db/src/generated/public/GameRival.ts index 835db1e85..5d349b23a 100644 --- a/typescript/db/src/generated/public/GameRival.ts +++ b/typescript/db/src/generated/public/GameRival.ts @@ -1,20 +1,20 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as Game } from "./Game"; -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { default as Game } from './Game'; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.game_rival */ export type game_rival_game = Game; /** Represents the table public.game_rival */ export default interface GameRivalTable { - user_id: ColumnType; + user_id: ColumnType; - game: ColumnType; + game: ColumnType; - rival: ColumnType; + rival: ColumnType; } export type GameRival = Selectable; diff --git a/typescript/db/src/generated/public/GameSettings.ts b/typescript/db/src/generated/public/GameSettings.ts index 7752a6561..19c4a229a 100644 --- a/typescript/db/src/generated/public/GameSettings.ts +++ b/typescript/db/src/generated/public/GameSettings.ts @@ -1,32 +1,32 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as Game } from "./Game"; -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { default as Game } from './Game'; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.game_settings */ export type game_settings_game = Game; /** Represents the table public.game_settings */ export default interface GameSettingsTable { - user_id: ColumnType; + user_id: ColumnType; - game: ColumnType; + game: ColumnType; - pf_preferred_score_alg: ColumnType; + pf_preferred_score_alg: ColumnType; - pf_preferred_session_alg: ColumnType; + pf_preferred_session_alg: ColumnType; - pf_preferred_profile_alg: ColumnType; + pf_preferred_profile_alg: ColumnType; - pf_preferred_default_enum: ColumnType; + pf_preferred_default_enum: ColumnType; - pf_default_table: ColumnType; + pf_default_table: ColumnType; - pf_preferred_ranking: ColumnType; + pf_preferred_ranking: ColumnType; - data: ColumnType; + data: ColumnType; } export type GameSettings = Selectable; diff --git a/typescript/db/src/generated/public/GameSettingsShowcase.ts b/typescript/db/src/generated/public/GameSettingsShowcase.ts index b767c9845..33e9f482f 100644 --- a/typescript/db/src/generated/public/GameSettingsShowcase.ts +++ b/typescript/db/src/generated/public/GameSettingsShowcase.ts @@ -1,24 +1,20 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as Game } from "./Game"; -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { default as Game } from './Game'; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.game_settings_showcase */ export type game_settings_showcase_game = Game; /** Represents the table public.game_settings_showcase */ export default interface GameSettingsShowcaseTable { - user_id: ColumnType; + user_id: ColumnType; - game: ColumnType< - game_settings_showcase_game, - game_settings_showcase_game, - game_settings_showcase_game - >; + game: ColumnType; - data: ColumnType; + data: ColumnType; } export type GameSettingsShowcase = Selectable; diff --git a/typescript/db/src/generated/public/GameStats.ts b/typescript/db/src/generated/public/GameStats.ts index 366b0ef32..3301ce89b 100644 --- a/typescript/db/src/generated/public/GameStats.ts +++ b/typescript/db/src/generated/public/GameStats.ts @@ -1,22 +1,22 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as Game } from "./Game"; -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { default as Game } from './Game'; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.game_stats */ export type game_stats_game = Game; /** Represents the table public.game_stats */ export default interface GameStatsTable { - user_id: ColumnType; + user_id: ColumnType; - game: ColumnType; + game: ColumnType; - ratings: ColumnType; + ratings: ColumnType; - classes: ColumnType; + classes: ColumnType; } export type GameStats = Selectable; diff --git a/typescript/db/src/generated/public/GameStatsSnapshot.ts b/typescript/db/src/generated/public/GameStatsSnapshot.ts index 425650c6e..579a8e336 100644 --- a/typescript/db/src/generated/public/GameStatsSnapshot.ts +++ b/typescript/db/src/generated/public/GameStatsSnapshot.ts @@ -1,9 +1,9 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as Game } from "./Game"; -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { default as Game } from './Game'; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.game_stats_snapshot */ export type game_stats_snapshot_game = Game; @@ -13,23 +13,19 @@ export type game_stats_snapshot_timestamp = string; /** Represents the table public.game_stats_snapshot */ export default interface GameStatsSnapshotTable { - user_id: ColumnType; + user_id: ColumnType; - game: ColumnType; + game: ColumnType; - timestamp: ColumnType< - game_stats_snapshot_timestamp, - game_stats_snapshot_timestamp, - game_stats_snapshot_timestamp - >; + timestamp: ColumnType; - playcount: ColumnType; + playcount: ColumnType; - ratings: ColumnType; + ratings: ColumnType; - classes: ColumnType; + classes: ColumnType; - rankings: ColumnType; + rankings: ColumnType; } export type GameStatsSnapshot = Selectable; diff --git a/typescript/db/src/generated/public/Goal.ts b/typescript/db/src/generated/public/Goal.ts index 5f05d8bc5..119e29881 100644 --- a/typescript/db/src/generated/public/Goal.ts +++ b/typescript/db/src/generated/public/Goal.ts @@ -1,23 +1,23 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as Game } from "./Game"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { default as Game } from './Game'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.goal */ export type goal_id = string; /** Represents the table public.goal */ export default interface GoalTable { - id: ColumnType; + id: ColumnType; - game: ColumnType; + game: ColumnType; - name: ColumnType; + name: ColumnType; - charts: ColumnType; + charts: ColumnType; - criteria: ColumnType; + criteria: ColumnType; } export type Goal = Selectable; diff --git a/typescript/db/src/generated/public/GoalSub.ts b/typescript/db/src/generated/public/GoalSub.ts index 7b25ca413..8d27d3798 100644 --- a/typescript/db/src/generated/public/GoalSub.ts +++ b/typescript/db/src/generated/public/GoalSub.ts @@ -1,33 +1,33 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { goal_id } from "./Goal"; -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { goal_id } from './Goal'; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Represents the table public.goal_sub */ export default interface GoalSubTable { - goal_id: ColumnType; + goal_id: ColumnType; - user_id: ColumnType; + user_id: ColumnType; - last_interaction: ColumnType; + last_interaction: ColumnType; - progress: ColumnType; + progress: ColumnType; - progress_human: ColumnType; + progress_human: ColumnType; - out_of: ColumnType; + out_of: ColumnType; - out_of_human: ColumnType; + out_of_human: ColumnType; - achieved: ColumnType; + achieved: ColumnType; - time_achieved: ColumnType; + time_achieved: ColumnType; - was_instantly_achieved: ColumnType; + was_instantly_achieved: ColumnType; - was_assigned_standalone: ColumnType; + was_assigned_standalone: ColumnType; } export type GoalSub = Selectable; diff --git a/typescript/db/src/generated/public/Import.ts b/typescript/db/src/generated/public/Import.ts index e8e1bb7bd..6d670d408 100644 --- a/typescript/db/src/generated/public/Import.ts +++ b/typescript/db/src/generated/public/Import.ts @@ -1,31 +1,31 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { default as GameGroup } from "./GameGroup"; -import type { default as ImportType } from "./ImportType"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { default as GameGroup } from './GameGroup'; +import type { default as ImportType } from './ImportType'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.import */ export type import_id = string; /** Represents the table public.import */ export default interface ImportTable { - id: ColumnType; + id: ColumnType; - user_id: ColumnType; + user_id: ColumnType; - time_started: ColumnType; + time_started: ColumnType; - time_finished: ColumnType; + time_finished: ColumnType; - game_group: ColumnType; + game_group: ColumnType; - import_type: ColumnType; + import_type: ColumnType; - user_intent: ColumnType; + user_intent: ColumnType; - service: ColumnType; + service: ColumnType; } export type Import = Selectable; diff --git a/typescript/db/src/generated/public/ImportClass.ts b/typescript/db/src/generated/public/ImportClass.ts index 7ed4dc2f6..1332b95f9 100644 --- a/typescript/db/src/generated/public/ImportClass.ts +++ b/typescript/db/src/generated/public/ImportClass.ts @@ -1,26 +1,26 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { import_id } from "./Import"; -import type { default as Game } from "./Game"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { import_id } from './Import'; +import type { default as Game } from './Game'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.import_class */ export type import_class_row_id = string; /** Represents the table public.import_class */ export default interface ImportClassTable { - row_id: ColumnType; + row_id: ColumnType; - import_id: ColumnType; + import_id: ColumnType; - game: ColumnType; + game: ColumnType; - set: ColumnType; + set: ColumnType; - prev: ColumnType; + prev: ColumnType; - "new": ColumnType; + 'new': ColumnType; } export type ImportClass = Selectable; diff --git a/typescript/db/src/generated/public/ImportError.ts b/typescript/db/src/generated/public/ImportError.ts index 7ea7ba78e..e844d7ee7 100644 --- a/typescript/db/src/generated/public/ImportError.ts +++ b/typescript/db/src/generated/public/ImportError.ts @@ -1,21 +1,21 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { import_id } from "./Import"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { import_id } from './Import'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.import_error */ export type import_error_row_id = string; /** Represents the table public.import_error */ export default interface ImportErrorTable { - row_id: ColumnType; + row_id: ColumnType; - import_id: ColumnType; + import_id: ColumnType; - type: ColumnType; + type: ColumnType; - message: ColumnType; + message: ColumnType; } export type ImportError = Selectable; diff --git a/typescript/db/src/generated/public/ImportGame.ts b/typescript/db/src/generated/public/ImportGame.ts index 92b42b97a..b3960671c 100644 --- a/typescript/db/src/generated/public/ImportGame.ts +++ b/typescript/db/src/generated/public/ImportGame.ts @@ -1,18 +1,18 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as Game } from "./Game"; -import type { import_id } from "./Import"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { default as Game } from './Game'; +import type { import_id } from './Import'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.import_game */ export type import_game_game = Game; /** Represents the table public.import_game */ export default interface ImportGameTable { - id: ColumnType; + id: ColumnType; - game: ColumnType; + game: ColumnType; } export type ImportGame = Selectable; diff --git a/typescript/db/src/generated/public/ImportGoal.ts b/typescript/db/src/generated/public/ImportGoal.ts index e38f6e1a8..7264d7478 100644 --- a/typescript/db/src/generated/public/ImportGoal.ts +++ b/typescript/db/src/generated/public/ImportGoal.ts @@ -1,40 +1,40 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { import_id } from "./Import"; -import type { goal_id } from "./Goal"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { import_id } from './Import'; +import type { goal_id } from './Goal'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.import_goal */ export type import_goal_row_id = string; /** Represents the table public.import_goal */ export default interface ImportGoalTable { - row_id: ColumnType; + row_id: ColumnType; - import_id: ColumnType; + import_id: ColumnType; - goal_id: ColumnType; + goal_id: ColumnType; - prev_achieved: ColumnType; + prev_achieved: ColumnType; - prev_out_of: ColumnType; + prev_out_of: ColumnType; - prev_out_of_human: ColumnType; + prev_out_of_human: ColumnType; - prev_progress: ColumnType; + prev_progress: ColumnType; - prev_progress_human: ColumnType; + prev_progress_human: ColumnType; - new_achieved: ColumnType; + new_achieved: ColumnType; - new_out_of: ColumnType; + new_out_of: ColumnType; - new_out_of_human: ColumnType; + new_out_of_human: ColumnType; - new_progress: ColumnType; + new_progress: ColumnType; - new_progress_human: ColumnType; + new_progress_human: ColumnType; } export type ImportGoal = Selectable; diff --git a/typescript/db/src/generated/public/ImportLock.ts b/typescript/db/src/generated/public/ImportLock.ts index 79b157ebc..e76a00bed 100644 --- a/typescript/db/src/generated/public/ImportLock.ts +++ b/typescript/db/src/generated/public/ImportLock.ts @@ -1,16 +1,16 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Represents the table public.import_lock */ export default interface ImportLockTable { - user_id: ColumnType; + user_id: ColumnType; - locked: ColumnType; + locked: ColumnType; - locked_at: ColumnType; + locked_at: ColumnType; } export type ImportLock = Selectable; diff --git a/typescript/db/src/generated/public/ImportQuest.ts b/typescript/db/src/generated/public/ImportQuest.ts index 1cc67bdfd..eded4ae61 100644 --- a/typescript/db/src/generated/public/ImportQuest.ts +++ b/typescript/db/src/generated/public/ImportQuest.ts @@ -1,28 +1,28 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { import_id } from "./Import"; -import type { quest_id } from "./Quest"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { import_id } from './Import'; +import type { quest_id } from './Quest'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.import_quest */ export type import_quest_row_id = string; /** Represents the table public.import_quest */ export default interface ImportQuestTable { - row_id: ColumnType; + row_id: ColumnType; - import_id: ColumnType; + import_id: ColumnType; - quest_id: ColumnType; + quest_id: ColumnType; - prev_achieved: ColumnType; + prev_achieved: ColumnType; - prev_progress: ColumnType; + prev_progress: ColumnType; - new_achieved: ColumnType; + new_achieved: ColumnType; - new_progress: ColumnType; + new_progress: ColumnType; } export type ImportQuest = Selectable; diff --git a/typescript/db/src/generated/public/ImportSession.ts b/typescript/db/src/generated/public/ImportSession.ts index 9b4d05c26..8c319d03b 100644 --- a/typescript/db/src/generated/public/ImportSession.ts +++ b/typescript/db/src/generated/public/ImportSession.ts @@ -1,26 +1,22 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { import_id } from "./Import"; -import type { session_id } from "./Session"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { import_id } from './Import'; +import type { session_id } from './Session'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.import_session */ export type import_session_row_id = string; /** Represents the table public.import_session */ export default interface ImportSessionTable { - row_id: ColumnType< - import_session_row_id, - import_session_row_id | undefined, - import_session_row_id - >; + row_id: ColumnType; - import_id: ColumnType; + import_id: ColumnType; - session_id: ColumnType; + session_id: ColumnType; - type: ColumnType; + type: ColumnType; } export type ImportSession = Selectable; diff --git a/typescript/db/src/generated/public/ImportTiming.ts b/typescript/db/src/generated/public/ImportTiming.ts index 950352090..a02605a3c 100644 --- a/typescript/db/src/generated/public/ImportTiming.ts +++ b/typescript/db/src/generated/public/ImportTiming.ts @@ -1,40 +1,40 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { import_id } from "./Import"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { import_id } from './Import'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Represents the table public.import_timing */ export default interface ImportTimingTable { - id: ColumnType; + id: ColumnType; - timestamp: ColumnType; + timestamp: ColumnType; - import_secs_avg: ColumnType; + import_secs_avg: ColumnType; - import_parse_secs_avg: ColumnType; + import_parse_secs_avg: ColumnType; - pb_secs_avg: ColumnType; + pb_secs_avg: ColumnType; - session_secs_avg: ColumnType; + session_secs_avg: ColumnType; - parse_secs: ColumnType; + parse_secs: ColumnType; - import_secs: ColumnType; + import_secs: ColumnType; - import_parse_secs: ColumnType; + import_parse_secs: ColumnType; - session_secs: ColumnType; + session_secs: ColumnType; - pb_secs: ColumnType; + pb_secs: ColumnType; - ugs_secs: ColumnType; + ugs_secs: ColumnType; - goal_secs: ColumnType; + goal_secs: ColumnType; - quest_secs: ColumnType; + quest_secs: ColumnType; - total_secs: ColumnType; + total_secs: ColumnType; } export type ImportTiming = Selectable; diff --git a/typescript/db/src/generated/public/ImportTracker.ts b/typescript/db/src/generated/public/ImportTracker.ts index 1a53c637c..ea6ba39fb 100644 --- a/typescript/db/src/generated/public/ImportTracker.ts +++ b/typescript/db/src/generated/public/ImportTracker.ts @@ -1,30 +1,26 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { default as ImportType } from "./ImportType"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { default as ImportType } from './ImportType'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.import_tracker */ export type import_tracker_import_id = string; /** Represents the table public.import_tracker */ export default interface ImportTrackerTable { - import_id: ColumnType< - import_tracker_import_id, - import_tracker_import_id, - import_tracker_import_id - >; + import_id: ColumnType; - user_id: ColumnType; + user_id: ColumnType; - import_type: ColumnType; + import_type: ColumnType; - user_intent: ColumnType; + user_intent: ColumnType; - time_started: ColumnType; + time_started: ColumnType; - error: ColumnType; + error: ColumnType; } export type ImportTracker = Selectable; diff --git a/typescript/db/src/generated/public/ImportType.ts b/typescript/db/src/generated/public/ImportType.ts index dd7d269f5..27d13eb1b 100644 --- a/typescript/db/src/generated/public/ImportType.ts +++ b/typescript/db/src/generated/public/ImportType.ts @@ -2,46 +2,46 @@ // This file is automatically generated by Kanel. Do not modify manually. /** Represents the enum public.import_type */ -type ImportType = - | "file/batch-manual" - | "file/eamusement-iidx-csv" - | "file/eamusement-sdvx-csv" - | "file/mypagescraper-player-csv" - | "file/mypagescraper-records-csv" - | "file/pli-iidx-csv" - | "file/solid-state-squad" - | "api/arc-iidx" - | "api/arc-sdvx" - | "api/mer-iidx" - | "api/eag-iidx" - | "api/eag-sdvx" - | "api/flo-iidx" - | "api/flo-sdvx" - | "api/min-sdvx" - | "api/myt-chunithm" - | "api/myt-maimaidx" - | "api/myt-ongeki" - | "api/myt-wacca" - | "api/cg-dev-jubeat" - | "api/cg-dev-museca" - | "api/cg-dev-popn" - | "api/cg-dev-sdvx" - | "api/cg-gan-jubeat" - | "api/cg-gan-museca" - | "api/cg-gan-popn" - | "api/cg-gan-sdvx" - | "api/cg-nag-jubeat" - | "api/cg-nag-museca" - | "api/cg-nag-popn" - | "api/cg-nag-sdvx" - | "ir/barbatos" - | "ir/beatoraja" - | "ir/direct-manual" - | "ir/fervidex-static" - | "ir/fervidex" - | "ir/kshook-sv6c-static" - | "ir/kshook-sv6c" - | "ir/lr2hook" - | "ir/usc"; +type ImportType = + | 'file/batch-manual' + | 'file/eamusement-iidx-csv' + | 'file/eamusement-sdvx-csv' + | 'file/mypagescraper-player-csv' + | 'file/mypagescraper-records-csv' + | 'file/pli-iidx-csv' + | 'file/solid-state-squad' + | 'api/arc-iidx' + | 'api/arc-sdvx' + | 'api/mer-iidx' + | 'api/eag-iidx' + | 'api/eag-sdvx' + | 'api/flo-iidx' + | 'api/flo-sdvx' + | 'api/min-sdvx' + | 'api/myt-chunithm' + | 'api/myt-maimaidx' + | 'api/myt-ongeki' + | 'api/myt-wacca' + | 'api/cg-dev-jubeat' + | 'api/cg-dev-museca' + | 'api/cg-dev-popn' + | 'api/cg-dev-sdvx' + | 'api/cg-gan-jubeat' + | 'api/cg-gan-museca' + | 'api/cg-gan-popn' + | 'api/cg-gan-sdvx' + | 'api/cg-nag-jubeat' + | 'api/cg-nag-museca' + | 'api/cg-nag-popn' + | 'api/cg-nag-sdvx' + | 'ir/barbatos' + | 'ir/beatoraja' + | 'ir/direct-manual' + | 'ir/fervidex-static' + | 'ir/fervidex' + | 'ir/kshook-sv6c-static' + | 'ir/kshook-sv6c' + | 'ir/lr2hook' + | 'ir/usc'; export default ImportType; diff --git a/typescript/db/src/generated/public/InviteLock.ts b/typescript/db/src/generated/public/InviteLock.ts index aaba9ff9c..cf9f7f20d 100644 --- a/typescript/db/src/generated/public/InviteLock.ts +++ b/typescript/db/src/generated/public/InviteLock.ts @@ -1,16 +1,16 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Represents the table public.invite_lock */ export default interface InviteLockTable { - user_id: ColumnType; + user_id: ColumnType; - locked: ColumnType; + locked: ColumnType; - locked_at: ColumnType; + locked_at: ColumnType; } export type InviteLock = Selectable; diff --git a/typescript/db/src/generated/public/JobQueue.ts b/typescript/db/src/generated/public/JobQueue.ts index 954ec6eba..d2f208e37 100644 --- a/typescript/db/src/generated/public/JobQueue.ts +++ b/typescript/db/src/generated/public/JobQueue.ts @@ -1,30 +1,30 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.job_queue */ export type job_queue_row_id = string; /** Represents the table public.job_queue */ export default interface JobQueueTable { - row_id: ColumnType; + row_id: ColumnType; - created_at: ColumnType; + created_at: ColumnType; - updated_at: ColumnType; + updated_at: ColumnType; - scheduled_for: ColumnType; + scheduled_for: ColumnType; - failed_attempts: ColumnType; + failed_attempts: ColumnType; - status: ColumnType; + status: ColumnType; - scope: ColumnType; + scope: ColumnType; - job_kind: ColumnType; + job_kind: ColumnType; - payload: ColumnType; + payload: ColumnType; } export type JobQueue = Selectable; diff --git a/typescript/db/src/generated/public/Migration.ts b/typescript/db/src/generated/public/Migration.ts index 7a4dd594c..29b48277a 100644 --- a/typescript/db/src/generated/public/Migration.ts +++ b/typescript/db/src/generated/public/Migration.ts @@ -1,21 +1,21 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Represents the table public._migration */ export default interface MigrationTable { - version: ColumnType; + version: ColumnType; - description: ColumnType; + description: ColumnType; - installed_on: ColumnType; + installed_on: ColumnType; - success: ColumnType; + success: ColumnType; - checksum: ColumnType; + checksum: ColumnType; - execution_time: ColumnType; + execution_time: ColumnType; } export type Migration = Selectable; diff --git a/typescript/db/src/generated/public/Notification.ts b/typescript/db/src/generated/public/Notification.ts index a6c75713e..1b73ace84 100644 --- a/typescript/db/src/generated/public/Notification.ts +++ b/typescript/db/src/generated/public/Notification.ts @@ -1,27 +1,27 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.notification */ export type notification_row_id = string; /** Represents the table public.notification */ export default interface NotificationTable { - row_id: ColumnType; + row_id: ColumnType; - title: ColumnType; + title: ColumnType; - sent_to: ColumnType; + sent_to: ColumnType; - sent_at: ColumnType; + sent_at: ColumnType; - read: ColumnType; + read: ColumnType; - kind: ColumnType; + kind: ColumnType; - payload: ColumnType; + payload: ColumnType; } export type Notification = Selectable; diff --git a/typescript/db/src/generated/public/OrphanChart.ts b/typescript/db/src/generated/public/OrphanChart.ts index d1d9ce0c3..c6359f702 100644 --- a/typescript/db/src/generated/public/OrphanChart.ts +++ b/typescript/db/src/generated/public/OrphanChart.ts @@ -1,21 +1,21 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as Game } from "./Game"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { default as Game } from './Game'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.orphan_chart */ export type orphan_chart_id = string; /** Represents the table public.orphan_chart */ export default interface OrphanChartTable { - id: ColumnType; + id: ColumnType; - game: ColumnType; + game: ColumnType; - chart_doc: ColumnType; + chart_doc: ColumnType; - song_doc: ColumnType; + song_doc: ColumnType; } export type OrphanChart = Selectable; diff --git a/typescript/db/src/generated/public/OrphanChartUser.ts b/typescript/db/src/generated/public/OrphanChartUser.ts index a4e9a110a..0f79a3b3f 100644 --- a/typescript/db/src/generated/public/OrphanChartUser.ts +++ b/typescript/db/src/generated/public/OrphanChartUser.ts @@ -1,15 +1,15 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { orphan_chart_id } from "./OrphanChart"; -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { orphan_chart_id } from './OrphanChart'; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Represents the table public.orphan_chart_user */ export default interface OrphanChartUserTable { - orphan_chart_id: ColumnType; + orphan_chart_id: ColumnType; - user_id: ColumnType; + user_id: ColumnType; } export type OrphanChartUser = Selectable; diff --git a/typescript/db/src/generated/public/OrphanScore.ts b/typescript/db/src/generated/public/OrphanScore.ts index 8f33d08fd..22960eb06 100644 --- a/typescript/db/src/generated/public/OrphanScore.ts +++ b/typescript/db/src/generated/public/OrphanScore.ts @@ -1,28 +1,28 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { import_id } from "./Import"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { import_id } from './Import'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.orphan_score */ export type orphan_score_row_id = string; /** Represents the table public.orphan_score */ export default interface OrphanScoreTable { - row_id: ColumnType; + row_id: ColumnType; - user_id: ColumnType; + user_id: ColumnType; - import_id: ColumnType; + import_id: ColumnType; - data: ColumnType; + data: ColumnType; - context: ColumnType; + context: ColumnType; - time_inserted: ColumnType; + time_inserted: ColumnType; - error_message: ColumnType; + error_message: ColumnType; } export type OrphanScore = Selectable; diff --git a/typescript/db/src/generated/public/Pb.ts b/typescript/db/src/generated/public/Pb.ts index 1412f5fa8..3ae0bc75d 100644 --- a/typescript/db/src/generated/public/Pb.ts +++ b/typescript/db/src/generated/public/Pb.ts @@ -1,44 +1,44 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { chart_id } from "./Chart"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { chart_id } from './Chart'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.pb */ export type pb_row_id = string; /** Represents the table public.pb */ export default interface PbTable { - row_id: ColumnType; + row_id: ColumnType; - user_id: ColumnType; + user_id: ColumnType; - chart_id: ColumnType; + chart_id: ColumnType; - lens: ColumnType; + lens: ColumnType; - data: ColumnType; + data: ColumnType; - derived_data: ColumnType; + derived_data: ColumnType; - calculated_data: ColumnType; + calculated_data: ColumnType; - ranking_value: ColumnType; + ranking_value: ColumnType; - ranking_value_tb1: ColumnType; + ranking_value_tb1: ColumnType; - ranking_value_tb2: ColumnType; + ranking_value_tb2: ColumnType; - ranking_value_tb3: ColumnType; + ranking_value_tb3: ColumnType; - ranking_value_tb4: ColumnType; + ranking_value_tb4: ColumnType; - ranking_value_tb5: ColumnType; + ranking_value_tb5: ColumnType; - highlight: ColumnType; + highlight: ColumnType; - time_achieved: ColumnType; + time_achieved: ColumnType; } export type Pb = Selectable; diff --git a/typescript/db/src/generated/public/PbComposedFrom.ts b/typescript/db/src/generated/public/PbComposedFrom.ts index 1ec07bcf5..f6296961b 100644 --- a/typescript/db/src/generated/public/PbComposedFrom.ts +++ b/typescript/db/src/generated/public/PbComposedFrom.ts @@ -1,15 +1,15 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { pb_row_id } from "./Pb"; -import type { score_id } from "./Score"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { pb_row_id } from './Pb'; +import type { score_id } from './Score'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Represents the table public.pb_composed_from */ export default interface PbComposedFromTable { - pb_id: ColumnType; + pb_id: ColumnType; - score_id: ColumnType; + score_id: ColumnType; } export type PbComposedFrom = Selectable; diff --git a/typescript/db/src/generated/public/PrivAccountCredential.ts b/typescript/db/src/generated/public/PrivAccountCredential.ts index 7b95b4962..a92d42be6 100644 --- a/typescript/db/src/generated/public/PrivAccountCredential.ts +++ b/typescript/db/src/generated/public/PrivAccountCredential.ts @@ -1,16 +1,16 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Represents the table public.priv_account_credential */ export default interface PrivAccountCredentialTable { - user_id: ColumnType; + user_id: ColumnType; - password: ColumnType; + password: ColumnType; - email: ColumnType; + email: ColumnType; } export type PrivAccountCredential = Selectable; diff --git a/typescript/db/src/generated/public/PrivApiClient.ts b/typescript/db/src/generated/public/PrivApiClient.ts index 394e32a19..ad14019e7 100644 --- a/typescript/db/src/generated/public/PrivApiClient.ts +++ b/typescript/db/src/generated/public/PrivApiClient.ts @@ -1,45 +1,41 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.priv_api_client */ export type priv_api_client_client_id = string; /** Represents the table public.priv_api_client */ export default interface PrivApiClientTable { - client_id: ColumnType< - priv_api_client_client_id, - priv_api_client_client_id, - priv_api_client_client_id - >; + client_id: ColumnType; - client_secret: ColumnType; + client_secret: ColumnType; - name: ColumnType; + name: ColumnType; - author: ColumnType; + author: ColumnType; - pm_customise_profile: ColumnType; + pm_customise_profile: ColumnType; - pm_customise_score: ColumnType; + pm_customise_score: ColumnType; - pm_customise_session: ColumnType; + pm_customise_session: ColumnType; - pm_delete_score: ColumnType; + pm_delete_score: ColumnType; - pm_manage_rivals: ColumnType; + pm_manage_rivals: ColumnType; - pm_manage_targets: ColumnType; + pm_manage_targets: ColumnType; - pm_submit_score: ColumnType; + pm_submit_score: ColumnType; - pm_manage_challenges: ColumnType; + pm_manage_challenges: ColumnType; - api_key_template: ColumnType; + api_key_template: ColumnType; - api_key_filename: ColumnType; + api_key_filename: ColumnType; } export type PrivApiClient = Selectable; diff --git a/typescript/db/src/generated/public/PrivApiToken.ts b/typescript/db/src/generated/public/PrivApiToken.ts index 0784a862b..a45220b8b 100644 --- a/typescript/db/src/generated/public/PrivApiToken.ts +++ b/typescript/db/src/generated/public/PrivApiToken.ts @@ -1,42 +1,38 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { priv_api_client_client_id } from "./PrivApiClient"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { priv_api_client_client_id } from './PrivApiClient'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.priv_api_token */ export type priv_api_token_token = string; /** Represents the table public.priv_api_token */ export default interface PrivApiTokenTable { - token: ColumnType; + token: ColumnType; - user_id: ColumnType; + user_id: ColumnType; - identifier: ColumnType; + identifier: ColumnType; - pm_customise_profile: ColumnType; + pm_customise_profile: ColumnType; - pm_customise_score: ColumnType; + pm_customise_score: ColumnType; - pm_customise_session: ColumnType; + pm_customise_session: ColumnType; - pm_delete_score: ColumnType; + pm_delete_score: ColumnType; - pm_manage_rivals: ColumnType; + pm_manage_rivals: ColumnType; - pm_manage_targets: ColumnType; + pm_manage_targets: ColumnType; - pm_submit_score: ColumnType; + pm_submit_score: ColumnType; - pm_manage_challenges: ColumnType; + pm_manage_challenges: ColumnType; - from_oauth2_client: ColumnType< - priv_api_client_client_id | null, - priv_api_client_client_id | null, - priv_api_client_client_id | null - >; + from_oauth2_client: ColumnType; } export type PrivApiToken = Selectable; diff --git a/typescript/db/src/generated/public/PrivInvite.ts b/typescript/db/src/generated/public/PrivInvite.ts index 3cd4e2dfc..0171e0cc2 100644 --- a/typescript/db/src/generated/public/PrivInvite.ts +++ b/typescript/db/src/generated/public/PrivInvite.ts @@ -1,25 +1,25 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.priv_invite */ export type priv_invite_code = string; /** Represents the table public.priv_invite */ export default interface PrivInviteTable { - code: ColumnType; + code: ColumnType; - created_by: ColumnType; + created_by: ColumnType; - created_at: ColumnType; + created_at: ColumnType; - consumed: ColumnType; + consumed: ColumnType; - consumed_by: ColumnType; + consumed_by: ColumnType; - consumed_at: ColumnType; + consumed_at: ColumnType; } export type PrivInvite = Selectable; diff --git a/typescript/db/src/generated/public/PrivOauth2AuthToken.ts b/typescript/db/src/generated/public/PrivOauth2AuthToken.ts index 6e791f788..160846e65 100644 --- a/typescript/db/src/generated/public/PrivOauth2AuthToken.ts +++ b/typescript/db/src/generated/public/PrivOauth2AuthToken.ts @@ -1,23 +1,19 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.priv_oauth2_auth_token */ export type priv_oauth2_auth_token_token = string; /** Represents the table public.priv_oauth2_auth_token */ export default interface PrivOauth2AuthTokenTable { - token: ColumnType< - priv_oauth2_auth_token_token, - priv_oauth2_auth_token_token, - priv_oauth2_auth_token_token - >; + token: ColumnType; - created_on: ColumnType; + created_on: ColumnType; - user_id: ColumnType; + user_id: ColumnType; } export type PrivOauth2AuthToken = Selectable; diff --git a/typescript/db/src/generated/public/PrivPasswordResetToken.ts b/typescript/db/src/generated/public/PrivPasswordResetToken.ts index 6b6cc4609..ae9133345 100644 --- a/typescript/db/src/generated/public/PrivPasswordResetToken.ts +++ b/typescript/db/src/generated/public/PrivPasswordResetToken.ts @@ -1,23 +1,19 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.priv_password_reset_token */ export type priv_password_reset_token_token = string; /** Represents the table public.priv_password_reset_token */ export default interface PrivPasswordResetTokenTable { - token: ColumnType< - priv_password_reset_token_token, - priv_password_reset_token_token, - priv_password_reset_token_token - >; + token: ColumnType; - created_on: ColumnType; + created_on: ColumnType; - user_id: ColumnType; + user_id: ColumnType; } export type PrivPasswordResetToken = Selectable; diff --git a/typescript/db/src/generated/public/PrivSvcCgCardInfo.ts b/typescript/db/src/generated/public/PrivSvcCgCardInfo.ts index 3b7d16a17..5ccaadb62 100644 --- a/typescript/db/src/generated/public/PrivSvcCgCardInfo.ts +++ b/typescript/db/src/generated/public/PrivSvcCgCardInfo.ts @@ -1,25 +1,21 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.priv_svc_cg_card_info */ export type priv_svc_cg_card_info_service = string; /** Represents the table public.priv_svc_cg_card_info */ export default interface PrivSvcCgCardInfoTable { - user_id: ColumnType; + user_id: ColumnType; - service: ColumnType< - priv_svc_cg_card_info_service, - priv_svc_cg_card_info_service, - priv_svc_cg_card_info_service - >; + service: ColumnType; - card_id: ColumnType; + card_id: ColumnType; - pin: ColumnType; + pin: ColumnType; } export type PrivSvcCgCardInfo = Selectable; diff --git a/typescript/db/src/generated/public/PrivSvcFerCard.ts b/typescript/db/src/generated/public/PrivSvcFerCard.ts index fbf7d4918..2aaf0e082 100644 --- a/typescript/db/src/generated/public/PrivSvcFerCard.ts +++ b/typescript/db/src/generated/public/PrivSvcFerCard.ts @@ -1,21 +1,17 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.priv_svc_fer_card */ export type priv_svc_fer_card_card_id = string; /** Represents the table public.priv_svc_fer_card */ export default interface PrivSvcFerCardTable { - user_id: ColumnType; + user_id: ColumnType; - card_id: ColumnType< - priv_svc_fer_card_card_id, - priv_svc_fer_card_card_id, - priv_svc_fer_card_card_id - >; + card_id: ColumnType; } export type PrivSvcFerCard = Selectable; diff --git a/typescript/db/src/generated/public/PrivSvcKaiAuthToken.ts b/typescript/db/src/generated/public/PrivSvcKaiAuthToken.ts index 558a9018d..ee3e106bd 100644 --- a/typescript/db/src/generated/public/PrivSvcKaiAuthToken.ts +++ b/typescript/db/src/generated/public/PrivSvcKaiAuthToken.ts @@ -1,25 +1,21 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.priv_svc_kai_auth_token */ export type priv_svc_kai_auth_token_service = string; /** Represents the table public.priv_svc_kai_auth_token */ export default interface PrivSvcKaiAuthTokenTable { - user_id: ColumnType; + user_id: ColumnType; - service: ColumnType< - priv_svc_kai_auth_token_service, - priv_svc_kai_auth_token_service, - priv_svc_kai_auth_token_service - >; + service: ColumnType; - token: ColumnType; + token: ColumnType; - refresh_token: ColumnType; + refresh_token: ColumnType; } export type PrivSvcKaiAuthToken = Selectable; diff --git a/typescript/db/src/generated/public/PrivSvcMytCardInfo.ts b/typescript/db/src/generated/public/PrivSvcMytCardInfo.ts index ceae9f943..fd1a3d225 100644 --- a/typescript/db/src/generated/public/PrivSvcMytCardInfo.ts +++ b/typescript/db/src/generated/public/PrivSvcMytCardInfo.ts @@ -1,21 +1,17 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.priv_svc_myt_card_info */ export type priv_svc_myt_card_info_card_access_code = string; /** Represents the table public.priv_svc_myt_card_info */ export default interface PrivSvcMytCardInfoTable { - card_access_code: ColumnType< - priv_svc_myt_card_info_card_access_code, - priv_svc_myt_card_info_card_access_code, - priv_svc_myt_card_info_card_access_code - >; + card_access_code: ColumnType; - user_id: ColumnType; + user_id: ColumnType; } export type PrivSvcMytCardInfo = Selectable; diff --git a/typescript/db/src/generated/public/PrivVerifyEmailToken.ts b/typescript/db/src/generated/public/PrivVerifyEmailToken.ts index 6a3f07a5f..e008ce3f0 100644 --- a/typescript/db/src/generated/public/PrivVerifyEmailToken.ts +++ b/typescript/db/src/generated/public/PrivVerifyEmailToken.ts @@ -1,23 +1,19 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.priv_verify_email_token */ export type priv_verify_email_token_token = string; /** Represents the table public.priv_verify_email_token */ export default interface PrivVerifyEmailTokenTable { - token: ColumnType< - priv_verify_email_token_token, - priv_verify_email_token_token, - priv_verify_email_token_token - >; + token: ColumnType; - email: ColumnType; + email: ColumnType; - user_id: ColumnType; + user_id: ColumnType; } export type PrivVerifyEmailToken = Selectable; diff --git a/typescript/db/src/generated/public/PublicSchema.ts b/typescript/db/src/generated/public/PublicSchema.ts index edd25b1a5..85f12c20d 100644 --- a/typescript/db/src/generated/public/PublicSchema.ts +++ b/typescript/db/src/generated/public/PublicSchema.ts @@ -1,206 +1,206 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as PrivSvcCgCardInfoTable } from "./PrivSvcCgCardInfo"; -import type { default as ClassAchievementTable } from "./ClassAchievement"; -import type { default as AccountTable } from "./Account"; -import type { default as ImportTrackerTable } from "./ImportTracker"; -import type { default as SvcFerSettingsTable } from "./SvcFerSettings"; -import type { default as InviteLockTable } from "./InviteLock"; -import type { default as OrphanChartTable } from "./OrphanChart"; -import type { default as GameRivalTable } from "./GameRival"; -import type { default as GoalTable } from "./Goal"; -import type { default as GameSettingsTable } from "./GameSettings"; -import type { default as ImportQuestTable } from "./ImportQuest"; -import type { default as CronTaskExecutionTable } from "./CronTaskExecution"; -import type { default as NotificationTable } from "./Notification"; -import type { default as ImportLockTable } from "./ImportLock"; -import type { default as ScoreBlacklistTable } from "./ScoreBlacklist"; -import type { default as TableFolderTable } from "./TableFolder"; -import type { default as GameStatsTable } from "./GameStats"; -import type { default as PrivOauth2AuthTokenTable } from "./PrivOauth2AuthToken"; -import type { default as ImportSessionTable } from "./ImportSession"; -import type { default as PrivSvcFerCardTable } from "./PrivSvcFerCard"; -import type { default as PbComposedFromTable } from "./PbComposedFrom"; -import type { default as BmsCourseLookupTable } from "./BmsCourseLookup"; -import type { default as SongSearchTermTable } from "./SongSearchTerm"; -import type { default as ImportGameTable } from "./ImportGame"; -import type { default as ImportGoalTable } from "./ImportGoal"; -import type { default as OrphanChartUserTable } from "./OrphanChartUser"; -import type { default as PrivVerifyEmailTokenTable } from "./PrivVerifyEmailToken"; -import type { default as PrivInviteTable } from "./PrivInvite"; -import type { default as SessionTable } from "./Session"; -import type { default as PrivPasswordResetTokenTable } from "./PrivPasswordResetToken"; -import type { default as SongTable } from "./Song"; -import type { default as AccountUsernameChangeTable } from "./AccountUsernameChange"; -import type { default as MigrationTable } from "./Migration"; -import type { default as AccountBadgeTable } from "./AccountBadge"; -import type { default as ActionTable } from "./Action"; -import type { default as PrivSvcKaiAuthTokenTable } from "./PrivSvcKaiAuthToken"; -import type { default as ChartTable } from "./Chart"; -import type { default as GameSettingsShowcaseTable } from "./GameSettingsShowcase"; -import type { default as AccountFollowingTable } from "./AccountFollowing"; -import type { default as ImportTable } from "./Import"; -import type { default as FolderTable } from "./Folder"; -import type { default as PrivAccountCredentialTable } from "./PrivAccountCredential"; -import type { default as ScoreTable } from "./Score"; -import type { default as ImportTimingTable } from "./ImportTiming"; -import type { default as QuestSubTable } from "./QuestSub"; -import type { default as OrphanScoreTable } from "./OrphanScore"; -import type { default as FolderViewTable } from "./FolderView"; -import type { default as TableTable } from "./Table"; -import type { default as ChartVersionTable } from "./ChartVersion"; -import type { default as GoalSubTable } from "./GoalSub"; -import type { default as FolderSearchTermTable } from "./FolderSearchTerm"; -import type { default as JobQueueTable } from "./JobQueue"; -import type { default as PrivApiClientTable } from "./PrivApiClient"; -import type { default as PrivApiTokenTable } from "./PrivApiToken"; -import type { default as SvcKshookSv6cSettingsTable } from "./SvcKshookSv6cSettings"; -import type { default as ImportErrorTable } from "./ImportError"; -import type { default as QuestTable } from "./Quest"; -import type { default as AccountSettingsTable } from "./AccountSettings"; -import type { default as PbTable } from "./Pb"; -import type { default as PrivSvcMytCardInfoTable } from "./PrivSvcMytCardInfo"; -import type { default as QuestlineQuestTable } from "./QuestlineQuest"; -import type { default as QuestlineTable } from "./Questline"; -import type { default as CronTaskTable } from "./CronTask"; -import type { default as ImportClassTable } from "./ImportClass"; -import type { default as SongAltTitleTable } from "./SongAltTitle"; -import type { default as GameStatsSnapshotTable } from "./GameStatsSnapshot"; -import type { default as ChartLeaderboardTable } from "./ChartLeaderboard"; +import type { default as PrivSvcCgCardInfoTable } from './PrivSvcCgCardInfo'; +import type { default as ClassAchievementTable } from './ClassAchievement'; +import type { default as AccountTable } from './Account'; +import type { default as ImportTrackerTable } from './ImportTracker'; +import type { default as SvcFerSettingsTable } from './SvcFerSettings'; +import type { default as InviteLockTable } from './InviteLock'; +import type { default as OrphanChartTable } from './OrphanChart'; +import type { default as GameRivalTable } from './GameRival'; +import type { default as GoalTable } from './Goal'; +import type { default as GameSettingsTable } from './GameSettings'; +import type { default as ImportQuestTable } from './ImportQuest'; +import type { default as CronTaskExecutionTable } from './CronTaskExecution'; +import type { default as NotificationTable } from './Notification'; +import type { default as ImportLockTable } from './ImportLock'; +import type { default as ScoreBlacklistTable } from './ScoreBlacklist'; +import type { default as TableFolderTable } from './TableFolder'; +import type { default as GameStatsTable } from './GameStats'; +import type { default as PrivOauth2AuthTokenTable } from './PrivOauth2AuthToken'; +import type { default as ImportSessionTable } from './ImportSession'; +import type { default as PrivSvcFerCardTable } from './PrivSvcFerCard'; +import type { default as PbComposedFromTable } from './PbComposedFrom'; +import type { default as BmsCourseLookupTable } from './BmsCourseLookup'; +import type { default as SongSearchTermTable } from './SongSearchTerm'; +import type { default as ImportGameTable } from './ImportGame'; +import type { default as ImportGoalTable } from './ImportGoal'; +import type { default as OrphanChartUserTable } from './OrphanChartUser'; +import type { default as PrivVerifyEmailTokenTable } from './PrivVerifyEmailToken'; +import type { default as PrivInviteTable } from './PrivInvite'; +import type { default as SessionTable } from './Session'; +import type { default as PrivPasswordResetTokenTable } from './PrivPasswordResetToken'; +import type { default as SongTable } from './Song'; +import type { default as AccountUsernameChangeTable } from './AccountUsernameChange'; +import type { default as MigrationTable } from './Migration'; +import type { default as AccountBadgeTable } from './AccountBadge'; +import type { default as ActionTable } from './Action'; +import type { default as PrivSvcKaiAuthTokenTable } from './PrivSvcKaiAuthToken'; +import type { default as ChartTable } from './Chart'; +import type { default as GameSettingsShowcaseTable } from './GameSettingsShowcase'; +import type { default as AccountFollowingTable } from './AccountFollowing'; +import type { default as ImportTable } from './Import'; +import type { default as FolderTable } from './Folder'; +import type { default as PrivAccountCredentialTable } from './PrivAccountCredential'; +import type { default as ScoreTable } from './Score'; +import type { default as ImportTimingTable } from './ImportTiming'; +import type { default as QuestSubTable } from './QuestSub'; +import type { default as OrphanScoreTable } from './OrphanScore'; +import type { default as FolderViewTable } from './FolderView'; +import type { default as TableTable } from './Table'; +import type { default as ChartVersionTable } from './ChartVersion'; +import type { default as GoalSubTable } from './GoalSub'; +import type { default as FolderSearchTermTable } from './FolderSearchTerm'; +import type { default as JobQueueTable } from './JobQueue'; +import type { default as PrivApiClientTable } from './PrivApiClient'; +import type { default as PrivApiTokenTable } from './PrivApiToken'; +import type { default as SvcKshookSv6cSettingsTable } from './SvcKshookSv6cSettings'; +import type { default as ImportErrorTable } from './ImportError'; +import type { default as QuestTable } from './Quest'; +import type { default as AccountSettingsTable } from './AccountSettings'; +import type { default as PbTable } from './Pb'; +import type { default as PrivSvcMytCardInfoTable } from './PrivSvcMytCardInfo'; +import type { default as QuestlineQuestTable } from './QuestlineQuest'; +import type { default as QuestlineTable } from './Questline'; +import type { default as CronTaskTable } from './CronTask'; +import type { default as ImportClassTable } from './ImportClass'; +import type { default as SongAltTitleTable } from './SongAltTitle'; +import type { default as GameStatsSnapshotTable } from './GameStatsSnapshot'; +import type { default as ChartLeaderboardTable } from './ChartLeaderboard'; export default interface PublicSchema { - priv_svc_cg_card_info: PrivSvcCgCardInfoTable; + priv_svc_cg_card_info: PrivSvcCgCardInfoTable; - class_achievement: ClassAchievementTable; + class_achievement: ClassAchievementTable; - account: AccountTable; + account: AccountTable; - import_tracker: ImportTrackerTable; + import_tracker: ImportTrackerTable; - svc_fer_settings: SvcFerSettingsTable; + svc_fer_settings: SvcFerSettingsTable; - invite_lock: InviteLockTable; + invite_lock: InviteLockTable; - orphan_chart: OrphanChartTable; + orphan_chart: OrphanChartTable; - game_rival: GameRivalTable; + game_rival: GameRivalTable; - goal: GoalTable; + goal: GoalTable; - game_settings: GameSettingsTable; + game_settings: GameSettingsTable; - import_quest: ImportQuestTable; + import_quest: ImportQuestTable; - cron_task_execution: CronTaskExecutionTable; + cron_task_execution: CronTaskExecutionTable; - notification: NotificationTable; + notification: NotificationTable; - import_lock: ImportLockTable; + import_lock: ImportLockTable; - score_blacklist: ScoreBlacklistTable; + score_blacklist: ScoreBlacklistTable; - table_folder: TableFolderTable; + table_folder: TableFolderTable; - game_stats: GameStatsTable; + game_stats: GameStatsTable; - priv_oauth2_auth_token: PrivOauth2AuthTokenTable; + priv_oauth2_auth_token: PrivOauth2AuthTokenTable; - import_session: ImportSessionTable; + import_session: ImportSessionTable; - priv_svc_fer_card: PrivSvcFerCardTable; + priv_svc_fer_card: PrivSvcFerCardTable; - pb_composed_from: PbComposedFromTable; + pb_composed_from: PbComposedFromTable; - bms_course_lookup: BmsCourseLookupTable; + bms_course_lookup: BmsCourseLookupTable; - song_search_term: SongSearchTermTable; + song_search_term: SongSearchTermTable; - import_game: ImportGameTable; + import_game: ImportGameTable; - import_goal: ImportGoalTable; + import_goal: ImportGoalTable; - orphan_chart_user: OrphanChartUserTable; + orphan_chart_user: OrphanChartUserTable; - priv_verify_email_token: PrivVerifyEmailTokenTable; + priv_verify_email_token: PrivVerifyEmailTokenTable; - priv_invite: PrivInviteTable; + priv_invite: PrivInviteTable; - session: SessionTable; + session: SessionTable; - priv_password_reset_token: PrivPasswordResetTokenTable; + priv_password_reset_token: PrivPasswordResetTokenTable; - song: SongTable; + song: SongTable; - account_username_change: AccountUsernameChangeTable; + account_username_change: AccountUsernameChangeTable; - _migration: MigrationTable; + _migration: MigrationTable; - account_badge: AccountBadgeTable; + account_badge: AccountBadgeTable; - action: ActionTable; + action: ActionTable; - priv_svc_kai_auth_token: PrivSvcKaiAuthTokenTable; + priv_svc_kai_auth_token: PrivSvcKaiAuthTokenTable; - chart: ChartTable; + chart: ChartTable; - game_settings_showcase: GameSettingsShowcaseTable; + game_settings_showcase: GameSettingsShowcaseTable; - account_following: AccountFollowingTable; + account_following: AccountFollowingTable; - import: ImportTable; + 'import': ImportTable; - folder: FolderTable; + folder: FolderTable; - priv_account_credential: PrivAccountCredentialTable; + priv_account_credential: PrivAccountCredentialTable; - score: ScoreTable; + score: ScoreTable; - import_timing: ImportTimingTable; + import_timing: ImportTimingTable; - quest_sub: QuestSubTable; + quest_sub: QuestSubTable; - orphan_score: OrphanScoreTable; + orphan_score: OrphanScoreTable; - folder_view: FolderViewTable; + folder_view: FolderViewTable; - table: TableTable; + table: TableTable; - chart_version: ChartVersionTable; + chart_version: ChartVersionTable; - goal_sub: GoalSubTable; + goal_sub: GoalSubTable; - folder_search_term: FolderSearchTermTable; + folder_search_term: FolderSearchTermTable; - job_queue: JobQueueTable; + job_queue: JobQueueTable; - priv_api_client: PrivApiClientTable; + priv_api_client: PrivApiClientTable; - priv_api_token: PrivApiTokenTable; + priv_api_token: PrivApiTokenTable; - svc_kshook_sv6c_settings: SvcKshookSv6cSettingsTable; + svc_kshook_sv6c_settings: SvcKshookSv6cSettingsTable; - import_error: ImportErrorTable; + import_error: ImportErrorTable; - quest: QuestTable; + quest: QuestTable; - account_settings: AccountSettingsTable; + account_settings: AccountSettingsTable; - pb: PbTable; + pb: PbTable; - priv_svc_myt_card_info: PrivSvcMytCardInfoTable; + priv_svc_myt_card_info: PrivSvcMytCardInfoTable; - questline_quest: QuestlineQuestTable; + questline_quest: QuestlineQuestTable; - questline: QuestlineTable; + questline: QuestlineTable; - cron_task: CronTaskTable; + cron_task: CronTaskTable; - import_class: ImportClassTable; + import_class: ImportClassTable; - song_alt_title: SongAltTitleTable; + song_alt_title: SongAltTitleTable; - game_stats_snapshot: GameStatsSnapshotTable; + game_stats_snapshot: GameStatsSnapshotTable; - chart_leaderboard: ChartLeaderboardTable; + chart_leaderboard: ChartLeaderboardTable; } diff --git a/typescript/db/src/generated/public/Quest.ts b/typescript/db/src/generated/public/Quest.ts index 00a851875..221de4d8b 100644 --- a/typescript/db/src/generated/public/Quest.ts +++ b/typescript/db/src/generated/public/Quest.ts @@ -1,23 +1,23 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as Game } from "./Game"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { default as Game } from './Game'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.quest */ export type quest_id = string; /** Represents the table public.quest */ export default interface QuestTable { - id: ColumnType; + id: ColumnType; - game: ColumnType; + game: ColumnType; - name: ColumnType; + name: ColumnType; - description: ColumnType; + description: ColumnType; - quest_data: ColumnType; + quest_data: ColumnType; } export type Quest = Selectable; diff --git a/typescript/db/src/generated/public/QuestSub.ts b/typescript/db/src/generated/public/QuestSub.ts index b49e9d6e0..24340f67c 100644 --- a/typescript/db/src/generated/public/QuestSub.ts +++ b/typescript/db/src/generated/public/QuestSub.ts @@ -1,25 +1,25 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { quest_id } from "./Quest"; -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { quest_id } from './Quest'; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Represents the table public.quest_sub */ export default interface QuestSubTable { - quest_id: ColumnType; + quest_id: ColumnType; - user_id: ColumnType; + user_id: ColumnType; - progress: ColumnType; + progress: ColumnType; - last_interaction: ColumnType; + last_interaction: ColumnType; - achieved: ColumnType; + achieved: ColumnType; - time_achieved: ColumnType; + time_achieved: ColumnType; - was_instantly_achieved: ColumnType; + was_instantly_achieved: ColumnType; } export type QuestSub = Selectable; diff --git a/typescript/db/src/generated/public/Questline.ts b/typescript/db/src/generated/public/Questline.ts index 270861262..af9cde422 100644 --- a/typescript/db/src/generated/public/Questline.ts +++ b/typescript/db/src/generated/public/Questline.ts @@ -1,21 +1,21 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as Game } from "./Game"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { default as Game } from './Game'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.questline */ export type questline_id = string; /** Represents the table public.questline */ export default interface QuestlineTable { - id: ColumnType; + id: ColumnType; - game: ColumnType; + game: ColumnType; - name: ColumnType; + name: ColumnType; - description: ColumnType; + description: ColumnType; } export type Questline = Selectable; diff --git a/typescript/db/src/generated/public/QuestlineQuest.ts b/typescript/db/src/generated/public/QuestlineQuest.ts index ade303e36..e10abe13a 100644 --- a/typescript/db/src/generated/public/QuestlineQuest.ts +++ b/typescript/db/src/generated/public/QuestlineQuest.ts @@ -1,17 +1,17 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { questline_id } from "./Questline"; -import type { quest_id } from "./Quest"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { questline_id } from './Questline'; +import type { quest_id } from './Quest'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Represents the table public.questline_quest */ export default interface QuestlineQuestTable { - questline_id: ColumnType; + questline_id: ColumnType; - quest_id: ColumnType; + quest_id: ColumnType; - sort_order: ColumnType; + sort_order: ColumnType; } export type QuestlineQuest = Selectable; diff --git a/typescript/db/src/generated/public/Score.ts b/typescript/db/src/generated/public/Score.ts index 1a16cddac..b1b315915 100644 --- a/typescript/db/src/generated/public/Score.ts +++ b/typescript/db/src/generated/public/Score.ts @@ -1,43 +1,43 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { chart_id } from "./Chart"; -import type { default as Game } from "./Game"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { chart_id } from './Chart'; +import type { default as Game } from './Game'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.score */ export type score_id = string; /** Represents the table public.score */ export default interface ScoreTable { - id: ColumnType; + id: ColumnType; - user_id: ColumnType; + user_id: ColumnType; - chart_id: ColumnType; + chart_id: ColumnType; - game: ColumnType; + game: ColumnType; - session_id: ColumnType; + session_id: ColumnType; - import_id: ColumnType; + import_id: ColumnType; - data: ColumnType; + data: ColumnType; - derived_data: ColumnType; + derived_data: ColumnType; - calculated_data: ColumnType; + calculated_data: ColumnType; - meta: ColumnType; + meta: ColumnType; - time_achieved: ColumnType; + time_achieved: ColumnType; - time_added: ColumnType; + time_added: ColumnType; - highlight: ColumnType; + highlight: ColumnType; - comment: ColumnType; + comment: ColumnType; } export type Score = Selectable; diff --git a/typescript/db/src/generated/public/ScoreBlacklist.ts b/typescript/db/src/generated/public/ScoreBlacklist.ts index 8d91adabc..63cb0257b 100644 --- a/typescript/db/src/generated/public/ScoreBlacklist.ts +++ b/typescript/db/src/generated/public/ScoreBlacklist.ts @@ -1,23 +1,19 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.score_blacklist */ export type score_blacklist_row_id = string; /** Represents the table public.score_blacklist */ export default interface ScoreBlacklistTable { - row_id: ColumnType< - score_blacklist_row_id, - score_blacklist_row_id | undefined, - score_blacklist_row_id - >; + row_id: ColumnType; - user_id: ColumnType; + user_id: ColumnType; - score_id: ColumnType; + score_id: ColumnType; } export type ScoreBlacklist = Selectable; diff --git a/typescript/db/src/generated/public/Session.ts b/typescript/db/src/generated/public/Session.ts index 5a6202692..a81eea506 100644 --- a/typescript/db/src/generated/public/Session.ts +++ b/typescript/db/src/generated/public/Session.ts @@ -1,34 +1,34 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { default as Game } from "./Game"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { default as Game } from './Game'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.session */ export type session_id = string; /** Represents the table public.session */ export default interface SessionTable { - id: ColumnType; + id: ColumnType; - user_id: ColumnType; + user_id: ColumnType; - game: ColumnType; + game: ColumnType; - name: ColumnType; + name: ColumnType; - description: ColumnType; + description: ColumnType; - time_inserted: ColumnType; + time_inserted: ColumnType; - time_started: ColumnType; + time_started: ColumnType; - time_ended: ColumnType; + time_ended: ColumnType; - calculated_data: ColumnType; + calculated_data: ColumnType; - highlight: ColumnType; + highlight: ColumnType; } export type Session = Selectable; diff --git a/typescript/db/src/generated/public/Song.ts b/typescript/db/src/generated/public/Song.ts index 29485eca0..66b69c8db 100644 --- a/typescript/db/src/generated/public/Song.ts +++ b/typescript/db/src/generated/public/Song.ts @@ -1,25 +1,25 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as GameGroup } from "./GameGroup"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { default as GameGroup } from './GameGroup'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.song */ export type song_id = string; /** Represents the table public.song */ export default interface SongTable { - id: ColumnType; + id: ColumnType; - legacy_id: ColumnType; + legacy_id: ColumnType; - game_group: ColumnType; + game_group: ColumnType; - title: ColumnType; + title: ColumnType; - artist: ColumnType; + artist: ColumnType; - data: ColumnType; + data: ColumnType; } export type Song = Selectable; diff --git a/typescript/db/src/generated/public/SongAltTitle.ts b/typescript/db/src/generated/public/SongAltTitle.ts index 2d694a4dc..92e419456 100644 --- a/typescript/db/src/generated/public/SongAltTitle.ts +++ b/typescript/db/src/generated/public/SongAltTitle.ts @@ -1,21 +1,17 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { song_id } from "./Song"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { song_id } from './Song'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.song_alt_title */ export type song_alt_title_alt_title = string; /** Represents the table public.song_alt_title */ export default interface SongAltTitleTable { - song_id: ColumnType; + song_id: ColumnType; - alt_title: ColumnType< - song_alt_title_alt_title, - song_alt_title_alt_title, - song_alt_title_alt_title - >; + alt_title: ColumnType; } export type SongAltTitle = Selectable; diff --git a/typescript/db/src/generated/public/SongSearchTerm.ts b/typescript/db/src/generated/public/SongSearchTerm.ts index 9d4a6be8a..d51a840fe 100644 --- a/typescript/db/src/generated/public/SongSearchTerm.ts +++ b/typescript/db/src/generated/public/SongSearchTerm.ts @@ -1,21 +1,17 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { song_id } from "./Song"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { song_id } from './Song'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.song_search_term */ export type song_search_term_search_term = string; /** Represents the table public.song_search_term */ export default interface SongSearchTermTable { - song_id: ColumnType; + song_id: ColumnType; - search_term: ColumnType< - song_search_term_search_term, - song_search_term_search_term, - song_search_term_search_term - >; + search_term: ColumnType; } export type SongSearchTerm = Selectable; diff --git a/typescript/db/src/generated/public/SvcFerSettings.ts b/typescript/db/src/generated/public/SvcFerSettings.ts index 45ac1c574..7b2698e21 100644 --- a/typescript/db/src/generated/public/SvcFerSettings.ts +++ b/typescript/db/src/generated/public/SvcFerSettings.ts @@ -1,14 +1,14 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Represents the table public.svc_fer_settings */ export default interface SvcFerSettingsTable { - user_id: ColumnType; + user_id: ColumnType; - force_static_import: ColumnType; + force_static_import: ColumnType; } export type SvcFerSettings = Selectable; diff --git a/typescript/db/src/generated/public/SvcKshookSv6cSettings.ts b/typescript/db/src/generated/public/SvcKshookSv6cSettings.ts index 9305397a4..b68ea8335 100644 --- a/typescript/db/src/generated/public/SvcKshookSv6cSettings.ts +++ b/typescript/db/src/generated/public/SvcKshookSv6cSettings.ts @@ -1,14 +1,14 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { account_id } from "./Account"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { account_id } from './Account'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Represents the table public.svc_kshook_sv6c_settings */ export default interface SvcKshookSv6cSettingsTable { - user_id: ColumnType; + user_id: ColumnType; - force_static_import: ColumnType; + force_static_import: ColumnType; } export type SvcKshookSv6cSettings = Selectable; diff --git a/typescript/db/src/generated/public/Table.ts b/typescript/db/src/generated/public/Table.ts index dc7998884..4caa47727 100644 --- a/typescript/db/src/generated/public/Table.ts +++ b/typescript/db/src/generated/public/Table.ts @@ -1,27 +1,27 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { default as Game } from "./Game"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { default as Game } from './Game'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Identifier type for public.table */ export type table_id = string; /** Represents the table public.table */ export default interface TableTable { - id: ColumnType; + id: ColumnType; - legacy_id: ColumnType; + legacy_id: ColumnType; - game: ColumnType; + game: ColumnType; - inactive: ColumnType; + inactive: ColumnType; - title: ColumnType; + title: ColumnType; - default_value: ColumnType; + default_value: ColumnType; - slug: ColumnType; + slug: ColumnType; } export type Table = Selectable; diff --git a/typescript/db/src/generated/public/TableFolder.ts b/typescript/db/src/generated/public/TableFolder.ts index fb4b3f6a8..50400eb3a 100644 --- a/typescript/db/src/generated/public/TableFolder.ts +++ b/typescript/db/src/generated/public/TableFolder.ts @@ -1,15 +1,15 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. -import type { table_id } from "./Table"; -import type { folder_id } from "./Folder"; -import type { ColumnType, Selectable, Insertable, Updateable } from "kysely"; +import type { table_id } from './Table'; +import type { folder_id } from './Folder'; +import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; /** Represents the table public.table_folder */ export default interface TableFolderTable { - table_id: ColumnType; + table_id: ColumnType; - folder_id: ColumnType; + folder_id: ColumnType; } export type TableFolder = Selectable; diff --git a/typescript/seeds-scripts/rerunners/arcaea/merge-songlist.ts b/typescript/seeds-scripts/rerunners/arcaea/merge-songlist.ts index 5b64c2c39..b6ff3e567 100644 --- a/typescript/seeds-scripts/rerunners/arcaea/merge-songlist.ts +++ b/typescript/seeds-scripts/rerunners/arcaea/merge-songlist.ts @@ -1,13 +1,13 @@ import { Command } from "commander"; import fjsh from "fast-json-stable-hash"; import fs from "fs"; + import { type ChartDocument, type Difficulties, type integer, type SongDocument, } from "../../../common/src"; - import { CreateChartID, GetFreshSongIDGenerator, diff --git a/typescript/seeds-scripts/rerunners/bms-pms/sync-bms-tablefolders.ts b/typescript/seeds-scripts/rerunners/bms-pms/sync-bms-tablefolders.ts index c17fc55b8..f24a75117 100644 --- a/typescript/seeds-scripts/rerunners/bms-pms/sync-bms-tablefolders.ts +++ b/typescript/seeds-scripts/rerunners/bms-pms/sync-bms-tablefolders.ts @@ -1,7 +1,7 @@ const { LoadBMSTable } = require("bms-table-loader"); -import { type BMSTableInfo, type FolderDocument, type TableDocument } from "../../../common/src"; const { BMS_TABLES } = require("tachi-common"); +import { type BMSTableInfo, type FolderDocument, type TableDocument } from "../../../common/src"; const logger = require("../../logger"); import { CreateFolderIDFromFolder } from "../../util"; const { ReadCollection, MutateCollection } = require("../../util"); diff --git a/typescript/seeds-scripts/rerunners/chunithm/merge-options.ts b/typescript/seeds-scripts/rerunners/chunithm/merge-options.ts index ec664c818..683120548 100644 --- a/typescript/seeds-scripts/rerunners/chunithm/merge-options.ts +++ b/typescript/seeds-scripts/rerunners/chunithm/merge-options.ts @@ -3,6 +3,7 @@ import { XMLParser } from "fast-xml-parser"; import { existsSync, readdirSync, readFileSync, statSync } from "fs"; import { CreateLogger } from "mei-logger"; import path from "path"; + import { type ChartDocument, type Difficulties, @@ -10,7 +11,6 @@ import { type integer, type SongDocument, } from "../../../common/src"; - import { CreateChartID, ReadCollection, WriteCollection } from "../../util"; const logger = CreateLogger("chunithm/merge-options"); diff --git a/typescript/seeds-scripts/rerunners/chunithm/parse-chunithm-dataset.ts b/typescript/seeds-scripts/rerunners/chunithm/parse-chunithm-dataset.ts index 60a1a931e..84b4006b2 100644 --- a/typescript/seeds-scripts/rerunners/chunithm/parse-chunithm-dataset.ts +++ b/typescript/seeds-scripts/rerunners/chunithm/parse-chunithm-dataset.ts @@ -1,6 +1,6 @@ import fetch from "node-fetch"; -import { type ChartDocument, type Difficulties, type SongDocument } from "../../../common/src"; +import { type ChartDocument, type Difficulties, type SongDocument } from "../../../common/src"; import { CreateChartID, MutateCollection, ReadCollection, WriteCollection } from "../../util"; const CURRENT_VERSION = "luminous"; diff --git a/typescript/seeds-scripts/rerunners/ddr/parse-charts.ts b/typescript/seeds-scripts/rerunners/ddr/parse-charts.ts index 02b66c743..be86c71e0 100644 --- a/typescript/seeds-scripts/rerunners/ddr/parse-charts.ts +++ b/typescript/seeds-scripts/rerunners/ddr/parse-charts.ts @@ -1,7 +1,7 @@ import { Parser } from "binary-parser"; import fs from "fs"; -import { type ChartDocument, type SongDocument } from "../../../common/src"; +import { type ChartDocument, type SongDocument } from "../../../common/src"; import { ReadCollection, WriteCollection } from "../../util"; const STEP_HEADER_LENGTH = 6; diff --git a/typescript/seeds-scripts/rerunners/ddr/parse-gameData.ts b/typescript/seeds-scripts/rerunners/ddr/parse-gameData.ts index b2459069b..5eb28ceb4 100644 --- a/typescript/seeds-scripts/rerunners/ddr/parse-gameData.ts +++ b/typescript/seeds-scripts/rerunners/ddr/parse-gameData.ts @@ -8,7 +8,6 @@ import { type Versions, } from "../../../common/src"; import { DDR_FLARE_CATEGORIES } from "../../../common/src/config/game-support/ddr"; - import { CreateChartID, MutateCollection, ReadCollection, WriteCollection } from "../../util"; const gameConfig = GetGameGroupConfig("ddr") as GameConfig<"ddr">; diff --git a/typescript/seeds-scripts/rerunners/gitadora/parse-mdb.ts b/typescript/seeds-scripts/rerunners/gitadora/parse-mdb.ts index 4ea8239cc..43630fd6b 100644 --- a/typescript/seeds-scripts/rerunners/gitadora/parse-mdb.ts +++ b/typescript/seeds-scripts/rerunners/gitadora/parse-mdb.ts @@ -1,6 +1,7 @@ import { Command } from "commander"; import { XMLParser } from "fast-xml-parser"; import { readFileSync } from "fs"; + import { type ChartDocument, type Difficulties, @@ -9,7 +10,6 @@ import { type Versions, } from "../../../common/src"; import { GITADORA_GITA_CONF } from "../../../common/src/config/game-support/gitadora"; - import { CreateChartID, MutateCollection, ReadCollection, WriteCollection } from "../../util"; const supportedVersions = Object.keys(GITADORA_GITA_CONF.versions); diff --git a/typescript/seeds-scripts/rerunners/iidx/aix-output/parse-aix-json.ts b/typescript/seeds-scripts/rerunners/iidx/aix-output/parse-aix-json.ts index 87aabeda6..05d528061 100644 --- a/typescript/seeds-scripts/rerunners/iidx/aix-output/parse-aix-json.ts +++ b/typescript/seeds-scripts/rerunners/iidx/aix-output/parse-aix-json.ts @@ -1,5 +1,6 @@ import { readdirSync, readFileSync } from "fs"; import { join } from "path"; + import { type ChartDocument, type Difficulties, @@ -8,7 +9,6 @@ import { type Playtypes, type SongDocument, } from "../../../../common/src"; - import { CreateChartID, GetFreshScoreIDGenerator, MutateCollection } from "../../util"; interface AixChart { diff --git a/typescript/seeds-scripts/rerunners/iidx/iidx-mdb-parse/convert.ts b/typescript/seeds-scripts/rerunners/iidx/iidx-mdb-parse/convert.ts index f33b6bcf4..9045f36f2 100644 --- a/typescript/seeds-scripts/rerunners/iidx/iidx-mdb-parse/convert.ts +++ b/typescript/seeds-scripts/rerunners/iidx/iidx-mdb-parse/convert.ts @@ -3,8 +3,8 @@ import { execSync } from "child_process"; import fs, { mkdirSync } from "fs"; import iconv from "iconv-lite"; import path from "path"; -import { type integer } from "../../../../common/src"; +import { type integer } from "../../../../common/src"; import logger from "../../../logger"; import { ParseDotOneFile } from "./dot-one-parser/parser"; import { type IIDXConvertOutput } from "./dot-one-parser/types"; diff --git a/typescript/seeds-scripts/rerunners/iidx/iidx-mdb-parse/dot-one-parser/parser.ts b/typescript/seeds-scripts/rerunners/iidx/iidx-mdb-parse/dot-one-parser/parser.ts index 6bb74f2ef..08d1076d6 100644 --- a/typescript/seeds-scripts/rerunners/iidx/iidx-mdb-parse/dot-one-parser/parser.ts +++ b/typescript/seeds-scripts/rerunners/iidx/iidx-mdb-parse/dot-one-parser/parser.ts @@ -1,7 +1,7 @@ import fs from "fs/promises"; import path from "path"; -import { type integer } from "../../../../../common/src"; +import { type integer } from "../../../../../common/src"; import logger from "../../../../logger"; import { type BGMObject, diff --git a/typescript/seeds-scripts/rerunners/iidx/iidx-mdb-parse/merge-mdb.ts b/typescript/seeds-scripts/rerunners/iidx/iidx-mdb-parse/merge-mdb.ts index 0c85ca5ce..cf8c69b19 100644 --- a/typescript/seeds-scripts/rerunners/iidx/iidx-mdb-parse/merge-mdb.ts +++ b/typescript/seeds-scripts/rerunners/iidx/iidx-mdb-parse/merge-mdb.ts @@ -1,6 +1,7 @@ import { Command } from "commander"; import fs from "fs"; import path from "path"; + import { type ChartDocument, type Difficulties, @@ -9,7 +10,6 @@ import { type SongDocument, type Versions, } from "../../../../common/src"; - import logger from "../../../logger"; import { CreateChartID, diff --git a/typescript/seeds-scripts/rerunners/import-raw-quests.ts b/typescript/seeds-scripts/rerunners/import-raw-quests.ts index e4f59274a..173b741af 100644 --- a/typescript/seeds-scripts/rerunners/import-raw-quests.ts +++ b/typescript/seeds-scripts/rerunners/import-raw-quests.ts @@ -1,7 +1,7 @@ import { Command } from "commander"; import fs from "fs"; -import { type GoalDocument, type QuestDocument } from "../../common/src"; +import { type GoalDocument, type QuestDocument } from "../../common/src"; import { CreateGoalID, CreateQuestID, MutateCollection } from "../util"; const program = new Command(); diff --git a/typescript/seeds-scripts/rerunners/jubeat/add-jubeat-folders.ts b/typescript/seeds-scripts/rerunners/jubeat/add-jubeat-folders.ts index 192b8ef35..099f61689 100644 --- a/typescript/seeds-scripts/rerunners/jubeat/add-jubeat-folders.ts +++ b/typescript/seeds-scripts/rerunners/jubeat/add-jubeat-folders.ts @@ -1,6 +1,6 @@ -import { JUBEAT_SINGLE_CONF } from "../../../common/src/config/game-support/jubeat"; import { type FolderDocument } from "tachi-common/src/types"; +import { JUBEAT_SINGLE_CONF } from "../../../common/src/config/game-support/jubeat"; const { MutateCollection, CreateFolderID } = require("../../util"); function CreateFolder(criteria, title) { diff --git a/typescript/seeds-scripts/rerunners/maimaidx/add-maimaidx-internal-levels.ts b/typescript/seeds-scripts/rerunners/maimaidx/add-maimaidx-internal-levels.ts index d2410a3e8..ebf74f25c 100644 --- a/typescript/seeds-scripts/rerunners/maimaidx/add-maimaidx-internal-levels.ts +++ b/typescript/seeds-scripts/rerunners/maimaidx/add-maimaidx-internal-levels.ts @@ -11,8 +11,8 @@ import { XMLParser } from "fast-xml-parser"; */ import fs from "fs"; import path from "path"; -import { type ChartDocument, type SongDocument } from "../../../common/src"; +import { type ChartDocument, type SongDocument } from "../../../common/src"; import { MutateCollection, ReadCollection } from "../../util"; interface XmlNotes { diff --git a/typescript/seeds-scripts/rerunners/maimaidx/merge-options.ts b/typescript/seeds-scripts/rerunners/maimaidx/merge-options.ts index 5d5b8239e..32c48c695 100644 --- a/typescript/seeds-scripts/rerunners/maimaidx/merge-options.ts +++ b/typescript/seeds-scripts/rerunners/maimaidx/merge-options.ts @@ -4,13 +4,13 @@ import { XMLParser } from "fast-xml-parser"; import { existsSync, readdirSync, readFileSync, statSync } from "fs"; import { CreateLogger } from "mei-logger"; import path from "path"; + import { type ChartDocument, type Difficulties, GetGamePTConfig, type SongDocument, } from "../../../common/src"; - import { CreateChartID, GetFreshSongIDGenerator, diff --git a/typescript/seeds-scripts/rerunners/make-questline-from-quests.ts b/typescript/seeds-scripts/rerunners/make-questline-from-quests.ts index f3542ec70..5388247ae 100644 --- a/typescript/seeds-scripts/rerunners/make-questline-from-quests.ts +++ b/typescript/seeds-scripts/rerunners/make-questline-from-quests.ts @@ -1,8 +1,8 @@ import { spawnSync } from "child_process"; import { Command } from "commander"; import fs from "fs"; -import { type QuestDocument, type QuestlineDocument } from "../../common/src"; +import { type QuestDocument, type QuestlineDocument } from "../../common/src"; import { MutateCollection, ReadCollection } from "../util"; /** diff --git a/typescript/seeds-scripts/rerunners/ongeki/add-tables-and-folders.ts b/typescript/seeds-scripts/rerunners/ongeki/add-tables-and-folders.ts index eabf50ee1..207d67a80 100644 --- a/typescript/seeds-scripts/rerunners/ongeki/add-tables-and-folders.ts +++ b/typescript/seeds-scripts/rerunners/ongeki/add-tables-and-folders.ts @@ -1,6 +1,6 @@ import { Command } from "commander"; -import { type FolderDocument, GetGamePTConfig } from "../../../common/src"; +import { type FolderDocument, GetGamePTConfig } from "../../../common/src"; import { CreateFolderID, MutateCollection } from "../../util"; const LEVELS = [ diff --git a/typescript/seeds-scripts/rerunners/ongeki/parse-music-data.ts b/typescript/seeds-scripts/rerunners/ongeki/parse-music-data.ts index ee838eee2..f49f53a01 100644 --- a/typescript/seeds-scripts/rerunners/ongeki/parse-music-data.ts +++ b/typescript/seeds-scripts/rerunners/ongeki/parse-music-data.ts @@ -1,8 +1,8 @@ // usage: cd rerunners && npx ts-node ongeki/parse-music-data.ts import fs from "fs/promises"; -import { type ChartDocument, type Difficulties, type SongDocument } from "../../../common/src"; +import { type ChartDocument, type Difficulties, type SongDocument } from "../../../common/src"; import { CreateChartID, ReadCollection, WriteCollection } from "../../util"; type OngekiChart = ChartDocument<"ongeki:Single">; diff --git a/typescript/seeds-scripts/rerunners/ongeki/parse-song-duration.ts b/typescript/seeds-scripts/rerunners/ongeki/parse-song-duration.ts index 92333e1da..55fb0db7b 100644 --- a/typescript/seeds-scripts/rerunners/ongeki/parse-song-duration.ts +++ b/typescript/seeds-scripts/rerunners/ongeki/parse-song-duration.ts @@ -6,8 +6,8 @@ import { execFile } from "node:child_process"; import fs from "node:fs/promises"; import path from "node:path"; import { promisify } from "node:util"; -import { type ChartDocument, type SongDocument } from "../../../common/src"; +import { type ChartDocument, type SongDocument } from "../../../common/src"; import { ReadCollection, WriteCollection } from "../../util"; const execFileAsync = promisify(execFile); diff --git a/typescript/seeds-scripts/rerunners/ongeki/scrape-sdvx-in.ts b/typescript/seeds-scripts/rerunners/ongeki/scrape-sdvx-in.ts index 682f82c78..c2c356b63 100644 --- a/typescript/seeds-scripts/rerunners/ongeki/scrape-sdvx-in.ts +++ b/typescript/seeds-scripts/rerunners/ongeki/scrape-sdvx-in.ts @@ -1,8 +1,8 @@ /* eslint-disable no-await-in-loop */ import readline from "readline"; -import { type ChartDocument, type SongDocument } from "../../../common/src"; +import { type ChartDocument, type SongDocument } from "../../../common/src"; import { ReadCollection, WriteCollection } from "../../util"; type OngekiChart = ChartDocument<"ongeki:Single">; diff --git a/typescript/seeds-scripts/rerunners/sdvx/merge-mdb.ts b/typescript/seeds-scripts/rerunners/sdvx/merge-mdb.ts index 4e44afa2d..adc85ca0f 100644 --- a/typescript/seeds-scripts/rerunners/sdvx/merge-mdb.ts +++ b/typescript/seeds-scripts/rerunners/sdvx/merge-mdb.ts @@ -2,13 +2,13 @@ import { Command } from "commander"; import { XMLParser } from "fast-xml-parser"; import fs from "fs"; import { decode } from "iconv-lite"; + import { type ChartDocument, type Difficulties, type integer, type SongDocument, } from "../../../common/src"; - import { CreateChartID, GetFreshSongIDGenerator, diff --git a/typescript/seeds-scripts/rerunners/v3/2-migrate-to-pg-style.ts b/typescript/seeds-scripts/rerunners/v3/2-migrate-to-pg-style.ts index cacc9a12f..fbdafc96f 100644 --- a/typescript/seeds-scripts/rerunners/v3/2-migrate-to-pg-style.ts +++ b/typescript/seeds-scripts/rerunners/v3/2-migrate-to-pg-style.ts @@ -1,12 +1,12 @@ import fs from "fs"; import path from "path"; + import { GAME_GROUP_CONFIGS, GAME_PT_CONFIGS, GPTStringToV3, V3ToGameGroup, } from "../../../common/src"; - const { CreateSongID, CreateChartID, ReadCollection, WriteCollection } = require("../../util"); // ── Stability map ───────────────────────────────────────────────────────────── diff --git a/typescript/seeds-scripts/rerunners/v3/3-migrate-folders-tables.ts b/typescript/seeds-scripts/rerunners/v3/3-migrate-folders-tables.ts index 0ef751606..2e2b8b7f6 100644 --- a/typescript/seeds-scripts/rerunners/v3/3-migrate-folders-tables.ts +++ b/typescript/seeds-scripts/rerunners/v3/3-migrate-folders-tables.ts @@ -1,7 +1,7 @@ import fs from "fs"; import path from "path"; -import { type GameGroup, GetGPTString, GPTStringToV3, type Playtype } from "../../../common/src"; +import { type GameGroup, GetGPTString, GPTStringToV3, type Playtype } from "../../../common/src"; import { CreateFolderID, CreateTableID } from "../../util"; const { ReadCollection, WriteCollection } = require("../../util"); diff --git a/typescript/seeds-scripts/test/collections.test.ts b/typescript/seeds-scripts/test/collections.test.ts index 00d18e3d5..ae4be1e6f 100644 --- a/typescript/seeds-scripts/test/collections.test.ts +++ b/typescript/seeds-scripts/test/collections.test.ts @@ -1,9 +1,9 @@ import chalk from "chalk"; import fs from "fs"; import path from "path"; -import { type GameGroup, V3ToGameGroup } from "../../common/src"; import { z } from "zod"; +import { type GameGroup, V3ToGameGroup } from "../../common/src"; import { GetChartCollectionGame, GetSongCollectionGame, ReadCollection } from "../util"; import { type AllCollections, V3_SCHEMAS } from "./schemas"; import { FormatFunctions } from "./test-utils"; diff --git a/typescript/seeds-scripts/test/custom.test.ts b/typescript/seeds-scripts/test/custom.test.ts index 355e7249c..b32ef81ac 100644 --- a/typescript/seeds-scripts/test/custom.test.ts +++ b/typescript/seeds-scripts/test/custom.test.ts @@ -1,13 +1,13 @@ import chalk from "chalk"; import fs from "fs"; import path from "path"; + import { type ChartDocument, type GameGroup, type GPTStrings, type SongDocument, } from "../../common/src"; - import { ReadCollection } from "../util"; import { FormatFunctions } from "./test-utils"; diff --git a/typescript/seeds-scripts/test/goal-id.test.ts b/typescript/seeds-scripts/test/goal-id.test.ts index 96486397f..49508e966 100644 --- a/typescript/seeds-scripts/test/goal-id.test.ts +++ b/typescript/seeds-scripts/test/goal-id.test.ts @@ -1,6 +1,6 @@ import chalk from "chalk"; -import { type GoalDocument } from "../../common/src"; +import { type GoalDocument } from "../../common/src"; import { CreateGoalID, ReadCollection } from "../util"; import { FormatFunctions } from "./test-utils"; diff --git a/typescript/seeds-scripts/test/id.test.ts b/typescript/seeds-scripts/test/id.test.ts index 5283169cc..bcd3110d6 100644 --- a/typescript/seeds-scripts/test/id.test.ts +++ b/typescript/seeds-scripts/test/id.test.ts @@ -1,9 +1,9 @@ import chalk from "chalk"; import fjsh from "fast-json-stable-hash"; import get from "lodash.get"; + import { allSupportedGameGroups, type GameGroup, type integer } from "../../common/src"; import { type SCHEMAS } from "../../common/src/lib/schemas"; - import { ReadCollection } from "../util"; import { FormatFunctions } from "./test-utils"; diff --git a/typescript/seeds-scripts/test/match-type.test.ts b/typescript/seeds-scripts/test/match-type.test.ts index 2e36140a1..18bce602b 100644 --- a/typescript/seeds-scripts/test/match-type.test.ts +++ b/typescript/seeds-scripts/test/match-type.test.ts @@ -1,4 +1,5 @@ import chalk from "chalk"; + import { type ChartDocument, GetGPTConfig, @@ -9,7 +10,6 @@ import { type V3Game, V3ToGPTString, } from "../../common/src"; - import { ReadCollection } from "../util"; // check that a given matchType works for a given game. diff --git a/typescript/seeds-scripts/test/references.test.ts b/typescript/seeds-scripts/test/references.test.ts index 586f4a14e..f59dddca1 100644 --- a/typescript/seeds-scripts/test/references.test.ts +++ b/typescript/seeds-scripts/test/references.test.ts @@ -2,8 +2,8 @@ // and no quest-goal desync, etc. import chalk from "chalk"; -import { type GameGroup, v3AllGames, type V3Game, V3ToGameGroup } from "../../common/src"; +import { type GameGroup, v3AllGames, type V3Game, V3ToGameGroup } from "../../common/src"; import { ReadCollection } from "../util"; import { FormatFunctions } from "./test-utils"; diff --git a/typescript/seeds-scripts/test/schemas.ts b/typescript/seeds-scripts/test/schemas.ts index 9418426b8..bdc597560 100644 --- a/typescript/seeds-scripts/test/schemas.ts +++ b/typescript/seeds-scripts/test/schemas.ts @@ -1,3 +1,5 @@ +import { z, type ZodType } from "zod"; + import { allSupportedGameGroups, GAME_GROUP_CONFIGS, @@ -7,7 +9,6 @@ import { type V3Game, V3ToGPTString, } from "../../common/src"; -import { z, type ZodType } from "zod"; export type AllCollections = | "bms-course-lookup.json" diff --git a/typescript/seeds-scripts/test/table-default.test.ts b/typescript/seeds-scripts/test/table-default.test.ts index b37716a4b..7160729df 100644 --- a/typescript/seeds-scripts/test/table-default.test.ts +++ b/typescript/seeds-scripts/test/table-default.test.ts @@ -1,8 +1,8 @@ import type { z } from "zod"; import chalk from "chalk"; -import { v3AllGames, V3FormatGame } from "../../common/src"; +import { v3AllGames, V3FormatGame } from "../../common/src"; import { ReadCollection } from "../util"; import { type V3_TABLE_SCHEMA } from "./schemas"; diff --git a/typescript/seeds-scripts/test/test-utils.ts b/typescript/seeds-scripts/test/test-utils.ts index 9ac6b1c52..0f72ff9d0 100644 --- a/typescript/seeds-scripts/test/test-utils.ts +++ b/typescript/seeds-scripts/test/test-utils.ts @@ -1,5 +1,4 @@ import { allSupportedGameGroups, type GameGroup, v3AllGames } from "../../common/src"; - import { ReadCollection } from "../util"; import { type V3_SCHEMAS } from "./schemas"; diff --git a/typescript/server/src/@types/express/index.d.ts b/typescript/server/src/@types/express/index.d.ts index 2794096c9..c77e0f904 100644 --- a/typescript/server/src/@types/express/index.d.ts +++ b/typescript/server/src/@types/express/index.d.ts @@ -1,6 +1,6 @@ import type { Session, SessionData } from "express-session"; -import type { APITokenDocument } from "../../../../common/src"; +import type { APITokenDocument } from "../../../../common/src"; import type { SYMBOL_TACHI_API_AUTH, SYMBOL_TACHI_DATA } from "../../lib/constants/tachi"; import type { TachiRequestData, TachiSessionData } from "../../utils/types"; diff --git a/typescript/server/src/game-implementations/games/_common.ts b/typescript/server/src/game-implementations/games/_common.ts index 4398e6380..27ef4baf2 100644 --- a/typescript/server/src/game-implementations/games/_common.ts +++ b/typescript/server/src/game-implementations/games/_common.ts @@ -19,11 +19,12 @@ import type { ScoreValidator, } from "#game-implementations/types"; -import { IsNullish, NumToDP } from "#utils/misc"; import { CreatePBMergeFor } from "#game-implementations/utils/pb-merge"; import { ProfileAvgBestN, ProfileSumBestN } from "#game-implementations/utils/profile-calc"; import { SessionAvgBest10For } from "#game-implementations/utils/session-calc"; +import { IsNullish, NumToDP } from "#utils/misc"; import { Volforce } from "rg-stats"; + import { type ChartDocument, FmtNum, diff --git a/typescript/server/src/game-implementations/games/arcaea.test.ts b/typescript/server/src/game-implementations/games/arcaea.test.ts index f5f423fcb..c4104eaf9 100644 --- a/typescript/server/src/game-implementations/games/arcaea.test.ts +++ b/typescript/server/src/game-implementations/games/arcaea.test.ts @@ -7,6 +7,8 @@ import { dmf, mkMockPB, mkMockScore } from "#test-utils/misc"; import ResetDBState from "#test-utils/resets"; import { TestSnapshot } from "#test-utils/single-process-snapshot"; import { TestingArcaeaSheriruthFTR, TestingWaccaPupaExp } from "#test-utils/test-data"; +import t from "tap"; + import { ARCAEA_GRADES, ARCAEA_LAMPS, @@ -15,8 +17,6 @@ import { type ScoreData, type ScoreDocument, } from "../../../../common/src"; -import t from "tap"; - import { RunValidators } from "./_common"; import { ARCAEA_IMPL } from "./arcaea"; diff --git a/typescript/server/src/game-implementations/games/arcaea.ts b/typescript/server/src/game-implementations/games/arcaea.ts index 65e6a47f9..d1bea8618 100644 --- a/typescript/server/src/game-implementations/games/arcaea.ts +++ b/typescript/server/src/game-implementations/games/arcaea.ts @@ -1,12 +1,12 @@ import type { GPTServerImplementation } from "#game-implementations/types"; -import { IsNullish } from "#utils/misc"; import { CreatePBMergeFor } from "#game-implementations/utils/pb-merge"; import { ProfileAvgBestN } from "#game-implementations/utils/profile-calc"; import { SessionAvgBest10For } from "#game-implementations/utils/session-calc"; +import { IsNullish } from "#utils/misc"; import { Potential } from "rg-stats"; -import { ARCAEA_GBOUNDARIES, FmtNum, GetGrade, type GPTStrings } from "../../../../common/src"; +import { ARCAEA_GBOUNDARIES, FmtNum, GetGrade, type GPTStrings } from "../../../../common/src"; import { GoalFmtScore, GoalOutOfFmtScore, GradeGoalFormatter } from "./_common"; export const ARCAEA_IMPL: GPTServerImplementation = { diff --git a/typescript/server/src/game-implementations/games/bms-pms.test.ts b/typescript/server/src/game-implementations/games/bms-pms.test.ts index ba3ad1bf7..3548fe474 100644 --- a/typescript/server/src/game-implementations/games/bms-pms.test.ts +++ b/typescript/server/src/game-implementations/games/bms-pms.test.ts @@ -4,6 +4,8 @@ import { CreatePBDoc } from "#lib/score-import/framework/pb/create-pb-doc"; import { dmf, mkMockPB, mkMockScore } from "#test-utils/misc"; import ResetDBState from "#test-utils/resets"; import { TestSnapshot } from "#test-utils/single-process-snapshot"; +import t from "tap"; + import { type ChartDocument, type ChartDocumentData, @@ -14,8 +16,6 @@ import { type ProvidedMetrics, type ScoreData, } from "../../../../common/src"; -import t from "tap"; - import { BMS_7K_IMPL, BMS_14K_IMPL, PMS_CONTROLLER_IMPL, PMS_KEYBOARD_IMPL } from "./bms-pms"; type BMSPMS = GPTStrings["bms" | "pms"]; diff --git a/typescript/server/src/game-implementations/games/bms-pms.ts b/typescript/server/src/game-implementations/games/bms-pms.ts index 6ac26e8c0..5235d44a0 100644 --- a/typescript/server/src/game-implementations/games/bms-pms.ts +++ b/typescript/server/src/game-implementations/games/bms-pms.ts @@ -3,8 +3,8 @@ import type { GPTServerImplementation, PBMergeFunction } from "#game-implementat import { CreatePBMergeFor } from "#game-implementations/utils/pb-merge"; import { ProfileAvgBestN } from "#game-implementations/utils/profile-calc"; import { SessionAvgBest10For } from "#game-implementations/utils/session-calc"; -import { type GPTStrings, IIDXLIKE_GBOUNDARIES } from "../../../../common/src"; +import { type GPTStrings, IIDXLIKE_GBOUNDARIES } from "../../../../common/src"; import { GoalFmtPercent, GoalOutOfFmtPercent, diff --git a/typescript/server/src/game-implementations/games/chunithm.test.ts b/typescript/server/src/game-implementations/games/chunithm.test.ts index e39010630..b18beb3e4 100644 --- a/typescript/server/src/game-implementations/games/chunithm.test.ts +++ b/typescript/server/src/game-implementations/games/chunithm.test.ts @@ -4,6 +4,8 @@ import { CreatePBDoc } from "#lib/score-import/framework/pb/create-pb-doc"; import { dmf, mkMockPB, mkMockScore } from "#test-utils/misc"; import ResetDBState from "#test-utils/resets"; import { CHUNITHMBBKKChart, TestingChunithmScorePB } from "#test-utils/test-data"; +import t from "tap"; + import { CHUNITHM_CLEAR_LAMPS, CHUNITHM_GRADES, @@ -11,8 +13,6 @@ import { type ProvidedMetrics, type ScoreData, } from "../../../../common/src"; -import t from "tap"; - import { CHUNITHM_IMPL } from "./chunithm"; const baseMetrics: ProvidedMetrics["chunithm:Single"] = { diff --git a/typescript/server/src/game-implementations/games/chunithm.ts b/typescript/server/src/game-implementations/games/chunithm.ts index 9bc620bd6..ff5fbdeee 100644 --- a/typescript/server/src/game-implementations/games/chunithm.ts +++ b/typescript/server/src/game-implementations/games/chunithm.ts @@ -1,12 +1,12 @@ import type { GPTServerImplementation } from "#game-implementations/types"; -import { IsNullish } from "#utils/misc"; import { CreatePBMergeFor } from "#game-implementations/utils/pb-merge"; import { ProfileAvgBestN } from "#game-implementations/utils/profile-calc"; import { SessionAvgBest10For } from "#game-implementations/utils/session-calc"; +import { IsNullish } from "#utils/misc"; import { CHUNITHMRating } from "rg-stats"; -import { CHUNITHM_GBOUNDARIES, FmtNum, GetGrade } from "../../../../common/src"; +import { CHUNITHM_GBOUNDARIES, FmtNum, GetGrade } from "../../../../common/src"; import { GoalFmtScore, GoalOutOfFmtScore, GradeGoalFormatter } from "./_common"; export const CHUNITHM_IMPL: GPTServerImplementation<"chunithm:Single"> = { diff --git a/typescript/server/src/game-implementations/games/ddr.test.ts b/typescript/server/src/game-implementations/games/ddr.test.ts index 408c9e817..ed3e1c854 100644 --- a/typescript/server/src/game-implementations/games/ddr.test.ts +++ b/typescript/server/src/game-implementations/games/ddr.test.ts @@ -1,5 +1,7 @@ import { dmf, mkFakePBDDRSP } from "#test-utils/misc"; import { Testing511SPA, TestingDDRSP, TestingDDRSPScore } from "#test-utils/test-data"; +import t from "tap"; + import { type ChartDocumentData, DDR_GRADES, @@ -7,8 +9,6 @@ import { type ProvidedMetrics, type ScoreData, } from "../../../../common/src"; -import t from "tap"; - import { TestSnapshot } from "../../test-utils/single-process-snapshot"; import { DDR_IMPL } from "./ddr"; import { IIDX_DP_IMPL, IIDX_SP_IMPL } from "./iidx"; diff --git a/typescript/server/src/game-implementations/games/ddr.ts b/typescript/server/src/game-implementations/games/ddr.ts index 4a11dab78..ca860bfb6 100644 --- a/typescript/server/src/game-implementations/games/ddr.ts +++ b/typescript/server/src/game-implementations/games/ddr.ts @@ -7,6 +7,7 @@ import type { } from "#game-implementations/types"; import { DDRFlare } from "rg-stats"; + import { type ChartDocument, DDR_GBOUNDARIES, @@ -20,7 +21,6 @@ import { type ScoreDocument, type SongDocument, } from "../../../../common/src"; - import db from "../../external/mongo/db"; import CreateLogCtx from "../../lib/logger/logger"; import { IsNullish } from "../../utils/misc"; diff --git a/typescript/server/src/game-implementations/games/gitadora.test.ts b/typescript/server/src/game-implementations/games/gitadora.test.ts index dfa91d09f..49d4b259e 100644 --- a/typescript/server/src/game-implementations/games/gitadora.test.ts +++ b/typescript/server/src/game-implementations/games/gitadora.test.ts @@ -4,6 +4,8 @@ import { CreatePBDoc } from "#lib/score-import/framework/pb/create-pb-doc"; import { dmf, mkMockPB, mkMockScore } from "#test-utils/misc"; import ResetDBState from "#test-utils/resets"; import { TestingGitadoraChart } from "#test-utils/test-data"; +import t from "tap"; + import { GetGPTString, GITADORA_GRADES, @@ -14,8 +16,6 @@ import { type ScoreData, type ScoreDocument, } from "../../../../common/src"; -import t from "tap"; - import { GITADORA_DORA_IMPL, GITADORA_GITA_IMPL } from "./gitadora"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/game-implementations/games/gitadora.ts b/typescript/server/src/game-implementations/games/gitadora.ts index 7ec6901de..e9201ce63 100644 --- a/typescript/server/src/game-implementations/games/gitadora.ts +++ b/typescript/server/src/game-implementations/games/gitadora.ts @@ -1,12 +1,12 @@ import type { GPTServerImplementation } from "#game-implementations/types"; -import { IsNullish } from "#utils/misc"; import { CreatePBMergeFor } from "#game-implementations/utils/pb-merge"; import { ProfileSumBestN } from "#game-implementations/utils/profile-calc"; import { SessionAvgBest10For } from "#game-implementations/utils/session-calc"; +import { IsNullish } from "#utils/misc"; import { GITADORASkill } from "rg-stats"; -import { GetGrade, GITADORA_GBOUNDARIES } from "../../../../common/src"; +import { GetGrade, GITADORA_GBOUNDARIES } from "../../../../common/src"; import { GoalFmtPercent, GoalOutOfFmtPercent, GradeGoalFormatter } from "./_common"; const GITADORA_IMPL: GPTServerImplementation<"gitadora:Dora" | "gitadora:Gita"> = { diff --git a/typescript/server/src/game-implementations/games/iidx.test.ts b/typescript/server/src/game-implementations/games/iidx.test.ts index 944b0a7df..a0aeae801 100644 --- a/typescript/server/src/game-implementations/games/iidx.test.ts +++ b/typescript/server/src/game-implementations/games/iidx.test.ts @@ -5,6 +5,8 @@ import { dmf, mkFakePBIIDXSP, mkFakeScoreIIDXSP } from "#test-utils/misc"; import ResetDBState from "#test-utils/resets"; import { TestSnapshot } from "#test-utils/single-process-snapshot"; import { Testing511SPA, TestingIIDXSPScore } from "#test-utils/test-data"; +import t from "tap"; + import { type ChartDocumentData, GetGrade, @@ -14,8 +16,6 @@ import { type ProvidedMetrics, type ScoreData, } from "../../../../common/src"; -import t from "tap"; - import { IIDX_DP_IMPL, IIDX_SP_IMPL } from "./iidx"; const baseMetrics: ProvidedMetrics["iidx:DP" | "iidx:SP"] = { diff --git a/typescript/server/src/game-implementations/games/iidx.ts b/typescript/server/src/game-implementations/games/iidx.ts index fd4b051bc..30bea64ec 100644 --- a/typescript/server/src/game-implementations/games/iidx.ts +++ b/typescript/server/src/game-implementations/games/iidx.ts @@ -9,13 +9,13 @@ import type { ScoreValidator, } from "#game-implementations/types"; -import { IsNullish } from "#utils/misc"; import { CreatePBMergeFor } from "#game-implementations/utils/pb-merge"; import { ProfileAvgBestN } from "#game-implementations/utils/profile-calc"; import { SessionAvgBest10For } from "#game-implementations/utils/session-calc"; +import { IsNullish } from "#utils/misc"; import { PoyashiBPI } from "rg-stats"; -import { type GPTStrings, IIDXLIKE_GBOUNDARIES } from "../../../../common/src"; +import { type GPTStrings, IIDXLIKE_GBOUNDARIES } from "../../../../common/src"; import { GoalFmtPercent, GoalOutOfFmtPercent, diff --git a/typescript/server/src/game-implementations/games/itg.ts b/typescript/server/src/game-implementations/games/itg.ts index 7489cc72f..dd4c9d368 100644 --- a/typescript/server/src/game-implementations/games/itg.ts +++ b/typescript/server/src/game-implementations/games/itg.ts @@ -1,12 +1,12 @@ import type { GPTServerImplementation } from "#game-implementations/types"; -import { NumToDP } from "#utils/misc"; import { CreatePBMergeFor } from "#game-implementations/utils/pb-merge"; import { ProfileSumBestN } from "#game-implementations/utils/profile-calc"; import { SessionAvgBestNFor } from "#game-implementations/utils/session-calc"; +import { NumToDP } from "#utils/misc"; import { ITGHighestUnbroken } from "rg-stats"; -import { GetGrade, ITG_GBOUNDARIES } from "../../../../common/src"; +import { GetGrade, ITG_GBOUNDARIES } from "../../../../common/src"; import { GoalFmtPercent, GradeGoalFormatter } from "./_common"; export const ITG_STAMINA_IMPL: GPTServerImplementation<"itg:Stamina"> = { diff --git a/typescript/server/src/game-implementations/games/jubeat.test.ts b/typescript/server/src/game-implementations/games/jubeat.test.ts index fa1728a9e..9a5e51b8b 100644 --- a/typescript/server/src/game-implementations/games/jubeat.test.ts +++ b/typescript/server/src/game-implementations/games/jubeat.test.ts @@ -1,5 +1,3 @@ -import type { ProvidedMetrics, ScoreData } from "../../../../common/src"; - import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import { CreatePBDoc } from "#lib/score-import/framework/pb/create-pb-doc"; @@ -7,9 +5,11 @@ import { dmf, mkMockPB, mkMockScore } from "#test-utils/misc"; import ResetDBState from "#test-utils/resets"; import { TestSnapshot } from "#test-utils/single-process-snapshot"; import { TestingJubeatChart } from "#test-utils/test-data"; -import { JUBEAT_SINGLE_CONF } from "../../../../common/src/config/game-support/jubeat"; import t from "tap"; +import type { ProvidedMetrics, ScoreData } from "../../../../common/src"; + +import { JUBEAT_SINGLE_CONF } from "../../../../common/src/config/game-support/jubeat"; import { JUBEAT_IMPL } from "./jubeat"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/game-implementations/games/jubeat.ts b/typescript/server/src/game-implementations/games/jubeat.ts index 16ac2473d..239448546 100644 --- a/typescript/server/src/game-implementations/games/jubeat.ts +++ b/typescript/server/src/game-implementations/games/jubeat.ts @@ -1,12 +1,13 @@ import type { GPTServerImplementation } from "#game-implementations/types"; import db from "#external/mongo/db"; -import { IsNullish } from "#utils/misc"; import { CreatePBMergeFor } from "#game-implementations/utils/pb-merge"; import { ProfileSumBestN } from "#game-implementations/utils/profile-calc"; import { SessionAvgBest10For } from "#game-implementations/utils/session-calc"; +import { IsNullish } from "#utils/misc"; import { p } from "prudence"; import { Jubility } from "rg-stats"; + import { FmtNum, type GameGroup, @@ -17,7 +18,6 @@ import { type Playtype, type Versions, } from "../../../../common/src"; - import { GoalFmtScore, GoalOutOfFmtScore, GradeGoalFormatter } from "./_common"; async function GetBestJubilityOnSongs( diff --git a/typescript/server/src/game-implementations/games/maimai.test.ts b/typescript/server/src/game-implementations/games/maimai.test.ts index b8fe4ea19..392831001 100644 --- a/typescript/server/src/game-implementations/games/maimai.test.ts +++ b/typescript/server/src/game-implementations/games/maimai.test.ts @@ -1,5 +1,3 @@ -import type { integer, ProvidedMetrics, ScoreData } from "../../../../common/src"; - import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import { CreatePBDoc } from "#lib/score-import/framework/pb/create-pb-doc"; @@ -7,9 +5,11 @@ import { dmf, mkMockPB, mkMockScore } from "#test-utils/misc"; import ResetDBState from "#test-utils/resets"; import { TestSnapshot } from "#test-utils/single-process-snapshot"; import { TestingMaimaiChart } from "#test-utils/test-data"; -import { MAIMAI_SINGLE_CONF } from "../../../../common/src/config/game-support/maimai"; import t from "tap"; +import type { integer, ProvidedMetrics, ScoreData } from "../../../../common/src"; + +import { MAIMAI_SINGLE_CONF } from "../../../../common/src/config/game-support/maimai"; import { MAIMAI_IMPL } from "./maimai"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/game-implementations/games/maimai.ts b/typescript/server/src/game-implementations/games/maimai.ts index 5e60598b0..0b7c1d217 100644 --- a/typescript/server/src/game-implementations/games/maimai.ts +++ b/typescript/server/src/game-implementations/games/maimai.ts @@ -1,12 +1,12 @@ import type { GPTServerImplementation } from "#game-implementations/types"; -import { IsNullish } from "#utils/misc"; import { CreatePBMergeFor } from "#game-implementations/utils/pb-merge"; import { ProfileAvgBestN } from "#game-implementations/utils/profile-calc"; import { SessionAvgBest10For } from "#game-implementations/utils/session-calc"; +import { IsNullish } from "#utils/misc"; import { MaimaiRate } from "rg-stats"; -import { GetGrade, MAIMAI_GBOUNDARIES } from "../../../../common/src"; +import { GetGrade, MAIMAI_GBOUNDARIES } from "../../../../common/src"; import { GoalFmtPercent, GoalOutOfFmtPercent, GradeGoalFormatter } from "./_common"; export const MAIMAI_IMPL: GPTServerImplementation<"maimai:Single"> = { diff --git a/typescript/server/src/game-implementations/games/maimaidx.test.ts b/typescript/server/src/game-implementations/games/maimaidx.test.ts index 30a362d48..9a4d00373 100644 --- a/typescript/server/src/game-implementations/games/maimaidx.test.ts +++ b/typescript/server/src/game-implementations/games/maimaidx.test.ts @@ -1,14 +1,14 @@ -import type { ProvidedMetrics, ScoreData } from "../../../../common/src"; - import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import { CreatePBDoc } from "#lib/score-import/framework/pb/create-pb-doc"; import { dmf, mkMockPB, mkMockScore } from "#test-utils/misc"; import ResetDBState from "#test-utils/resets"; import { TestingMaimaiDXChart } from "#test-utils/test-data"; -import { MAIMAI_DX_SINGLE_CONF } from "../../../../common/src/config/game-support/maimai-dx"; import t from "tap"; +import type { ProvidedMetrics, ScoreData } from "../../../../common/src"; + +import { MAIMAI_DX_SINGLE_CONF } from "../../../../common/src/config/game-support/maimai-dx"; import { MAIMAIDX_IMPL } from "./maimaidx"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/game-implementations/games/maimaidx.ts b/typescript/server/src/game-implementations/games/maimaidx.ts index c687ff24f..a2276cbdd 100644 --- a/typescript/server/src/game-implementations/games/maimaidx.ts +++ b/typescript/server/src/game-implementations/games/maimaidx.ts @@ -1,12 +1,12 @@ import type { GPTServerImplementation } from "#game-implementations/types"; -import { IsNullish } from "#utils/misc"; import { CreatePBMergeFor } from "#game-implementations/utils/pb-merge"; import { ProfileSumBestN } from "#game-implementations/utils/profile-calc"; import { SessionAvgBest10For } from "#game-implementations/utils/session-calc"; +import { IsNullish } from "#utils/misc"; import { MaimaiDXRate } from "rg-stats"; -import { GetGrade, MAIMAIDX_GBOUNDARIES } from "../../../../common/src"; +import { GetGrade, MAIMAIDX_GBOUNDARIES } from "../../../../common/src"; import { GoalFmtPercent, GoalOutOfFmtPercent, GradeGoalFormatter } from "./_common"; export const MAIMAIDX_IMPL: GPTServerImplementation<"maimaidx:Single"> = { diff --git a/typescript/server/src/game-implementations/games/museca.test.ts b/typescript/server/src/game-implementations/games/museca.test.ts index 446747bca..2d3e6e0a9 100644 --- a/typescript/server/src/game-implementations/games/museca.test.ts +++ b/typescript/server/src/game-implementations/games/museca.test.ts @@ -4,14 +4,14 @@ import { CreatePBDoc } from "#lib/score-import/framework/pb/create-pb-doc"; import { dmf, mkMockPB, mkMockScore } from "#test-utils/misc"; import ResetDBState from "#test-utils/resets"; import { TestingMusecaChart } from "#test-utils/test-data"; +import t from "tap"; + import { MUSECA_GRADES, MUSECA_LAMPS, type ProvidedMetrics, type ScoreData, } from "../../../../common/src"; -import t from "tap"; - import { MUSECA_IMPL } from "./museca"; const baseMetrics: ProvidedMetrics["museca:Single"] = { diff --git a/typescript/server/src/game-implementations/games/museca.ts b/typescript/server/src/game-implementations/games/museca.ts index cdb2acedc..763f6fda9 100644 --- a/typescript/server/src/game-implementations/games/museca.ts +++ b/typescript/server/src/game-implementations/games/museca.ts @@ -4,8 +4,8 @@ import { CreatePBMergeFor } from "#game-implementations/utils/pb-merge"; import { ProfileSumBestN } from "#game-implementations/utils/profile-calc"; import { SessionAvgBest10For } from "#game-implementations/utils/session-calc"; import { CuratorSkill } from "rg-stats"; -import { FmtNum, GetGrade, MUSECA_GBOUNDARIES } from "../../../../common/src"; +import { FmtNum, GetGrade, MUSECA_GBOUNDARIES } from "../../../../common/src"; import { GoalFmtScore, GoalOutOfFmtScore, GradeGoalFormatter } from "./_common"; export const MUSECA_IMPL: GPTServerImplementation<"museca:Single"> = { diff --git a/typescript/server/src/game-implementations/games/ongeki.test.ts b/typescript/server/src/game-implementations/games/ongeki.test.ts index 7f5de819f..258346c78 100644 --- a/typescript/server/src/game-implementations/games/ongeki.test.ts +++ b/typescript/server/src/game-implementations/games/ongeki.test.ts @@ -6,6 +6,8 @@ import { CreatePBDoc, UpdateChartRanking } from "#lib/score-import/framework/pb/ import { dmf, mkMockPB, mkMockScore } from "#test-utils/misc"; import ResetDBState from "#test-utils/resets"; import { TestingOngekiChart, TestingOngekiScorePB } from "#test-utils/test-data"; +import t from "tap"; + import { ONGEKI_BELL_LAMPS, ONGEKI_GRADES, @@ -14,8 +16,6 @@ import { type ProvidedMetrics, type ScoreData, } from "../../../../common/src"; -import t from "tap"; - import { ONGEKI_IMPL } from "./ongeki"; const baseMetrics: ProvidedMetrics["ongeki:Single"] = { diff --git a/typescript/server/src/game-implementations/games/ongeki.ts b/typescript/server/src/game-implementations/games/ongeki.ts index d859f673c..8654f5c6b 100644 --- a/typescript/server/src/game-implementations/games/ongeki.ts +++ b/typescript/server/src/game-implementations/games/ongeki.ts @@ -1,10 +1,11 @@ import type { GPTServerImplementation } from "#game-implementations/types"; -import { IsNullish } from "#utils/misc"; import { CreatePBMergeFor } from "#game-implementations/utils/pb-merge"; import { ProfileAvgBestN } from "#game-implementations/utils/profile-calc"; import { SessionAvgBest10For } from "#game-implementations/utils/session-calc"; +import { IsNullish } from "#utils/misc"; import { ONGEKIRating } from "rg-stats"; + import { type ChartDocument, FmtNum, @@ -16,7 +17,6 @@ import { ONGEKI_GBOUNDARIES, type Playtype, } from "../../../../common/src"; - import { GoalFmtScore, GoalOutOfFmtScore, GradeGoalFormatter } from "./_common"; const isUnranked = (chart: ChartDocument<"ongeki:Single">) => diff --git a/typescript/server/src/game-implementations/games/popn.test.ts b/typescript/server/src/game-implementations/games/popn.test.ts index 37c436a84..5c45f8d1d 100644 --- a/typescript/server/src/game-implementations/games/popn.test.ts +++ b/typescript/server/src/game-implementations/games/popn.test.ts @@ -1,14 +1,14 @@ -import type { ProvidedMetrics, ScoreData } from "../../../../common/src"; - import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import { CreatePBDoc } from "#lib/score-import/framework/pb/create-pb-doc"; import { dmf, mkMockPB, mkMockScore } from "#test-utils/misc"; import ResetDBState from "#test-utils/resets"; import { TestingPopnChart } from "#test-utils/test-data"; -import { POPN_9B_CONF } from "../../../../common/src/config/game-support/popn"; import t from "tap"; +import type { ProvidedMetrics, ScoreData } from "../../../../common/src"; + +import { POPN_9B_CONF } from "../../../../common/src/config/game-support/popn"; import { POPN_9B_IMPL } from "./popn"; const baseMetrics: ProvidedMetrics["popn:9B"] = { diff --git a/typescript/server/src/game-implementations/games/popn.ts b/typescript/server/src/game-implementations/games/popn.ts index 342410477..662515147 100644 --- a/typescript/server/src/game-implementations/games/popn.ts +++ b/typescript/server/src/game-implementations/games/popn.ts @@ -1,13 +1,14 @@ import type { GPTServerImplementation } from "#game-implementations/types"; -import type { GetEnumValue } from "../../../../common/src/types/metrics"; -import { IsNullish } from "#utils/misc"; import { CreatePBMergeFor } from "#game-implementations/utils/pb-merge"; import { ProfileAvgBestN, ProfileSumBestN } from "#game-implementations/utils/profile-calc"; import { SessionAvgBest10For } from "#game-implementations/utils/session-calc"; +import { IsNullish } from "#utils/misc"; import { PopnClassPoints } from "rg-stats"; -import { FmtNum, FmtNumCompact, GetGrade, POPN_GBOUNDARIES } from "../../../../common/src"; +import type { GetEnumValue } from "../../../../common/src/types/metrics"; + +import { FmtNum, FmtNumCompact, GetGrade, POPN_GBOUNDARIES } from "../../../../common/src"; import { GoalFmtScore, GoalOutOfFmtScore, GradeGoalFormatter } from "./_common"; export function PopnClearMedalToLamp( diff --git a/typescript/server/src/game-implementations/games/sdvx.test.ts b/typescript/server/src/game-implementations/games/sdvx.test.ts index 643a596bd..398d0da1a 100644 --- a/typescript/server/src/game-implementations/games/sdvx.test.ts +++ b/typescript/server/src/game-implementations/games/sdvx.test.ts @@ -5,14 +5,14 @@ import { dmf, mkMockPB, mkMockScore } from "#test-utils/misc"; import ResetDBState from "#test-utils/resets"; import { TestSnapshot } from "#test-utils/single-process-snapshot"; import { TestingSDVXAlbidaChart } from "#test-utils/test-data"; +import t from "tap"; + import { type ProvidedMetrics, type ScoreData, SDVX_GRADES, SDVX_LAMPS, } from "../../../../common/src"; -import t from "tap"; - import { SDVX_IMPL } from "./sdvx"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/game-implementations/games/usc.test.ts b/typescript/server/src/game-implementations/games/usc.test.ts index b77a3bc5e..47bb8e990 100644 --- a/typescript/server/src/game-implementations/games/usc.test.ts +++ b/typescript/server/src/game-implementations/games/usc.test.ts @@ -4,6 +4,8 @@ import { CreatePBDoc } from "#lib/score-import/framework/pb/create-pb-doc"; import { dmf, mkMockPB, mkMockScore } from "#test-utils/misc"; import ResetDBState from "#test-utils/resets"; import { TestingUSCChart } from "#test-utils/test-data"; +import t from "tap"; + import { GetGPTString, type GPTStrings, @@ -12,8 +14,6 @@ import { SDVX_GRADES, USC_LAMPS, } from "../../../../common/src"; -import t from "tap"; - import { USC_CONTROLLER_IMPL, USC_KEYBOARD_IMPL } from "./usc"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/game-implementations/games/usc.ts b/typescript/server/src/game-implementations/games/usc.ts index 7913c661c..26f625751 100644 --- a/typescript/server/src/game-implementations/games/usc.ts +++ b/typescript/server/src/game-implementations/games/usc.ts @@ -1,4 +1,5 @@ import type { GPTServerImplementation } from "#game-implementations/types"; + import type { GPTStrings } from "../../../../common/src"; import { diff --git a/typescript/server/src/game-implementations/games/wacca.test.ts b/typescript/server/src/game-implementations/games/wacca.test.ts index a6e99b3d4..5bafe494a 100644 --- a/typescript/server/src/game-implementations/games/wacca.test.ts +++ b/typescript/server/src/game-implementations/games/wacca.test.ts @@ -1,5 +1,4 @@ import type { DeepPartial } from "#utils/types"; -import type { ProvidedMetrics, ScoreData, ScoreDocument } from "../../../../common/src"; import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; @@ -8,9 +7,11 @@ import { dmf, mkMockPB, mkMockScore } from "#test-utils/misc"; import ResetDBState from "#test-utils/resets"; import { TestSnapshot } from "#test-utils/single-process-snapshot"; import { TestingWaccaPupaExp } from "#test-utils/test-data"; -import { WACCA_SINGLE_CONF } from "../../../../common/src/config/game-support/wacca"; import t from "tap"; +import type { ProvidedMetrics, ScoreData, ScoreDocument } from "../../../../common/src"; + +import { WACCA_SINGLE_CONF } from "../../../../common/src/config/game-support/wacca"; import { RunValidators } from "./_common"; import { WACCA_IMPL } from "./wacca"; diff --git a/typescript/server/src/game-implementations/games/wacca.ts b/typescript/server/src/game-implementations/games/wacca.ts index a3c8c56d8..68b03ae68 100644 --- a/typescript/server/src/game-implementations/games/wacca.ts +++ b/typescript/server/src/game-implementations/games/wacca.ts @@ -1,12 +1,12 @@ import type { GPTServerImplementation } from "#game-implementations/types"; -import { IsNullish } from "#utils/misc"; import { CreatePBMergeFor } from "#game-implementations/utils/pb-merge"; import { ProfileSumBestN } from "#game-implementations/utils/profile-calc"; import { SessionAvgBest10For } from "#game-implementations/utils/session-calc"; +import { IsNullish } from "#utils/misc"; import { WACCARate } from "rg-stats"; -import { FmtNum, GetGrade, WACCA_GBOUNDARIES } from "../../../../common/src"; +import { FmtNum, GetGrade, WACCA_GBOUNDARIES } from "../../../../common/src"; import { GoalFmtScore, GoalOutOfFmtScore, GradeGoalFormatter } from "./_common"; export const WACCA_IMPL: GPTServerImplementation<"wacca:Single"> = { diff --git a/typescript/server/src/game-implementations/types.ts b/typescript/server/src/game-implementations/types.ts index 58ab1e588..81c2a7ea8 100644 --- a/typescript/server/src/game-implementations/types.ts +++ b/typescript/server/src/game-implementations/types.ts @@ -1,5 +1,6 @@ import type { DryScoreData } from "#lib/score-import/framework/common/types"; import type { PBScoreDocumentNoRank } from "#lib/score-import/framework/pb/create-pb-doc"; + import type { ChartDocument, ClassConfigs, diff --git a/typescript/server/src/game-implementations/utils/pb-merge.ts b/typescript/server/src/game-implementations/utils/pb-merge.ts index cc64c2286..8d0880b96 100644 --- a/typescript/server/src/game-implementations/utils/pb-merge.ts +++ b/typescript/server/src/game-implementations/utils/pb-merge.ts @@ -1,6 +1,9 @@ -import type { PBScoreDocumentNoRank } from "#lib/score-import/framework/pb/create-pb-doc"; import type { PBMergeFunction } from "#game-implementations/types"; +import type { PBScoreDocumentNoRank } from "#lib/score-import/framework/pb/create-pb-doc"; import type { FilterQuery } from "mongodb"; + +import db from "#external/mongo/db"; + import type { ConfDerivedMetrics, ConfOptionalMetrics, @@ -10,8 +13,6 @@ import type { } from "../../../../common/src"; import type { ExtractEnumMetricNames } from "../../../../common/src/types/metrics"; -import db from "#external/mongo/db"; - // insane typemagic to get mongodb-safe names for this GPT's metrics. type MetricKeys = Exclude< | `enumIndexes.${ExtractEnumMetricNames}` diff --git a/typescript/server/src/game-implementations/utils/profile-calc.ts b/typescript/server/src/game-implementations/utils/profile-calc.ts index a78e180a8..2889acd50 100644 --- a/typescript/server/src/game-implementations/utils/profile-calc.ts +++ b/typescript/server/src/game-implementations/utils/profile-calc.ts @@ -1,3 +1,5 @@ +import db from "#external/mongo/db"; + import type { GameGroup, GPTString, @@ -7,8 +9,6 @@ import type { ScoreRatingAlgorithms, } from "../../../../common/src"; -import db from "#external/mongo/db"; - /** * Curries a function that returns the sum of N best ratings on `key`. * diff --git a/typescript/server/src/game-implementations/utils/session-calc.ts b/typescript/server/src/game-implementations/utils/session-calc.ts index 58d33ef74..4ab08ea18 100644 --- a/typescript/server/src/game-implementations/utils/session-calc.ts +++ b/typescript/server/src/game-implementations/utils/session-calc.ts @@ -1,4 +1,5 @@ import type { SessionCalculator } from "#game-implementations/types"; + import type { GPTString, integer, ScoreDocument } from "../../../../common/src"; export function SessionAverageBestN(vals: Array, n = 10) { diff --git a/typescript/server/src/lib/activity/activity.ts b/typescript/server/src/lib/activity/activity.ts index 971f4e40c..3e55019d9 100644 --- a/typescript/server/src/lib/activity/activity.ts +++ b/typescript/server/src/lib/activity/activity.ts @@ -1,5 +1,16 @@ import type { Request, Response } from "express-serve-static-core"; import type { FilterQuery } from "mongodb"; + +import db from "#external/mongo/db"; +import { + GetRecentlyAchievedGoals, + GetRecentlyAchievedQuests, + GetRelevantSongsAndCharts, +} from "#utils/db"; +import { DedupeArr } from "#utils/misc"; +import { GetGPT } from "#utils/req-tachi-data"; +import { GetUsersWithIDs } from "#utils/user"; + import type { ChartDocument, ClassAchievementDocument, @@ -16,16 +27,6 @@ import type { UserDocument, } from "../../../../common/src"; -import db from "#external/mongo/db"; -import { - GetRecentlyAchievedGoals, - GetRecentlyAchievedQuests, - GetRelevantSongsAndCharts, -} from "#utils/db"; -import { DedupeArr } from "#utils/misc"; -import { GetGPT } from "#utils/req-tachi-data"; -import { GetUsersWithIDs } from "#utils/user"; - export type ActivityConstraint = FilterQuery< ClassAchievementDocument & ScoreDocument & SessionDocument >; diff --git a/typescript/server/src/lib/game-settings/create-game-settings.ts b/typescript/server/src/lib/game-settings/create-game-settings.ts index 5c6a03a0b..ba143bbdc 100644 --- a/typescript/server/src/lib/game-settings/create-game-settings.ts +++ b/typescript/server/src/lib/game-settings/create-game-settings.ts @@ -1,8 +1,8 @@ -import type { GameGroup, integer, Playtype } from "../../../../common/src"; - import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; +import type { GameGroup, integer, Playtype } from "../../../../common/src"; + const logger = CreateLogCtx(__filename); /** diff --git a/typescript/server/src/lib/game-specific/custom-bms-tables.ts b/typescript/server/src/lib/game-specific/custom-bms-tables.ts index 39b2e4502..aadc34e72 100644 --- a/typescript/server/src/lib/game-specific/custom-bms-tables.ts +++ b/typescript/server/src/lib/game-specific/custom-bms-tables.ts @@ -14,6 +14,7 @@ import { import { GetRecentUGPTScores } from "#utils/queries/scores"; import { GetUser } from "#utils/req-tachi-data"; import path from "path"; + import { type ChartDocument, CreateSongMap, diff --git a/typescript/server/src/lib/game-specific/iidx-playlists.ts b/typescript/server/src/lib/game-specific/iidx-playlists.ts index 65ea583f3..3d235bcd5 100644 --- a/typescript/server/src/lib/game-specific/iidx-playlists.ts +++ b/typescript/server/src/lib/game-specific/iidx-playlists.ts @@ -1,9 +1,9 @@ -import type { ChartDocument, integer, Playtypes } from "../../../../common/src"; - import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import { PoyashiBPI } from "rg-stats"; +import type { ChartDocument, integer, Playtypes } from "../../../../common/src"; + const logger = CreateLogCtx(__filename); interface PlaylistEntry { diff --git a/typescript/server/src/lib/imports/imports.ts b/typescript/server/src/lib/imports/imports.ts index 97aa0f54e..6816d1057 100644 --- a/typescript/server/src/lib/imports/imports.ts +++ b/typescript/server/src/lib/imports/imports.ts @@ -1,5 +1,3 @@ -import type { ImportDocument } from "../../../../common/src"; - import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import { @@ -8,6 +6,8 @@ import { } from "#lib/score-import/framework/import-locks/lock"; import { DeleteMultipleScores } from "#lib/score-mutation/delete-scores"; +import type { ImportDocument } from "../../../../common/src"; + const logger = CreateLogCtx(__filename); interface OngoingImportError { diff --git a/typescript/server/src/lib/invites/invites.ts b/typescript/server/src/lib/invites/invites.ts index d454129f0..b17b3014c 100644 --- a/typescript/server/src/lib/invites/invites.ts +++ b/typescript/server/src/lib/invites/invites.ts @@ -1,9 +1,9 @@ -import type { UserDocument } from "../../../../common/src"; - import { ONE_MONTH } from "#lib/constants/time"; import CreateLogCtx from "#lib/logger/logger"; import { ServerConfig } from "#lib/setup/config"; +import type { UserDocument } from "../../../../common/src"; + const logger = CreateLogCtx(__filename); /** diff --git a/typescript/server/src/lib/jobs/bms-ai-table-sync.ts b/typescript/server/src/lib/jobs/bms-ai-table-sync.ts index 69d71a6cd..3136dff18 100644 --- a/typescript/server/src/lib/jobs/bms-ai-table-sync.ts +++ b/typescript/server/src/lib/jobs/bms-ai-table-sync.ts @@ -1,10 +1,10 @@ -import type { ChartDocument } from "../../../../common/src"; - import CreateLogCtx from "#lib/logger/logger"; import { PullDatabaseSeeds } from "#lib/seeds/repo"; import { WrapScriptPromise } from "#utils/misc"; import fetch from "node-fetch"; +import type { ChartDocument } from "../../../../common/src"; + const AI_URL = "https://bms.hexlataia.xyz/tables/json/ai.json"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/lib/jobs/bms-table-sync.ts b/typescript/server/src/lib/jobs/bms-table-sync.ts index 6022e4c3b..f76fab9eb 100644 --- a/typescript/server/src/lib/jobs/bms-table-sync.ts +++ b/typescript/server/src/lib/jobs/bms-table-sync.ts @@ -7,6 +7,7 @@ import { DeorphanIfInQueue } from "#lib/orphan-queue/orphan-queue"; import { InitaliseFolderChartLookup } from "#utils/folder"; import { FormatBMSTables, WrapScriptPromise } from "#utils/misc"; import { type BMSTableEntry, LoadBMSTable } from "bms-table-loader"; + import { BMS_TABLES, type BMSTableInfo, diff --git a/typescript/server/src/lib/jobs/ugs-snapshot.ts b/typescript/server/src/lib/jobs/ugs-snapshot.ts index 56582758d..673789358 100644 --- a/typescript/server/src/lib/jobs/ugs-snapshot.ts +++ b/typescript/server/src/lib/jobs/ugs-snapshot.ts @@ -1,10 +1,10 @@ -import type { UserGameStats, UserGameStatsSnapshotDocument } from "../../../../common/src"; - import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import { GetMillisecondsSince } from "#utils/misc"; import { GetAllRankings } from "#utils/user"; +import type { UserGameStats, UserGameStatsSnapshotDocument } from "../../../../common/src"; + const logger = CreateLogCtx(__filename); // get the time of this midnight. it's possible this script eclipses itself when weird timezone diff --git a/typescript/server/src/lib/jobs/update-bpi-data.ts b/typescript/server/src/lib/jobs/update-bpi-data.ts index b5420db67..c71db936d 100644 --- a/typescript/server/src/lib/jobs/update-bpi-data.ts +++ b/typescript/server/src/lib/jobs/update-bpi-data.ts @@ -1,3 +1,10 @@ +import db from "#external/mongo/db"; +import CreateLogCtx from "#lib/logger/logger"; +import { BacksyncCollection, PullDatabaseSeeds } from "#lib/seeds/repo"; +import { RecalcAllScores } from "#utils/calculations/recalc-scores"; +import fetch from "#utils/fetch"; +import { WrapScriptPromise } from "#utils/misc"; + import type { ChartDocument, Difficulties, @@ -7,13 +14,6 @@ import type { Versions, } from "../../../../common/src"; -import db from "#external/mongo/db"; -import CreateLogCtx from "#lib/logger/logger"; -import { BacksyncCollection, PullDatabaseSeeds } from "#lib/seeds/repo"; -import { RecalcAllScores } from "#utils/calculations/recalc-scores"; -import fetch from "#utils/fetch"; -import { WrapScriptPromise } from "#utils/misc"; - const logger = CreateLogCtx(__filename); const difficultyResolve: Record = diff --git a/typescript/server/src/lib/migration/migrations/chunithm-lamp-split.ts b/typescript/server/src/lib/migration/migrations/chunithm-lamp-split.ts index 15b785ca6..c1964bb50 100644 --- a/typescript/server/src/lib/migration/migrations/chunithm-lamp-split.ts +++ b/typescript/server/src/lib/migration/migrations/chunithm-lamp-split.ts @@ -1,4 +1,5 @@ import type { Migration } from "#utils/types"; + import type { GetEnumValue } from "../../../../../common/src/types/metrics"; import { diff --git a/typescript/server/src/lib/migration/migrations/maimaidx-fix-lamps.ts b/typescript/server/src/lib/migration/migrations/maimaidx-fix-lamps.ts index 139a86be1..96439afb8 100644 --- a/typescript/server/src/lib/migration/migrations/maimaidx-fix-lamps.ts +++ b/typescript/server/src/lib/migration/migrations/maimaidx-fix-lamps.ts @@ -1,5 +1,4 @@ import type { Migration } from "#utils/types"; -import type { integer, ProvidedMetrics, ScoreDocument } from "../../../../../common/src"; import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; @@ -7,6 +6,8 @@ import { ProcessPBs } from "#lib/score-import/framework/pb/process-pbs"; import UpdateScore from "#lib/score-mutation/update-score"; import { RecalcAllScores } from "#utils/calculations/recalc-scores"; +import type { integer, ProvidedMetrics, ScoreDocument } from "../../../../../common/src"; + const logger = CreateLogCtx(__filename); const migration: Migration = { diff --git a/typescript/server/src/lib/migration/migrations/ongeki-v2.ts b/typescript/server/src/lib/migration/migrations/ongeki-v2.ts index 04f85adec..0471dbf6b 100644 --- a/typescript/server/src/lib/migration/migrations/ongeki-v2.ts +++ b/typescript/server/src/lib/migration/migrations/ongeki-v2.ts @@ -4,6 +4,7 @@ import db from "#external/mongo/db"; import { rootLogger } from "#lib/logger/logger"; import UpdateScore from "#lib/score-mutation/update-score"; import { EfficientDBIterate } from "#utils/efficient-db-iterate"; + import { ONGEKI_NOTE_LAMPS, type ScoreDocument } from "../../../../../common/src"; const migration: Migration = { diff --git a/typescript/server/src/lib/migration/migrations/sessions-to-scoreIDs.ts b/typescript/server/src/lib/migration/migrations/sessions-to-scoreIDs.ts index 6ded2f6f3..c77f4a0a3 100644 --- a/typescript/server/src/lib/migration/migrations/sessions-to-scoreIDs.ts +++ b/typescript/server/src/lib/migration/migrations/sessions-to-scoreIDs.ts @@ -1,9 +1,10 @@ import type { Migration } from "#utils/types"; -import type { SessionDocument } from "../../../../../common/src"; import db from "#external/mongo/db"; import { EfficientDBIterate } from "#utils/efficient-db-iterate"; +import type { SessionDocument } from "../../../../../common/src"; + const migration: Migration = { id: "sessions-to-scoreIDs", up: async () => { diff --git a/typescript/server/src/lib/migration/migrations/v3-props.ts b/typescript/server/src/lib/migration/migrations/v3-props.ts index 965c9aa56..ef955ab2d 100644 --- a/typescript/server/src/lib/migration/migrations/v3-props.ts +++ b/typescript/server/src/lib/migration/migrations/v3-props.ts @@ -1,10 +1,11 @@ import type { Migration } from "#utils/types"; import type { FilterQuery } from "mongodb"; -import type { GoalDocument } from "../../../../../common/src"; import db from "#external/mongo/db"; import { EditGoal } from "#lib/targets/goals"; +import type { GoalDocument } from "../../../../../common/src"; + async function UpdateGoals( query: FilterQuery, newCriteriaKey: string, diff --git a/typescript/server/src/lib/notifications/notification-wrappers.ts b/typescript/server/src/lib/notifications/notification-wrappers.ts index 539f096b9..c034b5265 100644 --- a/typescript/server/src/lib/notifications/notification-wrappers.ts +++ b/typescript/server/src/lib/notifications/notification-wrappers.ts @@ -1,4 +1,5 @@ import db from "#external/mongo/db"; + import { FormatGameGroup, type GameGroup, @@ -6,7 +7,6 @@ import { type Playtype, type UserDocument, } from "../../../../common/src"; - import { BulkSendNotification, SendNotification } from "./notifications"; /** diff --git a/typescript/server/src/lib/notifications/notifications.ts b/typescript/server/src/lib/notifications/notifications.ts index 102a9fece..a8f530ac8 100644 --- a/typescript/server/src/lib/notifications/notifications.ts +++ b/typescript/server/src/lib/notifications/notifications.ts @@ -1,8 +1,8 @@ -import type { integer, NotificationBody, NotificationDocument } from "../../../../common/src"; - import db from "#external/mongo/db"; import { Random20Hex } from "#utils/misc"; +import type { integer, NotificationBody, NotificationDocument } from "../../../../common/src"; + function ConstructNotificationDoc( title: string, toUserID: integer, diff --git a/typescript/server/src/lib/orphan-queue/orphan-queue.ts b/typescript/server/src/lib/orphan-queue/orphan-queue.ts index 99eb88bb2..107ad5efe 100644 --- a/typescript/server/src/lib/orphan-queue/orphan-queue.ts +++ b/typescript/server/src/lib/orphan-queue/orphan-queue.ts @@ -1,4 +1,10 @@ import type { FilterQuery } from "mongodb"; + +import db from "#external/mongo/db"; +import CreateLogCtx from "#lib/logger/logger"; +import { GetNextCounterValue } from "#utils/db"; +import { DedupeArr } from "#utils/misc"; + import type { ChartDocument, GPTString, @@ -8,11 +14,6 @@ import type { SongDocument, } from "../../../../common/src"; -import db from "#external/mongo/db"; -import CreateLogCtx from "#lib/logger/logger"; -import { GetNextCounterValue } from "#utils/db"; -import { DedupeArr } from "#utils/misc"; - const logger = CreateLogCtx(__filename); /** diff --git a/typescript/server/src/lib/rivals/rivals.ts b/typescript/server/src/lib/rivals/rivals.ts index 7cd5136a0..d485a1e08 100644 --- a/typescript/server/src/lib/rivals/rivals.ts +++ b/typescript/server/src/lib/rivals/rivals.ts @@ -7,6 +7,7 @@ import { SendSetRivalNotification } from "#lib/notifications/notification-wrappe import { ServerConfig } from "#lib/setup/config"; import { ArrayDiff } from "#utils/misc"; import { GetUsersWithIDs, GetUserWithIDGuaranteed } from "#utils/user"; + import { FormatGameGroup, type GameGroup, diff --git a/typescript/server/src/lib/score-import/framework/calculated-data/profile-classes.ts b/typescript/server/src/lib/score-import/framework/calculated-data/profile-classes.ts index 7dff028b7..e030a1b81 100644 --- a/typescript/server/src/lib/score-import/framework/calculated-data/profile-classes.ts +++ b/typescript/server/src/lib/score-import/framework/calculated-data/profile-classes.ts @@ -1,8 +1,9 @@ import type { ClassDeriver } from "#game-implementations/types"; -import type { ExtractedClasses, GPTString, UserGameStats } from "../../../../../../common/src"; import { GPT_SERVER_IMPLEMENTATIONS } from "#game-implementations/game-implementations"; +import type { ExtractedClasses, GPTString, UserGameStats } from "../../../../../../common/src"; + export function CalculateDerivedClasses( gptString: GPT, profileRatings: UserGameStats["ratings"], diff --git a/typescript/server/src/lib/score-import/framework/calculated-data/profile.ts b/typescript/server/src/lib/score-import/framework/calculated-data/profile.ts index 404116bdf..7bb53e58b 100644 --- a/typescript/server/src/lib/score-import/framework/calculated-data/profile.ts +++ b/typescript/server/src/lib/score-import/framework/calculated-data/profile.ts @@ -1,4 +1,5 @@ import { GPT_SERVER_IMPLEMENTATIONS } from "#game-implementations/game-implementations"; + import { type GameGroup, GetGPTString, diff --git a/typescript/server/src/lib/score-import/framework/calculated-data/score.ts b/typescript/server/src/lib/score-import/framework/calculated-data/score.ts index eaa9fc799..8447b1efa 100644 --- a/typescript/server/src/lib/score-import/framework/calculated-data/score.ts +++ b/typescript/server/src/lib/score-import/framework/calculated-data/score.ts @@ -1,4 +1,7 @@ import { GPT_SERVER_IMPLEMENTATIONS } from "#game-implementations/game-implementations"; + +import type { DryScoreData } from "../common/types"; + import { type ChartDocument, type GameGroup, @@ -6,8 +9,6 @@ import { type GPTString, } from "../../../../../../common/src"; -import type { DryScoreData } from "../common/types"; - /** * Create calculated data for a score. * @param scores - All of the scores in this session. diff --git a/typescript/server/src/lib/score-import/framework/calculated-data/session.ts b/typescript/server/src/lib/score-import/framework/calculated-data/session.ts index f785f6eaf..65cb01aba 100644 --- a/typescript/server/src/lib/score-import/framework/calculated-data/session.ts +++ b/typescript/server/src/lib/score-import/framework/calculated-data/session.ts @@ -1,4 +1,5 @@ import { GPT_SERVER_IMPLEMENTATIONS } from "#game-implementations/game-implementations"; + import { type GPTString, type ScoreDocument } from "../../../../../../common/src"; /** diff --git a/typescript/server/src/lib/score-import/framework/calculated-data/types.ts b/typescript/server/src/lib/score-import/framework/calculated-data/types.ts index 5e2e20b35..9e6b39b53 100644 --- a/typescript/server/src/lib/score-import/framework/calculated-data/types.ts +++ b/typescript/server/src/lib/score-import/framework/calculated-data/types.ts @@ -1,4 +1,5 @@ import type { KtLogger } from "#lib/logger/logger"; + import type { ClassConfigs, Classes, GPTString, integer } from "../../../../../../common/src"; import type { DerivedClassConfig, diff --git a/typescript/server/src/lib/score-import/framework/common/converter-failures.ts b/typescript/server/src/lib/score-import/framework/common/converter-failures.ts index f1933862a..eb324b9f6 100644 --- a/typescript/server/src/lib/score-import/framework/common/converter-failures.ts +++ b/typescript/server/src/lib/score-import/framework/common/converter-failures.ts @@ -1,7 +1,6 @@ // Various Errors that can occur during processing. import type { ImportTypes } from "../../../../../../common/src"; - import type { ImportTypeContextMap, ImportTypeDataMap } from "../../import-types/common/types"; export type FailureTypes = diff --git a/typescript/server/src/lib/score-import/framework/common/get-input-parser.ts b/typescript/server/src/lib/score-import/framework/common/get-input-parser.ts index a2557ac1f..0a579c331 100644 --- a/typescript/server/src/lib/score-import/framework/common/get-input-parser.ts +++ b/typescript/server/src/lib/score-import/framework/common/get-input-parser.ts @@ -5,10 +5,11 @@ import type { ParserFunctionReturns, } from "#lib/score-import/import-types/common/types"; import type { ScoreImportJobData } from "#lib/score-import/worker/types"; -import type { ImportTypes } from "../../../../../../common/src"; import { Parsers } from "#lib/score-import/import-types/parsers"; +import type { ImportTypes } from "../../../../../../common/src"; + export function GetInputParser(jobData: ScoreImportJobData) { // Retrieve the set parser function for this import type. const ParserFunction = Parsers[jobData.importType]; diff --git a/typescript/server/src/lib/score-import/framework/common/import-logger.ts b/typescript/server/src/lib/score-import/framework/common/import-logger.ts index 756e2df9d..5a7f108f7 100644 --- a/typescript/server/src/lib/score-import/framework/common/import-logger.ts +++ b/typescript/server/src/lib/score-import/framework/common/import-logger.ts @@ -1,8 +1,8 @@ -import type { ImportTypes, UserDocument } from "../../../../../../common/src"; - import { type KtLogger, rootLogger } from "#lib/logger/logger"; import { FormatUserDoc } from "#utils/user"; +import type { ImportTypes, UserDocument } from "../../../../../../common/src"; + export function CreateScoreLogger( user: UserDocument, importID: string, diff --git a/typescript/server/src/lib/score-import/framework/common/string-asserts.ts b/typescript/server/src/lib/score-import/framework/common/string-asserts.ts index 74786f696..c00be4ee5 100644 --- a/typescript/server/src/lib/score-import/framework/common/string-asserts.ts +++ b/typescript/server/src/lib/score-import/framework/common/string-asserts.ts @@ -5,7 +5,6 @@ import { type GPTString, type Playtype, } from "../../../../../../common/src"; - import { InvalidScoreFailure } from "./converter-failures"; export function AssertStrAsDifficulty( diff --git a/typescript/server/src/lib/score-import/framework/common/types.ts b/typescript/server/src/lib/score-import/framework/common/types.ts index 03f61d7a8..48aab9d96 100644 --- a/typescript/server/src/lib/score-import/framework/common/types.ts +++ b/typescript/server/src/lib/score-import/framework/common/types.ts @@ -1,4 +1,5 @@ import type { Mutable } from "#utils/types"; + import type { ConfProvidedMetrics, GPTString, diff --git a/typescript/server/src/lib/score-import/framework/express-wrapper.ts b/typescript/server/src/lib/score-import/framework/express-wrapper.ts index 13715ca8c..d94c32272 100644 --- a/typescript/server/src/lib/score-import/framework/express-wrapper.ts +++ b/typescript/server/src/lib/score-import/framework/express-wrapper.ts @@ -1,3 +1,6 @@ +import CreateLogCtx from "#lib/logger/logger"; +import { Random20Hex } from "#utils/misc"; + import type { ImportDocument, ImportTypes, @@ -5,10 +8,6 @@ import type { SuccessfulAPIResponse, UnsuccessfulAPIResponse, } from "../../../../../common/src"; - -import CreateLogCtx from "#lib/logger/logger"; -import { Random20Hex } from "#utils/misc"; - import type { ParserArguments } from "../worker/types"; import { MakeScoreImport } from "./score-import"; diff --git a/typescript/server/src/lib/score-import/framework/goals/goals.ts b/typescript/server/src/lib/score-import/framework/goals/goals.ts index 94eba330d..39e4f925f 100644 --- a/typescript/server/src/lib/score-import/framework/goals/goals.ts +++ b/typescript/server/src/lib/score-import/framework/goals/goals.ts @@ -1,4 +1,9 @@ import type { KtLogger } from "#lib/logger/logger"; + +import db from "#external/mongo/db"; +import { EvaluateGoalForUser, GetRelevantGoals } from "#lib/targets/goals"; +import { EmitWebhookEvent } from "#lib/webhooks/webhooks"; + import type { GameGroup, GoalDocument, @@ -6,10 +11,6 @@ import type { integer, } from "../../../../../../common/src"; -import db from "#external/mongo/db"; -import { EvaluateGoalForUser, GetRelevantGoals } from "#lib/targets/goals"; -import { EmitWebhookEvent } from "#lib/webhooks/webhooks"; - /** * Update a user's progress on all of their set goals. */ diff --git a/typescript/server/src/lib/score-import/framework/import-locks/lock.ts b/typescript/server/src/lib/score-import/framework/import-locks/lock.ts index e52970656..0abf5cc06 100644 --- a/typescript/server/src/lib/score-import/framework/import-locks/lock.ts +++ b/typescript/server/src/lib/score-import/framework/import-locks/lock.ts @@ -1,9 +1,9 @@ -import type { integer } from "../../../../../../common/src"; - import db from "#external/mongo/db"; import { ONE_DAY, ONE_HOUR } from "#lib/constants/time"; import CreateLogCtx from "#lib/logger/logger"; +import type { integer } from "../../../../../../common/src"; + const logger = CreateLogCtx(__filename); /** diff --git a/typescript/server/src/lib/score-import/framework/orphans/orphans.test.ts b/typescript/server/src/lib/score-import/framework/orphans/orphans.test.ts index 09d571f7e..1102f53df 100644 --- a/typescript/server/src/lib/score-import/framework/orphans/orphans.test.ts +++ b/typescript/server/src/lib/score-import/framework/orphans/orphans.test.ts @@ -1,5 +1,3 @@ -import type { BatchManualScore } from "../../../../../../common/src"; - import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import ResetDBState from "#test-utils/resets"; @@ -7,6 +5,7 @@ import deepmerge from "deepmerge"; import fjsh from "fast-json-stable-hash"; import t from "tap"; +import type { BatchManualScore } from "../../../../../../common/src"; import type { BatchManualContext } from "../../import-types/common/batch-manual/types"; import type { OrphanScoreDocument } from "../../import-types/common/types"; diff --git a/typescript/server/src/lib/score-import/framework/orphans/orphans.ts b/typescript/server/src/lib/score-import/framework/orphans/orphans.ts index b0d2c8ce6..522073b00 100644 --- a/typescript/server/src/lib/score-import/framework/orphans/orphans.ts +++ b/typescript/server/src/lib/score-import/framework/orphans/orphans.ts @@ -1,12 +1,12 @@ import type { KtLogger } from "#lib/logger/logger"; import type { FilterQuery } from "mongodb"; -import type { GameGroup, ImportTypes, integer } from "../../../../../../common/src"; import db from "#external/mongo/db"; import { GetBlacklist } from "#utils/queries/blacklist"; import { GetUserWithID } from "#utils/user"; import fjsh from "fast-json-stable-hash"; +import type { GameGroup, ImportTypes, integer } from "../../../../../../common/src"; import type { ConverterFnReturnOrFailure, ConverterFunction, diff --git a/typescript/server/src/lib/score-import/framework/pb/create-pb-doc.test.ts b/typescript/server/src/lib/score-import/framework/pb/create-pb-doc.test.ts index 7116671cd..880c054c2 100644 --- a/typescript/server/src/lib/score-import/framework/pb/create-pb-doc.test.ts +++ b/typescript/server/src/lib/score-import/framework/pb/create-pb-doc.test.ts @@ -8,9 +8,9 @@ import { TestingIIDXSPScore, } from "#test-utils/test-data"; import deepmerge from "deepmerge"; -import { IIDX_GRADES, IIDX_LAMPS } from "../../../../../../common/src"; import t from "tap"; +import { IIDX_GRADES, IIDX_LAMPS } from "../../../../../../common/src"; import { CreatePBDoc, type PBScoreDocumentNoRank } from "./create-pb-doc"; const IIDXScore = TestingIIDXSPScore; diff --git a/typescript/server/src/lib/score-import/framework/pb/create-pb-doc.ts b/typescript/server/src/lib/score-import/framework/pb/create-pb-doc.ts index 1aacfe5c5..cea6d3452 100644 --- a/typescript/server/src/lib/score-import/framework/pb/create-pb-doc.ts +++ b/typescript/server/src/lib/score-import/framework/pb/create-pb-doc.ts @@ -2,9 +2,10 @@ import type { KtLogger } from "#lib/logger/logger"; import type { BulkWriteUpdateOneOperation, FilterQuery, SortOptionObject } from "mongodb"; import db from "#external/mongo/db"; +import { GPT_SERVER_IMPLEMENTATIONS } from "#game-implementations/game-implementations"; import { GetEveryonesRivalIDs } from "#lib/rivals/rivals"; import { DeleteUndefinedProps } from "#utils/misc"; -import { GPT_SERVER_IMPLEMENTATIONS } from "#game-implementations/game-implementations"; + import { type ChartDocument, type GameGroup, @@ -16,7 +17,6 @@ import { type Playtype, type ScoreDocument, } from "../../../../../../common/src"; - import { CreateScoreCalcData } from "../calculated-data/score"; import { CreateEnumIndexes } from "../score-importing/derivers"; diff --git a/typescript/server/src/lib/score-import/framework/pb/process-pbs.ts b/typescript/server/src/lib/score-import/framework/pb/process-pbs.ts index 077dfd3c7..ac30bfed3 100644 --- a/typescript/server/src/lib/score-import/framework/pb/process-pbs.ts +++ b/typescript/server/src/lib/score-import/framework/pb/process-pbs.ts @@ -2,13 +2,13 @@ import type { KtLogger } from "#lib/logger/logger"; import db from "#external/mongo/db"; import { GetChartForIDGuaranteed } from "#utils/db"; + import { type GameGroup, GetGPTString, type integer, type Playtype, } from "../../../../../../common/src"; - import { CreatePBDoc, type PBScoreDocumentNoRank, UpdateChartRanking } from "./create-pb-doc"; /** diff --git a/typescript/server/src/lib/score-import/framework/profile-calculated-data/classes.test.ts b/typescript/server/src/lib/score-import/framework/profile-calculated-data/classes.test.ts index 576e6a76f..0fa71a8f8 100644 --- a/typescript/server/src/lib/score-import/framework/profile-calculated-data/classes.test.ts +++ b/typescript/server/src/lib/score-import/framework/profile-calculated-data/classes.test.ts @@ -1,8 +1,8 @@ import CreateLogCtx from "#lib/logger/logger"; import ResetDBState from "#test-utils/resets"; -import { GITADORA_COLOURS, type UserGameStats } from "../../../../../../common/src"; import t from "tap"; +import { GITADORA_COLOURS, type UserGameStats } from "../../../../../../common/src"; import { CalculateUGPTClasses, ProcessClassDeltas } from "./classes"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/lib/score-import/framework/profile-calculated-data/classes.ts b/typescript/server/src/lib/score-import/framework/profile-calculated-data/classes.ts index d3415f285..358a9134d 100644 --- a/typescript/server/src/lib/score-import/framework/profile-calculated-data/classes.ts +++ b/typescript/server/src/lib/score-import/framework/profile-calculated-data/classes.ts @@ -4,6 +4,9 @@ import db from "#external/mongo/db"; import { EmitWebhookEvent } from "#lib/webhooks/webhooks"; import { ReturnClassIfGreater } from "#utils/class"; import deepmerge from "deepmerge"; + +import type { ClassProvider } from "../calculated-data/types"; + import { type AnyClasses, type ClassDelta, @@ -17,9 +20,6 @@ import { type Playtype, type UserGameStats, } from "../../../../../../common/src"; - -import type { ClassProvider } from "../calculated-data/types"; - import { CalculateDerivedClasses } from "../calculated-data/profile-classes"; /** diff --git a/typescript/server/src/lib/score-import/framework/quests/quests.ts b/typescript/server/src/lib/score-import/framework/quests/quests.ts index 6e1993784..21120fa5b 100644 --- a/typescript/server/src/lib/score-import/framework/quests/quests.ts +++ b/typescript/server/src/lib/score-import/framework/quests/quests.ts @@ -1,5 +1,10 @@ import type { KtLogger } from "#lib/logger/logger"; import type { BulkWriteUpdateOneOperation } from "mongodb"; + +import db from "#external/mongo/db"; +import { EvaluateQuestProgress } from "#lib/targets/quests"; +import { EmitWebhookEvent } from "#lib/webhooks/webhooks"; + import type { GameGroup, GoalImportInfo, @@ -10,10 +15,6 @@ import type { QuestSubscriptionDocument, } from "../../../../../../common/src"; -import db from "#external/mongo/db"; -import { EvaluateQuestProgress } from "#lib/targets/quests"; -import { EmitWebhookEvent } from "#lib/webhooks/webhooks"; - export async function UpdateUsersQuests( importGoalInfo: Array, game: GameGroup, diff --git a/typescript/server/src/lib/score-import/framework/score-import.ts b/typescript/server/src/lib/score-import/framework/score-import.ts index e78a15712..98858a9bb 100644 --- a/typescript/server/src/lib/score-import/framework/score-import.ts +++ b/typescript/server/src/lib/score-import/framework/score-import.ts @@ -1,10 +1,9 @@ -import type { ImportDocument, ImportTypes, integer } from "../../../../../common/src"; - import { JOB_RETRY_COUNT } from "#lib/constants/tachi"; import CreateLogCtx from "#lib/logger/logger"; import { ServerConfig } from "#lib/setup/config"; import { Sleep } from "#utils/misc"; +import type { ImportDocument, ImportTypes, integer } from "../../../../../common/src"; import type { ScoreImportJobData, ScoreImportWorkerReturns } from "../worker/types"; import ScoreImportQueue, { ScoreImportQueueEvents } from "../worker/queue"; diff --git a/typescript/server/src/lib/score-import/framework/score-importing/derivers.ts b/typescript/server/src/lib/score-import/framework/score-importing/derivers.ts index 0dbd0821e..0bcfc0303 100644 --- a/typescript/server/src/lib/score-import/framework/score-importing/derivers.ts +++ b/typescript/server/src/lib/score-import/framework/score-importing/derivers.ts @@ -1,8 +1,11 @@ -import type { KtLogger } from "#lib/logger/logger"; import type { GPTDerivers } from "#game-implementations/types"; -import type { MetricValue } from "../../../../../../common/src/types/metrics"; +import type { KtLogger } from "#lib/logger/logger"; import { GPT_SERVER_IMPLEMENTATIONS } from "#game-implementations/game-implementations"; + +import type { MetricValue } from "../../../../../../common/src/types/metrics"; +import type { DryScore, DryScoreData } from "../common/types"; + import { type ChartDocument, type DerivedMetrics, @@ -13,9 +16,6 @@ import { type ScoreData, type ScoreEnumIndexes, } from "../../../../../../common/src"; - -import type { DryScore, DryScoreData } from "../common/types"; - import { InternalFailure } from "../common/converter-failures"; /** diff --git a/typescript/server/src/lib/score-import/framework/score-importing/hydrate-score.ts b/typescript/server/src/lib/score-import/framework/score-importing/hydrate-score.ts index 3d9841208..8d7f7da09 100644 --- a/typescript/server/src/lib/score-import/framework/score-importing/hydrate-score.ts +++ b/typescript/server/src/lib/score-import/framework/score-importing/hydrate-score.ts @@ -1,5 +1,7 @@ import type { KtLogger } from "#lib/logger/logger"; +import type { DryScore } from "../common/types"; + import { type ChartDocument, GetGPTString, @@ -7,9 +9,6 @@ import { type ScoreDocument, type SongDocument, } from "../../../../../../common/src"; - -import type { DryScore } from "../common/types"; - import { CreateScoreCalcData } from "../calculated-data/score"; import { CreateFullScoreData } from "./derivers"; diff --git a/typescript/server/src/lib/score-import/framework/score-importing/insert-score.test.ts b/typescript/server/src/lib/score-import/framework/score-importing/insert-score.test.ts index 108c7a37a..229362b3a 100644 --- a/typescript/server/src/lib/score-import/framework/score-importing/insert-score.test.ts +++ b/typescript/server/src/lib/score-import/framework/score-importing/insert-score.test.ts @@ -1,9 +1,9 @@ -import type { ScoreDocument } from "../../../../../../common/src"; - import db from "#external/mongo/db"; import ResetDBState from "#test-utils/resets"; import t from "tap"; +import type { ScoreDocument } from "../../../../../../common/src"; + import { InsertQueue, QueueScoreInsert } from "./insert-score"; // these two get the same tests, because they're too closely linked diff --git a/typescript/server/src/lib/score-import/framework/score-importing/insert-score.ts b/typescript/server/src/lib/score-import/framework/score-importing/insert-score.ts index cb2c17a15..28193f963 100644 --- a/typescript/server/src/lib/score-import/framework/score-importing/insert-score.ts +++ b/typescript/server/src/lib/score-import/framework/score-importing/insert-score.ts @@ -1,8 +1,8 @@ -import type { integer, ScoreDocument } from "../../../../../../common/src"; - import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; +import type { integer, ScoreDocument } from "../../../../../../common/src"; + const logger = CreateLogCtx(__filename); const MAX_PIPELINE_LENGTH = 500; diff --git a/typescript/server/src/lib/score-import/framework/score-importing/score-id.ts b/typescript/server/src/lib/score-import/framework/score-importing/score-id.ts index 973749711..b6a896332 100644 --- a/typescript/server/src/lib/score-import/framework/score-importing/score-id.ts +++ b/typescript/server/src/lib/score-import/framework/score-importing/score-id.ts @@ -2,6 +2,9 @@ import type { KtLogger } from "#lib/logger/logger"; import db from "#external/mongo/db"; import fjsh from "fast-json-stable-hash"; + +import type { DryScore } from "../common/types"; + import { GetGPTConfig, type GPTString, @@ -10,8 +13,6 @@ import { type ProvidedMetrics, } from "../../../../../../common/src"; -import type { DryScore } from "../common/types"; - /** * Creates an identifier for this score. * This is used to deduplicate repeated scores. diff --git a/typescript/server/src/lib/score-import/framework/score-importing/score-import-main.ts b/typescript/server/src/lib/score-import/framework/score-importing/score-import-main.ts index cf490ff48..c750c4c6d 100644 --- a/typescript/server/src/lib/score-import/framework/score-importing/score-import-main.ts +++ b/typescript/server/src/lib/score-import/framework/score-importing/score-import-main.ts @@ -4,6 +4,11 @@ import type { ScoreImportJob } from "#lib/score-import/worker/types"; import db from "#external/mongo/db"; import { GetMillisecondsSince } from "#utils/misc"; import { GetUserWithID } from "#utils/user"; + +import type { ConverterFunction, ImportInputParser } from "../../import-types/common/types"; +import type { ClassProvider } from "../calculated-data/types"; +import type { ChartIDPlaytypeMap, ScorePlaytypeMap } from "../common/types"; + import { type GameGroup, GetGameGroupConfig, @@ -15,11 +20,6 @@ import { type Playtype, type UserDocument, } from "../../../../../../common/src"; - -import type { ConverterFunction, ImportInputParser } from "../../import-types/common/types"; -import type { ClassProvider } from "../calculated-data/types"; -import type { ChartIDPlaytypeMap, ScorePlaytypeMap } from "../common/types"; - import { Converters } from "../../import-types/converters"; import { InternalFailure } from "../common/converter-failures"; import { CreateScoreLogger } from "../common/import-logger"; diff --git a/typescript/server/src/lib/score-import/framework/score-importing/score-importing.ts b/typescript/server/src/lib/score-import/framework/score-importing/score-importing.ts index 48ba9a0d8..c37920b49 100644 --- a/typescript/server/src/lib/score-import/framework/score-importing/score-importing.ts +++ b/typescript/server/src/lib/score-import/framework/score-importing/score-importing.ts @@ -3,6 +3,10 @@ import type { ScoreImportJob } from "#lib/score-import/worker/types"; import db from "#external/mongo/db"; import { AppendLogCtx, type KtLogger } from "#lib/logger/logger"; import { ClassToObject } from "#utils/misc"; + +import type { ConverterFnSuccessReturn, ConverterFunction } from "../../import-types/common/types"; +import type { DryScore } from "../common/types"; + import { type ChartDocument, type GameGroup, @@ -13,10 +17,6 @@ import { type ScoreDocument, type SongDocument, } from "../../../../../../common/src"; - -import type { ConverterFnSuccessReturn, ConverterFunction } from "../../import-types/common/types"; -import type { DryScore } from "../common/types"; - import { type AmbiguousTitleFailure, type ConverterFailure, diff --git a/typescript/server/src/lib/score-import/framework/score-importing/validate-score.ts b/typescript/server/src/lib/score-import/framework/score-importing/validate-score.ts index 18f165c64..c531e1c91 100644 --- a/typescript/server/src/lib/score-import/framework/score-importing/validate-score.ts +++ b/typescript/server/src/lib/score-import/framework/score-importing/validate-score.ts @@ -1,8 +1,9 @@ -import type { ConfScoreMetric } from "../../../../../../common/src/types/metrics"; - -import { ONE_HOUR } from "#lib/constants/time"; import { GPT_SERVER_IMPLEMENTATIONS } from "#game-implementations/game-implementations"; import { RunValidators } from "#game-implementations/games/_common"; +import { ONE_HOUR } from "#lib/constants/time"; + +import type { ConfScoreMetric } from "../../../../../../common/src/types/metrics"; + import { type ChartDocument, GetGPTConfig, @@ -10,7 +11,6 @@ import { type GPTString, type ScoreDocument, } from "../../../../../../common/src"; - import { InvalidScoreFailure } from "../common/converter-failures"; /** diff --git a/typescript/server/src/lib/score-import/framework/sessions/sessions.test.ts b/typescript/server/src/lib/score-import/framework/sessions/sessions.test.ts index eee14282a..869a685f5 100644 --- a/typescript/server/src/lib/score-import/framework/sessions/sessions.test.ts +++ b/typescript/server/src/lib/score-import/framework/sessions/sessions.test.ts @@ -1,11 +1,11 @@ -import type { ScoreDocument, SessionDocument, UserDocument } from "../../../../../../common/src"; - import db from "#external/mongo/db"; import ResetDBState from "#test-utils/resets"; import { TestingIIDXSPScore, TestingIIDXSPScorePB } from "#test-utils/test-data"; import deepmerge from "deepmerge"; import t from "tap"; +import type { ScoreDocument, SessionDocument, UserDocument } from "../../../../../../common/src"; + import { CreateScoreLogger } from "../common/import-logger"; import { CreateSessions, LoadScoresIntoSessions } from "./sessions"; diff --git a/typescript/server/src/lib/score-import/framework/sessions/sessions.ts b/typescript/server/src/lib/score-import/framework/sessions/sessions.ts index 6364ab8c2..9a785b00b 100644 --- a/typescript/server/src/lib/score-import/framework/sessions/sessions.ts +++ b/typescript/server/src/lib/score-import/framework/sessions/sessions.ts @@ -4,6 +4,9 @@ import CreateLogCtx, { AppendLogCtx, type KtLogger } from "#lib/logger/logger"; import { GetChartForIDGuaranteed } from "#utils/db"; import { GetScoresFromSession } from "#utils/session"; import crypto from "crypto"; + +import type { ScorePlaytypeMap } from "../common/types"; + import { type GameGroup, GetGamePTConfig, @@ -17,9 +20,6 @@ import { type SessionInfoReturn, type SessionScoreInfo, } from "../../../../../../common/src"; - -import type { ScorePlaytypeMap } from "../common/types"; - import { CreateSessionCalcData } from "../calculated-data/session"; import { CreatePBDoc, type PBScoreDocumentNoRank } from "../pb/create-pb-doc"; import { GenerateRandomSessionName } from "./name-generation"; diff --git a/typescript/server/src/lib/score-import/framework/status-tracking/import-status-tracking.ts b/typescript/server/src/lib/score-import/framework/status-tracking/import-status-tracking.ts index 414891464..144a45f8f 100644 --- a/typescript/server/src/lib/score-import/framework/status-tracking/import-status-tracking.ts +++ b/typescript/server/src/lib/score-import/framework/status-tracking/import-status-tracking.ts @@ -1,11 +1,11 @@ import type { ScoreImportJobData } from "#lib/score-import/worker/types"; -import type { ImportTypes } from "../../../../../../common/src"; import db from "#external/mongo/db"; import { CDNStoreOrOverwrite } from "#lib/cdn/cdn"; import { GetScoreImportInputURL } from "#lib/cdn/url-format"; import CreateLogCtx from "#lib/logger/logger"; +import type { ImportTypes } from "../../../../../../common/src"; import type ScoreImportFatalError from "../score-importing/score-import-error"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/lib/score-import/framework/ugpt-stats/update-ugpt-stats.ts b/typescript/server/src/lib/score-import/framework/ugpt-stats/update-ugpt-stats.ts index 9b819d945..4706860fa 100644 --- a/typescript/server/src/lib/score-import/framework/ugpt-stats/update-ugpt-stats.ts +++ b/typescript/server/src/lib/score-import/framework/ugpt-stats/update-ugpt-stats.ts @@ -1,4 +1,8 @@ import type { KtLogger } from "#lib/logger/logger"; + +import db from "#external/mongo/db"; +import { CreateGameSettings } from "#lib/game-settings/create-game-settings"; + import type { ClassDelta, GameGroup, @@ -6,10 +10,6 @@ import type { Playtype, UserGameStats, } from "../../../../../../common/src"; - -import db from "#external/mongo/db"; -import { CreateGameSettings } from "#lib/game-settings/create-game-settings"; - import type { ClassProvider } from "../calculated-data/types"; import { CalculateProfileRatings } from "../calculated-data/profile"; diff --git a/typescript/server/src/lib/score-import/import-types/api/eag-iidx/parser.ts b/typescript/server/src/lib/score-import/import-types/api/eag-iidx/parser.ts index 7b66b803e..a379053c8 100644 --- a/typescript/server/src/lib/score-import/import-types/api/eag-iidx/parser.ts +++ b/typescript/server/src/lib/score-import/import-types/api/eag-iidx/parser.ts @@ -1,8 +1,9 @@ import type { KtLogger } from "#lib/logger/logger"; -import type { integer } from "../../../../../../../common/src"; import { GetKaiAuthGuaranteed } from "#utils/queries/auth"; +import type { integer } from "../../../../../../../common/src"; + import { ParseKaiIIDX } from "../../common/api-kai/iidx/parser"; export async function ParseEagIIDX(userID: integer, logger: KtLogger) { diff --git a/typescript/server/src/lib/score-import/import-types/api/eag-sdvx/parser.ts b/typescript/server/src/lib/score-import/import-types/api/eag-sdvx/parser.ts index aa2b27a50..509c3bba1 100644 --- a/typescript/server/src/lib/score-import/import-types/api/eag-sdvx/parser.ts +++ b/typescript/server/src/lib/score-import/import-types/api/eag-sdvx/parser.ts @@ -1,8 +1,9 @@ import type { KtLogger } from "#lib/logger/logger"; -import type { integer } from "../../../../../../../common/src"; import { GetKaiAuthGuaranteed } from "#utils/queries/auth"; +import type { integer } from "../../../../../../../common/src"; + import { ParseKaiSDVX } from "../../common/api-kai/sdvx/parser"; export async function ParseEagSDVX(userID: integer, logger: KtLogger) { diff --git a/typescript/server/src/lib/score-import/import-types/api/flo-iidx/parser.ts b/typescript/server/src/lib/score-import/import-types/api/flo-iidx/parser.ts index 3cc2ea840..4852ecc12 100644 --- a/typescript/server/src/lib/score-import/import-types/api/flo-iidx/parser.ts +++ b/typescript/server/src/lib/score-import/import-types/api/flo-iidx/parser.ts @@ -1,8 +1,9 @@ import type { KtLogger } from "#lib/logger/logger"; -import type { integer } from "../../../../../../../common/src"; import { GetKaiAuthGuaranteed } from "#utils/queries/auth"; +import type { integer } from "../../../../../../../common/src"; + import { ParseKaiIIDX } from "../../common/api-kai/iidx/parser"; export async function ParseFloIIDX(userID: integer, logger: KtLogger) { diff --git a/typescript/server/src/lib/score-import/import-types/api/flo-sdvx/parser.ts b/typescript/server/src/lib/score-import/import-types/api/flo-sdvx/parser.ts index 5c2e70f9e..95d4e01c5 100644 --- a/typescript/server/src/lib/score-import/import-types/api/flo-sdvx/parser.ts +++ b/typescript/server/src/lib/score-import/import-types/api/flo-sdvx/parser.ts @@ -1,8 +1,9 @@ import type { KtLogger } from "#lib/logger/logger"; -import type { integer } from "../../../../../../../common/src"; import { GetKaiAuthGuaranteed } from "#utils/queries/auth"; +import type { integer } from "../../../../../../../common/src"; + import { ParseKaiSDVX } from "../../common/api-kai/sdvx/parser"; export async function ParseFloSDVX(userID: integer, logger: KtLogger) { diff --git a/typescript/server/src/lib/score-import/import-types/api/myt-chunithm/converter.test.ts b/typescript/server/src/lib/score-import/import-types/api/myt-chunithm/converter.test.ts index c8a20deee..b4093b122 100644 --- a/typescript/server/src/lib/score-import/import-types/api/myt-chunithm/converter.test.ts +++ b/typescript/server/src/lib/score-import/import-types/api/myt-chunithm/converter.test.ts @@ -1,8 +1,5 @@ import CreateLogCtx from "#lib/logger/logger"; import { ParseDateFromString } from "#lib/score-import/framework/common/score-utils"; -import { dmf } from "#test-utils/misc"; -import ResetDBState from "#test-utils/resets"; -import { TestingChunithmChartConverter, TestingChunithmSongConverter } from "#test-utils/test-data"; import { ChunithmClearStatus, ChunithmComboStatus, @@ -10,6 +7,9 @@ import { ChunithmLevel, ChunithmScoreRank, } from "#proto/generated/chunithm/common_pb"; +import { dmf } from "#test-utils/misc"; +import ResetDBState from "#test-utils/resets"; +import { TestingChunithmChartConverter, TestingChunithmSongConverter } from "#test-utils/test-data"; import t from "tap"; import type { MytChunithmScore } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/api/myt-chunithm/converter.ts b/typescript/server/src/lib/score-import/import-types/api/myt-chunithm/converter.ts index 48ecc3e18..4201b3c04 100644 --- a/typescript/server/src/lib/score-import/import-types/api/myt-chunithm/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/api/myt-chunithm/converter.ts @@ -8,13 +8,13 @@ import { SongOrChartNotFoundFailure, } from "#lib/score-import/framework/common/converter-failures"; import { ParseDateFromString } from "#lib/score-import/framework/common/score-utils"; -import { FindChartOnInGameID } from "#utils/queries/charts"; -import { FindSongOnID } from "#utils/queries/songs"; import { ChunithmClearStatus, ChunithmComboStatus, ChunithmLevel, } from "#proto/generated/chunithm/common_pb"; +import { FindChartOnInGameID } from "#utils/queries/charts"; +import { FindSongOnID } from "#utils/queries/songs"; import type { ConverterFunction } from "../../common/types"; import type { MytChunithmScore } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/api/myt-chunithm/parser.ts b/typescript/server/src/lib/score-import/import-types/api/myt-chunithm/parser.ts index cb38678f9..5d0b6a562 100644 --- a/typescript/server/src/lib/score-import/import-types/api/myt-chunithm/parser.ts +++ b/typescript/server/src/lib/score-import/import-types/api/myt-chunithm/parser.ts @@ -1,12 +1,12 @@ import type { KtLogger } from "#lib/logger/logger"; import type { EmptyObject } from "#utils/types"; -import type { integer } from "../../../../../../../common/src"; import ScoreImportFatalError from "#lib/score-import/framework/score-importing/score-import-error"; -import { credentials } from "@grpc/grpc-js"; import { ChunithmUserClient } from "#proto/generated/chunithm/user_grpc_pb"; import { GetPlaylogRequest, type GetPlaylogStreamItem } from "#proto/generated/chunithm/user_pb"; +import { credentials } from "@grpc/grpc-js"; +import type { integer } from "../../../../../../../common/src"; import type { ParserFunctionReturns } from "../../common/types"; import type { MytChunithmScore } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/api/myt-maimaidx/converter.test.ts b/typescript/server/src/lib/score-import/import-types/api/myt-maimaidx/converter.test.ts index 3f54c406d..61c014758 100644 --- a/typescript/server/src/lib/score-import/import-types/api/myt-maimaidx/converter.test.ts +++ b/typescript/server/src/lib/score-import/import-types/api/myt-maimaidx/converter.test.ts @@ -1,14 +1,14 @@ import CreateLogCtx from "#lib/logger/logger"; import { ParseDateFromString } from "#lib/score-import/framework/common/score-utils"; -import { dmf } from "#test-utils/misc"; -import ResetDBState from "#test-utils/resets"; -import { TestingMaimaiDXChartConverter, TestingMaimaiDXSongConverter } from "#test-utils/test-data"; import { MaimaiComboStatus, MaimaiLevel, MaimaiScoreRank, MaimaiSyncStatus, } from "#proto/generated/maimai/common_pb"; +import { dmf } from "#test-utils/misc"; +import ResetDBState from "#test-utils/resets"; +import { TestingMaimaiDXChartConverter, TestingMaimaiDXSongConverter } from "#test-utils/test-data"; import t from "tap"; import type { MytMaimaiDxScore } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/api/myt-maimaidx/converter.ts b/typescript/server/src/lib/score-import/import-types/api/myt-maimaidx/converter.ts index 99ea84272..58310f91a 100644 --- a/typescript/server/src/lib/score-import/import-types/api/myt-maimaidx/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/api/myt-maimaidx/converter.ts @@ -1,6 +1,5 @@ import type { DryScore } from "#lib/score-import/framework/common/types"; import type { EmptyObject } from "#utils/types"; -import type { ScoreData } from "../../../../../../../common/src"; import { InternalFailure, @@ -9,10 +8,11 @@ import { SongOrChartNotFoundFailure, } from "#lib/score-import/framework/common/converter-failures"; import { ParseDateFromString } from "#lib/score-import/framework/common/score-utils"; +import { MaimaiComboStatus, MaimaiLevel } from "#proto/generated/maimai/common_pb"; import { FindChartOnInGameID } from "#utils/queries/charts"; import { FindSongOnID } from "#utils/queries/songs"; -import { MaimaiComboStatus, MaimaiLevel } from "#proto/generated/maimai/common_pb"; +import type { ScoreData } from "../../../../../../../common/src"; import type { ConverterFunction } from "../../common/types"; import type { MytMaimaiDxScore } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/api/myt-maimaidx/parser.ts b/typescript/server/src/lib/score-import/import-types/api/myt-maimaidx/parser.ts index c58aaf774..de06ebc4a 100644 --- a/typescript/server/src/lib/score-import/import-types/api/myt-maimaidx/parser.ts +++ b/typescript/server/src/lib/score-import/import-types/api/myt-maimaidx/parser.ts @@ -1,12 +1,12 @@ import type { KtLogger } from "#lib/logger/logger"; import type { EmptyObject } from "#utils/types"; -import type { integer } from "../../../../../../../common/src"; import ScoreImportFatalError from "#lib/score-import/framework/score-importing/score-import-error"; -import { credentials } from "@grpc/grpc-js"; import { MaimaiUserClient } from "#proto/generated/maimai/user_grpc_pb"; import { GetPlaylogRequest, type GetPlaylogStreamItem } from "#proto/generated/maimai/user_pb"; +import { credentials } from "@grpc/grpc-js"; +import type { integer } from "../../../../../../../common/src"; import type { ParserFunctionReturns } from "../../common/types"; import type { MytMaimaiDxScore } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/api/myt-ongeki/converter.test.ts b/typescript/server/src/lib/score-import/import-types/api/myt-ongeki/converter.test.ts index eb5110e4e..6e564dbb7 100644 --- a/typescript/server/src/lib/score-import/import-types/api/myt-ongeki/converter.test.ts +++ b/typescript/server/src/lib/score-import/import-types/api/myt-ongeki/converter.test.ts @@ -1,8 +1,5 @@ import CreateLogCtx from "#lib/logger/logger"; import { ParseDateFromString } from "#lib/score-import/framework/common/score-utils"; -import { dmf } from "#test-utils/misc"; -import ResetDBState from "#test-utils/resets"; -import { TestingOngekiChartConverter, TestingOngekiSongConverter } from "#test-utils/test-data"; import { OngekiBattleScoreRank, OngekiClearStatus, @@ -10,6 +7,9 @@ import { OngekiLevel, OngekiTechScoreRank, } from "#proto/generated/ongeki/common_pb"; +import { dmf } from "#test-utils/misc"; +import ResetDBState from "#test-utils/resets"; +import { TestingOngekiChartConverter, TestingOngekiSongConverter } from "#test-utils/test-data"; import t from "tap"; import type { MytOngekiScore } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/api/myt-ongeki/converter.ts b/typescript/server/src/lib/score-import/import-types/api/myt-ongeki/converter.ts index 25f1a09c9..c9cffbbce 100644 --- a/typescript/server/src/lib/score-import/import-types/api/myt-ongeki/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/api/myt-ongeki/converter.ts @@ -1,6 +1,5 @@ import type { DryScore } from "#lib/score-import/framework/common/types"; import type { EmptyObject } from "#utils/types"; -import type { ScoreData } from "../../../../../../../common/src"; import { InternalFailure, @@ -8,14 +7,15 @@ import { SongOrChartNotFoundFailure, } from "#lib/score-import/framework/common/converter-failures"; import { ParseDateFromString } from "#lib/score-import/framework/common/score-utils"; -import { FindChartOnInGameID } from "#utils/queries/charts"; -import { FindSongOnID } from "#utils/queries/songs"; import { OngekiClearStatus, OngekiComboStatus, OngekiLevel, } from "#proto/generated/ongeki/common_pb"; +import { FindChartOnInGameID } from "#utils/queries/charts"; +import { FindSongOnID } from "#utils/queries/songs"; +import type { ScoreData } from "../../../../../../../common/src"; import type { ConverterFunction } from "../../common/types"; import type { MytOngekiScore } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/api/myt-ongeki/parser.ts b/typescript/server/src/lib/score-import/import-types/api/myt-ongeki/parser.ts index 02e1b4f84..190ad03ff 100644 --- a/typescript/server/src/lib/score-import/import-types/api/myt-ongeki/parser.ts +++ b/typescript/server/src/lib/score-import/import-types/api/myt-ongeki/parser.ts @@ -1,12 +1,12 @@ import type { KtLogger } from "#lib/logger/logger"; import type { EmptyObject } from "#utils/types"; -import type { integer } from "../../../../../../../common/src"; import ScoreImportFatalError from "#lib/score-import/framework/score-importing/score-import-error"; -import { credentials } from "@grpc/grpc-js"; import { OngekiUserClient } from "#proto/generated/ongeki/user_grpc_pb"; import { GetPlaylogRequest, type GetPlaylogStreamItem } from "#proto/generated/ongeki/user_pb"; +import { credentials } from "@grpc/grpc-js"; +import type { integer } from "../../../../../../../common/src"; import type { ParserFunctionReturns } from "../../common/types"; import type { MytOngekiScore } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/api/myt-wacca/class-handler.ts b/typescript/server/src/lib/score-import/import-types/api/myt-wacca/class-handler.ts index 3c457e904..9e9c7c154 100644 --- a/typescript/server/src/lib/score-import/import-types/api/myt-wacca/class-handler.ts +++ b/typescript/server/src/lib/score-import/import-types/api/myt-wacca/class-handler.ts @@ -4,8 +4,8 @@ import type { WaccaUserClient } from "#proto/generated/wacca/user_grpc_pb"; import ScoreImportFatalError from "#lib/score-import/framework/score-importing/score-import-error"; import { WaccaVersion } from "#proto/generated/wacca/common_pb"; import { DataRequest, type DataResponse } from "#proto/generated/wacca/user_pb"; -import { WaccaStageUps } from "../../../../../../../common/src/config/game-support/wacca"; +import { WaccaStageUps } from "../../../../../../../common/src/config/game-support/wacca"; import { UnaryRPCAsAsync } from "../../common/api-myt/traverse-api"; export default async function CreateMytWACCAClassHandler( diff --git a/typescript/server/src/lib/score-import/import-types/api/myt-wacca/converter.test.ts b/typescript/server/src/lib/score-import/import-types/api/myt-wacca/converter.test.ts index be22dc86c..4723d36e2 100644 --- a/typescript/server/src/lib/score-import/import-types/api/myt-wacca/converter.test.ts +++ b/typescript/server/src/lib/score-import/import-types/api/myt-wacca/converter.test.ts @@ -1,13 +1,13 @@ import CreateLogCtx from "#lib/logger/logger"; import { ParseDateFromString } from "#lib/score-import/framework/common/score-utils"; -import ResetDBState from "#test-utils/resets"; -import { TestingWaccaPupaExp, TestingWaccaPupaSong } from "#test-utils/test-data"; -import deepmerge from "deepmerge"; import { WaccaMusicDifficulty, WaccaMusicScoreGrade, WaccaPlayMode, } from "#proto/generated/wacca/common_pb"; +import ResetDBState from "#test-utils/resets"; +import { TestingWaccaPupaExp, TestingWaccaPupaSong } from "#test-utils/test-data"; +import deepmerge from "deepmerge"; import t from "tap"; import type { MytWaccaScore } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/api/myt-wacca/converter.ts b/typescript/server/src/lib/score-import/import-types/api/myt-wacca/converter.ts index fd6e5f775..f62a7bd2c 100644 --- a/typescript/server/src/lib/score-import/import-types/api/myt-wacca/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/api/myt-wacca/converter.ts @@ -1,7 +1,5 @@ import type { DryScore } from "#lib/score-import/framework/common/types"; import type { EmptyObject } from "#utils/types"; -import type { Difficulties } from "../../../../../../../common/src"; -import type { GetEnumValue } from "../../../../../../../common/src/types/metrics"; import { InternalFailure, @@ -9,14 +7,16 @@ import { SongOrChartNotFoundFailure, } from "#lib/score-import/framework/common/converter-failures"; import { ParseDateFromString } from "#lib/score-import/framework/common/score-utils"; -import { FindChartOnInGameID } from "#utils/queries/charts"; -import { FindSongOnID } from "#utils/queries/songs"; import { type WaccaClearStatus, WaccaMusicDifficulty, type WaccaMusicDifficultyMap, } from "#proto/generated/wacca/common_pb"; +import { FindChartOnInGameID } from "#utils/queries/charts"; +import { FindSongOnID } from "#utils/queries/songs"; +import type { Difficulties } from "../../../../../../../common/src"; +import type { GetEnumValue } from "../../../../../../../common/src/types/metrics"; import type { ConverterFunction } from "../../common/types"; import type { MytWaccaScore } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/api/myt-wacca/parser.ts b/typescript/server/src/lib/score-import/import-types/api/myt-wacca/parser.ts index 3a48021db..9bce8942f 100644 --- a/typescript/server/src/lib/score-import/import-types/api/myt-wacca/parser.ts +++ b/typescript/server/src/lib/score-import/import-types/api/myt-wacca/parser.ts @@ -1,12 +1,12 @@ import type { KtLogger } from "#lib/logger/logger"; import type { EmptyObject } from "#utils/types"; -import type { integer } from "../../../../../../../common/src"; import ScoreImportFatalError from "#lib/score-import/framework/score-importing/score-import-error"; -import { credentials } from "@grpc/grpc-js"; import { WaccaUserClient } from "#proto/generated/wacca/user_grpc_pb"; import { PlaylogRequest, type PlaylogStreamItem } from "#proto/generated/wacca/user_pb"; +import { credentials } from "@grpc/grpc-js"; +import type { integer } from "../../../../../../../common/src"; import type { ParserFunctionReturns } from "../../common/types"; import type { MytWaccaScore } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/common/api-cg/jb/converter.ts b/typescript/server/src/lib/score-import/import-types/common/api-cg/jb/converter.ts index 3505eae8b..174b6e1cb 100644 --- a/typescript/server/src/lib/score-import/import-types/common/api-cg/jb/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/common/api-cg/jb/converter.ts @@ -1,10 +1,4 @@ import type { DryScore } from "#lib/score-import/framework/common/types"; -import type { - Difficulties, - integer, - Judgements, - Versions, -} from "../../../../../../../../common/src"; import { InternalFailure, @@ -15,6 +9,12 @@ import { ParseDateFromString } from "#lib/score-import/framework/common/score-ut import { FindChartOnInGameID } from "#utils/queries/charts"; import { FindSongOnID } from "#utils/queries/songs"; +import type { + Difficulties, + integer, + Judgements, + Versions, +} from "../../../../../../../../common/src"; import type { ConverterFunction } from "../../types"; import type { CGContext, CGJubeatScore } from "../types"; diff --git a/typescript/server/src/lib/score-import/import-types/common/api-cg/museca/converter.ts b/typescript/server/src/lib/score-import/import-types/common/api-cg/museca/converter.ts index 901aea699..6aa857441 100644 --- a/typescript/server/src/lib/score-import/import-types/common/api-cg/museca/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/common/api-cg/museca/converter.ts @@ -1,5 +1,4 @@ import type { DryScore } from "#lib/score-import/framework/common/types"; -import type { Difficulties, Versions } from "../../../../../../../../common/src"; import { InternalFailure, @@ -10,6 +9,7 @@ import { MusecaGetLamp, ParseDateFromString } from "#lib/score-import/framework/ import { FindChartOnInGameIDVersion } from "#utils/queries/charts"; import { FindSongOnID } from "#utils/queries/songs"; +import type { Difficulties, Versions } from "../../../../../../../../common/src"; import type { ConverterFunction } from "../../types"; import type { CGContext, CGMusecaScore } from "../types"; diff --git a/typescript/server/src/lib/score-import/import-types/common/api-cg/parsers.ts b/typescript/server/src/lib/score-import/import-types/common/api-cg/parsers.ts index c762fe683..2e7c65d98 100644 --- a/typescript/server/src/lib/score-import/import-types/common/api-cg/parsers.ts +++ b/typescript/server/src/lib/score-import/import-types/common/api-cg/parsers.ts @@ -4,7 +4,6 @@ import db from "#external/mongo/db"; import ScoreImportFatalError from "#lib/score-import/framework/score-importing/score-import-error"; import fetch from "node-fetch"; import { p, type PrudenceSchema } from "prudence"; -import { FormatPrError, type integer } from "../../../../../../../common/src"; import type { ParserFunctionReturns } from "../types"; import type { @@ -17,6 +16,7 @@ import type { CGSupportedGames, } from "./types"; +import { FormatPrError, type integer } from "../../../../../../../common/src"; import { FetchCGScores } from "./traverse-api"; import { CGGameToTachiGame } from "./util"; diff --git a/typescript/server/src/lib/score-import/import-types/common/api-cg/popn/converter.ts b/typescript/server/src/lib/score-import/import-types/common/api-cg/popn/converter.ts index 5a4df02b9..689f4b620 100644 --- a/typescript/server/src/lib/score-import/import-types/common/api-cg/popn/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/common/api-cg/popn/converter.ts @@ -1,6 +1,4 @@ import type { DryScore } from "#lib/score-import/framework/common/types"; -import type { Difficulties, integer, Versions } from "../../../../../../../../common/src"; -import type { GetEnumValue } from "../../../../../../../../common/src/types/metrics"; import { InternalFailure, @@ -12,6 +10,8 @@ import { ParseDateFromString } from "#lib/score-import/framework/common/score-ut import { FindChartOnInGameIDVersion } from "#utils/queries/charts"; import { FindSongOnID } from "#utils/queries/songs"; +import type { Difficulties, integer, Versions } from "../../../../../../../../common/src"; +import type { GetEnumValue } from "../../../../../../../../common/src/types/metrics"; import type { ConverterFunction } from "../../types"; import type { CGContext, CGPopnScore } from "../types"; diff --git a/typescript/server/src/lib/score-import/import-types/common/api-cg/sdvx/converter.ts b/typescript/server/src/lib/score-import/import-types/common/api-cg/sdvx/converter.ts index bf2c1262c..c417e5add 100644 --- a/typescript/server/src/lib/score-import/import-types/common/api-cg/sdvx/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/common/api-cg/sdvx/converter.ts @@ -1,6 +1,4 @@ import type { DryScore } from "#lib/score-import/framework/common/types"; -import type { Versions } from "../../../../../../../../common/src"; -import type { GetEnumValue } from "../../../../../../../../common/src/types/metrics"; import { InternalFailure, @@ -11,6 +9,8 @@ import { ParseDateFromString } from "#lib/score-import/framework/common/score-ut import { FindSDVXChartOnInGameIDVersion } from "#utils/queries/charts"; import { FindSongOnID } from "#utils/queries/songs"; +import type { Versions } from "../../../../../../../../common/src"; +import type { GetEnumValue } from "../../../../../../../../common/src/types/metrics"; import type { ConverterFunction } from "../../types"; import type { CGContext, CGSDVXScore } from "../types"; diff --git a/typescript/server/src/lib/score-import/import-types/common/api-cg/traverse-api.ts b/typescript/server/src/lib/score-import/import-types/common/api-cg/traverse-api.ts index 9293b0d9e..2d80817af 100644 --- a/typescript/server/src/lib/score-import/import-types/common/api-cg/traverse-api.ts +++ b/typescript/server/src/lib/score-import/import-types/common/api-cg/traverse-api.ts @@ -1,5 +1,4 @@ import type { KtLogger } from "#lib/logger/logger"; -import type { CGCardInfo } from "../../../../../../../common/src"; import ScoreImportFatalError from "#lib/score-import/framework/score-importing/score-import-error"; import { ServerConfig } from "#lib/setup/config"; @@ -7,6 +6,7 @@ import nodeFetch, { type NodeFetch } from "#utils/fetch"; import { p, type PrudenceSchema } from "prudence"; import { URLSearchParams } from "url"; +import type { CGCardInfo } from "../../../../../../../common/src"; import type { CGErrorResponse, CGScoresResponse, CGServices, CGSupportedGames } from "./types"; const PR_CG_RESPONSE: PrudenceSchema = { diff --git a/typescript/server/src/lib/score-import/import-types/common/api-cg/util.ts b/typescript/server/src/lib/score-import/import-types/common/api-cg/util.ts index 21d73487e..75e741a09 100644 --- a/typescript/server/src/lib/score-import/import-types/common/api-cg/util.ts +++ b/typescript/server/src/lib/score-import/import-types/common/api-cg/util.ts @@ -1,5 +1,4 @@ import type { GameGroup } from "../../../../../../../common/src"; - import type { CGServices, CGSupportedGames } from "./types"; export function CGGameToTachiGame(cgGame: CGSupportedGames): GameGroup { diff --git a/typescript/server/src/lib/score-import/import-types/common/api-kai/iidx/class-handler.test.ts b/typescript/server/src/lib/score-import/import-types/common/api-kai/iidx/class-handler.test.ts index 205ae390d..04a85bd0a 100644 --- a/typescript/server/src/lib/score-import/import-types/common/api-kai/iidx/class-handler.test.ts +++ b/typescript/server/src/lib/score-import/import-types/common/api-kai/iidx/class-handler.test.ts @@ -1,9 +1,9 @@ import CreateLogCtx from "#lib/logger/logger"; import { MockBasicFetch, MockJSONFetch } from "#test-utils/mock-fetch"; import ResetDBState from "#test-utils/resets"; -import { IIDX_DANS } from "../../../../../../../../common/src"; import t from "tap"; +import { IIDX_DANS } from "../../../../../../../../common/src"; import { KaiTypeToBaseURL } from "../utils"; import { CreateKaiIIDXClassProvider } from "./class-handler"; diff --git a/typescript/server/src/lib/score-import/import-types/common/api-kai/iidx/class-handler.ts b/typescript/server/src/lib/score-import/import-types/common/api-kai/iidx/class-handler.ts index a80a28362..3c2ec4b4f 100644 --- a/typescript/server/src/lib/score-import/import-types/common/api-kai/iidx/class-handler.ts +++ b/typescript/server/src/lib/score-import/import-types/common/api-kai/iidx/class-handler.ts @@ -2,11 +2,11 @@ import type { ClassProvider } from "#lib/score-import/framework/calculated-data/ import nodeFetch from "#utils/fetch"; import { IsRecord } from "#utils/misc"; -import { IIDX_DANS } from "../../../../../../../../common/src"; -import { IIDXDans } from "../../../../../../../../common/src/config/game-support/iidx"; import type { KaiAPIReauthFunction } from "../traverse-api"; +import { IIDX_DANS } from "../../../../../../../../common/src"; +import { IIDXDans } from "../../../../../../../../common/src/config/game-support/iidx"; import { KaiTypeToBaseURL } from "../utils"; export async function CreateKaiIIDXClassProvider( diff --git a/typescript/server/src/lib/score-import/import-types/common/api-kai/iidx/converter.ts b/typescript/server/src/lib/score-import/import-types/common/api-kai/iidx/converter.ts index 7039ac738..0b501cda6 100644 --- a/typescript/server/src/lib/score-import/import-types/common/api-kai/iidx/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/common/api-kai/iidx/converter.ts @@ -1,11 +1,10 @@ -import type { integer, Versions } from "../../../../../../../../common/src"; -import type { GetEnumValue } from "../../../../../../../../common/src/types/metrics"; - import { FormatPrError } from "#utils/prudence"; import { FindIIDXChartOnInGameIDVersion } from "#utils/queries/charts"; import { FindSongOnID } from "#utils/queries/songs"; import { p } from "prudence"; +import type { integer, Versions } from "../../../../../../../../common/src"; +import type { GetEnumValue } from "../../../../../../../../common/src/types/metrics"; import type { DryScore } from "../../../../framework/common/types"; import type { ConverterFunction } from "../../types"; import type { KaiContext, KaiIIDXScore } from "../types"; diff --git a/typescript/server/src/lib/score-import/import-types/common/api-kai/reauth.test.ts b/typescript/server/src/lib/score-import/import-types/common/api-kai/reauth.test.ts index 5bdf78cec..417ad36e6 100644 --- a/typescript/server/src/lib/score-import/import-types/common/api-kai/reauth.test.ts +++ b/typescript/server/src/lib/score-import/import-types/common/api-kai/reauth.test.ts @@ -1,5 +1,3 @@ -import type { KaiAuthDocument } from "../../../../../../../common/src"; - import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import { ServerConfig } from "#lib/setup/config"; @@ -8,6 +6,8 @@ import ResetDBState from "#test-utils/resets"; import deepmerge from "deepmerge"; import t from "tap"; +import type { KaiAuthDocument } from "../../../../../../../common/src"; + import { CreateKaiReauthFunction } from "./reauth"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/lib/score-import/import-types/common/api-kai/reauth.ts b/typescript/server/src/lib/score-import/import-types/common/api-kai/reauth.ts index b6985a066..d4b6b9fbf 100644 --- a/typescript/server/src/lib/score-import/import-types/common/api-kai/reauth.ts +++ b/typescript/server/src/lib/score-import/import-types/common/api-kai/reauth.ts @@ -1,5 +1,4 @@ import type { KtLogger } from "#lib/logger/logger"; -import type { KaiAuthDocument } from "../../../../../../../common/src"; import db from "#external/mongo/db"; import ScoreImportFatalError from "#lib/score-import/framework/score-importing/score-import-error"; @@ -7,6 +6,8 @@ import { ServerConfig } from "#lib/setup/config"; import nodeFetch from "#utils/fetch"; import { p } from "prudence"; +import type { KaiAuthDocument } from "../../../../../../../common/src"; + import { GetKaiTypeClientCredentials, KaiTypeToBaseURL } from "./utils"; const REAUTH_SCHEMA = { diff --git a/typescript/server/src/lib/score-import/import-types/common/api-kai/sdvx/class-handler.test.ts b/typescript/server/src/lib/score-import/import-types/common/api-kai/sdvx/class-handler.test.ts index 72d3b11c1..c1013a385 100644 --- a/typescript/server/src/lib/score-import/import-types/common/api-kai/sdvx/class-handler.test.ts +++ b/typescript/server/src/lib/score-import/import-types/common/api-kai/sdvx/class-handler.test.ts @@ -1,9 +1,9 @@ import CreateLogCtx from "#lib/logger/logger"; import { MockBasicFetch, MockJSONFetch } from "#test-utils/mock-fetch"; import ResetDBState from "#test-utils/resets"; -import { SDVX_DANS } from "../../../../../../../../common/src"; import t from "tap"; +import { SDVX_DANS } from "../../../../../../../../common/src"; import { KaiTypeToBaseURL } from "../utils"; import { CreateKaiSDVXClassProvider } from "./class-handler"; diff --git a/typescript/server/src/lib/score-import/import-types/common/api-kai/sdvx/converter.ts b/typescript/server/src/lib/score-import/import-types/common/api-kai/sdvx/converter.ts index fb0602cb1..0cbac5061 100644 --- a/typescript/server/src/lib/score-import/import-types/common/api-kai/sdvx/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/common/api-kai/sdvx/converter.ts @@ -1,11 +1,10 @@ -import type { Versions } from "../../../../../../../../common/src"; -import type { GetEnumValue } from "../../../../../../../../common/src/types/metrics"; - import { FormatPrError } from "#utils/prudence"; import { FindSDVXChartOnInGameIDVersion } from "#utils/queries/charts"; import { FindSongOnID } from "#utils/queries/songs"; import { p } from "prudence"; +import type { Versions } from "../../../../../../../../common/src"; +import type { GetEnumValue } from "../../../../../../../../common/src/types/metrics"; import type { DryScore } from "../../../../framework/common/types"; import type { ConverterFunction } from "../../types"; import type { KaiContext, KaiSDVXScore } from "../types"; diff --git a/typescript/server/src/lib/score-import/import-types/common/api-myt/traverse-api.ts b/typescript/server/src/lib/score-import/import-types/common/api-myt/traverse-api.ts index 4dc35b9e2..da8997675 100644 --- a/typescript/server/src/lib/score-import/import-types/common/api-myt/traverse-api.ts +++ b/typescript/server/src/lib/score-import/import-types/common/api-myt/traverse-api.ts @@ -14,8 +14,8 @@ import { type ServiceError, } from "@grpc/grpc-js"; import { Status } from "@grpc/grpc-js/build/src/constants"; -import { type GameGroup, GetGameGroupConfig, type integer } from "../../../../../../../common/src"; +import { type GameGroup, GetGameGroupConfig, type integer } from "../../../../../../../common/src"; import { GameToMytGame } from "./util"; // Hardcode all requests to time out after 10m. diff --git a/typescript/server/src/lib/score-import/import-types/common/api-myt/util.ts b/typescript/server/src/lib/score-import/import-types/common/api-myt/util.ts index d38fd731d..66b700f80 100644 --- a/typescript/server/src/lib/score-import/import-types/common/api-myt/util.ts +++ b/typescript/server/src/lib/score-import/import-types/common/api-myt/util.ts @@ -1,5 +1,4 @@ import type { GameGroup } from "../../../../../../../common/src"; - import type { MytGame } from "./types"; export function GameToMytGame(game: GameGroup): MytGame | undefined { diff --git a/typescript/server/src/lib/score-import/import-types/common/batch-manual/class-handler.ts b/typescript/server/src/lib/score-import/import-types/common/batch-manual/class-handler.ts index 1bb922401..f8a528a24 100644 --- a/typescript/server/src/lib/score-import/import-types/common/batch-manual/class-handler.ts +++ b/typescript/server/src/lib/score-import/import-types/common/batch-manual/class-handler.ts @@ -2,6 +2,7 @@ import type { ClassProvider } from "#lib/score-import/framework/calculated-data/ import ScoreImportFatalError from "#lib/score-import/framework/score-importing/score-import-error"; import { ClassToIndex } from "#utils/class"; + import { type Classes, GetGPTConfig, type GPTString } from "../../../../../../../common/src"; // Note: This is tested by batch-manuals parser.test.ts. diff --git a/typescript/server/src/lib/score-import/import-types/common/batch-manual/converter.test.ts b/typescript/server/src/lib/score-import/import-types/common/batch-manual/converter.test.ts index 7beb86d97..29f002195 100644 --- a/typescript/server/src/lib/score-import/import-types/common/batch-manual/converter.test.ts +++ b/typescript/server/src/lib/score-import/import-types/common/batch-manual/converter.test.ts @@ -1,10 +1,3 @@ -import type { - BatchManualScore, - ChartDocument, - MatchTypeResolver, - MatchTypeResolverWithDifficulty, -} from "../../../../../../../common/src"; - import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import { InvalidScoreFailure } from "#lib/score-import/framework/common/converter-failures"; @@ -20,6 +13,13 @@ import { import deepmerge from "deepmerge"; import t from "tap"; +import type { + BatchManualScore, + ChartDocument, + MatchTypeResolver, + MatchTypeResolverWithDifficulty, +} from "../../../../../../../common/src"; + import { BatchManualScoreToResolver, ConverterBatchManual, diff --git a/typescript/server/src/lib/score-import/import-types/common/batch-manual/converter.ts b/typescript/server/src/lib/score-import/import-types/common/batch-manual/converter.ts index 0c90cec68..374d5a839 100644 --- a/typescript/server/src/lib/score-import/import-types/common/batch-manual/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/common/batch-manual/converter.ts @@ -11,6 +11,11 @@ import { FindSDVXChartOnInGameIDVersion, } from "#utils/queries/charts"; import { FindSongOnID, FindSongOnTitleInsensitive } from "#utils/queries/songs"; + +import type { DryScore } from "../../../framework/common/types"; +import type { ConverterFunction } from "../types"; +import type { BatchManualContext } from "./types"; + import { type BatchManualScore, type ChartDocument, @@ -24,11 +29,6 @@ import { type SongDocument, type Versions, } from "../../../../../../../common/src"; - -import type { DryScore } from "../../../framework/common/types"; -import type { ConverterFunction } from "../types"; -import type { BatchManualContext } from "./types"; - import { InternalFailure, InvalidScoreFailure, diff --git a/typescript/server/src/lib/score-import/import-types/common/batch-manual/parser.test.ts b/typescript/server/src/lib/score-import/import-types/common/batch-manual/parser.test.ts index bb4ec949d..1dfc83a7a 100644 --- a/typescript/server/src/lib/score-import/import-types/common/batch-manual/parser.test.ts +++ b/typescript/server/src/lib/score-import/import-types/common/batch-manual/parser.test.ts @@ -1,10 +1,10 @@ -import type { BatchManual } from "../../../../../../../common/src"; - import CreateLogCtx from "#lib/logger/logger"; import { EscapeStringRegexp } from "#utils/misc"; import deepmerge from "deepmerge"; import t from "tap"; +import type { BatchManual } from "../../../../../../../common/src"; + import ScoreImportFatalError from "../../../framework/score-importing/score-import-error"; import { ParseBatchManualFromObject as ParserFn } from "./parser"; diff --git a/typescript/server/src/lib/score-import/import-types/common/batch-manual/parser.ts b/typescript/server/src/lib/score-import/import-types/common/batch-manual/parser.ts index c5dc596f6..07f472c2c 100644 --- a/typescript/server/src/lib/score-import/import-types/common/batch-manual/parser.ts +++ b/typescript/server/src/lib/score-import/import-types/common/batch-manual/parser.ts @@ -4,6 +4,10 @@ import { TachiConfig } from "#lib/setup/config"; import { IsRecord, IsValidGame, IsValidPlaytype } from "#utils/misc"; import { FormatPrError } from "#utils/prudence"; import { p } from "prudence"; + +import type { ParserFunctionReturns } from "../types"; +import type { BatchManualContext } from "./types"; + import { type BatchManual, type BatchManualScore, @@ -14,10 +18,6 @@ import { type Playtype, } from "../../../../../../../common/src"; import { PR_BATCH_MANUAL } from "../../../../../../../common/src/lib/schemas"; - -import type { ParserFunctionReturns } from "../types"; -import type { BatchManualContext } from "./types"; - import ScoreImportFatalError from "../../../framework/score-importing/score-import-error"; import { CreateBatchManualClassProvider } from "./class-handler"; diff --git a/typescript/server/src/lib/score-import/import-types/common/eamusement-iidx-csv/converter.ts b/typescript/server/src/lib/score-import/import-types/common/eamusement-iidx-csv/converter.ts index b5291af33..c6fdd0255 100644 --- a/typescript/server/src/lib/score-import/import-types/common/eamusement-iidx-csv/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/common/eamusement-iidx-csv/converter.ts @@ -1,9 +1,8 @@ -import type { ChartDocument } from "../../../../../../../common/src"; -import type { GetEnumValue } from "../../../../../../../common/src/types/metrics"; - import { FindChartWithPTDFVersion } from "#utils/queries/charts"; import { FindSongOnTitle } from "#utils/queries/songs"; +import type { ChartDocument } from "../../../../../../../common/src"; +import type { GetEnumValue } from "../../../../../../../common/src/types/metrics"; import type { DryScore } from "../../../framework/common/types"; import type { ConverterFunction } from "../types"; import type { IIDXEamusementCSVContext, IIDXEamusementCSVData } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/common/eamusement-iidx-csv/parser.ts b/typescript/server/src/lib/score-import/import-types/common/eamusement-iidx-csv/parser.ts index fea46b473..5e5046e86 100644 --- a/typescript/server/src/lib/score-import/import-types/common/eamusement-iidx-csv/parser.ts +++ b/typescript/server/src/lib/score-import/import-types/common/eamusement-iidx-csv/parser.ts @@ -2,6 +2,10 @@ import type { KtLogger } from "#lib/logger/logger"; import { StringIsGameVersion } from "#utils/misc"; import { CSVParseError, NaiveCSVParse } from "#utils/naive-csv-parser"; + +import type { ParserFunctionReturns } from "../types"; +import type { EamusementScoreData, IIDXEamusementCSVContext, IIDXEamusementCSVData } from "./types"; + import { GetGamePTConfig, type integer, @@ -9,10 +13,6 @@ import { type Playtypes, type Versions, } from "../../../../../../../common/src"; - -import type { ParserFunctionReturns } from "../types"; -import type { EamusementScoreData, IIDXEamusementCSVContext, IIDXEamusementCSVData } from "./types"; - import ScoreImportFatalError from "../../../framework/score-importing/score-import-error"; export enum EAM_VERSION_NAMES { diff --git a/typescript/server/src/lib/score-import/import-types/common/types.ts b/typescript/server/src/lib/score-import/import-types/common/types.ts index 474802d44..290f99dda 100644 --- a/typescript/server/src/lib/score-import/import-types/common/types.ts +++ b/typescript/server/src/lib/score-import/import-types/common/types.ts @@ -1,7 +1,8 @@ import type { KtLogger } from "#lib/logger/logger"; import type { ClassProvider } from "#lib/score-import/framework/calculated-data/types"; -import type { EmptyObject } from "#utils/types"; import type { USCClientScore } from "#server/router/ir/usc/_playtype/types"; +import type { EmptyObject } from "#utils/types"; + import type { BatchManualScore, ChartDocument, @@ -10,7 +11,6 @@ import type { integer, SongDocument, } from "../../../../../../common/src"; - import type { ConverterFailure } from "../../framework/common/converter-failures"; import type { DryScore } from "../../framework/common/types"; import type { MytChunithmScore } from "../api/myt-chunithm/types"; diff --git a/typescript/server/src/lib/score-import/import-types/converters.ts b/typescript/server/src/lib/score-import/import-types/converters.ts index 334b8e07d..1405146db 100644 --- a/typescript/server/src/lib/score-import/import-types/converters.ts +++ b/typescript/server/src/lib/score-import/import-types/converters.ts @@ -1,7 +1,6 @@ -import type { ImportTypes } from "../../../../../common/src"; - import { Never } from "#utils/misc"; +import type { ImportTypes } from "../../../../../common/src"; import type { ConverterFunction, ImportTypeContextMap, ImportTypeDataMap } from "./common/types"; import ConvertAPIMytChunithm from "./api/myt-chunithm/converter"; diff --git a/typescript/server/src/lib/score-import/import-types/file/batch-manual/parser.ts b/typescript/server/src/lib/score-import/import-types/file/batch-manual/parser.ts index fadb090b9..774304b34 100644 --- a/typescript/server/src/lib/score-import/import-types/file/batch-manual/parser.ts +++ b/typescript/server/src/lib/score-import/import-types/file/batch-manual/parser.ts @@ -1,6 +1,6 @@ import type { KtLogger } from "#lib/logger/logger"; -import type { BatchManualScore } from "../../../../../../../common/src"; +import type { BatchManualScore } from "../../../../../../../common/src"; import type { BatchManualContext } from "../../common/batch-manual/types"; import type { ParserFunctionReturns } from "../../common/types"; diff --git a/typescript/server/src/lib/score-import/import-types/file/eamusement-sdvx-csv/converter.ts b/typescript/server/src/lib/score-import/import-types/file/eamusement-sdvx-csv/converter.ts index a9ada79d1..ba7957298 100644 --- a/typescript/server/src/lib/score-import/import-types/file/eamusement-sdvx-csv/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/file/eamusement-sdvx-csv/converter.ts @@ -1,7 +1,5 @@ import type { DryScore } from "#lib/score-import/framework/common/types"; import type { EmptyObject } from "#utils/types"; -import type { Difficulties } from "../../../../../../../common/src"; -import type { GetEnumValue } from "../../../../../../../common/src/types/metrics"; import { InvalidScoreFailure, @@ -11,6 +9,8 @@ import { AssertStrAsPositiveInt } from "#lib/score-import/framework/common/strin import { FindChartWithPTDF } from "#utils/queries/charts"; import { FindSongOnTitle } from "#utils/queries/songs"; +import type { Difficulties } from "../../../../../../../common/src"; +import type { GetEnumValue } from "../../../../../../../common/src/types/metrics"; import type { ConverterFunction } from "../../common/types"; import type { SDVXEamusementCSVData } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/file/solid-state-squad/converter.ts b/typescript/server/src/lib/score-import/import-types/file/solid-state-squad/converter.ts index 7e1f64c44..600682019 100644 --- a/typescript/server/src/lib/score-import/import-types/file/solid-state-squad/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/file/solid-state-squad/converter.ts @@ -1,10 +1,10 @@ import type { EmptyObject } from "#utils/types"; -import type { Difficulties, Playtypes, Versions } from "../../../../../../../common/src"; -import type { GetEnumValue } from "../../../../../../../common/src/types/metrics"; import { FindChartWithPTDFVersion } from "#utils/queries/charts"; import { FindSongOnTitleInsensitive } from "#utils/queries/songs"; +import type { Difficulties, Playtypes, Versions } from "../../../../../../../common/src"; +import type { GetEnumValue } from "../../../../../../../common/src/types/metrics"; import type { DryScore } from "../../../framework/common/types"; import type { ConverterFunction } from "../../common/types"; import type { S3Score } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/file/wacca-mypage-scraper/class-handler.ts b/typescript/server/src/lib/score-import/import-types/file/wacca-mypage-scraper/class-handler.ts index 309e14081..082167adc 100644 --- a/typescript/server/src/lib/score-import/import-types/file/wacca-mypage-scraper/class-handler.ts +++ b/typescript/server/src/lib/score-import/import-types/file/wacca-mypage-scraper/class-handler.ts @@ -1,10 +1,9 @@ import type { ClassProvider } from "#lib/score-import/framework/calculated-data/types"; -import { WACCA_STAGEUPS } from "../../../../../../../common/src"; -import { WaccaStageUps } from "../../../../../../../common/src/config/game-support/wacca"; - import type { MyPagePlayerStage } from "./types"; +import { WACCA_STAGEUPS } from "../../../../../../../common/src"; +import { WaccaStageUps } from "../../../../../../../common/src/config/game-support/wacca"; import ScoreImportFatalError from "../../../framework/score-importing/score-import-error"; const STAGES: Record = { diff --git a/typescript/server/src/lib/score-import/import-types/file/wacca-mypage-scraper/converter.ts b/typescript/server/src/lib/score-import/import-types/file/wacca-mypage-scraper/converter.ts index 531f97650..638848198 100644 --- a/typescript/server/src/lib/score-import/import-types/file/wacca-mypage-scraper/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/file/wacca-mypage-scraper/converter.ts @@ -1,7 +1,5 @@ import type { DryScore } from "#lib/score-import/framework/common/types"; import type { EmptyObject } from "#utils/types"; -import type { Difficulties } from "../../../../../../../common/src"; -import type { GetEnumValue } from "../../../../../../../common/src/types/metrics"; import { InvalidScoreFailure, @@ -10,6 +8,8 @@ import { import { FindChartWithPTDF } from "#utils/queries/charts"; import { FindSongOnTitle } from "#utils/queries/songs"; +import type { Difficulties } from "../../../../../../../common/src"; +import type { GetEnumValue } from "../../../../../../../common/src/types/metrics"; import type { ConverterFunction } from "../../common/types"; import type { MyPageRecordsParsedPB } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/file/wacca-mypage-scraper/parser.test.ts b/typescript/server/src/lib/score-import/import-types/file/wacca-mypage-scraper/parser.test.ts index 7a7a946b9..b72d5c8a4 100644 --- a/typescript/server/src/lib/score-import/import-types/file/wacca-mypage-scraper/parser.test.ts +++ b/typescript/server/src/lib/score-import/import-types/file/wacca-mypage-scraper/parser.test.ts @@ -2,11 +2,11 @@ import CreateLogCtx from "#lib/logger/logger"; import ScoreImportFatalError from "#lib/score-import/framework/score-importing/score-import-error"; import { MockMulterFile } from "#test-utils/mock-multer"; import { TestingWaccaMyPageScraperRecordsCSV } from "#test-utils/test-data"; -import { WACCA_STAGEUPS } from "../../../../../../../common/src/constants/game"; import t from "tap"; import type { MyPageRecordsParsedPB } from "./types"; +import { WACCA_STAGEUPS } from "../../../../../../../common/src/constants/game"; import { ParseMyPageScraperPlayerCSV, ParseMyPageScraperRecordsCSV } from "./parser"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/lib/score-import/import-types/ir/beatoraja/converter.ts b/typescript/server/src/lib/score-import/import-types/ir/beatoraja/converter.ts index b020acd0f..8d197ff9a 100644 --- a/typescript/server/src/lib/score-import/import-types/ir/beatoraja/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/ir/beatoraja/converter.ts @@ -1,6 +1,5 @@ import type { KtLogger } from "#lib/logger/logger"; import type { Mutable } from "#utils/types"; -import type { ChartDocument, Playtypes, SongDocument } from "../../../../../../../common/src"; import { HandleOrphanQueue } from "#lib/orphan-queue/orphan-queue"; import { DeorphanScores } from "#lib/score-import/framework/orphans/orphans"; @@ -9,6 +8,7 @@ import { Random20Hex } from "#utils/misc"; import { FindChartOnSHA256, FindChartOnSHA256Playtype } from "#utils/queries/charts"; import { FindSongOnID } from "#utils/queries/songs"; +import type { ChartDocument, Playtypes, SongDocument } from "../../../../../../../common/src"; import type { DryScore } from "../../../framework/common/types"; import type { ConverterFunction } from "../../common/types"; import type { BeatorajaChart, BeatorajaContext, BeatorajaScore } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/ir/beatoraja/parser.ts b/typescript/server/src/lib/score-import/import-types/ir/beatoraja/parser.ts index eb98d9434..48d23e8e2 100644 --- a/typescript/server/src/lib/score-import/import-types/ir/beatoraja/parser.ts +++ b/typescript/server/src/lib/score-import/import-types/ir/beatoraja/parser.ts @@ -1,9 +1,9 @@ import type { KtLogger } from "#lib/logger/logger"; -import type { integer } from "../../../../../../../common/src"; import { FormatPrError } from "#utils/prudence"; import { p } from "prudence"; +import type { integer } from "../../../../../../../common/src"; import type { ParserFunctionReturns } from "../../common/types"; import type { BeatorajaChart, BeatorajaContext, BeatorajaScore } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/ir/direct-manual/parser.ts b/typescript/server/src/lib/score-import/import-types/ir/direct-manual/parser.ts index 8f1f69e54..9f56cb86c 100644 --- a/typescript/server/src/lib/score-import/import-types/ir/direct-manual/parser.ts +++ b/typescript/server/src/lib/score-import/import-types/ir/direct-manual/parser.ts @@ -1,6 +1,6 @@ import type { KtLogger } from "#lib/logger/logger"; -import type { BatchManualScore } from "../../../../../../../common/src"; +import type { BatchManualScore } from "../../../../../../../common/src"; import type { BatchManualContext } from "../../common/batch-manual/types"; import type { ParserFunctionReturns } from "../../common/types"; diff --git a/typescript/server/src/lib/score-import/import-types/ir/fervidex-static/class-handler.test.ts b/typescript/server/src/lib/score-import/import-types/ir/fervidex-static/class-handler.test.ts index 31ef57d15..18d097ca2 100644 --- a/typescript/server/src/lib/score-import/import-types/ir/fervidex-static/class-handler.test.ts +++ b/typescript/server/src/lib/score-import/import-types/ir/fervidex-static/class-handler.test.ts @@ -1,8 +1,8 @@ import CreateLogCtx from "#lib/logger/logger"; import ResetDBState from "#test-utils/resets"; -import { IIDXDans } from "../../../../../../../common/src/config/game-support/iidx"; import t from "tap"; +import { IIDXDans } from "../../../../../../../common/src/config/game-support/iidx"; import { CreateFerStaticClassProvider } from "./class-handler"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/lib/score-import/import-types/ir/fervidex-static/class-handler.ts b/typescript/server/src/lib/score-import/import-types/ir/fervidex-static/class-handler.ts index 81607434e..619e607b4 100644 --- a/typescript/server/src/lib/score-import/import-types/ir/fervidex-static/class-handler.ts +++ b/typescript/server/src/lib/score-import/import-types/ir/fervidex-static/class-handler.ts @@ -1,4 +1,5 @@ import type { ClassProvider } from "#lib/score-import/framework/calculated-data/types"; + import type { integer } from "../../../../../../../common/src"; import { IIDXDans } from "../../../../../../../common/src/config/game-support/iidx"; diff --git a/typescript/server/src/lib/score-import/import-types/ir/fervidex/converter.ts b/typescript/server/src/lib/score-import/import-types/ir/fervidex/converter.ts index f3171aa9b..a363054ea 100644 --- a/typescript/server/src/lib/score-import/import-types/ir/fervidex/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/ir/fervidex/converter.ts @@ -3,12 +3,12 @@ import { CreateScoreID } from "#lib/score-import/framework/score-importing/score import { DeleteUndefinedProps, IsNullishOrEmptyStr } from "#utils/misc"; import { FindIIDXChartOnInGameIDVersion, FindIIDXChartWith2DXtraHash } from "#utils/queries/charts"; import { FindSongOnID } from "#utils/queries/songs"; -import { type Difficulties, GetGPTString, type Playtypes } from "../../../../../../../common/src"; import type { DryScore } from "../../../framework/common/types"; import type { ConverterFunction } from "../../common/types"; import type { FervidexContext, FervidexScore } from "./types"; +import { type Difficulties, GetGPTString, type Playtypes } from "../../../../../../../common/src"; import { InternalFailure, InvalidScoreFailure, diff --git a/typescript/server/src/lib/score-import/import-types/ir/fervidex/parser.ts b/typescript/server/src/lib/score-import/import-types/ir/fervidex/parser.ts index 332f8e47f..93c9f596b 100644 --- a/typescript/server/src/lib/score-import/import-types/ir/fervidex/parser.ts +++ b/typescript/server/src/lib/score-import/import-types/ir/fervidex/parser.ts @@ -1,5 +1,4 @@ import type { KtLogger } from "#lib/logger/logger"; -import type { integer, Versions } from "../../../../../../../common/src"; import { EXT_BISTROVER, @@ -21,6 +20,7 @@ import { ParseEA3SoftID } from "#utils/ea3id"; import { FormatPrError, optNull } from "#utils/prudence"; import { p, type PrudenceSchema, type ValidSchemaValue } from "prudence"; +import type { integer, Versions } from "../../../../../../../common/src"; import type { ParserFunctionReturns } from "../../common/types"; import type { FervidexContext, FerHeaders as FervidexHeaders, FervidexScore } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/ir/kshook-sv6c/converter.ts b/typescript/server/src/lib/score-import/import-types/ir/kshook-sv6c/converter.ts index abff744a8..665137298 100644 --- a/typescript/server/src/lib/score-import/import-types/ir/kshook-sv6c/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/ir/kshook-sv6c/converter.ts @@ -1,5 +1,4 @@ import type { DryScore } from "#lib/score-import/framework/common/types"; -import type { GetEnumValue } from "../../../../../../../common/src/types/metrics"; import { InternalFailure, @@ -9,6 +8,7 @@ import { import { FindSDVXChartOnInGameIDVersion } from "#utils/queries/charts"; import { FindSongOnID } from "#utils/queries/songs"; +import type { GetEnumValue } from "../../../../../../../common/src/types/metrics"; import type { ConverterFunction } from "../../common/types"; import type { KsHookSV6CContext, KsHookSV6CScore } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/ir/lr2hook/converter.ts b/typescript/server/src/lib/score-import/import-types/ir/lr2hook/converter.ts index 2e51ac211..c2ceee92d 100644 --- a/typescript/server/src/lib/score-import/import-types/ir/lr2hook/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/ir/lr2hook/converter.ts @@ -1,6 +1,4 @@ import type { DryScore } from "#lib/score-import/framework/common/types"; -import type { ScoreDocument } from "../../../../../../../common/src"; -import type { GetEnumValue } from "../../../../../../../common/src/types/metrics"; import { InternalFailure, @@ -9,6 +7,8 @@ import { import { FindBMSChartOnHash } from "#utils/queries/charts"; import { FindSongOnID } from "#utils/queries/songs"; +import type { ScoreDocument } from "../../../../../../../common/src"; +import type { GetEnumValue } from "../../../../../../../common/src/types/metrics"; import type { ConverterFunction } from "../../common/types"; import type { LR2HookContext, LR2HookScore } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/ir/usc/converter.ts b/typescript/server/src/lib/score-import/import-types/ir/usc/converter.ts index 76fe83bdf..f2c8ff2c4 100644 --- a/typescript/server/src/lib/score-import/import-types/ir/usc/converter.ts +++ b/typescript/server/src/lib/score-import/import-types/ir/usc/converter.ts @@ -1,5 +1,4 @@ import type { USCClientScore } from "#server/router/ir/usc/_playtype/types"; -import type { GetEnumValue } from "../../../../../../../common/src/types/metrics"; import db from "#external/mongo/db"; import { @@ -11,6 +10,7 @@ import { } from "#lib/constants/usc-ir"; import { FindSongOnID } from "#utils/queries/songs"; +import type { GetEnumValue } from "../../../../../../../common/src/types/metrics"; import type { DryScore } from "../../../framework/common/types"; import type { ConverterFunction } from "../../common/types"; import type { IRUSCContext } from "./types"; diff --git a/typescript/server/src/lib/score-import/import-types/ir/usc/parser.ts b/typescript/server/src/lib/score-import/import-types/ir/usc/parser.ts index c9e00a8c2..fd461e8f5 100644 --- a/typescript/server/src/lib/score-import/import-types/ir/usc/parser.ts +++ b/typescript/server/src/lib/score-import/import-types/ir/usc/parser.ts @@ -1,10 +1,10 @@ import type { KtLogger } from "#lib/logger/logger"; import type { USCClientScore } from "#server/router/ir/usc/_playtype/types"; -import type { Playtypes } from "../../../../../../../common/src"; import { FormatPrError } from "#utils/prudence"; import { p, type PrudenceSchema } from "prudence"; +import type { Playtypes } from "../../../../../../../common/src"; import type { ParserFunctionReturns } from "../../common/types"; import type { IRUSCContext } from "./types"; diff --git a/typescript/server/src/lib/score-import/worker/types.ts b/typescript/server/src/lib/score-import/worker/types.ts index 582ba1a46..f020bcd95 100644 --- a/typescript/server/src/lib/score-import/worker/types.ts +++ b/typescript/server/src/lib/score-import/worker/types.ts @@ -1,6 +1,6 @@ import type { Job } from "bullmq"; -import type { ImportDocument, ImportTypes, integer } from "../../../../../common/src"; +import type { ImportDocument, ImportTypes, integer } from "../../../../../common/src"; import type { Parsers } from "../import-types/parsers"; // Ok so, please hear me out on this one. diff --git a/typescript/server/src/lib/score-import/worker/worker.ts b/typescript/server/src/lib/score-import/worker/worker.ts index 5cb8b922f..9c5ee193f 100644 --- a/typescript/server/src/lib/score-import/worker/worker.ts +++ b/typescript/server/src/lib/score-import/worker/worker.ts @@ -1,5 +1,3 @@ -import type { ImportTypes } from "../../../../../common/src"; - import { HandleSIGTERMGracefully } from "#lib/handlers/sigterm"; import CreateLogCtx from "#lib/logger/logger"; import { Environment, ServerConfig } from "#lib/setup/config"; @@ -7,6 +5,7 @@ import { FormatUserDoc, GetUserWithID } from "#utils/user"; import { Worker } from "bullmq"; import { EventEmitter } from "events"; +import type { ImportTypes } from "../../../../../common/src"; import type ScoreImportFatalError from "../framework/score-importing/score-import-error"; import type { ScoreImportJob, ScoreImportJobData } from "./types"; diff --git a/typescript/server/src/lib/score-mutation/delete-scores.test.ts b/typescript/server/src/lib/score-mutation/delete-scores.test.ts index 975ffa3d1..ec8b5d377 100644 --- a/typescript/server/src/lib/score-mutation/delete-scores.test.ts +++ b/typescript/server/src/lib/score-mutation/delete-scores.test.ts @@ -1,5 +1,3 @@ -import type { ImportDocument, ScoreDocument, SessionDocument } from "../../../../common/src"; - import db from "#external/mongo/db"; import { mkFakeSDVXChart, mkFakeSDVXPB } from "#test-utils/misc"; import ResetDBState from "#test-utils/resets"; @@ -7,6 +5,8 @@ import { TestingIIDXSPScore, TestingSDVXScore } from "#test-utils/test-data"; import deepmerge from "deepmerge"; import t from "tap"; +import type { ImportDocument, ScoreDocument, SessionDocument } from "../../../../common/src"; + import { DeleteScore } from "./delete-scores"; const mockImportDocument: ImportDocument = { diff --git a/typescript/server/src/lib/score-mutation/update-score.test.ts b/typescript/server/src/lib/score-mutation/update-score.test.ts index f26ed904a..dabbc0e4a 100644 --- a/typescript/server/src/lib/score-mutation/update-score.test.ts +++ b/typescript/server/src/lib/score-mutation/update-score.test.ts @@ -1,5 +1,3 @@ -import type { ImportDocument, ScoreDocument, SessionDocument } from "../../../../common/src"; - import db from "#external/mongo/db"; import { CreateScoreID } from "#lib/score-import/framework/score-importing/score-id"; import ResetDBState from "#test-utils/resets"; @@ -7,6 +5,8 @@ import { TestingIIDXSPScore } from "#test-utils/test-data"; import deepmerge from "deepmerge"; import t from "tap"; +import type { ImportDocument, ScoreDocument, SessionDocument } from "../../../../common/src"; + import UpdateScore from "./update-score"; const mockImportDocument: ImportDocument = { diff --git a/typescript/server/src/lib/search/search.ts b/typescript/server/src/lib/search/search.ts index b4b9c6e4e..1d86e8a25 100644 --- a/typescript/server/src/lib/search/search.ts +++ b/typescript/server/src/lib/search/search.ts @@ -7,6 +7,7 @@ import { TachiConfig } from "#lib/setup/config"; import { GetSongForIDGuaranteed } from "#utils/db"; import { EscapeStringRegexp } from "#utils/misc"; import { GetOnlineCutoff } from "#utils/user"; + import { type ChartDocument, CreateSongMap, @@ -21,7 +22,6 @@ import { SplitGPT, type UserDocument, } from "../../../../common/src"; - import { AsyncFzf } from "./fzf/main"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/lib/showcase/evaluator.test.ts b/typescript/server/src/lib/showcase/evaluator.test.ts index 1694b5027..fecccb881 100644 --- a/typescript/server/src/lib/showcase/evaluator.test.ts +++ b/typescript/server/src/lib/showcase/evaluator.test.ts @@ -3,9 +3,9 @@ import ResetDBState from "#test-utils/resets"; import { Testing511SPA, TestingIIDXFolderSP10, TestingIIDXSPScorePB } from "#test-utils/test-data"; import { CreateFolderChartLookup } from "#utils/folder"; import deepmerge from "deepmerge"; -import { IIDX_LAMPS } from "../../../../common/src"; import t from "tap"; +import { IIDX_LAMPS } from "../../../../common/src"; import { EvaluateShowcaseStat } from "./evaluator"; /* eslint-disable no-return-await */ diff --git a/typescript/server/src/lib/showcase/evaluator.ts b/typescript/server/src/lib/showcase/evaluator.ts index 64ba70c69..f43416737 100644 --- a/typescript/server/src/lib/showcase/evaluator.ts +++ b/typescript/server/src/lib/showcase/evaluator.ts @@ -1,5 +1,6 @@ import db from "#external/mongo/db"; import { GetFolderChartIDs } from "#utils/folder"; + import { GetGPTConfig, type GPTString, diff --git a/typescript/server/src/lib/showcase/get-related.ts b/typescript/server/src/lib/showcase/get-related.ts index 309575863..ab73d7172 100644 --- a/typescript/server/src/lib/showcase/get-related.ts +++ b/typescript/server/src/lib/showcase/get-related.ts @@ -1,8 +1,8 @@ -import type { GameGroup, ShowcaseStatDetails } from "../../../../common/src"; - import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; +import type { GameGroup, ShowcaseStatDetails } from "../../../../common/src"; + const logger = CreateLogCtx(__filename); export async function GetRelatedStatDocuments(stat: ShowcaseStatDetails, game: GameGroup) { diff --git a/typescript/server/src/lib/showcase/get-stats.test.ts b/typescript/server/src/lib/showcase/get-stats.test.ts index 35d40312c..5b8a468ac 100644 --- a/typescript/server/src/lib/showcase/get-stats.test.ts +++ b/typescript/server/src/lib/showcase/get-stats.test.ts @@ -3,9 +3,9 @@ import ResetDBState from "#test-utils/resets"; import { Testing511SPA, TestingIIDXFolderSP10, TestingIIDXSPScorePB } from "#test-utils/test-data"; import { CreateFolderChartLookup } from "#utils/folder"; import deepmerge from "deepmerge"; -import { IIDX_LAMPS } from "../../../../common/src"; import t from "tap"; +import { IIDX_LAMPS } from "../../../../common/src"; import { EvaluateUsersStatsShowcase } from "./get-stats"; t.test("#EvalulateUsersStatsShowcase", (t) => { diff --git a/typescript/server/src/lib/showcase/get-stats.ts b/typescript/server/src/lib/showcase/get-stats.ts index 3af66828d..28dc6f94d 100644 --- a/typescript/server/src/lib/showcase/get-stats.ts +++ b/typescript/server/src/lib/showcase/get-stats.ts @@ -1,5 +1,6 @@ import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; + import { type GameGroup, GetGPTString, @@ -8,7 +9,6 @@ import { type Playtype, type ShowcaseStatDetails, } from "../../../../common/src"; - import { EvaluateShowcaseStat } from "./evaluator"; import { GetRelatedStatDocuments } from "./get-related"; diff --git a/typescript/server/src/lib/targets/goal-utils.ts b/typescript/server/src/lib/targets/goal-utils.ts index 5b323dcf5..10366f7c7 100644 --- a/typescript/server/src/lib/targets/goal-utils.ts +++ b/typescript/server/src/lib/targets/goal-utils.ts @@ -1,10 +1,11 @@ import type { GoalCriteriaFormatter } from "#game-implementations/types"; import db from "#external/mongo/db"; +import { GPT_SERVER_IMPLEMENTATIONS } from "#game-implementations/game-implementations"; import { GetFolderForIDGuaranteed, HumaniseChartID } from "#utils/db"; import { GetFolderChartIDs } from "#utils/folder"; import { HumanisedJoinArray, OnlyFloatToDP } from "#utils/misc"; -import { GPT_SERVER_IMPLEMENTATIONS } from "#game-implementations/game-implementations"; + import { FormatGameGroup, type GameGroup, diff --git a/typescript/server/src/lib/targets/goals.ts b/typescript/server/src/lib/targets/goals.ts index b332f38e8..7d4d81c0d 100644 --- a/typescript/server/src/lib/targets/goals.ts +++ b/typescript/server/src/lib/targets/goals.ts @@ -2,11 +2,12 @@ import type { GoalCriteriaFormatter } from "#game-implementations/types"; import type { FilterQuery } from "mongodb"; import db from "#external/mongo/db"; +import { GPT_SERVER_IMPLEMENTATIONS } from "#game-implementations/game-implementations"; import { SubscribeFailReasons } from "#lib/constants/err-codes"; import CreateLogCtx, { type KtLogger } from "#lib/logger/logger"; import { GetFolderChartIDs } from "#utils/folder"; import fjsh from "fast-json-stable-hash"; -import { GPT_SERVER_IMPLEMENTATIONS } from "#game-implementations/game-implementations"; + import { FormatGameGroup, type GameGroup, @@ -22,7 +23,6 @@ import { type QuestDocument, type QuestSubscriptionDocument, } from "../../../../common/src"; - import { CreateGoalTitle as CreateGoalName, ValidateGoalChartsAndCriteria } from "./goal-utils"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/lib/targets/quests.ts b/typescript/server/src/lib/targets/quests.ts index 3a51e0f67..0f330ca2a 100644 --- a/typescript/server/src/lib/targets/quests.ts +++ b/typescript/server/src/lib/targets/quests.ts @@ -1,3 +1,8 @@ +import db from "#external/mongo/db"; +import { SubscribeFailReasons } from "#lib/constants/err-codes"; +import CreateLogCtx from "#lib/logger/logger"; +import { BulkSendNotification } from "#lib/notifications/notifications"; + import type { GameGroup, GoalDocument, @@ -8,11 +13,6 @@ import type { QuestSubscriptionDocument, } from "../../../../common/src"; -import db from "#external/mongo/db"; -import { SubscribeFailReasons } from "#lib/constants/err-codes"; -import CreateLogCtx from "#lib/logger/logger"; -import { BulkSendNotification } from "#lib/notifications/notifications"; - import { type EvaluatedGoalReturn, EvaluateGoalForUser, diff --git a/typescript/server/src/lib/v3/migration-tools.ts b/typescript/server/src/lib/v3/migration-tools.ts index 209c2f675..364ce09fd 100644 --- a/typescript/server/src/lib/v3/migration-tools.ts +++ b/typescript/server/src/lib/v3/migration-tools.ts @@ -1,4 +1,5 @@ import { GPT_SERVER_IMPLEMENTATIONS } from "#game-implementations/game-implementations"; + import { type DerivedMetrics, GAME_PT_CONFIGS, diff --git a/typescript/server/src/lib/webhooks/webhooks.ts b/typescript/server/src/lib/webhooks/webhooks.ts index a261308c8..605fa1b3a 100644 --- a/typescript/server/src/lib/webhooks/webhooks.ts +++ b/typescript/server/src/lib/webhooks/webhooks.ts @@ -1,9 +1,9 @@ -import type { WebhookEvents } from "../../../../common/src"; - import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import fetch from "#utils/fetch"; +import type { WebhookEvents } from "../../../../common/src"; + const logger = CreateLogCtx(__filename); // @todo make use of aggressive caching here? diff --git a/typescript/server/src/main.ts b/typescript/server/src/main.ts index f4e9750a5..7d7a4ca77 100644 --- a/typescript/server/src/main.ts +++ b/typescript/server/src/main.ts @@ -13,14 +13,15 @@ import { HandleSIGTERMGracefully } from "#lib/handlers/sigterm"; import CreateLogCtx from "#lib/logger/logger"; import { ApplyUnappliedMigrations } from "#lib/migration/migrations"; import { Environment, ServerConfig, TachiConfig } from "#lib/setup/config"; +import { AddNewUser } from "#server/router/api/v1/auth/auth"; +import server from "#server/server"; import fetch from "#utils/fetch"; import { InitaliseFolderChartLookup } from "#utils/folder"; import { spawn } from "child_process"; import fs from "fs"; import https from "https"; import path from "path"; -import { AddNewUser } from "#server/router/api/v1/auth/auth"; -import server from "#server/server"; + import { UserAuthLevels } from "../../common/src"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/scripts/load-seeds-mongo.ts b/typescript/server/src/scripts/load-seeds-mongo.ts index a55d53abf..d0b431ee7 100644 --- a/typescript/server/src/scripts/load-seeds-mongo.ts +++ b/typescript/server/src/scripts/load-seeds-mongo.ts @@ -1,5 +1,8 @@ import type { BulkWriteOperation, DeleteWriteOpResultObject } from "mongodb"; import type { ICollection } from "monk"; + +import CreateLogCtx, { type KtLogger } from "#lib/logger/logger"; + import type { BMSCourseDocument, ChartDocument, @@ -12,8 +15,6 @@ import type { TableDocument, } from "../../../common/src"; -import CreateLogCtx, { type KtLogger } from "#lib/logger/logger"; - /* eslint-disable no-await-in-loop */ import db, { monkDB } from "#external/mongo/db"; import { UpdateGoalsInFolder } from "#lib/score-import/framework/goals/goals"; diff --git a/typescript/server/src/scripts/make-user-admin.ts b/typescript/server/src/scripts/make-user-admin.ts index 549d387a0..d238ab040 100644 --- a/typescript/server/src/scripts/make-user-admin.ts +++ b/typescript/server/src/scripts/make-user-admin.ts @@ -2,6 +2,7 @@ import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import { WrapScriptPromise } from "#utils/misc"; import { FormatUserDoc, ResolveUser } from "#utils/user"; + import { UserAuthLevels } from "../../../common/src"; const userID = process.argv[2]; diff --git a/typescript/server/src/scripts/migrate-to-postgres.ts b/typescript/server/src/scripts/migrate-to-postgres.ts index 15fb1e751..84b980bdb 100644 --- a/typescript/server/src/scripts/migrate-to-postgres.ts +++ b/typescript/server/src/scripts/migrate-to-postgres.ts @@ -66,6 +66,7 @@ import { type Insertable, Kysely, PostgresDialect, sql } from "kysely"; import monk from "monk"; import path from "path"; import { Pool } from "pg"; + import { type CGCardInfo, type ClassAchievementDocument, @@ -93,7 +94,6 @@ import { type UserNameChangeDocument, type UserSettingsDocument, } from "../../../common/src"; - import { buildChartIdMap, importSeeds } from "./load-seeds-pg"; // ────────────────────────────────────────────────────────────────────────────── diff --git a/typescript/server/src/scripts/state-sync/dedupe-score-ids.ts b/typescript/server/src/scripts/state-sync/dedupe-score-ids.ts index 537291989..13afbd42b 100644 --- a/typescript/server/src/scripts/state-sync/dedupe-score-ids.ts +++ b/typescript/server/src/scripts/state-sync/dedupe-score-ids.ts @@ -1,10 +1,11 @@ import type { IObjectID } from "monk"; -import type { integer } from "../../../../common/src"; import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import { WrapScriptPromise } from "#utils/misc"; +import type { integer } from "../../../../common/src"; + const logger = CreateLogCtx(__filename); async function DedupeScoreIDs() { diff --git a/typescript/server/src/server/middleware/auth.test.ts b/typescript/server/src/server/middleware/auth.test.ts index 683372eea..d1a9b62ae 100644 --- a/typescript/server/src/server/middleware/auth.test.ts +++ b/typescript/server/src/server/middleware/auth.test.ts @@ -3,9 +3,9 @@ import { SYMBOL_TACHI_API_AUTH } from "#lib/constants/tachi"; import mockApi from "#test-utils/mock-api"; import { expressRequestMock } from "#test-utils/mock-request"; import ResetDBState from "#test-utils/resets"; -import { ALL_PERMISSIONS } from "../../../../common/src"; import t from "tap"; +import { ALL_PERMISSIONS } from "../../../../common/src"; import { SetRequestPermissions } from "./auth"; t.test("#SetRequestPermissions", (t) => { diff --git a/typescript/server/src/server/middleware/auth.ts b/typescript/server/src/server/middleware/auth.ts index cce60a8fc..4ab5e03d7 100644 --- a/typescript/server/src/server/middleware/auth.ts +++ b/typescript/server/src/server/middleware/auth.ts @@ -6,6 +6,7 @@ import { SYMBOL_TACHI_API_AUTH } from "#lib/constants/tachi"; import CreateLogCtx from "#lib/logger/logger"; import { TachiConfig } from "#lib/setup/config"; import { IsNullishOrEmptyStr, SplitAuthorizationHeader } from "#utils/misc"; + import { ALL_PERMISSIONS, type APIPermissions, diff --git a/typescript/server/src/server/middleware/multer-upload.ts b/typescript/server/src/server/middleware/multer-upload.ts index 953937d24..b9bcaff68 100644 --- a/typescript/server/src/server/middleware/multer-upload.ts +++ b/typescript/server/src/server/middleware/multer-upload.ts @@ -1,10 +1,11 @@ import type { RequestHandler } from "express"; -import type { integer } from "../../../../common/src"; import { SIXTEEN_MEGABTYES } from "#lib/constants/filesize"; import CreateLogCtx from "#lib/logger/logger"; import multer, { MulterError } from "multer"; +import type { integer } from "../../../../common/src"; + const defaultLogger = CreateLogCtx(__filename); // 16MB diff --git a/typescript/server/src/server/middleware/rate-limiter.ts b/typescript/server/src/server/middleware/rate-limiter.ts index 61e8994d1..11da5194b 100644 --- a/typescript/server/src/server/middleware/rate-limiter.ts +++ b/typescript/server/src/server/middleware/rate-limiter.ts @@ -1,5 +1,4 @@ import type { Request } from "express"; -import type { integer } from "../../../../common/src"; import { RedisClient } from "#external/redis/redis"; import { ONE_MINUTE } from "#lib/constants/time"; @@ -9,6 +8,8 @@ import { OmitUndefinedKeys } from "#utils/misc"; import rateLimit, { type Options } from "express-rate-limit"; import RateLimitRedis from "rate-limit-redis"; +import type { integer } from "../../../../common/src"; + const logger = CreateLogCtx(__filename); function CreateStore(name: string) { diff --git a/typescript/server/src/server/middleware/request-logger.ts b/typescript/server/src/server/middleware/request-logger.ts index f132706dd..f7c0c7431 100644 --- a/typescript/server/src/server/middleware/request-logger.ts +++ b/typescript/server/src/server/middleware/request-logger.ts @@ -1,10 +1,11 @@ import type { RequestHandler, Response } from "express-serve-static-core"; -import type { APITokenDocument } from "../../../../common/src"; import { SYMBOL_TACHI_API_AUTH } from "#lib/constants/tachi"; import CreateLogCtx from "#lib/logger/logger"; import { TachiConfig } from "#lib/setup/config"; +import type { APITokenDocument } from "../../../../common/src"; + const logger = CreateLogCtx(__filename); // https://stackoverflow.com/a/64546368/11885828 diff --git a/typescript/server/src/server/router/api/v1/activity/router.ts b/typescript/server/src/server/router/api/v1/activity/router.ts index 5bc2fe33a..34a5a3065 100644 --- a/typescript/server/src/server/router/api/v1/activity/router.ts +++ b/typescript/server/src/server/router/api/v1/activity/router.ts @@ -1,6 +1,7 @@ import { GetRecentActivityForMultipleGames } from "#lib/activity/activity"; import { TachiConfig } from "#lib/setup/config"; import { Router } from "express"; + import { GetGameGroupConfig } from "../../../../../../../common/src"; const router: Router = Router({ mergeParams: true }); diff --git a/typescript/server/src/server/router/api/v1/admin/router.test.ts b/typescript/server/src/server/router/api/v1/admin/router.test.ts index 8bd67865d..18a47939f 100644 --- a/typescript/server/src/server/router/api/v1/admin/router.test.ts +++ b/typescript/server/src/server/router/api/v1/admin/router.test.ts @@ -8,9 +8,10 @@ import ResetDBState from "#test-utils/resets"; import { TestingIIDXSPScore } from "#test-utils/test-data"; import { Sleep } from "#utils/misc"; import deepmerge from "deepmerge"; -import { type ScoreDocument, UserAuthLevels } from "../../../../../../../common/src"; import t from "tap"; +import { type ScoreDocument, UserAuthLevels } from "../../../../../../../common/src"; + const LOG_LEVEL = Environment.logLevel; t.test("POST /api/v1/admin/change-log-level", async (t) => { diff --git a/typescript/server/src/server/router/api/v1/admin/router.ts b/typescript/server/src/server/router/api/v1/admin/router.ts index 5e4c2e26f..a81f90384 100644 --- a/typescript/server/src/server/router/api/v1/admin/router.ts +++ b/typescript/server/src/server/router/api/v1/admin/router.ts @@ -7,6 +7,7 @@ import { UpdateGoalsForUser } from "#lib/score-import/framework/goals/goals"; import { UpdateQuestsForUser } from "#lib/score-import/framework/quests/quests"; import { DeleteMultipleScores, DeleteScore } from "#lib/score-mutation/delete-scores"; import { Environment, ServerConfig, TachiConfig } from "#lib/setup/config"; +import prValidate from "#server/middleware/prudence-validate"; import { RecalcAllScores, UpdateAllPBs } from "#utils/calculations/recalc-scores"; import { RecalcSessions } from "#utils/calculations/recalc-sessions"; import { IsValidPlaytype } from "#utils/misc"; @@ -15,7 +16,7 @@ import { GetScoresFromSession } from "#utils/session"; import { GetUserWithID, ResolveUser } from "#utils/user"; import { type RequestHandler, Router } from "express"; import { p } from "prudence"; -import prValidate from "#server/middleware/prudence-validate"; + import { type GameGroup, type GoalSubscriptionDocument, diff --git a/typescript/server/src/server/router/api/v1/auth/auth.ts b/typescript/server/src/server/router/api/v1/auth/auth.ts index c7887eb0e..cb0e5c85e 100644 --- a/typescript/server/src/server/router/api/v1/auth/auth.ts +++ b/typescript/server/src/server/router/api/v1/auth/auth.ts @@ -9,6 +9,7 @@ import { CreateURLWithParams } from "#utils/url"; import { FormatUserDoc } from "#utils/user"; import bcrypt from "bcryptjs"; import { p } from "prudence"; + import { type integer, UserAuthLevels, diff --git a/typescript/server/src/server/router/api/v1/auth/router.test.ts b/typescript/server/src/server/router/api/v1/auth/router.test.ts index 3897be17a..590caedf2 100644 --- a/typescript/server/src/server/router/api/v1/auth/router.test.ts +++ b/typescript/server/src/server/router/api/v1/auth/router.test.ts @@ -1,8 +1,8 @@ import db from "#external/mongo/db"; +import { ClearTestingRateLimitCache } from "#server/middleware/rate-limiter"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; import { Sleep } from "#utils/misc"; -import { ClearTestingRateLimitCache } from "#server/middleware/rate-limiter"; import t from "tap"; import { PasswordCompare } from "./auth"; diff --git a/typescript/server/src/server/router/api/v1/auth/router.ts b/typescript/server/src/server/router/api/v1/auth/router.ts index 113b13f4d..46dad07f9 100644 --- a/typescript/server/src/server/router/api/v1/auth/router.ts +++ b/typescript/server/src/server/router/api/v1/auth/router.ts @@ -1,10 +1,13 @@ -import type { integer } from "../../../../../../../common/src"; - import db from "#external/mongo/db"; import { SendEmail } from "#lib/email/client"; import { EmailFormatResetPassword, EmailFormatVerifyEmail } from "#lib/email/formats"; import CreateLogCtx from "#lib/logger/logger"; import { Environment, ServerConfig, TachiConfig } from "#lib/setup/config"; +import prValidate from "#server/middleware/prudence-validate"; +import { + AggressiveRateLimitMiddleware, + HyperAggressiveRateLimitMiddleware, +} from "#server/middleware/rate-limiter"; import { DecrementCounterValue, GetNextCounterValue } from "#utils/db"; import { Random20Hex } from "#utils/misc"; import { @@ -18,11 +21,8 @@ import { } from "#utils/user"; import { Router } from "express"; import { p } from "prudence"; -import prValidate from "#server/middleware/prudence-validate"; -import { - AggressiveRateLimitMiddleware, - HyperAggressiveRateLimitMiddleware, -} from "#server/middleware/rate-limiter"; + +import type { integer } from "../../../../../../../common/src"; import { AddNewUser, diff --git a/typescript/server/src/server/router/api/v1/clients/middleware.ts b/typescript/server/src/server/router/api/v1/clients/middleware.ts index 444cd8363..85e45da4e 100644 --- a/typescript/server/src/server/router/api/v1/clients/middleware.ts +++ b/typescript/server/src/server/router/api/v1/clients/middleware.ts @@ -1,10 +1,11 @@ import type { RequestHandler } from "express"; -import type { TachiAPIClientDocument } from "../../../../../../../common/src"; import db from "#external/mongo/db"; import { Environment } from "#lib/setup/config"; import { AssignToReqTachiData, GetTachiData } from "#utils/req-tachi-data"; +import type { TachiAPIClientDocument } from "../../../../../../../common/src"; + export const GetClientFromID: RequestHandler = async (req, res, next) => { const client = await db["api-clients"].findOne( { diff --git a/typescript/server/src/server/router/api/v1/clients/router.test.ts b/typescript/server/src/server/router/api/v1/clients/router.test.ts index 59084e5ad..00f5a7ec9 100644 --- a/typescript/server/src/server/router/api/v1/clients/router.test.ts +++ b/typescript/server/src/server/router/api/v1/clients/router.test.ts @@ -1,5 +1,3 @@ -import type { APITokenDocument, TachiAPIClientDocument } from "../../../../../../../common/src"; - import db from "#external/mongo/db"; import { ServerConfig } from "#lib/setup/config"; import { CreateFakeAuthCookie } from "#test-utils/fake-auth"; @@ -7,6 +5,8 @@ import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; import t from "tap"; +import type { APITokenDocument, TachiAPIClientDocument } from "../../../../../../../common/src"; + const clientDataset: Array = [ { author: 1, diff --git a/typescript/server/src/server/router/api/v1/clients/router.ts b/typescript/server/src/server/router/api/v1/clients/router.ts index 1efc2e766..6ec62cd84 100644 --- a/typescript/server/src/server/router/api/v1/clients/router.ts +++ b/typescript/server/src/server/router/api/v1/clients/router.ts @@ -1,20 +1,20 @@ import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import { ServerConfig } from "#lib/setup/config"; +import prValidate from "#server/middleware/prudence-validate"; import { DedupeArr, DeleteUndefinedProps, IsValidURL, Random20Hex } from "#utils/misc"; import { optNull } from "#utils/prudence"; import { GetTachiData } from "#utils/req-tachi-data"; import { FormatUserDoc } from "#utils/user"; import { Router } from "express"; import { p } from "prudence"; -import prValidate from "#server/middleware/prudence-validate"; + import { ALL_PERMISSIONS, type APIPermissions, type TachiAPIClientDocument, UserAuthLevels, } from "../../../../../../../common/src"; - import { GetClientFromID, RequireOwnershipOfClient } from "./middleware"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/server/router/api/v1/config/router.ts b/typescript/server/src/server/router/api/v1/config/router.ts index 3a357e3d4..5d4aa9d8e 100644 --- a/typescript/server/src/server/router/api/v1/config/router.ts +++ b/typescript/server/src/server/router/api/v1/config/router.ts @@ -1,6 +1,6 @@ import { ServerConfig, TachiConfig } from "#lib/setup/config"; -import { Router } from "express"; import { RequireBokutachi } from "#server/middleware/type-require"; +import { Router } from "express"; const router: Router = Router({ mergeParams: true }); diff --git a/typescript/server/src/server/router/api/v1/games/@gameSpecificRoutes/bms/router.ts b/typescript/server/src/server/router/api/v1/games/@gameSpecificRoutes/bms/router.ts index 013cf8264..44635690c 100644 --- a/typescript/server/src/server/router/api/v1/games/@gameSpecificRoutes/bms/router.ts +++ b/typescript/server/src/server/router/api/v1/games/@gameSpecificRoutes/bms/router.ts @@ -1,5 +1,3 @@ -import type { Playtypes } from "../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import { CUSTOM_TACHI_BMS_TABLES, @@ -11,6 +9,8 @@ import { import { AssignToReqTachiData, GetTachiData } from "#utils/req-tachi-data"; import { type RequestHandler, Router } from "express"; +import type { Playtypes } from "../../../../../../../../../common/src"; + import { ValidatePlaytypeFromParamFor } from "../../_game/_playtype/middleware"; const router: Router = Router({ mergeParams: true }); diff --git a/typescript/server/src/server/router/api/v1/games/_game/_playtype/charts/_chartID/router.ts b/typescript/server/src/server/router/api/v1/games/_game/_playtype/charts/_chartID/router.ts index 1c2e82100..34f00e906 100644 --- a/typescript/server/src/server/router/api/v1/games/_game/_playtype/charts/_chartID/router.ts +++ b/typescript/server/src/server/router/api/v1/games/_game/_playtype/charts/_chartID/router.ts @@ -8,8 +8,8 @@ import { GetTachiData } from "#utils/req-tachi-data"; import { ParseStrPositiveNonZeroInt } from "#utils/string-checks"; import { GetUsersWithIDs } from "#utils/user"; import { Router } from "express"; -import { type FolderDocument, FormatChart } from "../../../../../../../../../../../common/src"; +import { type FolderDocument, FormatChart } from "../../../../../../../../../../../common/src"; import { ValidateAndGetChart } from "./middleware"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/server/router/api/v1/games/_game/_playtype/charts/router.ts b/typescript/server/src/server/router/api/v1/games/_game/_playtype/charts/router.ts index edead43bc..40511795d 100644 --- a/typescript/server/src/server/router/api/v1/games/_game/_playtype/charts/router.ts +++ b/typescript/server/src/server/router/api/v1/games/_game/_playtype/charts/router.ts @@ -8,6 +8,7 @@ import { IsString } from "#utils/misc"; import { FindChartsOnPopularity } from "#utils/queries/charts"; import { GetGPT } from "#utils/req-tachi-data"; import { Router } from "express"; + import { type ChartDocument, type integer, @@ -15,7 +16,6 @@ import { type UGPTSettingsDocument, } from "../../../../../../../../../../common/src"; import { PR_RESOLVER } from "../../../../../../../../../../common/src/lib/schemas"; - import chartIDRouter from "./_chartID/router"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/server/router/api/v1/games/_game/_playtype/folders/router.test.ts b/typescript/server/src/server/router/api/v1/games/_game/_playtype/folders/router.test.ts index 122757c9e..33e5c4bfc 100644 --- a/typescript/server/src/server/router/api/v1/games/_game/_playtype/folders/router.test.ts +++ b/typescript/server/src/server/router/api/v1/games/_game/_playtype/folders/router.test.ts @@ -1,5 +1,3 @@ -import type { FolderDocument } from "../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; @@ -8,6 +6,8 @@ import { CreateFolderChartLookup } from "#utils/folder"; import deepmerge from "deepmerge"; import t from "tap"; +import type { FolderDocument } from "../../../../../../../../../../common/src"; + const mockFolder: FolderDocument = { folderID: "foo", game: "iidx", diff --git a/typescript/server/src/server/router/api/v1/games/_game/_playtype/middleware.ts b/typescript/server/src/server/router/api/v1/games/_game/_playtype/middleware.ts index fefb2ef81..bbb8a6b38 100644 --- a/typescript/server/src/server/router/api/v1/games/_game/_playtype/middleware.ts +++ b/typescript/server/src/server/router/api/v1/games/_game/_playtype/middleware.ts @@ -1,6 +1,7 @@ import type { RequestHandler } from "express"; import { AssignToReqTachiData, GetTachiData } from "#utils/req-tachi-data"; + import { type GameGroup, GetGameGroupConfig, diff --git a/typescript/server/src/server/router/api/v1/games/_game/_playtype/router.test.ts b/typescript/server/src/server/router/api/v1/games/_game/_playtype/router.test.ts index e7a7d449e..2f83e1db3 100644 --- a/typescript/server/src/server/router/api/v1/games/_game/_playtype/router.test.ts +++ b/typescript/server/src/server/router/api/v1/games/_game/_playtype/router.test.ts @@ -4,12 +4,13 @@ import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; import { FakeOtherUser } from "#test-utils/test-data"; import dm from "deepmerge"; +import t from "tap"; + import { GetGamePTConfig, type UserDocument, type UserGameStats, } from "../../../../../../../../../common/src"; -import t from "tap"; t.test("GET /api/v1/games/:game/:playtype", (t) => { t.test("Should return information about the game:playtype.", async (t) => { diff --git a/typescript/server/src/server/router/api/v1/games/_game/_playtype/router.ts b/typescript/server/src/server/router/api/v1/games/_game/_playtype/router.ts index 313b3faca..19fceda1f 100644 --- a/typescript/server/src/server/router/api/v1/games/_game/_playtype/router.ts +++ b/typescript/server/src/server/router/api/v1/games/_game/_playtype/router.ts @@ -4,6 +4,7 @@ import db from "#external/mongo/db"; import { CreateActivityRouteHandler } from "#lib/activity/activity"; import { ONE_HOUR } from "#lib/constants/time"; import { SearchUsersRegExp } from "#lib/search/search"; +import prValidate from "#server/middleware/prudence-validate"; import { GetRelevantSongsAndCharts } from "#utils/db"; import { IsString } from "#utils/misc"; import { GetGPT } from "#utils/req-tachi-data"; @@ -15,7 +16,7 @@ import { import { GetUsersWithIDs } from "#utils/user"; import { Router } from "express"; import NodeCache from "node-cache"; -import prValidate from "#server/middleware/prudence-validate"; + import { FormatGameGroup, type GameGroup, @@ -24,7 +25,6 @@ import { type Playtype, type UserGameStats, } from "../../../../../../../../../common/src"; - import chartsRouter from "./charts/router"; import foldersRouter from "./folders/router"; import { ValidatePlaytypeFromParam } from "./middleware"; diff --git a/typescript/server/src/server/router/api/v1/games/_game/_playtype/tables/router.test.ts b/typescript/server/src/server/router/api/v1/games/_game/_playtype/tables/router.test.ts index 7d6daac1d..51fba575a 100644 --- a/typescript/server/src/server/router/api/v1/games/_game/_playtype/tables/router.test.ts +++ b/typescript/server/src/server/router/api/v1/games/_game/_playtype/tables/router.test.ts @@ -1,5 +1,3 @@ -import type { FolderDocument } from "../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; @@ -7,6 +5,8 @@ import { TestingIIDXFolderSP10 } from "#test-utils/test-data"; import deepmerge from "deepmerge"; import t from "tap"; +import type { FolderDocument } from "../../../../../../../../../../common/src"; + t.test("GET /api/v1/games/:game/:playtype/tables", (t) => { t.beforeEach(ResetDBState); diff --git a/typescript/server/src/server/router/api/v1/games/_game/_playtype/tables/router.ts b/typescript/server/src/server/router/api/v1/games/_game/_playtype/tables/router.ts index 8982af284..29519e2ba 100644 --- a/typescript/server/src/server/router/api/v1/games/_game/_playtype/tables/router.ts +++ b/typescript/server/src/server/router/api/v1/games/_game/_playtype/tables/router.ts @@ -5,8 +5,8 @@ import CreateLogCtx from "#lib/logger/logger"; import { GetFoldersFromTable } from "#utils/folder"; import { GetGPT, GetTachiData } from "#utils/req-tachi-data"; import { Router } from "express"; -import { FormatGameGroup, type TableDocument } from "../../../../../../../../../../common/src"; +import { FormatGameGroup, type TableDocument } from "../../../../../../../../../../common/src"; import { GetTableFromParam } from "./middleware"; const router: Router = Router({ mergeParams: true }); diff --git a/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/goals/router.test.ts b/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/goals/router.test.ts index 1f05e782b..33fc69ff8 100644 --- a/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/goals/router.test.ts +++ b/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/goals/router.test.ts @@ -1,8 +1,3 @@ -import type { - GoalDocument, - GoalSubscriptionDocument, -} from "../../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; @@ -15,6 +10,11 @@ import { import dm from "deepmerge"; import t from "tap"; +import type { + GoalDocument, + GoalSubscriptionDocument, +} from "../../../../../../../../../../../common/src"; + // this is my lazy sample data for these tests. const LoadLazySampleData = async () => { await db.users.insert(FakeOtherUser); diff --git a/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/goals/router.ts b/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/goals/router.ts index 29c41c1c0..fc3597acb 100644 --- a/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/goals/router.ts +++ b/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/goals/router.ts @@ -1,15 +1,15 @@ -import type { GoalDocument } from "../../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import { CreateGoalTitle, ValidateGoalChartsAndCriteria } from "#lib/targets/goal-utils"; import { GetQuestsThatContainGoal } from "#lib/targets/goals"; +import prValidate from "#server/middleware/prudence-validate"; import { GetMostSubscribedGoals } from "#utils/db"; import { AssignToReqTachiData, GetGPT, GetTachiData } from "#utils/req-tachi-data"; import { GetUsersWithIDs } from "#utils/user"; import { type RequestHandler, Router } from "express"; import { p } from "prudence"; -import prValidate from "#server/middleware/prudence-validate"; + +import type { GoalDocument } from "../../../../../../../../../../../common/src"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/questlines/router.test.ts b/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/questlines/router.test.ts index 76bc7dc3d..fe0b80a6b 100644 --- a/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/questlines/router.test.ts +++ b/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/questlines/router.test.ts @@ -1,5 +1,3 @@ -import type { QuestDocument, QuestlineDocument } from "../../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; @@ -7,6 +5,8 @@ import { TestingIIDXSPQuest } from "#test-utils/test-data"; import dm from "deepmerge"; import t from "tap"; +import type { QuestDocument, QuestlineDocument } from "../../../../../../../../../../../common/src"; + const TestingIIDXSPQuestline: QuestlineDocument = { name: "Testing Questline", desc: "foo", diff --git a/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/quests/router.test.ts b/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/quests/router.test.ts index 30ec7b79a..0aaf85199 100644 --- a/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/quests/router.test.ts +++ b/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/quests/router.test.ts @@ -1,9 +1,3 @@ -import type { - QuestDocument, - QuestlineDocument, - QuestSubscriptionDocument, -} from "../../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; @@ -17,6 +11,12 @@ import { import dm from "deepmerge"; import t from "tap"; +import type { + QuestDocument, + QuestlineDocument, + QuestSubscriptionDocument, +} from "../../../../../../../../../../../common/src"; + t.test("GET /api/v1/games/:game/:playtype/targets/quests", (t) => { t.beforeEach(ResetDBState); diff --git a/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/router.test.ts b/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/router.test.ts index 3d6ed6757..d6d207f82 100644 --- a/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/router.test.ts +++ b/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/router.test.ts @@ -1,5 +1,3 @@ -import type { GoalSubscriptionDocument } from "../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import { mkFakeGoal, mkFakeGoalSub } from "#test-utils/misc"; import mockApi from "#test-utils/mock-api"; @@ -7,6 +5,8 @@ import ResetDBState from "#test-utils/resets"; import { HC511UserGoal } from "#test-utils/test-data"; import t from "tap"; +import type { GoalSubscriptionDocument } from "../../../../../../../../../../common/src"; + t.test("GET /api/v1/games/:game/:playtype/targets/recently-achieved", (t) => { t.beforeEach(ResetDBState); diff --git a/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/router.ts b/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/router.ts index b595ab78d..9cc0e3c04 100644 --- a/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/router.ts +++ b/typescript/server/src/server/router/api/v1/games/_game/_playtype/targets/router.ts @@ -6,8 +6,8 @@ import { } from "#utils/db"; import { GetGPT } from "#utils/req-tachi-data"; import { Router } from "express"; -import { FormatGameGroup } from "../../../../../../../../../../common/src"; +import { FormatGameGroup } from "../../../../../../../../../../common/src"; import goalsRouter from "./goals/router"; import questlineRouter from "./questlines/router"; import questsRouter from "./quests/router"; diff --git a/typescript/server/src/server/router/api/v1/games/_game/router.test.ts b/typescript/server/src/server/router/api/v1/games/_game/router.test.ts index 53bc0390a..f5db3994a 100644 --- a/typescript/server/src/server/router/api/v1/games/_game/router.test.ts +++ b/typescript/server/src/server/router/api/v1/games/_game/router.test.ts @@ -1,7 +1,8 @@ import mockApi from "#test-utils/mock-api"; -import { GetGameGroupConfig } from "../../../../../../../../common/src"; import t from "tap"; +import { GetGameGroupConfig } from "../../../../../../../../common/src"; + t.test("GET /api/v1/games/:game", (t) => { t.test("Should parse the game from the header", async (t) => { const res = await mockApi.get("/api/v1/games/iidx"); diff --git a/typescript/server/src/server/router/api/v1/games/_game/router.ts b/typescript/server/src/server/router/api/v1/games/_game/router.ts index b2fa673aa..691dc62e2 100644 --- a/typescript/server/src/server/router/api/v1/games/_game/router.ts +++ b/typescript/server/src/server/router/api/v1/games/_game/router.ts @@ -1,7 +1,7 @@ import { GetTachiData } from "#utils/req-tachi-data"; import { Router } from "express"; -import { GetGameGroupConfig } from "../../../../../../../../common/src"; +import { GetGameGroupConfig } from "../../../../../../../../common/src"; import playtypeRouter from "./_playtype/router"; import { ValidateGameFromParam } from "./middleware"; diff --git a/typescript/server/src/server/router/api/v1/games/router.test.ts b/typescript/server/src/server/router/api/v1/games/router.test.ts index 9749e54c8..e4cb74c61 100644 --- a/typescript/server/src/server/router/api/v1/games/router.test.ts +++ b/typescript/server/src/server/router/api/v1/games/router.test.ts @@ -1,8 +1,9 @@ import { TachiConfig } from "#lib/setup/config"; import mockApi from "#test-utils/mock-api"; -import { GetGameGroupConfig } from "../../../../../../../common/src"; import t from "tap"; +import { GetGameGroupConfig } from "../../../../../../../common/src"; + t.test("GET /api/v1/games", async (t) => { // lets just run some basic tests that this contains all of our supported games // and also returns configs properly. diff --git a/typescript/server/src/server/router/api/v1/games/router.ts b/typescript/server/src/server/router/api/v1/games/router.ts index 841b8c451..e41df281c 100644 --- a/typescript/server/src/server/router/api/v1/games/router.ts +++ b/typescript/server/src/server/router/api/v1/games/router.ts @@ -1,7 +1,7 @@ import { TachiConfig } from "#lib/setup/config"; import { Router } from "express"; -import { GetGameGroupConfig } from "../../../../../../../common/src"; +import { GetGameGroupConfig } from "../../../../../../../common/src"; import gameSpecificRoutes from "./@gameSpecificRoutes/router"; import gameRouter from "./_game/router"; diff --git a/typescript/server/src/server/router/api/v1/import/router.ts b/typescript/server/src/server/router/api/v1/import/router.ts index d0f639b7b..288526e18 100644 --- a/typescript/server/src/server/router/api/v1/import/router.ts +++ b/typescript/server/src/server/router/api/v1/import/router.ts @@ -1,5 +1,4 @@ import type { ScoreImportJobData } from "#lib/score-import/worker/types"; -import type { APIImportTypes, FileUploadImportTypes } from "../../../../../../../common/src"; import { SIXTEEN_MEGABTYES } from "#lib/constants/filesize"; import { SYMBOL_TACHI_API_AUTH } from "#lib/constants/tachi"; @@ -8,14 +7,16 @@ import { ExpressWrappedScoreImportMain } from "#lib/score-import/framework/expre import { DeorphanScores } from "#lib/score-import/framework/orphans/orphans"; import { MakeScoreImport } from "#lib/score-import/framework/score-import"; import { ServerConfig, TachiConfig } from "#lib/setup/config"; -import { Random20Hex } from "#utils/misc"; -import { FormatUserDoc, GetUserWithIDGuaranteed } from "#utils/user"; -import { Router } from "express"; -import { p } from "prudence"; import { RequirePermissions } from "#server/middleware/auth"; import { CreateMulterSingleUploadMiddleware } from "#server/middleware/multer-upload"; import prValidate from "#server/middleware/prudence-validate"; import { ScoreImportRateLimiter } from "#server/middleware/rate-limiter"; +import { Random20Hex } from "#utils/misc"; +import { FormatUserDoc, GetUserWithIDGuaranteed } from "#utils/user"; +import { Router } from "express"; +import { p } from "prudence"; + +import type { APIImportTypes, FileUploadImportTypes } from "../../../../../../../common/src"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/server/router/api/v1/imports/router.test.ts b/typescript/server/src/server/router/api/v1/imports/router.test.ts index cefde3406..6d72e8076 100644 --- a/typescript/server/src/server/router/api/v1/imports/router.test.ts +++ b/typescript/server/src/server/router/api/v1/imports/router.test.ts @@ -4,9 +4,10 @@ import { mkFakeImport } from "#test-utils/misc"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; import { FakeImport } from "#test-utils/test-data"; -import { UserAuthLevels } from "../../../../../../../common/src"; import t from "tap"; +import { UserAuthLevels } from "../../../../../../../common/src"; + t.test("GET /api/v1/imports/:importID", (t) => { t.beforeEach(ResetDBState); t.beforeEach(() => db.imports.insert(FakeImport)); diff --git a/typescript/server/src/server/router/api/v1/imports/router.ts b/typescript/server/src/server/router/api/v1/imports/router.ts index 95df823bc..d9d6569ad 100644 --- a/typescript/server/src/server/router/api/v1/imports/router.ts +++ b/typescript/server/src/server/router/api/v1/imports/router.ts @@ -1,6 +1,5 @@ import type { ScoreImportWorkerReturns } from "#lib/score-import/worker/types"; import type { FilterQuery } from "mongodb"; -import type { ImportTrackerDocument, ImportTypes } from "../../../../../../../common/src"; import db from "#external/mongo/db"; import { JOB_RETRY_COUNT } from "#lib/constants/tachi"; @@ -8,14 +7,16 @@ import { RevertImport } from "#lib/imports/imports"; import CreateLogCtx from "#lib/logger/logger"; import ScoreImportQueue, { ScoreImportQueueEvents } from "#lib/score-import/worker/queue"; import { ServerConfig, TachiConfig } from "#lib/setup/config"; +import { RequirePermissions } from "#server/middleware/auth"; +import prValidate from "#server/middleware/prudence-validate"; import { GetRelevantSongsAndCharts } from "#utils/db"; import { DeleteUndefinedProps } from "#utils/misc"; import { GetTachiData } from "#utils/req-tachi-data"; import { GetUsersWithIDs, GetUserWithID } from "#utils/user"; import { Router } from "express"; import { p } from "prudence"; -import { RequirePermissions } from "#server/middleware/auth"; -import prValidate from "#server/middleware/prudence-validate"; + +import type { ImportTrackerDocument, ImportTypes } from "../../../../../../../common/src"; import { GetImportFromParam, RequireOwnershipOfImportOrAdmin } from "./middleware"; diff --git a/typescript/server/src/server/router/api/v1/oauth/router.ts b/typescript/server/src/server/router/api/v1/oauth/router.ts index 7f178abe4..19b47e650 100644 --- a/typescript/server/src/server/router/api/v1/oauth/router.ts +++ b/typescript/server/src/server/router/api/v1/oauth/router.ts @@ -1,8 +1,8 @@ import db from "#external/mongo/db"; +import prValidate from "#server/middleware/prudence-validate"; import { Random20Hex } from "#utils/misc"; import { Router } from "express"; import { p } from "prudence"; -import prValidate from "#server/middleware/prudence-validate"; const router: Router = Router({ mergeParams: true }); diff --git a/typescript/server/src/server/router/api/v1/router.test.ts b/typescript/server/src/server/router/api/v1/router.test.ts index 5a9845b7f..f75b352a5 100644 --- a/typescript/server/src/server/router/api/v1/router.test.ts +++ b/typescript/server/src/server/router/api/v1/router.test.ts @@ -1,5 +1,5 @@ -import mockApi from "#test-utils/mock-api"; import { ClearTestingRateLimitCache } from "#server/middleware/rate-limiter"; +import mockApi from "#test-utils/mock-api"; import t from "tap"; // just a rudimentary test for rate-limiting. We fire 150 requests at GET /api/v1 diff --git a/typescript/server/src/server/router/api/v1/router.ts b/typescript/server/src/server/router/api/v1/router.ts index 5cdefe916..c65eba03f 100644 --- a/typescript/server/src/server/router/api/v1/router.ts +++ b/typescript/server/src/server/router/api/v1/router.ts @@ -1,5 +1,5 @@ -import { Router } from "express"; import { NormalRateLimitMiddleware } from "#server/middleware/rate-limiter"; +import { Router } from "express"; import activityRouter from "./activity/router"; import adminRouter from "./admin/router"; diff --git a/typescript/server/src/server/router/api/v1/scores/_scoreID/router.test.ts b/typescript/server/src/server/router/api/v1/scores/_scoreID/router.test.ts index 395734350..40dd45a65 100644 --- a/typescript/server/src/server/router/api/v1/scores/_scoreID/router.test.ts +++ b/typescript/server/src/server/router/api/v1/scores/_scoreID/router.test.ts @@ -4,9 +4,10 @@ import { mkFakeScoreIIDXSP } from "#test-utils/misc"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; import { Testing511SPA } from "#test-utils/test-data"; -import { UserAuthLevels } from "../../../../../../../../common/src"; import t from "tap"; +import { UserAuthLevels } from "../../../../../../../../common/src"; + t.test("GET /api/v1/scores/:scoreID", (t) => { t.beforeEach(ResetDBState); diff --git a/typescript/server/src/server/router/api/v1/scores/_scoreID/router.ts b/typescript/server/src/server/router/api/v1/scores/_scoreID/router.ts index 22b668780..99c8b3bca 100644 --- a/typescript/server/src/server/router/api/v1/scores/_scoreID/router.ts +++ b/typescript/server/src/server/router/api/v1/scores/_scoreID/router.ts @@ -1,12 +1,12 @@ import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import { DeleteScore } from "#lib/score-mutation/delete-scores"; +import { RequirePermissions } from "#server/middleware/auth"; +import prValidate from "#server/middleware/prudence-validate"; import { GetTachiData } from "#utils/req-tachi-data"; import { GetUserWithID } from "#utils/user"; import { Router } from "express"; import { p } from "prudence"; -import { RequirePermissions } from "#server/middleware/auth"; -import prValidate from "#server/middleware/prudence-validate"; import { GetScoreFromParam, RequireOwnershipOfScoreOrAdmin } from "./middleware"; diff --git a/typescript/server/src/server/router/api/v1/search/router.test.ts b/typescript/server/src/server/router/api/v1/search/router.test.ts index a864c7c24..e02b45f00 100644 --- a/typescript/server/src/server/router/api/v1/search/router.test.ts +++ b/typescript/server/src/server/router/api/v1/search/router.test.ts @@ -1,5 +1,3 @@ -import type { ChartDocument, SongDocument } from "../../../../../../../common/src"; - import db from "#external/mongo/db"; import { mkFakeGameSettings, mkFakeUser } from "#test-utils/misc"; import mockApi from "#test-utils/mock-api"; @@ -7,6 +5,8 @@ import ResetDBState from "#test-utils/resets"; import { LoadTachiIIDXData } from "#test-utils/test-data"; import t from "tap"; +import type { ChartDocument, SongDocument } from "../../../../../../../common/src"; + t.test("GET /api/v1/search", (t) => { t.beforeEach(ResetDBState); t.beforeEach(LoadTachiIIDXData); diff --git a/typescript/server/src/server/router/api/v1/search/router.ts b/typescript/server/src/server/router/api/v1/search/router.ts index a18e53182..782ee76e4 100644 --- a/typescript/server/src/server/router/api/v1/search/router.ts +++ b/typescript/server/src/server/router/api/v1/search/router.ts @@ -11,6 +11,7 @@ import { TachiConfig } from "#lib/setup/config"; import { IsString } from "#utils/misc"; import { GetAllUserRivals, GetUserPlayedGPTs } from "#utils/user"; import { Router } from "express"; + import { type FolderDocument, GameGroup, diff --git a/typescript/server/src/server/router/api/v1/seeds/router.ts b/typescript/server/src/server/router/api/v1/seeds/router.ts index 1fca27137..4d5db58da 100644 --- a/typescript/server/src/server/router/api/v1/seeds/router.ts +++ b/typescript/server/src/server/router/api/v1/seeds/router.ts @@ -1,14 +1,14 @@ import CreateLogCtx from "#lib/logger/logger"; import { PullDatabaseSeeds } from "#lib/seeds/repo"; import { Environment } from "#lib/setup/config"; +import prValidate from "#server/middleware/prudence-validate"; +import { RequireLocalDevelopment } from "#server/middleware/type-require"; import { GetCommit, ListGitCommitsInPath } from "#utils/git"; import { asyncExec, IsString } from "#utils/misc"; import { Router } from "express"; import fsSync from "fs"; import fs from "fs/promises"; import path from "path"; -import prValidate from "#server/middleware/prudence-validate"; -import { RequireLocalDevelopment } from "#server/middleware/type-require"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/server/router/api/v1/sessions/_sessionID/router.ts b/typescript/server/src/server/router/api/v1/sessions/_sessionID/router.ts index 123c39688..c3a28aeb0 100644 --- a/typescript/server/src/server/router/api/v1/sessions/_sessionID/router.ts +++ b/typescript/server/src/server/router/api/v1/sessions/_sessionID/router.ts @@ -1,13 +1,14 @@ import db from "#external/mongo/db"; import { GetSessionScoreInfo } from "#lib/score-import/framework/sessions/sessions"; +import { RequirePermissions } from "#server/middleware/auth"; +import prValidate from "#server/middleware/prudence-validate"; import { GetEnumDistForFolderAsOf } from "#utils/folder"; import { AddToSetInRecord } from "#utils/misc"; import { GetTachiData } from "#utils/req-tachi-data"; import { GetUserWithID } from "#utils/user"; import { Router } from "express"; import { p } from "prudence"; -import { RequirePermissions } from "#server/middleware/auth"; -import prValidate from "#server/middleware/prudence-validate"; + import { type FolderDocument, GetGamePTConfig, @@ -17,7 +18,6 @@ import { type ScoreDocument, } from "../../../../../../../../common/src"; import { optNull } from "../../../../../../../../common/src/lib/schemas"; - import { GetSessionFromParam, RequireOwnershipOfSession } from "./middleware"; const router: Router = Router({ mergeParams: true }); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/api-tokens/router.test.ts b/typescript/server/src/server/router/api/v1/users/_userID/api-tokens/router.test.ts index 7c4dd04d1..d60bdb665 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/api-tokens/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/api-tokens/router.test.ts @@ -1,11 +1,11 @@ -import type { UserDocument } from "../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import { CreateFakeAuthCookie } from "#test-utils/fake-auth"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; import t from "tap"; +import type { UserDocument } from "../../../../../../../../../common/src"; + t.test("GET /api/v1/users/:userID/api-tokens", async (t) => { t.beforeEach(ResetDBState); t.beforeEach(async () => { diff --git a/typescript/server/src/server/router/api/v1/users/_userID/api-tokens/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/api-tokens/router.ts index 6f148737c..ae512ee1e 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/api-tokens/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/api-tokens/router.ts @@ -1,17 +1,17 @@ import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; +import prValidate from "#server/middleware/prudence-validate"; import { Random20Hex } from "#utils/misc"; import { GetTachiData } from "#utils/req-tachi-data"; import { FormatUserDoc } from "#utils/user"; import { Router } from "express"; import { p } from "prudence"; -import prValidate from "#server/middleware/prudence-validate"; + import { ALL_PERMISSIONS, type APIPermissions, type APITokenDocument, } from "../../../../../../../../../common/src"; - import { RequireSelfRequestFromUser } from "../middleware"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/banner/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/banner/router.ts index 05a5d5c00..664144bf1 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/banner/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/banner/router.ts @@ -3,12 +3,12 @@ import { CDNDelete, CDNRedirect, CDNStoreOrOverwrite } from "#lib/cdn/cdn"; import { GetProfileBannerURL } from "#lib/cdn/url-format"; import { ONE_MEGABYTE } from "#lib/constants/filesize"; import CreateLogCtx from "#lib/logger/logger"; +import { RequirePermissions } from "#server/middleware/auth"; +import { CreateMulterSingleUploadMiddleware } from "#server/middleware/multer-upload"; import { HashSHA256 } from "#utils/crypto"; import { GetTachiData } from "#utils/req-tachi-data"; import { FormatUserDoc } from "#utils/user"; import { Router } from "express"; -import { RequirePermissions } from "#server/middleware/auth"; -import { CreateMulterSingleUploadMiddleware } from "#server/middleware/multer-upload"; import { RequireAuthedAsUser } from "../middleware"; diff --git a/typescript/server/src/server/router/api/v1/users/_userID/following/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/following/router.ts index 9ce9b2c06..244911448 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/following/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/following/router.ts @@ -1,13 +1,13 @@ -import type { integer } from "../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import { ServerConfig } from "#lib/setup/config"; +import prValidate from "#server/middleware/prudence-validate"; import { GetUser } from "#utils/req-tachi-data"; import { FormatUserDoc, GetUsersWithIDs, GetUserWithID } from "#utils/user"; import { Router } from "express"; import { p } from "prudence"; -import prValidate from "#server/middleware/prudence-validate"; + +import type { integer } from "../../../../../../../../../common/src"; import { RequireSelfRequestFromUser } from "../middleware"; diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/@gameSpecificRoutes/bms/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/@gameSpecificRoutes/bms/router.ts index d2aa4cd9b..a3602e13b 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/@gameSpecificRoutes/bms/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/@gameSpecificRoutes/bms/router.ts @@ -5,9 +5,9 @@ import { HandleBMSTableHeaderRequest, HandleBMSTableHTMLRequest, } from "#lib/game-specific/custom-bms-tables"; +import { ValidatePlaytypeFromParamFor } from "#server/router/api/v1/games/_game/_playtype/middleware"; import { AssignToReqTachiData, GetTachiData, GetUGPT, GetUser } from "#utils/req-tachi-data"; import { type RequestHandler, Router } from "express"; -import { ValidatePlaytypeFromParamFor } from "#server/router/api/v1/games/_game/_playtype/middleware"; const router: Router = Router({ mergeParams: true }); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/@gameSpecificRoutes/iidx/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/@gameSpecificRoutes/iidx/router.ts index 4c5054489..1aa55ec99 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/@gameSpecificRoutes/iidx/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/@gameSpecificRoutes/iidx/router.ts @@ -1,3 +1,15 @@ +import db from "#external/mongo/db"; +import { + CUSTOM_TACHI_IIDX_PLAYLISTS, + type TachiIIDXPlaylist, +} from "#lib/game-specific/iidx-playlists"; +import { ResolveSongAndChart } from "#lib/score-import/import-types/common/batch-manual/converter"; +import { EAM_VERSION_NAMES } from "#lib/score-import/import-types/common/eamusement-iidx-csv/parser"; +import { AggressiveRateLimitMiddleware } from "#server/middleware/rate-limiter"; +import { ValidatePlaytypeFromParamFor } from "#server/router/api/v1/games/_game/_playtype/middleware"; +import { GetUser } from "#utils/req-tachi-data"; +import { Router } from "express"; + import type { ChartDocument, integer, @@ -7,18 +19,6 @@ import type { } from "../../../../../../../../../../../common/src"; import type { GetEnumValue } from "../../../../../../../../../../../common/src/types/metrics"; -import db from "#external/mongo/db"; -import { - CUSTOM_TACHI_IIDX_PLAYLISTS, - type TachiIIDXPlaylist, -} from "#lib/game-specific/iidx-playlists"; -import { ResolveSongAndChart } from "#lib/score-import/import-types/common/batch-manual/converter"; -import { EAM_VERSION_NAMES } from "#lib/score-import/import-types/common/eamusement-iidx-csv/parser"; -import { GetUser } from "#utils/req-tachi-data"; -import { Router } from "express"; -import { AggressiveRateLimitMiddleware } from "#server/middleware/rate-limiter"; -import { ValidatePlaytypeFromParamFor } from "#server/router/api/v1/games/_game/_playtype/middleware"; - const router: Router = Router({ mergeParams: true }); const EAMUSEMENT_CSV_HEADER = `バージョン,タイトル,ジャンル,アーティスト,プレー回数,BEGINNER 難易度,BEGINNER スコア,BEGINNER PGreat,BEGINNER Great,BEGINNER ミスカウント,BEGINNER クリアタイプ,BEGINNER DJ LEVEL,NORMAL 難易度,NORMAL スコア,NORMAL PGreat,NORMAL Great,NORMAL ミスカウント,NORMAL クリアタイプ,NORMAL DJ LEVEL,HYPER 難易度,HYPER スコア,HYPER PGreat,HYPER Great,HYPER ミスカウント,HYPER クリアタイプ,HYPER DJ LEVEL,ANOTHER 難易度,ANOTHER スコア,ANOTHER PGreat,ANOTHER Great,ANOTHER ミスカウント,ANOTHER クリアタイプ,ANOTHER DJ LEVEL,LEGGENDARIA 難易度,LEGGENDARIA スコア,LEGGENDARIA PGreat,LEGGENDARIA Great,LEGGENDARIA ミスカウント,LEGGENDARIA クリアタイプ,LEGGENDARIA DJ LEVEL,最終プレー日時`; diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/@gameSpecificRoutes/jubeat/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/@gameSpecificRoutes/jubeat/router.ts index c5f24b358..6cb4223fe 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/@gameSpecificRoutes/jubeat/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/@gameSpecificRoutes/jubeat/router.ts @@ -1,7 +1,7 @@ +import { GetPBsForJubility } from "#game-implementations/games/jubeat"; import { GetRelevantSongsAndCharts } from "#utils/db"; import { GetUser } from "#utils/req-tachi-data"; import { Router } from "express"; -import { GetPBsForJubility } from "#game-implementations/games/jubeat"; const router: Router = Router({ mergeParams: true }); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/folders/_folderID/router.test.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/folders/_folderID/router.test.ts index 6d87b2652..a05be7655 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/folders/_folderID/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/folders/_folderID/router.test.ts @@ -1,10 +1,3 @@ -import type { - ChartDocument, - FolderDocument, - ScoreDocument, - SongDocument, -} from "../../../../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; @@ -19,6 +12,13 @@ import { CreateFolderChartLookup } from "#utils/folder"; import deepmerge from "deepmerge"; import t from "tap"; +import type { + ChartDocument, + FolderDocument, + ScoreDocument, + SongDocument, +} from "../../../../../../../../../../../../../common/src"; + t.test("GET /api/v1/users/:userID/games/:game/:playtype/folders/:folderID", (t) => { t.beforeEach(ResetDBState); t.beforeEach(async () => { diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/folders/_folderID/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/folders/_folderID/router.ts index 6408a79dc..8dca4305d 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/folders/_folderID/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/folders/_folderID/router.ts @@ -1,18 +1,18 @@ import type { FilterQuery } from "mongodb"; import db from "#external/mongo/db"; +import prValidate from "#server/middleware/prudence-validate"; import { GetEnumDistForFolder, GetFolderCharts, GetPBsOnFolder } from "#utils/folder"; import { GetTachiData, GetUGPT } from "#utils/req-tachi-data"; import { ParseStrPositiveInt } from "#utils/string-checks"; import { Router } from "express"; -import prValidate from "#server/middleware/prudence-validate"; + import { GetGamePTConfig, GetScoreMetricConf, type ScoreDocument, ValidateMetric, } from "../../../../../../../../../../../../../common/src"; - import { GetFolderFromParam } from "../../../../../../../games/_game/_playtype/folders/middleware"; import { RequireSelfRequestFromUser } from "../../../../../middleware"; diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/pbs/router.test.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/pbs/router.test.ts index 0997bc8e3..5b7c6acc2 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/pbs/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/pbs/router.test.ts @@ -1,8 +1,3 @@ -import type { - ChartDocument, - PBScoreDocument, -} from "../../../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; @@ -15,6 +10,11 @@ import { } from "#test-utils/test-data"; import t from "tap"; +import type { + ChartDocument, + PBScoreDocument, +} from "../../../../../../../../../../../../common/src"; + t.test("GET /api/v1/users/:userID/games/:game/:playtype/pbs/best", (t) => { t.beforeEach(ResetDBState); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/pbs/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/pbs/router.ts index 848b2b3f9..c342d7267 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/pbs/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/pbs/router.ts @@ -3,6 +3,8 @@ import CreateLogCtx from "#lib/logger/logger"; import { GetRivalUsers } from "#lib/rivals/rivals"; import { ResolveSongAndChart } from "#lib/score-import/import-types/common/batch-manual/converter"; import { SearchSpecificGameSongsAndCharts } from "#lib/search/search"; +import prValidate from "#server/middleware/prudence-validate"; +import { AggressiveRateLimitMiddleware } from "#server/middleware/rate-limiter"; import { GetRelevantSongsAndCharts } from "#utils/db"; import { IsValidScoreAlg } from "#utils/misc"; import { GetAdjacentAbove, GetAdjacentBelow } from "#utils/queries/pbs"; @@ -10,8 +12,7 @@ import { GetUGPT } from "#utils/req-tachi-data"; import { FilterChartsAndSongs, GetPBOnChart, GetScoreIDsFromComposed } from "#utils/scores"; import { GetUsersWithIDs } from "#utils/user"; import { Router } from "express"; -import prValidate from "#server/middleware/prudence-validate"; -import { AggressiveRateLimitMiddleware } from "#server/middleware/rate-limiter"; + import { GetGamePTConfig, type MatchTypeResolver, diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/rivals/router.test.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/rivals/router.test.ts index 26aab680b..daec113e8 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/rivals/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/rivals/router.test.ts @@ -1,5 +1,3 @@ -import type { UserDocument } from "../../../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import { CreateFakeAuthCookie } from "#test-utils/fake-auth"; import { mkFakeGameSettings, mkFakeUser } from "#test-utils/misc"; @@ -8,6 +6,8 @@ import ResetDBState from "#test-utils/resets"; import { FakeOtherUser } from "#test-utils/test-data"; import t from "tap"; +import type { UserDocument } from "../../../../../../../../../../../../common/src"; + const SetupRivals = async () => { await db.users.insert([FakeOtherUser, mkFakeUser(3), mkFakeUser(4)]); await db["game-settings"].insert([ diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/rivals/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/rivals/router.ts index a301ea1e1..f343598c6 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/rivals/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/rivals/router.ts @@ -2,6 +2,8 @@ import db from "#external/mongo/db"; import { CreateActivityRouteHandler } from "#lib/activity/activity"; import { SetRivalsFailReasons } from "#lib/constants/err-codes"; import { GetChallengerUsers, GetRivalIDs, GetRivalUsers, SetRivals } from "#lib/rivals/rivals"; +import { RequirePermissions } from "#server/middleware/auth"; +import prValidate from "#server/middleware/prudence-validate"; import { GetRelevantSongsAndCharts } from "#utils/db"; import { IsString } from "#utils/misc"; import { GetUGPT } from "#utils/req-tachi-data"; @@ -9,14 +11,12 @@ import { CheckStrScoreAlg } from "#utils/string-checks"; import { GetUsersWithIDs } from "#utils/user"; import { Router } from "express"; import { p } from "prudence"; -import { RequirePermissions } from "#server/middleware/auth"; -import prValidate from "#server/middleware/prudence-validate"; + import { FormatGameGroup, GetGamePTConfig, type integer, } from "../../../../../../../../../../../../common/src"; - import { RequireAuthedAsUser } from "../../../../middleware"; const router: Router = Router({ mergeParams: true }); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/router.test.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/router.test.ts index a7fe64d1e..681f39b54 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/router.test.ts @@ -1,5 +1,3 @@ -import type { ScoreDocument } from "../../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import { ONE_DAY } from "#lib/constants/time"; import { CreateFakeAuthCookie } from "#test-utils/fake-auth"; @@ -9,6 +7,8 @@ import { Testing511SPA, TestingIIDXSPScore, TestingIIDXSPScorePB } from "#test-u import deepmerge from "deepmerge"; import t from "tap"; +import type { ScoreDocument } from "../../../../../../../../../../../common/src"; + t.test("GET /api/v1/users/:userID/games/:game/:playtype", (t) => { t.beforeEach(ResetDBState); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/router.ts index c72c9be99..67abeaf71 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/router.ts @@ -2,6 +2,8 @@ import db from "#external/mongo/db"; import { CreateActivityRouteHandler } from "#lib/activity/activity"; import { ONE_MONTH, ONE_WEEK, ONE_YEAR } from "#lib/constants/time"; import CreateLogCtx from "#lib/logger/logger"; +import prValidate from "#server/middleware/prudence-validate"; +import { PasswordCompare, ValidatePassword } from "#server/router/api/v1/auth/auth"; import { IsString } from "#utils/misc"; import { GetTachiData, GetUGPT } from "#utils/req-tachi-data"; import DestroyUserGamePlaytypeData from "#utils/reset-state/destroy-ugpt"; @@ -16,8 +18,7 @@ import { } from "#utils/user"; import { Router } from "express"; import { p } from "prudence"; -import prValidate from "#server/middleware/prudence-validate"; -import { PasswordCompare, ValidatePassword } from "#server/router/api/v1/auth/auth"; + import { FormatGameGroup, GetGamePTConfig, @@ -27,7 +28,6 @@ import { type ProfileRatingAlgorithms, type UserGameStatsSnapshotDocument, } from "../../../../../../../../../../../common/src"; - import { RequireAuthedAsUser, RequireSelfRequestFromUser } from "../../../middleware"; import foldersRouter from "./folders/router"; import { CheckUserPlayedGamePlaytype } from "./middleware"; diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/scores/router.test.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/scores/router.test.ts index d735780a2..6ed4c8952 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/scores/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/scores/router.test.ts @@ -1,5 +1,3 @@ -import type { ChartDocument, ScoreDocument } from "../../../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import { mkFakeScoreIIDXSP, mkFakeScoreSDVX } from "#test-utils/misc"; import mockApi from "#test-utils/mock-api"; @@ -12,6 +10,8 @@ import { } from "#test-utils/test-data"; import t from "tap"; +import type { ChartDocument, ScoreDocument } from "../../../../../../../../../../../../common/src"; + t.test("GET /api/v1/users/:userID/games/:game/:playtype/scores/recent", (t) => { t.beforeEach(ResetDBState); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/scores/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/scores/router.ts index 0efca6c5d..140b93ed0 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/scores/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/scores/router.ts @@ -1,10 +1,10 @@ import db from "#external/mongo/db"; import { SearchSpecificGameSongsAndCharts } from "#lib/search/search"; +import { HyperAggressiveRateLimitMiddleware } from "#server/middleware/rate-limiter"; import { GetRelevantSongsAndCharts } from "#utils/db"; import { GetUGPT } from "#utils/req-tachi-data"; import { FilterChartsAndSongs } from "#utils/scores"; import { Router } from "express"; -import { HyperAggressiveRateLimitMiddleware } from "#server/middleware/rate-limiter"; const router: Router = Router({ mergeParams: true }); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/sessions/router.test.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/sessions/router.test.ts index cc8a2710f..e29d15e8e 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/sessions/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/sessions/router.test.ts @@ -1,11 +1,11 @@ -import type { SessionDocument } from "../../../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; import { LoadTachiIIDXData } from "#test-utils/test-data"; import t from "tap"; +import type { SessionDocument } from "../../../../../../../../../../../../common/src"; + t.test("GET /api/v1/users/:userID/games/:game/:playtype/sessions", (t) => { t.beforeEach(ResetDBState); t.beforeEach(LoadTachiIIDXData); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/sessions/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/sessions/router.ts index fc8676760..285db9037 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/sessions/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/sessions/router.ts @@ -4,6 +4,7 @@ import { SearchSessions } from "#lib/search/search"; import { GetUGPT } from "#utils/req-tachi-data"; import { CheckStrSessionAlg } from "#utils/string-checks"; import { Router } from "express"; + import { type AnySessionRatingAlg, GetGamePTConfig, diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/settings/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/settings/router.ts index 478b0abf8..9d5763191 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/settings/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/settings/router.ts @@ -1,18 +1,18 @@ import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; +import { RequirePermissions } from "#server/middleware/auth"; import { FormatPrError, optNull } from "#utils/prudence"; import { GetUGPT } from "#utils/req-tachi-data"; import { FormatUserDoc } from "#utils/user"; import { Router } from "express"; import { p } from "prudence"; -import { RequirePermissions } from "#server/middleware/auth"; + import { GetGamePTConfig, GetScoreMetrics, PrudenceZodShim, type UGPTSettingsDocument, } from "../../../../../../../../../../../../common/src"; - import { RequireAuthedAsUser } from "../../../../middleware"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/showcase/router.test.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/showcase/router.test.ts index 098b1da5d..d3d6e65af 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/showcase/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/showcase/router.test.ts @@ -5,13 +5,14 @@ import ResetDBState from "#test-utils/resets"; import { Testing511SPA, TestingIIDXFolderSP10, TestingIIDXSPScorePB } from "#test-utils/test-data"; import { CreateFolderChartLookup } from "#utils/folder"; import deepmerge from "deepmerge"; +import t from "tap"; + import { type ChartDocument, IIDX_GRADES, IIDX_LAMPS, type UserDocument, } from "../../../../../../../../../../../../common/src"; -import t from "tap"; const SetFolders = async () => { await db.folders.insert(TestingIIDXFolderSP10); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/showcase/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/showcase/router.ts index 79c703323..6d871589f 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/showcase/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/showcase/router.ts @@ -2,14 +2,15 @@ import db from "#external/mongo/db"; import { EvaluateShowcaseStat } from "#lib/showcase/evaluator"; import { GetRelatedStatDocuments } from "#lib/showcase/get-related"; import { EvaluateUsersStatsShowcase } from "#lib/showcase/get-stats"; +import { RequirePermissions } from "#server/middleware/auth"; +import { RequireAuthedAsUser } from "#server/router/api/v1/users/_userID/middleware"; import { IsRecord } from "#utils/misc"; import { FormatPrError } from "#utils/prudence"; import { GetUGPT } from "#utils/req-tachi-data"; import { ResolveUser } from "#utils/user"; import { Router } from "express"; import { p } from "prudence"; -import { RequirePermissions } from "#server/middleware/auth"; -import { RequireAuthedAsUser } from "#server/router/api/v1/users/_userID/middleware"; + import { FormatGameGroup, GetGamePTConfig, diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/tables/router.test.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/tables/router.test.ts index 9985297de..b578e349a 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/tables/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/tables/router.test.ts @@ -1,5 +1,3 @@ -import type { FolderDocument } from "../../../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; @@ -8,6 +6,8 @@ import { CreateFolderChartLookup } from "#utils/folder"; import deepmerge from "deepmerge"; import t from "tap"; +import type { FolderDocument } from "../../../../../../../../../../../../common/src"; + t.test("GET /api/v1/users/:userID/games/:game/:playtype/tables/:tableID", (t) => { t.beforeEach(ResetDBState); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/goals/router.test.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/goals/router.test.ts index 257435543..6734c3938 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/goals/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/goals/router.test.ts @@ -16,6 +16,7 @@ import { TestingIIDXSPScorePB, } from "#test-utils/test-data"; import { CreateFolderChartLookup } from "#utils/folder"; + import { type ChartDocument, type GoalSubscriptionDocument, diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/goals/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/goals/router.ts index ceab32382..8c3a07997 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/goals/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/goals/router.ts @@ -9,18 +9,18 @@ import { UnsubscribeFromGoal, } from "#lib/targets/goals"; import { GetParentQuests } from "#lib/targets/quests"; +import { RequirePermissions } from "#server/middleware/auth"; +import prValidate from "#server/middleware/prudence-validate"; import { GetGoalForIDGuaranteed } from "#utils/db"; import { AssignToReqTachiData, GetTachiData, GetUGPT } from "#utils/req-tachi-data"; import { type RequestHandler, Router } from "express"; import { p } from "prudence"; -import { RequirePermissions } from "#server/middleware/auth"; -import prValidate from "#server/middleware/prudence-validate"; + import { GetGamePTConfig, type GoalDocument, type QuestDocument, } from "../../../../../../../../../../../../../common/src"; - import { RequireAuthedAsUser } from "../../../../../middleware"; const router: Router = Router({ mergeParams: true }); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/quests/router.test.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/quests/router.test.ts index 8265a61d4..2eba49584 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/quests/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/quests/router.test.ts @@ -1,8 +1,3 @@ -import type { - UserDocument, - UserGameStats, -} from "../../../../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import { CreateFakeAuthCookie } from "#test-utils/fake-auth"; import mockApi from "#test-utils/mock-api"; @@ -15,6 +10,11 @@ import { } from "#test-utils/test-data"; import t from "tap"; +import type { + UserDocument, + UserGameStats, +} from "../../../../../../../../../../../../../common/src"; + t.test("GET /api/v1/users/:userID/games/:game/:playtype/targets/quests", (t) => { t.beforeEach(ResetDBState); t.beforeEach(() => db.quests.insert(TestingIIDXSPQuest)); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/quests/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/quests/router.ts index 7d5bb568c..efe69a58b 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/quests/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/quests/router.ts @@ -8,10 +8,10 @@ import { SubscribeToQuest, UnsubscribeFromQuest, } from "#lib/targets/quests"; +import { RequirePermissions } from "#server/middleware/auth"; import { AssignToReqTachiData, GetGPT, GetTachiData, GetUGPT } from "#utils/req-tachi-data"; import { FormatUserDoc } from "#utils/user"; import { type RequestHandler, Router } from "express"; -import { RequirePermissions } from "#server/middleware/auth"; import { RequireAuthedAsUser } from "../../../../../middleware"; diff --git a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/router.test.ts b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/router.test.ts index 0909972b6..56d538304 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/targets/router.test.ts @@ -1,10 +1,3 @@ -import type { - GoalDocument, - GoalSubscriptionDocument, - QuestDocument, - QuestSubscriptionDocument, -} from "../../../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; @@ -17,6 +10,13 @@ import { import dm from "deepmerge"; import t from "tap"; +import type { + GoalDocument, + GoalSubscriptionDocument, + QuestDocument, + QuestSubscriptionDocument, +} from "../../../../../../../../../../../../common/src"; + function mkGoalSub(merge: Partial) { return dm(HC511UserGoal, merge); } diff --git a/typescript/server/src/server/router/api/v1/users/_userID/imports/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/imports/router.ts index a888a41d0..8d705bb08 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/imports/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/imports/router.ts @@ -1,13 +1,14 @@ import type { FilterQuery } from "mongodb"; -import type { ImportTrackerDocument, ImportTypes } from "../../../../../../../../../common/src"; import db from "#external/mongo/db"; import { TachiConfig } from "#lib/setup/config"; +import prValidate from "#server/middleware/prudence-validate"; import { DeleteUndefinedProps } from "#utils/misc"; import { GetTachiData } from "#utils/req-tachi-data"; import { Router } from "express"; import { p } from "prudence"; -import prValidate from "#server/middleware/prudence-validate"; + +import type { ImportTrackerDocument, ImportTypes } from "../../../../../../../../../common/src"; const router: Router = Router({ mergeParams: true }); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/integrations/cg/_cgType/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/integrations/cg/_cgType/router.ts index 3641693ed..9da211038 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/integrations/cg/_cgType/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/integrations/cg/_cgType/router.ts @@ -1,12 +1,13 @@ import type { CGServices } from "#lib/score-import/import-types/common/api-cg/types"; import type { RequestHandler } from "express-serve-static-core"; -import type { CGCardInfo } from "../../../../../../../../../../../common/src"; import db from "#external/mongo/db"; +import prValidate from "#server/middleware/prudence-validate"; import { GetTachiData } from "#utils/req-tachi-data"; import { Router } from "express"; import { p } from "prudence"; -import prValidate from "#server/middleware/prudence-validate"; + +import type { CGCardInfo } from "../../../../../../../../../../../common/src"; import { RequireSelfRequestFromUser } from "../../../middleware"; diff --git a/typescript/server/src/server/router/api/v1/users/_userID/integrations/fervidex/router.test.ts b/typescript/server/src/server/router/api/v1/users/_userID/integrations/fervidex/router.test.ts index 3e856e285..30593d829 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/integrations/fervidex/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/integrations/fervidex/router.test.ts @@ -1,11 +1,11 @@ -import type { UserDocument } from "../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import { CreateFakeAuthCookie } from "#test-utils/fake-auth"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; import t from "tap"; +import type { UserDocument } from "../../../../../../../../../../common/src"; + t.test("GET /api/v1/users/:userID/integrations/fervidex/settings", async (t) => { t.beforeEach(ResetDBState); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/integrations/fervidex/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/integrations/fervidex/router.ts index 888da12ea..08e60e697 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/integrations/fervidex/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/integrations/fervidex/router.ts @@ -1,10 +1,10 @@ import db from "#external/mongo/db"; +import prValidate from "#server/middleware/prudence-validate"; +import { RequireKamaitachi } from "#server/middleware/type-require"; import { DeleteUndefinedProps } from "#utils/misc"; import { optNull } from "#utils/prudence"; import { GetTachiData } from "#utils/req-tachi-data"; import { Router } from "express"; -import prValidate from "#server/middleware/prudence-validate"; -import { RequireKamaitachi } from "#server/middleware/type-require"; import { RequireSelfRequestFromUser } from "../../middleware"; diff --git a/typescript/server/src/server/router/api/v1/users/_userID/integrations/kai/_kaiType/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/integrations/kai/_kaiType/router.ts index 1690995f4..9fa330e65 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/integrations/kai/_kaiType/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/integrations/kai/_kaiType/router.ts @@ -4,6 +4,8 @@ import { GetKaiTypeClientCredentials, KaiTypeToBaseURL, } from "#lib/score-import/import-types/common/api-kai/utils"; +import prValidate from "#server/middleware/prudence-validate"; +import { RequireKamaitachi } from "#server/middleware/type-require"; import fetch from "#utils/fetch"; import { NotNullish } from "#utils/misc"; import { GetKaiAuth, RevokeKaiAuth } from "#utils/queries/auth"; @@ -11,8 +13,6 @@ import { GetTachiData } from "#utils/req-tachi-data"; import { FormatUserDoc } from "#utils/user"; import { Router } from "express"; import { p } from "prudence"; -import prValidate from "#server/middleware/prudence-validate"; -import { RequireKamaitachi } from "#server/middleware/type-require"; import { RequireSelfRequestFromUser } from "../../../middleware"; import { ValidateKaiType } from "./middleware"; diff --git a/typescript/server/src/server/router/api/v1/users/_userID/integrations/kshook-sv6c/router.test.ts b/typescript/server/src/server/router/api/v1/users/_userID/integrations/kshook-sv6c/router.test.ts index 4fd7a7626..182307912 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/integrations/kshook-sv6c/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/integrations/kshook-sv6c/router.test.ts @@ -1,11 +1,11 @@ -import type { UserDocument } from "../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import { CreateFakeAuthCookie } from "#test-utils/fake-auth"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; import t from "tap"; +import type { UserDocument } from "../../../../../../../../../../common/src"; + t.test("GET /api/v1/users/:userID/integrations/kshook-sv6c/settings", async (t) => { t.beforeEach(ResetDBState); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/integrations/kshook-sv6c/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/integrations/kshook-sv6c/router.ts index 1927adc0d..4564db59a 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/integrations/kshook-sv6c/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/integrations/kshook-sv6c/router.ts @@ -1,8 +1,8 @@ import db from "#external/mongo/db"; -import { GetTachiData } from "#utils/req-tachi-data"; -import { Router } from "express"; import prValidate from "#server/middleware/prudence-validate"; import { RequireKamaitachi } from "#server/middleware/type-require"; +import { GetTachiData } from "#utils/req-tachi-data"; +import { Router } from "express"; import { RequireSelfRequestFromUser } from "../../middleware"; diff --git a/typescript/server/src/server/router/api/v1/users/_userID/integrations/myt/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/integrations/myt/router.ts index 7280dad17..5abe63e00 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/integrations/myt/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/integrations/myt/router.ts @@ -1,11 +1,11 @@ -import type { MytCardInfo } from "../../../../../../../../../../common/src"; - import db from "#external/mongo/db"; +import prValidate from "#server/middleware/prudence-validate"; +import { RequireKamaitachi } from "#server/middleware/type-require"; import { GetTachiData } from "#utils/req-tachi-data"; import { Router } from "express"; import { p } from "prudence"; -import prValidate from "#server/middleware/prudence-validate"; -import { RequireKamaitachi } from "#server/middleware/type-require"; + +import type { MytCardInfo } from "../../../../../../../../../../common/src"; import { RequireSelfRequestFromUser } from "../../middleware"; diff --git a/typescript/server/src/server/router/api/v1/users/_userID/invites/router.test.ts b/typescript/server/src/server/router/api/v1/users/_userID/invites/router.test.ts index b4cff21c9..f01b5f8c6 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/invites/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/invites/router.test.ts @@ -3,12 +3,13 @@ import { ONE_MONTH } from "#lib/constants/time"; import { CreateFakeAuthCookie } from "#test-utils/fake-auth"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; +import t from "tap"; + import { type InviteCodeDocument, UserAuthLevels, type UserDocument, } from "../../../../../../../../../common/src"; -import t from "tap"; t.test("GET /api/v1/users/:userID/invites", async (t) => { t.beforeEach(ResetDBState); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/invites/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/invites/router.ts index d40d95eca..8fe49d6da 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/invites/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/invites/router.ts @@ -1,12 +1,12 @@ import db from "#external/mongo/db"; import { GetTotalAllowedInvites } from "#lib/invites/invites"; +import { RequireInvitesEnabled } from "#server/middleware/type-require"; import { Random20Hex } from "#utils/misc"; import { GetTachiData } from "#utils/req-tachi-data"; import { GetUsersWithIDs } from "#utils/user"; import { Router } from "express"; -import { RequireInvitesEnabled } from "#server/middleware/type-require"; -import { type InviteCodeDocument, UserAuthLevels } from "../../../../../../../../../common/src"; +import { type InviteCodeDocument, UserAuthLevels } from "../../../../../../../../../common/src"; import { RequireSelfRequestFromUser } from "../middleware"; const router: Router = Router({ mergeParams: true }); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/middleware.ts b/typescript/server/src/server/router/api/v1/users/_userID/middleware.ts index d3de59a43..03829bdc9 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/middleware.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/middleware.ts @@ -5,6 +5,7 @@ import CreateLogCtx from "#lib/logger/logger"; import { IsNullish } from "#utils/misc"; import { AssignToReqTachiData, GetTachiData } from "#utils/req-tachi-data"; import { GetUserWithID, ResolveUser } from "#utils/user"; + import { UserAuthLevels } from "../../../../../../../../common/src"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/notifications/router.test.ts b/typescript/server/src/server/router/api/v1/users/_userID/notifications/router.test.ts index 8e85919e4..d4022849b 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/notifications/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/notifications/router.test.ts @@ -1,5 +1,3 @@ -import type { NotificationDocument } from "../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import { CreateFakeAuthCookie } from "#test-utils/fake-auth"; import { mkFakeNotification, mkFakeUser } from "#test-utils/misc"; @@ -7,6 +5,8 @@ import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; import t from "tap"; +import type { NotificationDocument } from "../../../../../../../../../common/src"; + t.test("GET /api/v1/users/:userID/notifications", async (t) => { t.beforeEach(ResetDBState); t.beforeEach(() => diff --git a/typescript/server/src/server/router/api/v1/users/_userID/pfp/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/pfp/router.ts index 0172ad7aa..e48b5b6f9 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/pfp/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/pfp/router.ts @@ -3,12 +3,12 @@ import { CDNDelete, CDNRedirect, CDNStoreOrOverwrite } from "#lib/cdn/cdn"; import { GetProfilePictureURL } from "#lib/cdn/url-format"; import { ONE_MEGABYTE } from "#lib/constants/filesize"; import CreateLogCtx from "#lib/logger/logger"; +import { RequirePermissions } from "#server/middleware/auth"; +import { CreateMulterSingleUploadMiddleware } from "#server/middleware/multer-upload"; import { HashSHA256 } from "#utils/crypto"; import { GetTachiData } from "#utils/req-tachi-data"; import { FormatUserDoc } from "#utils/user"; import { Router } from "express"; -import { RequirePermissions } from "#server/middleware/auth"; -import { CreateMulterSingleUploadMiddleware } from "#server/middleware/multer-upload"; import { RequireAuthedAsUser } from "../middleware"; diff --git a/typescript/server/src/server/router/api/v1/users/_userID/router.test.ts b/typescript/server/src/server/router/api/v1/users/_userID/router.test.ts index 0071348d4..4d80410c6 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/router.test.ts @@ -1,10 +1,3 @@ -import type { - GameGroup, - ImportDocument, - ImportTypes, - UserGameStats, -} from "../../../../../../../../common/src"; - import db from "#external/mongo/db"; import { ONE_DAY, ONE_YEAR } from "#lib/constants/time"; import { CreateFakeAuthCookie } from "#test-utils/fake-auth"; @@ -13,6 +6,13 @@ import ResetDBState from "#test-utils/resets"; import { Random20Hex } from "#utils/misc"; import t from "tap"; +import type { + GameGroup, + ImportDocument, + ImportTypes, + UserGameStats, +} from "../../../../../../../../common/src"; + import { PasswordCompare } from "../../auth/auth"; t.test("GET /api/v1/users/:userID", (t) => { diff --git a/typescript/server/src/server/router/api/v1/users/_userID/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/router.ts index 0cb2e5a45..9c961ef45 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/router.ts @@ -1,11 +1,3 @@ -import type { - AnyProfileRatingAlg, - GPTString, - ImportTypes, - integer, - UserGameStats, -} from "../../../../../../../../common/src"; - import db from "#external/mongo/db"; import { GetRecentActivity } from "#lib/activity/activity"; import { ONE_MONTH } from "#lib/constants/time"; @@ -14,6 +6,7 @@ import { EmailFormatVerifyEmail } from "#lib/email/formats"; import CreateLogCtx from "#lib/logger/logger"; import { GetRivalIDs } from "#lib/rivals/rivals"; import { ServerConfig } from "#lib/setup/config"; +import prValidate from "#server/middleware/prudence-validate"; import { DeleteUndefinedProps, IsNonEmptyString, Random20Hex, StripUrl } from "#utils/misc"; import { optNullFluffStrField } from "#utils/prudence"; import { @@ -34,7 +27,14 @@ import { } from "#utils/user"; import { Router } from "express"; import { p } from "prudence"; -import prValidate from "#server/middleware/prudence-validate"; + +import type { + AnyProfileRatingAlg, + GPTString, + ImportTypes, + integer, + UserGameStats, +} from "../../../../../../../../common/src"; import { HashPassword, PasswordCompare, ValidateEmail, ValidatePassword } from "../../auth/auth"; import apiTokensRouter from "./api-tokens/router"; diff --git a/typescript/server/src/server/router/api/v1/users/_userID/settings/router.test.ts b/typescript/server/src/server/router/api/v1/users/_userID/settings/router.test.ts index fe8441ac4..b32d18ce1 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/settings/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/settings/router.test.ts @@ -1,5 +1,3 @@ -import type { UserDocument } from "../../../../../../../../../common/src"; - import db from "#external/mongo/db"; import { CreateFakeAuthCookie } from "#test-utils/fake-auth"; import mockApi from "#test-utils/mock-api"; @@ -7,6 +5,8 @@ import ResetDBState from "#test-utils/resets"; import deepmerge from "deepmerge"; import t from "tap"; +import type { UserDocument } from "../../../../../../../../../common/src"; + t.test("GET /api/v1/users/:userID/settings", (t) => { t.beforeEach(ResetDBState); diff --git a/typescript/server/src/server/router/api/v1/users/_userID/settings/router.ts b/typescript/server/src/server/router/api/v1/users/_userID/settings/router.ts index afa126407..7c98f0b83 100644 --- a/typescript/server/src/server/router/api/v1/users/_userID/settings/router.ts +++ b/typescript/server/src/server/router/api/v1/users/_userID/settings/router.ts @@ -1,9 +1,9 @@ import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; +import prValidate from "#server/middleware/prudence-validate"; import { GetTachiData } from "#utils/req-tachi-data"; import { FormatUserDoc, GetSettingsForUser } from "#utils/user"; import { Router } from "express"; -import prValidate from "#server/middleware/prudence-validate"; import { RequireSelfRequestFromUser } from "../middleware"; diff --git a/typescript/server/src/server/router/api/v1/users/router.test.ts b/typescript/server/src/server/router/api/v1/users/router.test.ts index b1d0d9e58..dd1f71bdb 100644 --- a/typescript/server/src/server/router/api/v1/users/router.test.ts +++ b/typescript/server/src/server/router/api/v1/users/router.test.ts @@ -1,10 +1,10 @@ -import type { UserDocument } from "../../../../../../../common/src"; - import db from "#external/mongo/db"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; import t from "tap"; +import type { UserDocument } from "../../../../../../../common/src"; + t.test("GET /api/v1/users", (t) => { t.beforeEach(ResetDBState); diff --git a/typescript/server/src/server/router/ir/barbatos/router.ts b/typescript/server/src/server/router/ir/barbatos/router.ts index 0a2804492..af8a30c09 100644 --- a/typescript/server/src/server/router/ir/barbatos/router.ts +++ b/typescript/server/src/server/router/ir/barbatos/router.ts @@ -1,7 +1,7 @@ import { SYMBOL_TACHI_API_AUTH } from "#lib/constants/tachi"; import { ExpressWrappedScoreImportMain } from "#lib/score-import/framework/express-wrapper"; -import { Router } from "express"; import { RequirePermissions } from "#server/middleware/auth"; +import { Router } from "express"; const router: Router = Router({ mergeParams: true }); diff --git a/typescript/server/src/server/router/ir/beatoraja/charts/_chartSHA256/router.test.ts b/typescript/server/src/server/router/ir/beatoraja/charts/_chartSHA256/router.test.ts index 5f68e55cc..6dcc3e8d4 100644 --- a/typescript/server/src/server/router/ir/beatoraja/charts/_chartSHA256/router.test.ts +++ b/typescript/server/src/server/router/ir/beatoraja/charts/_chartSHA256/router.test.ts @@ -1,10 +1,10 @@ -import type { PBScoreDocument, ScoreDocument } from "../../../../../../../../common/src"; - import db from "#external/mongo/db"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; import t from "tap"; +import type { PBScoreDocument, ScoreDocument } from "../../../../../../../../common/src"; + t.test("GET /ir/beatoraja/charts/:chartSHA256/scores", (t) => { t.beforeEach(ResetDBState); t.beforeEach(() => diff --git a/typescript/server/src/server/router/ir/beatoraja/charts/_chartSHA256/router.ts b/typescript/server/src/server/router/ir/beatoraja/charts/_chartSHA256/router.ts index bcf6ad5cd..1fd77cd1e 100644 --- a/typescript/server/src/server/router/ir/beatoraja/charts/_chartSHA256/router.ts +++ b/typescript/server/src/server/router/ir/beatoraja/charts/_chartSHA256/router.ts @@ -1,3 +1,9 @@ +import db from "#external/mongo/db"; +import { SYMBOL_TACHI_API_AUTH } from "#lib/constants/tachi"; +import CreateLogCtx from "#lib/logger/logger"; +import { AssignToReqTachiData, GetTachiData } from "#utils/req-tachi-data"; +import { type RequestHandler, Router } from "express"; + import type { ChartDocument, integer, @@ -5,12 +11,6 @@ import type { UserDocument, } from "../../../../../../../../common/src"; -import db from "#external/mongo/db"; -import { SYMBOL_TACHI_API_AUTH } from "#lib/constants/tachi"; -import CreateLogCtx from "#lib/logger/logger"; -import { AssignToReqTachiData, GetTachiData } from "#utils/req-tachi-data"; -import { type RequestHandler, Router } from "express"; - import { TachiScoreDataToBeatorajaFormat } from "./convert-scores"; const router: Router = Router({ mergeParams: true }); diff --git a/typescript/server/src/server/router/ir/beatoraja/router.test.ts b/typescript/server/src/server/router/ir/beatoraja/router.test.ts index 249dedd5c..70552c659 100644 --- a/typescript/server/src/server/router/ir/beatoraja/router.test.ts +++ b/typescript/server/src/server/router/ir/beatoraja/router.test.ts @@ -1,5 +1,3 @@ -import type { UserDocument } from "../../../../../../common/src"; - import db from "#external/mongo/db"; import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; @@ -7,6 +5,8 @@ import { MockBeatorajaBMSScore, MockBeatorajaPMSScore } from "#test-utils/test-d import deepmerge from "deepmerge"; import t from "tap"; +import type { UserDocument } from "../../../../../../common/src"; + const NEW_SHA256 = "769359ebb55d3d6dff3b5c6a07ec03be9b87beda1ffb0c07d7ea99590605a732"; const NEW_MD5 = "d0f497c0f955e7edfb0278f446cdb6f8"; diff --git a/typescript/server/src/server/router/ir/beatoraja/router.ts b/typescript/server/src/server/router/ir/beatoraja/router.ts index 33afc459f..9e8897811 100644 --- a/typescript/server/src/server/router/ir/beatoraja/router.ts +++ b/typescript/server/src/server/router/ir/beatoraja/router.ts @@ -2,19 +2,20 @@ import type { BeatorajaChart, BeatorajaScore, } from "#lib/score-import/import-types/ir/beatoraja/types"; -import type { integer } from "../../../../../../common/src"; import db from "#external/mongo/db"; import { SYMBOL_TACHI_API_AUTH } from "#lib/constants/tachi"; import CreateLogCtx from "#lib/logger/logger"; import { ExpressWrappedScoreImportMain } from "#lib/score-import/framework/express-wrapper"; import { ServerConfig } from "#lib/setup/config"; +import { RequireNotGuest } from "#server/middleware/auth"; +import prValidate from "#server/middleware/prudence-validate"; import { UpdateClassIfGreater } from "#utils/class"; import { IsRecord, NotNullish } from "#utils/misc"; import { Router } from "express"; import { p } from "prudence"; -import { RequireNotGuest } from "#server/middleware/auth"; -import prValidate from "#server/middleware/prudence-validate"; + +import type { integer } from "../../../../../../common/src"; import { ValidateIRClientVersion } from "./auth"; import chartsRouter from "./charts/_chartSHA256/router"; diff --git a/typescript/server/src/server/router/ir/direct-manual/router.test.ts b/typescript/server/src/server/router/ir/direct-manual/router.test.ts index 68e57bdaa..56628690e 100644 --- a/typescript/server/src/server/router/ir/direct-manual/router.test.ts +++ b/typescript/server/src/server/router/ir/direct-manual/router.test.ts @@ -1,5 +1,3 @@ -import type { BatchManual, BatchManualScore } from "../../../../../../common/src"; - import db from "#external/mongo/db"; import { CreateFakeAuthCookie } from "#test-utils/fake-auth"; import mockApi from "#test-utils/mock-api"; @@ -12,6 +10,8 @@ import { import deepmerge from "deepmerge"; import t from "tap"; +import type { BatchManual, BatchManualScore } from "../../../../../../common/src"; + t.test("POST /ir/direct-manual/import", async (t) => { const cookie = await CreateFakeAuthCookie(mockApi); diff --git a/typescript/server/src/server/router/ir/direct-manual/router.ts b/typescript/server/src/server/router/ir/direct-manual/router.ts index 31e679e40..ed3b96b85 100644 --- a/typescript/server/src/server/router/ir/direct-manual/router.ts +++ b/typescript/server/src/server/router/ir/direct-manual/router.ts @@ -4,10 +4,10 @@ import { SYMBOL_TACHI_API_AUTH } from "#lib/constants/tachi"; import { ExpressWrappedScoreImportMain } from "#lib/score-import/framework/express-wrapper"; import { MakeScoreImport } from "#lib/score-import/framework/score-import"; import { ServerConfig } from "#lib/setup/config"; -import { Random20Hex } from "#utils/misc"; -import { Router } from "express"; import { RequirePermissions } from "#server/middleware/auth"; import { ScoreImportRateLimiter } from "#server/middleware/rate-limiter"; +import { Random20Hex } from "#utils/misc"; +import { Router } from "express"; const router: Router = Router({ mergeParams: true }); diff --git a/typescript/server/src/server/router/ir/fervidex/router.test.ts b/typescript/server/src/server/router/ir/fervidex/router.test.ts index 2e3ee7c45..4eecf490b 100644 --- a/typescript/server/src/server/router/ir/fervidex/router.test.ts +++ b/typescript/server/src/server/router/ir/fervidex/router.test.ts @@ -1,5 +1,3 @@ -import type { ChartDocument, GPTStrings, SongDocument } from "../../../../../../common/src"; - import db from "#external/mongo/db"; import { InsertFakeTokenWithAllPerms } from "#test-utils/fake-auth"; import mockApi from "#test-utils/mock-api"; @@ -14,6 +12,8 @@ import { Random20Hex, Sleep } from "#utils/misc"; import deepmerge from "deepmerge"; import t from "tap"; +import type { ChartDocument, GPTStrings, SongDocument } from "../../../../../../common/src"; + // eslint-disable-next-line @typescript-eslint/no-explicit-any function TestHeaders(url: string, data: any) { t.test("Should validate against card filters", async (t) => { diff --git a/typescript/server/src/server/router/ir/fervidex/router.ts b/typescript/server/src/server/router/ir/fervidex/router.ts index ec18e9123..61d763353 100644 --- a/typescript/server/src/server/router/ir/fervidex/router.ts +++ b/typescript/server/src/server/router/ir/fervidex/router.ts @@ -4,13 +4,14 @@ import { SYMBOL_TACHI_API_AUTH } from "#lib/constants/tachi"; import CreateLogCtx from "#lib/logger/logger"; import { ExpressWrappedScoreImportMain } from "#lib/score-import/framework/express-wrapper"; import { SoftwareIDToVersion } from "#lib/score-import/import-types/ir/fervidex/parser"; +import { RequirePermissions } from "#server/middleware/auth"; +import { PrudenceErrorFormatter } from "#server/middleware/prudence-validate"; import { UpdateClassIfGreater } from "#utils/class"; import { ParseEA3SoftID } from "#utils/ea3id"; import { IsNullishOrEmptyStr } from "#utils/misc"; import { type RequestHandler, Router } from "express"; import { p } from "prudence"; -import { RequirePermissions } from "#server/middleware/auth"; -import { PrudenceErrorFormatter } from "#server/middleware/prudence-validate"; + import { GetGamePTConfig, type integer, diff --git a/typescript/server/src/server/router/ir/kshook/sv6c/router.test.ts b/typescript/server/src/server/router/ir/kshook/sv6c/router.test.ts index e0ad014b8..22d313270 100644 --- a/typescript/server/src/server/router/ir/kshook/sv6c/router.test.ts +++ b/typescript/server/src/server/router/ir/kshook/sv6c/router.test.ts @@ -4,9 +4,10 @@ import mockApi from "#test-utils/mock-api"; import ResetDBState from "#test-utils/resets"; import { TestingKsHookSV6CScore, TestingKsHookSV6CStaticScore } from "#test-utils/test-data"; import deepmerge from "deepmerge"; -import { ALL_PERMISSIONS } from "../../../../../../../common/src"; import t from "tap"; +import { ALL_PERMISSIONS } from "../../../../../../../common/src"; + t.test("POST /ir/kshook/sv6c/score/save", (t) => { t.beforeEach(ResetDBState); t.beforeEach(() => diff --git a/typescript/server/src/server/router/ir/lr2hook/router.ts b/typescript/server/src/server/router/ir/lr2hook/router.ts index f95edbaae..60b142168 100644 --- a/typescript/server/src/server/router/ir/lr2hook/router.ts +++ b/typescript/server/src/server/router/ir/lr2hook/router.ts @@ -4,10 +4,10 @@ import db from "#external/mongo/db"; import { SYMBOL_TACHI_API_AUTH } from "#lib/constants/tachi"; import { ExpressWrappedScoreImportMain } from "#lib/score-import/framework/express-wrapper"; import { PR_LR2HOOK as PR_LR2_HOOK } from "#lib/score-import/import-types/ir/lr2hook/parser"; -import { UpdateClassIfGreater } from "#utils/class"; -import { Router } from "express"; import { RequirePermissions } from "#server/middleware/auth"; import prValidate from "#server/middleware/prudence-validate"; +import { UpdateClassIfGreater } from "#utils/class"; +import { Router } from "express"; const router: Router = Router({ mergeParams: true }); diff --git a/typescript/server/src/server/router/ir/usc/_playtype/router.ts b/typescript/server/src/server/router/ir/usc/_playtype/router.ts index ba7dc0740..98a6f1d64 100644 --- a/typescript/server/src/server/router/ir/usc/_playtype/router.ts +++ b/typescript/server/src/server/router/ir/usc/_playtype/router.ts @@ -14,6 +14,9 @@ import { FormatPrError } from "#utils/prudence"; import { AssignToReqTachiData, GetTachiData } from "#utils/req-tachi-data"; import { type RequestHandler, Router } from "express"; import { p } from "prudence"; + +import type { USCClientChart } from "./types"; + import { type ChartDocument, GetGamePTConfig, @@ -22,9 +25,6 @@ import { type Playtypes, type SuccessfulAPIResponse, } from "../../../../../../../common/src"; - -import type { USCClientChart } from "./types"; - import { CreatePOSTScoresResponseBody, TachiScoreToServerScore } from "./usc"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/server/router/ir/usc/_playtype/usc.test.ts b/typescript/server/src/server/router/ir/usc/_playtype/usc.test.ts index 1e01dcdda..36ab785af 100644 --- a/typescript/server/src/server/router/ir/usc/_playtype/usc.test.ts +++ b/typescript/server/src/server/router/ir/usc/_playtype/usc.test.ts @@ -1,3 +1,8 @@ +import db from "#external/mongo/db"; +import ResetDBState from "#test-utils/resets"; +import deepmerge from "deepmerge"; +import t from "tap"; + import type { ChartDocument, PBScoreDocument, @@ -5,11 +10,6 @@ import type { UserDocument, } from "../../../../../../../common/src"; -import db from "#external/mongo/db"; -import ResetDBState from "#test-utils/resets"; -import deepmerge from "deepmerge"; -import t from "tap"; - import { CreatePOSTScoresResponseBody, TachiScoreToServerScore } from "./usc"; const mockScorePB: PBScoreDocument<"usc:Controller" | "usc:Keyboard"> = { diff --git a/typescript/server/src/server/router/ir/usc/_playtype/usc.ts b/typescript/server/src/server/router/ir/usc/_playtype/usc.ts index 87ebdab04..ccec962a3 100644 --- a/typescript/server/src/server/router/ir/usc/_playtype/usc.ts +++ b/typescript/server/src/server/router/ir/usc/_playtype/usc.ts @@ -1,3 +1,9 @@ +import db from "#external/mongo/db"; +import { USCIR_ADJACENT_SCORE_N } from "#lib/constants/usc-ir"; +import CreateLogCtx from "#lib/logger/logger"; +import { MStoS } from "#utils/misc"; +import { GetPBOnChart, GetServerRecordOnChart } from "#utils/scores"; + import type { ChartDocument, GPTStrings, @@ -6,13 +12,6 @@ import type { ScoreDocument, } from "../../../../../../../common/src"; import type { GetEnumValue } from "../../../../../../../common/src/types/metrics"; - -import db from "#external/mongo/db"; -import { USCIR_ADJACENT_SCORE_N } from "#lib/constants/usc-ir"; -import CreateLogCtx from "#lib/logger/logger"; -import { MStoS } from "#utils/misc"; -import { GetPBOnChart, GetServerRecordOnChart } from "#utils/scores"; - import type { USCServerScore } from "./types"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/server/router/router.ts b/typescript/server/src/server/router/router.ts index c6e7b4023..49a2cffd1 100644 --- a/typescript/server/src/server/router/router.ts +++ b/typescript/server/src/server/router/router.ts @@ -1,6 +1,6 @@ import { Environment } from "#lib/setup/config"; -import { Router } from "express"; import { UpdateLastSeen } from "#server/middleware/update-last-seen"; +import { Router } from "express"; import { RejectIfBanned, SetRequestPermissions } from "../middleware/auth"; import { NormalRateLimitMiddleware } from "../middleware/rate-limiter"; diff --git a/typescript/server/src/server/server.ts b/typescript/server/src/server/server.ts index c4989326a..3e8aef505 100644 --- a/typescript/server/src/server/server.ts +++ b/typescript/server/src/server/server.ts @@ -1,8 +1,8 @@ -import type { integer } from "../../../common/src"; - -import "express-async-errors"; import connectRedis from "connect-redis"; +import "express-async-errors"; import express, { type Express } from "express"; + +import type { integer } from "../../../common/src"; // THIS IMPORT **MUST** GO HERE. DO NOT MOVE IT. IT MUST OCCUR BEFORE ANYTHING HAPPENS WITH EXPRESS // BUT AFTER EXPRESS IS IMPORTED. diff --git a/typescript/server/src/services/mongo/db.test.ts b/typescript/server/src/services/mongo/db.test.ts index f01f47f47..b941b43e4 100644 --- a/typescript/server/src/services/mongo/db.test.ts +++ b/typescript/server/src/services/mongo/db.test.ts @@ -1,8 +1,8 @@ -import type { ScoreDocument } from "../../../../common/src"; - import ResetDBState from "#test-utils/resets"; import t from "tap"; +import type { ScoreDocument } from "../../../../common/src"; + import db from "./db"; t.test("ID field autoprojection", async (t) => { diff --git a/typescript/server/src/services/mongo/db.ts b/typescript/server/src/services/mongo/db.ts index de808fc76..2c0b2b749 100644 --- a/typescript/server/src/services/mongo/db.ts +++ b/typescript/server/src/services/mongo/db.ts @@ -2,6 +2,7 @@ import type { OrphanScoreDocument } from "#lib/score-import/import-types/common/ import type { MigrationDocument, PrivateUserInfoDocument } from "#utils/types"; import monk, { type ICollection, type TMiddleware } from "monk"; + import { allSupportedGameGroups, type APITokenDocument, diff --git a/typescript/server/src/services/mongo/indexes.ts b/typescript/server/src/services/mongo/indexes.ts index 889ec7353..faab61884 100644 --- a/typescript/server/src/services/mongo/indexes.ts +++ b/typescript/server/src/services/mongo/indexes.ts @@ -6,10 +6,11 @@ import monk, { type IMonkManager } from "monk"; import CreateLogCtx from "#lib/logger/logger"; import { TachiConfig } from "#lib/setup/config"; import { DedupeArr, Random20Hex } from "#utils/misc"; -import { GAME_PT_CONFIGS } from "../../../../common/src"; import type { Databases } from "./db"; +import { GAME_PT_CONFIGS } from "../../../../common/src"; + const logger = CreateLogCtx(__filename); interface Index { diff --git a/typescript/server/src/services/mongo/schemas.ts b/typescript/server/src/services/mongo/schemas.ts index 4a0102c5c..9d3bd75c3 100644 --- a/typescript/server/src/services/mongo/schemas.ts +++ b/typescript/server/src/services/mongo/schemas.ts @@ -1,10 +1,11 @@ import { TachiConfig } from "#lib/setup/config"; import { p, type PrudenceSchema } from "prudence"; -import { allImportTypes } from "../../../../common/src/constants/import-types"; -import { SCHEMAS, type SchemaValidatorFunction } from "../../../../common/src/lib/schemas"; import type { Databases } from "./db"; +import { allImportTypes } from "../../../../common/src/constants/import-types"; +import { SCHEMAS, type SchemaValidatorFunction } from "../../../../common/src/lib/schemas"; + // The idea of this file is to export a function for every database // that will validate that collection. diff --git a/typescript/server/src/services/pg/seeds.ts b/typescript/server/src/services/pg/seeds.ts index a1551e20f..5a99b81ef 100644 --- a/typescript/server/src/services/pg/seeds.ts +++ b/typescript/server/src/services/pg/seeds.ts @@ -19,6 +19,10 @@ import type { Game as PgGame, } from "tachi-db"; +import fs from "fs"; +import { type Insertable, type Kysely, sql } from "kysely"; +import path from "path"; + import type { BMSCourseDocument, ChartDocument, @@ -30,10 +34,6 @@ import type { TableDocument, } from "../../../../common/src"; -import fs from "fs"; -import { type Insertable, type Kysely, sql } from "kysely"; -import path from "path"; - // ── Seed types ───────────────────────────────────────────────────────────── type SeedSong = { id: string; legacySongID?: number } & Omit; diff --git a/typescript/server/src/test-utils/api-common.ts b/typescript/server/src/test-utils/api-common.ts index ad3c07798..45d106dcb 100644 --- a/typescript/server/src/test-utils/api-common.ts +++ b/typescript/server/src/test-utils/api-common.ts @@ -1,8 +1,8 @@ -import type { APIPermissions } from "../../../common/src"; - import db from "#external/mongo/db"; import t from "tap"; +import type { APIPermissions } from "../../../common/src"; + import mockApi from "./mock-api"; import ResetDBState from "./resets"; diff --git a/typescript/server/src/test-utils/fake-auth.ts b/typescript/server/src/test-utils/fake-auth.ts index 0ba1c6291..dad6ddb2f 100644 --- a/typescript/server/src/test-utils/fake-auth.ts +++ b/typescript/server/src/test-utils/fake-auth.ts @@ -3,8 +3,8 @@ import type supertest from "supertest"; import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import { ClearTestingRateLimitCache } from "#server/middleware/rate-limiter"; -import { ALL_PERMISSIONS } from "../../../common/src"; +import { ALL_PERMISSIONS } from "../../../common/src"; import ResetDBState from "./resets"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/test-utils/misc.ts b/typescript/server/src/test-utils/misc.ts index 7c8946828..400640544 100644 --- a/typescript/server/src/test-utils/misc.ts +++ b/typescript/server/src/test-utils/misc.ts @@ -1,4 +1,7 @@ import type { DeepPartial } from "#utils/types"; + +import deepmerge from "deepmerge"; + import type { ChartDocument, GameGroup, @@ -17,8 +20,6 @@ import type { UserGameStats, } from "../../../common/src"; -import deepmerge from "deepmerge"; - import { FakeGameSettings, FakeImport, diff --git a/typescript/server/src/test-utils/resets.ts b/typescript/server/src/test-utils/resets.ts index fce098464..f16054b05 100644 --- a/typescript/server/src/test-utils/resets.ts +++ b/typescript/server/src/test-utils/resets.ts @@ -1,14 +1,15 @@ import type { ICollection } from "monk"; -import type { GameGroup } from "../../../common/src"; import db, { type StaticDatabases } from "#external/mongo/db"; import { SetIndexes } from "#external/mongo/indexes"; import CreateLogCtx from "#lib/logger/logger"; import { Environment, ServerConfig } from "#lib/setup/config"; +import { ClearTestingRateLimitCache } from "#server/middleware/rate-limiter"; import fs from "fs"; import path from "path"; import rimraf from "rimraf"; -import { ClearTestingRateLimitCache } from "#server/middleware/rate-limiter"; + +import type { GameGroup } from "../../../common/src"; // im installing an entire library for rm rf... diff --git a/typescript/server/src/utils/calculations/recalc-scores.ts b/typescript/server/src/utils/calculations/recalc-scores.ts index 637bcb75a..67ccbd50f 100644 --- a/typescript/server/src/utils/calculations/recalc-scores.ts +++ b/typescript/server/src/utils/calculations/recalc-scores.ts @@ -8,6 +8,7 @@ import { UpdateUsersGamePlaytypeStats } from "#lib/score-import/framework/ugpt-s import { TachiConfig } from "#lib/setup/config"; import { EfficientDBIterate } from "#utils/efficient-db-iterate"; import { FormatUserDoc } from "#utils/user"; + import { type GameGroup, GetGameGroupConfig, diff --git a/typescript/server/src/utils/calculations/recalc-sessions.ts b/typescript/server/src/utils/calculations/recalc-sessions.ts index d7d9d1ba7..333a7ab90 100644 --- a/typescript/server/src/utils/calculations/recalc-sessions.ts +++ b/typescript/server/src/utils/calculations/recalc-sessions.ts @@ -3,6 +3,7 @@ import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; import { CreateSessionCalcData } from "#lib/score-import/framework/calculated-data/session"; + import { GetGPTString } from "../../../../common/src"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/utils/class.ts b/typescript/server/src/utils/class.ts index 3b448382d..ff807f7d7 100644 --- a/typescript/server/src/utils/class.ts +++ b/typescript/server/src/utils/class.ts @@ -2,6 +2,7 @@ import db from "#external/mongo/db"; import { CreateGameSettings } from "#lib/game-settings/create-game-settings"; import CreateLogCtx from "#lib/logger/logger"; import { EmitWebhookEvent } from "#lib/webhooks/webhooks"; + import { type Classes, type GameGroup, diff --git a/typescript/server/src/utils/db.ts b/typescript/server/src/utils/db.ts index b42fd52b8..04f7c38a8 100644 --- a/typescript/server/src/utils/db.ts +++ b/typescript/server/src/utils/db.ts @@ -2,6 +2,7 @@ import type { FilterQuery } from "mongodb"; import db from "#external/mongo/db"; import CreateLogCtx from "#lib/logger/logger"; + import { FormatChart, type GameGroup, diff --git a/typescript/server/src/utils/folder.test.ts b/typescript/server/src/utils/folder.test.ts index f0a2eb2a3..542b8b07d 100644 --- a/typescript/server/src/utils/folder.test.ts +++ b/typescript/server/src/utils/folder.test.ts @@ -1,11 +1,11 @@ -import type { ChartDocument, FolderDocument } from "../../../common/src"; - import db from "#external/mongo/db"; import ResetDBState from "#test-utils/resets"; import { Testing511SPA } from "#test-utils/test-data"; import deepmerge from "deepmerge"; import t from "tap"; +import type { ChartDocument, FolderDocument } from "../../../common/src"; + import { GetFolderChartIDs, ResolveFolderToCharts, TransposeFolderData } from "./folder"; t.todo("#CreateFolderChartLookup"); diff --git a/typescript/server/src/utils/folder.ts b/typescript/server/src/utils/folder.ts index cbb3fe3f7..5fed73f7e 100644 --- a/typescript/server/src/utils/folder.ts +++ b/typescript/server/src/utils/folder.ts @@ -5,6 +5,7 @@ import CreateLogCtx from "#lib/logger/logger"; import { TachiConfig } from "#lib/setup/config"; import deepmerge from "deepmerge"; import fjsh from "fast-json-stable-hash"; + import { type ChartDocument, type FolderChartLookup, @@ -20,7 +21,6 @@ import { type SongDocument, type TableDocument, } from "../../../common/src"; - import { GetFolderForIDGuaranteed } from "./db"; const logger = CreateLogCtx(__filename); diff --git a/typescript/server/src/utils/misc.ts b/typescript/server/src/utils/misc.ts index b9b88e156..7cba6a12c 100644 --- a/typescript/server/src/utils/misc.ts +++ b/typescript/server/src/utils/misc.ts @@ -5,6 +5,8 @@ import { ONE_HOUR, ONE_SECOND } from "#lib/constants/time"; import { TachiConfig } from "#lib/setup/config"; import { exec } from "child_process"; import crypto from "crypto"; +import { URL } from "url"; + import { type GameGroup, type GamePTConfig, @@ -15,7 +17,6 @@ import { type Playtype, type Versions, } from "../../../common/src"; -import { URL } from "url"; // https://github.com/sindresorhus/escape-string-regexp/blob/main/index.js // the developer of this has migrated everything to Force ES6 style modules, diff --git a/typescript/server/src/utils/queries/auth.ts b/typescript/server/src/utils/queries/auth.ts index 47c47ee64..19e6ddee8 100644 --- a/typescript/server/src/utils/queries/auth.ts +++ b/typescript/server/src/utils/queries/auth.ts @@ -1,9 +1,10 @@ import type { KtLogger } from "#lib/logger/logger"; -import type { integer } from "../../../../common/src"; import db from "#external/mongo/db"; import ScoreImportFatalError from "#lib/score-import/framework/score-importing/score-import-error"; +import type { integer } from "../../../../common/src"; + export function GetKaiAuth(userID: integer, service: "EAG" | "FLO" | "MIN") { return db["kai-auth-tokens"].findOne({ userID, diff --git a/typescript/server/src/utils/queries/charts.ts b/typescript/server/src/utils/queries/charts.ts index 58bb02d3e..8bd196a86 100644 --- a/typescript/server/src/utils/queries/charts.ts +++ b/typescript/server/src/utils/queries/charts.ts @@ -1,4 +1,7 @@ import type { FilterQuery } from "mongodb"; + +import db from "#external/mongo/db"; + import type { ChartDocument, Difficulties, @@ -10,8 +13,6 @@ import type { Versions, } from "../../../../common/src"; -import db from "#external/mongo/db"; - export function FindChartWithChartID(game: GameGroup, chartID: string) { return db.anyCharts[game].findOne({ chartID }); } diff --git a/typescript/server/src/utils/queries/pbs.ts b/typescript/server/src/utils/queries/pbs.ts index bbb51a37a..5eef04d27 100644 --- a/typescript/server/src/utils/queries/pbs.ts +++ b/typescript/server/src/utils/queries/pbs.ts @@ -1,7 +1,7 @@ -import type { PBScoreDocument } from "../../../../common/src"; - import db from "#external/mongo/db"; +import type { PBScoreDocument } from "../../../../common/src"; + export async function GetAdjacentAbove(userPB: PBScoreDocument, size = 5) { const adjAbove = (await db["personal-bests"].find( { diff --git a/typescript/server/src/utils/queries/scores.ts b/typescript/server/src/utils/queries/scores.ts index cdd3d34f9..c5cc146c4 100644 --- a/typescript/server/src/utils/queries/scores.ts +++ b/typescript/server/src/utils/queries/scores.ts @@ -1,7 +1,7 @@ -import type { GameGroup, integer, Playtype } from "../../../../common/src"; - import db from "#external/mongo/db"; +import type { GameGroup, integer, Playtype } from "../../../../common/src"; + export async function GetRecentUGPTScores( userID: integer, game: GameGroup, diff --git a/typescript/server/src/utils/queries/songs.ts b/typescript/server/src/utils/queries/songs.ts index 51927069b..48c65dd38 100644 --- a/typescript/server/src/utils/queries/songs.ts +++ b/typescript/server/src/utils/queries/songs.ts @@ -1,6 +1,5 @@ import type { KtLogger } from "#lib/logger/logger"; import type { FindOneResult } from "monk"; -import type { GameGroup, integer, SongDocument } from "../../../../common/src"; import db from "#external/mongo/db"; import { @@ -8,6 +7,8 @@ import { InternalFailure, } from "#lib/score-import/framework/common/converter-failures"; +import type { GameGroup, integer, SongDocument } from "../../../../common/src"; + import { EscapeStringRegexp } from "../misc"; /** diff --git a/typescript/server/src/utils/queries/stats.ts b/typescript/server/src/utils/queries/stats.ts index 0ca691195..ae26a9891 100644 --- a/typescript/server/src/utils/queries/stats.ts +++ b/typescript/server/src/utils/queries/stats.ts @@ -1,9 +1,9 @@ -import type { Classes, GameGroup, GPTString, integer, Playtype } from "../../../../common/src"; - import db from "#external/mongo/db"; import { ONE_HOUR } from "#lib/constants/time"; import NodeCache from "node-cache"; +import type { Classes, GameGroup, GPTString, integer, Playtype } from "../../../../common/src"; + const classDistCache = new NodeCache(); export async function GetClassDistribution( diff --git a/typescript/server/src/utils/queries/summary.ts b/typescript/server/src/utils/queries/summary.ts index f1c902db8..10a495971 100644 --- a/typescript/server/src/utils/queries/summary.ts +++ b/typescript/server/src/utils/queries/summary.ts @@ -1,9 +1,9 @@ -import type { integer } from "../../../../common/src"; - import db from "#external/mongo/db"; import { GetEnumDistForFolders } from "#utils/folder"; import { GetTimeXHoursAgo } from "#utils/misc"; +import type { integer } from "../../../../common/src"; + // Various utils related to the player summary endpoint. const REASONABLE_HOURS_AGO = 16; diff --git a/typescript/server/src/utils/reset-state/destroy-ugpt.ts b/typescript/server/src/utils/reset-state/destroy-ugpt.ts index 618803b80..d6a519a70 100644 --- a/typescript/server/src/utils/reset-state/destroy-ugpt.ts +++ b/typescript/server/src/utils/reset-state/destroy-ugpt.ts @@ -1,8 +1,8 @@ -import type { GameGroup, integer, Playtype } from "../../../../common/src"; - import db from "#external/mongo/db"; import { UpdateAllPBs } from "#utils/calculations/recalc-scores"; +import type { GameGroup, integer, Playtype } from "../../../../common/src"; + /** * Completely resets a UGPT profile. * diff --git a/typescript/server/src/utils/scores.ts b/typescript/server/src/utils/scores.ts index ddc1265c0..500d0bbc1 100644 --- a/typescript/server/src/utils/scores.ts +++ b/typescript/server/src/utils/scores.ts @@ -1,3 +1,5 @@ +import db from "#external/mongo/db"; + import type { ChartDocument, integer, @@ -6,8 +8,6 @@ import type { SongDocument, } from "../../../common/src"; -import db from "#external/mongo/db"; - import { DedupeArr } from "./misc"; export function GetPBOnChart(userID: integer, chartID: string) { diff --git a/typescript/server/src/utils/session.ts b/typescript/server/src/utils/session.ts index cf93932b6..1a978dfa8 100644 --- a/typescript/server/src/utils/session.ts +++ b/typescript/server/src/utils/session.ts @@ -1,7 +1,7 @@ -import type { ScoreDocument, SessionDocument } from "../../../common/src"; - import db from "#external/mongo/db"; +import type { ScoreDocument, SessionDocument } from "../../../common/src"; + /** * Returns all the score documents inside a session. * @param session The session to retrieve the score documents of. diff --git a/typescript/server/src/utils/string-checks.ts b/typescript/server/src/utils/string-checks.ts index a813dc11b..1d65fba74 100644 --- a/typescript/server/src/utils/string-checks.ts +++ b/typescript/server/src/utils/string-checks.ts @@ -6,7 +6,6 @@ import { GetGamePTConfig, type Playtype, } from "../../../common/src"; - import { IsString } from "./misc"; const isIntegerRegex = /^-?\d+$/u; diff --git a/typescript/server/src/utils/types.ts b/typescript/server/src/utils/types.ts index 4fdbb52e3..7e7e3280c 100644 --- a/typescript/server/src/utils/types.ts +++ b/typescript/server/src/utils/types.ts @@ -1,4 +1,5 @@ import type { TachiBMSTable } from "#lib/game-specific/custom-bms-tables"; + import type { ChartDocument, FolderDocument, diff --git a/typescript/server/src/utils/user.test.ts b/typescript/server/src/utils/user.test.ts index eb3cae1f3..d22f0aae0 100644 --- a/typescript/server/src/utils/user.test.ts +++ b/typescript/server/src/utils/user.test.ts @@ -1,11 +1,11 @@ -import type { UserDocument } from "../../../common/src"; - import db from "#external/mongo/db"; import { DatabaseSchemas } from "#external/mongo/schemas"; import { mkFakeUser } from "#test-utils/misc"; import ResetDBState from "#test-utils/resets"; import t from "tap"; +import type { UserDocument } from "../../../common/src"; + import { FormatUserDoc, GetUserCaseInsensitive, GetUsersWithIDs } from "./user"; t.test("#GetUserCaseInsensitive", (t) => { diff --git a/typescript/server/src/utils/user.ts b/typescript/server/src/utils/user.ts index dc3095b36..78fc6eace 100644 --- a/typescript/server/src/utils/user.ts +++ b/typescript/server/src/utils/user.ts @@ -3,6 +3,7 @@ import type { FindOneResult } from "monk"; import db from "#external/mongo/db"; import { ONE_DAY } from "#lib/constants/time"; import CreateLogCtx from "#lib/logger/logger"; + import { type APITokenDocument, type GameGroup,