chore: lints

This commit is contained in:
2026-02-04 22:36:26 -08:00
parent 9caf74945a
commit 9f0132db34
46 changed files with 531 additions and 463 deletions
+11 -11
View File
@@ -1,17 +1,17 @@
/**
* @copyright 2026 NHCarrigan
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
export * from "./lib/game.types";
export * from "./lib/book.types";
export * from "./lib/music.types";
export * from "./lib/art.types";
export * from "./lib/show.types";
export * from "./lib/manga.types";
export type * from "./lib/auth.types";
export * from "./lib/comment.types";
export type * from "./lib/art.types";
export * from "./lib/audit.types";
export type * from "./lib/auth.types";
export * from "./lib/book.types";
export type * from "./lib/comment.types";
export type * from "./lib/common.types";
export * from "./lib/game.types";
export type * from "./lib/like.types";
export * from "./lib/manga.types";
export * from "./lib/music.types";
export * from "./lib/show.types";
export * from "./lib/suggestion.types";
export * from "./lib/common.types";
export * from "./lib/like.types";
+22 -19
View File
@@ -1,30 +1,33 @@
/**
* @copyright 2026 NHCarrigan
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { Link } from "./common.types";
import type { Link } from "./common.types";
export interface Art {
id: string;
title: string;
artist: string;
interface Art {
id: string;
title: string;
artist: string;
description?: string;
imageUrl: string;
tags: string[];
links: Link[];
dateAdded: Date;
createdAt: Date;
updatedAt: Date;
imageUrl: string;
tags: Array<string>;
links: Array<Link>;
dateAdded: Date;
createdAt: Date;
updatedAt: Date;
}
export interface CreateArtDto {
title: string;
artist: string;
interface CreateArtDto {
title: string;
artist: string;
description?: string;
imageUrl: string;
tags?: string[];
links?: Link[];
imageUrl: string;
tags?: Array<string>;
links?: Array<Link>;
}
export interface UpdateArtDto extends Partial<CreateArtDto> {}
type UpdateArtDto = Partial<CreateArtDto>;
export type { Art, CreateArtDto, UpdateArtDto };
+59 -45
View File
@@ -1,58 +1,72 @@
export enum AuditAction {
LOGIN = "LOGIN",
LOGOUT = "LOGOUT",
LOGIN_FAILED = "LOGIN_FAILED",
COMMENT_CREATE = "COMMENT_CREATE",
COMMENT_UPDATE = "COMMENT_UPDATE",
COMMENT_DELETE = "COMMENT_DELETE",
ENTRY_CREATE = "ENTRY_CREATE",
ENTRY_UPDATE = "ENTRY_UPDATE",
ENTRY_DELETE = "ENTRY_DELETE",
LIKE = "LIKE",
UNLIKE = "UNLIKE",
USER_BAN = "USER_BAN",
USER_UNBAN = "USER_UNBAN",
RATE_LIMIT_EXCEEDED = "RATE_LIMIT_EXCEEDED",
CSRF_VALIDATION_FAILED = "CSRF_VALIDATION_FAILED",
UNAUTHORIZED_ACCESS = "UNAUTHORIZED_ACCESS",
/**
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
enum AuditAction {
login = "LOGIN",
logout = "LOGOUT",
loginFailed = "LOGIN_FAILED",
commentCreate = "COMMENT_CREATE",
commentUpdate = "COMMENT_UPDATE",
commentDelete = "COMMENT_DELETE",
entryCreate = "ENTRY_CREATE",
entryUpdate = "ENTRY_UPDATE",
entryDelete = "ENTRY_DELETE",
like = "LIKE",
unlike = "UNLIKE",
userBan = "USER_BAN",
userUnban = "USER_UNBAN",
rateLimitExceeded = "RATE_LIMIT_EXCEEDED",
csrfValidationFailed = "CSRF_VALIDATION_FAILED",
unauthorizedAccess = "UNAUTHORIZED_ACCESS",
}
export enum AuditCategory {
AUTH = "AUTH",
CONTENT = "CONTENT",
ADMIN = "ADMIN",
SECURITY = "SECURITY",
enum AuditCategory {
auth = "AUTH",
content = "CONTENT",
admin = "ADMIN",
security = "SECURITY",
}
export interface AuditLogUser {
id: string;
interface AuditLogUser {
id: string;
username: string;
avatar?: string;
avatar?: string;
}
export interface AuditLog {
id: string;
action: AuditAction;
category: AuditCategory;
userId?: string;
user?: AuditLogUser;
interface AuditLog {
id: string;
action: AuditAction;
category: AuditCategory;
userId?: string;
user?: AuditLogUser;
targetUserId?: string;
targetUser?: AuditLogUser;
targetUser?: AuditLogUser;
resourceType?: string;
resourceId?: string;
details?: string;
userAgent?: string;
success: boolean;
createdAt: Date;
resourceId?: string;
details?: string;
userAgent?: string;
success: boolean;
createdAt: Date;
}
export interface AuditLogFilters {
action?: AuditAction;
category?: AuditCategory;
userId?: string;
success?: boolean;
interface AuditLogFilters {
action?: AuditAction;
category?: AuditCategory;
userId?: string;
success?: boolean;
startDate?: Date;
endDate?: Date;
page?: number;
limit?: number;
endDate?: Date;
page?: number;
limit?: number;
}
export {
AuditAction,
AuditCategory,
type AuditLog,
type AuditLogFilters,
type AuditLogUser,
};
+22 -19
View File
@@ -4,33 +4,36 @@
* @author Naomi Carrigan
*/
export interface User {
id: string;
email: string;
username: string;
avatar?: string;
interface User {
id: string;
email: string;
username: string;
avatar?: string;
discordId: string;
isAdmin: boolean;
isBanned: boolean;
isAdmin: boolean;
isBanned: boolean;
inDiscord: boolean;
isVip: boolean;
isMod: boolean;
isStaff: boolean;
isVip: boolean;
isMod: boolean;
isStaff: boolean;
}
export interface JwtPayload {
interface JwtPayload {
/**
* User id.
*/
sub: string;
email: string;
sub: string;
email: string;
username: string;
isAdmin: boolean;
iat?: number;
exp?: number;
isAdmin: boolean;
iat?: number;
exp?: number;
}
export interface AuthResponse {
interface AuthResponse {
accessToken: string;
user: User;
}
user: User;
}
export type { AuthResponse, JwtPayload, User };
+14 -12
View File
@@ -1,18 +1,18 @@
/**
* @copyright 2026 NHCarrigan
* @copyright 2026 NHCarrigan
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
export enum BookStatus {
import type { Link } from "./common.types";
enum BookStatus {
reading = "READING",
finished = "FINISHED",
toRead = "TO_READ",
}
import { Link } from "./common.types";
export interface Book {
interface Book {
id: string;
title: string;
author: string;
@@ -23,13 +23,13 @@ export interface Book {
rating?: number;
notes?: string;
coverImage?: string;
tags: string[];
links: Link[];
tags: Array<string>;
links: Array<Link>;
createdAt: Date;
updatedAt: Date;
}
export interface CreateBookDto {
interface CreateBookDto {
title: string;
author: string;
isbn?: string;
@@ -37,10 +37,12 @@ export interface CreateBookDto {
rating?: number;
notes?: string;
coverImage?: string;
tags?: string[];
links?: Link[];
tags?: Array<string>;
links?: Array<Link>;
}
export interface UpdateBookDto extends Partial<CreateBookDto> {
interface UpdateBookDto extends Partial<CreateBookDto> {
dateFinished?: Date;
}
export { type Book, BookStatus, type CreateBookDto, type UpdateBookDto };
+23 -21
View File
@@ -4,32 +4,34 @@
* @author Naomi Carrigan
*/
export interface CommentUser {
id: string;
username: string;
avatar?: string;
interface CommentUser {
id: string;
username: string;
avatar?: string;
inDiscord?: boolean;
isVip?: boolean;
isMod?: boolean;
isStaff?: boolean;
isVip?: boolean;
isMod?: boolean;
isStaff?: boolean;
}
export interface Comment {
id: string;
content: string;
interface Comment {
id: string;
content: string;
rawContent?: string;
userId: string;
user: CommentUser;
gameId?: string;
bookId?: string;
musicId?: string;
artId?: string;
showId?: string;
mangaId?: string;
createdAt: Date;
updatedAt: Date;
userId: string;
user: CommentUser;
gameId?: string;
bookId?: string;
musicId?: string;
artId?: string;
showId?: string;
mangaId?: string;
createdAt: Date;
updatedAt: Date;
}
export interface CreateCommentDto {
interface CreateCommentDto {
content: string;
}
export type { Comment, CommentUser, CreateCommentDto };
+7 -1
View File
@@ -1,4 +1,10 @@
/**
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
export interface Link {
title: string;
url: string;
url: string;
}
+14 -12
View File
@@ -1,18 +1,18 @@
/**
* @copyright 2026 NHCarrigan
* @copyright 2026 NHCarrigan
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
export enum GameStatus {
import type { Link } from "./common.types";
enum GameStatus {
playing = "PLAYING",
completed = "COMPLETED",
backlog = "BACKLOG",
}
import { Link } from "./common.types";
export interface Game {
interface Game {
id: string;
title: string;
platform?: string;
@@ -22,23 +22,25 @@ export interface Game {
rating?: number;
notes?: string;
coverImage?: string;
tags: string[];
links: Link[];
tags: Array<string>;
links: Array<Link>;
createdAt: Date;
updatedAt: Date;
}
export interface CreateGameDto {
interface CreateGameDto {
title: string;
platform?: string;
status: GameStatus;
rating?: number;
notes?: string;
coverImage?: string;
tags?: string[];
links?: Link[];
tags?: Array<string>;
links?: Array<Link>;
}
export interface UpdateGameDto extends Partial<CreateGameDto> {
interface UpdateGameDto extends Partial<CreateGameDto> {
dateCompleted?: Date;
}
export { type CreateGameDto, type Game, GameStatus, type UpdateGameDto };
+21 -15
View File
@@ -1,32 +1,38 @@
/**
* @copyright 2026 NHCarrigan
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
export interface Like {
id: string;
userId: string;
entityType: 'book' | 'game' | 'show' | 'manga' | 'music' | 'art';
entityId: string;
createdAt: Date;
interface Like {
id: string;
userId: string;
entityType: "book" | "game" | "show" | "manga" | "music" | "art";
entityId: string;
createdAt: Date;
}
export type CreateLikeDto = Pick<Like, 'entityType' | 'entityId'>;
type CreateLikeDto = Pick<Like, "entityType" | "entityId">;
export interface LikeCountDto {
entityId: string;
interface LikeCountDto {
entityId: string;
entityType: string;
count: number;
count: number;
}
export interface LikedItemDto {
interface LikedItemDto {
like: Like;
item: any; // This will be the actual entity (Book, Game, etc.)
/**
* This will be the actual entity (Book, Game, etc.).
*/
item: unknown;
}
// Response types
export interface LikeResponse {
interface LikeResponse {
liked: boolean;
count: number;
}
}
export type { CreateLikeDto, Like, LikeCountDto, LikedItemDto, LikeResponse };
+14 -11
View File
@@ -1,18 +1,18 @@
/**
* @copyright 2026 NHCarrigan
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
export enum MangaStatus {
import type { Link } from "./common.types";
enum MangaStatus {
reading = "READING",
completed = "COMPLETED",
wantToRead = "WANT_TO_READ",
}
import { Link } from "./common.types";
export interface Manga {
interface Manga {
id: string;
title: string;
author: string;
@@ -22,23 +22,26 @@ export interface Manga {
rating?: number;
notes?: string;
coverImage?: string;
tags: string[];
links: Link[];
tags: Array<string>;
links: Array<Link>;
createdAt: Date;
updatedAt: Date;
}
export interface CreateMangaDto {
interface CreateMangaDto {
title: string;
author: string;
status: MangaStatus;
rating?: number;
notes?: string;
coverImage?: string;
tags?: string[];
links?: Link[];
tags?: Array<string>;
links?: Array<Link>;
}
export interface UpdateMangaDto extends Partial<CreateMangaDto> {
interface UpdateMangaDto extends Partial<CreateMangaDto> {
dateCompleted?: Date;
}
export { MangaStatus };
export type { CreateMangaDto, Manga, UpdateMangaDto };
+16 -13
View File
@@ -1,24 +1,24 @@
/**
* @copyright 2026 NHCarrigan
* @copyright 2026 NHCarrigan
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
export enum MusicType {
import type { Link } from "./common.types";
enum MusicType {
album = "ALBUM",
single = "SINGLE",
ep = "EP",
}
export enum MusicStatus {
enum MusicStatus {
listening = "LISTENING",
completed = "COMPLETED",
wantToListen = "WANT_TO_LISTEN",
}
import { Link } from "./common.types";
export interface Music {
interface Music {
id: string;
title: string;
artist: string;
@@ -29,13 +29,13 @@ export interface Music {
rating?: number;
notes?: string;
coverArt?: string;
tags: string[];
links: Link[];
tags: Array<string>;
links: Array<Link>;
createdAt: Date;
updatedAt: Date;
}
export interface CreateMusicDto {
interface CreateMusicDto {
title: string;
artist: string;
type: MusicType;
@@ -43,10 +43,13 @@ export interface CreateMusicDto {
rating?: number;
notes?: string;
coverArt?: string;
tags?: string[];
links?: Link[];
tags?: Array<string>;
links?: Array<Link>;
}
export interface UpdateMusicDto extends Partial<CreateMusicDto> {
interface UpdateMusicDto extends Partial<CreateMusicDto> {
dateCompleted?: Date;
}
export { MusicStatus, MusicType };
export type { CreateMusicDto, Music, UpdateMusicDto };
+15 -12
View File
@@ -1,25 +1,25 @@
/**
* @copyright 2026 NHCarrigan
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
export enum ShowType {
import type { Link } from "./common.types";
enum ShowType {
tvSeries = "TV_SERIES",
anime = "ANIME",
film = "FILM",
documentary = "DOCUMENTARY",
}
export enum ShowStatus {
enum ShowStatus {
watching = "WATCHING",
completed = "COMPLETED",
wantToWatch = "WANT_TO_WATCH",
}
import { Link } from "./common.types";
export interface Show {
interface Show {
id: string;
title: string;
type: ShowType;
@@ -29,23 +29,26 @@ export interface Show {
rating?: number;
notes?: string;
coverImage?: string;
tags: string[];
links: Link[];
tags: Array<string>;
links: Array<Link>;
createdAt: Date;
updatedAt: Date;
}
export interface CreateShowDto {
interface CreateShowDto {
title: string;
type: ShowType;
status: ShowStatus;
rating?: number;
notes?: string;
coverImage?: string;
tags?: string[];
links?: Link[];
tags?: Array<string>;
links?: Array<Link>;
}
export interface UpdateShowDto extends Partial<CreateShowDto> {
interface UpdateShowDto extends Partial<CreateShowDto> {
dateCompleted?: Date;
}
export { ShowStatus, ShowType };
export type { CreateShowDto, Show, UpdateShowDto };
+106 -85
View File
@@ -1,104 +1,110 @@
import type { CreateGameDto } from "./game.types";
import type { CreateBookDto } from "./book.types";
import type { CreateMusicDto } from "./music.types";
/**
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import type { CreateArtDto } from "./art.types";
import type { CreateShowDto } from "./show.types";
import type { CreateBookDto } from "./book.types";
import type { CreateGameDto } from "./game.types";
import type { CreateMangaDto } from "./manga.types";
import type { CreateMusicDto } from "./music.types";
import type { CreateShowDto } from "./show.types";
export enum SuggestionEntity {
GAME = "GAME",
BOOK = "BOOK",
MUSIC = "MUSIC",
ART = "ART",
SHOW = "SHOW",
MANGA = "MANGA",
enum SuggestionEntity {
game = "GAME",
book = "BOOK",
music = "MUSIC",
art = "ART",
show = "SHOW",
manga = "MANGA",
}
export enum SuggestionStatus {
UNREVIEWED = "UNREVIEWED",
ACCEPTED = "ACCEPTED",
DECLINED = "DECLINED",
enum SuggestionStatus {
unreviewed = "UNREVIEWED",
accepted = "ACCEPTED",
declined = "DECLINED",
}
export interface SuggestionUser {
id: string;
username: string;
avatar?: string;
interface SuggestionUser {
id: string;
username: string;
avatar?: string;
inDiscord: boolean;
isVip: boolean;
isMod: boolean;
isStaff: boolean;
isVip: boolean;
isMod: boolean;
isStaff: boolean;
}
export interface Suggestion {
id: string;
userId: string;
user: SuggestionUser;
entityType: SuggestionEntity;
status: SuggestionStatus;
interface Suggestion {
id: string;
userId: string;
user: SuggestionUser;
entityType: SuggestionEntity;
status: SuggestionStatus;
declineReason?: string;
title: string;
gameData?: Omit<CreateGameDto, "rating">;
bookData?: Omit<CreateBookDto, "rating">;
musicData?: Omit<CreateMusicDto, "rating">;
artData?: CreateArtDto;
showData?: Omit<CreateShowDto, "rating">;
mangaData?: Omit<CreateMangaDto, "rating">;
createdAt: Date;
updatedAt: Date;
title: string;
gameData?: Omit<CreateGameDto, "rating">;
bookData?: Omit<CreateBookDto, "rating">;
musicData?: Omit<CreateMusicDto, "rating">;
artData?: CreateArtDto;
showData?: Omit<CreateShowDto, "rating">;
mangaData?: Omit<CreateMangaDto, "rating">;
createdAt: Date;
updatedAt: Date;
}
export interface CreateGameSuggestionDto {
entityType: SuggestionEntity.GAME;
title: string;
platform?: string;
notes?: string;
interface CreateGameSuggestionDto {
entityType: SuggestionEntity.game;
title: string;
platform?: string;
notes?: string;
coverImage?: string;
}
export interface CreateBookSuggestionDto {
entityType: SuggestionEntity.BOOK;
title: string;
author: string;
isbn?: string;
notes?: string;
interface CreateBookSuggestionDto {
entityType: SuggestionEntity.book;
title: string;
author: string;
isbn?: string;
notes?: string;
coverImage?: string;
}
export interface CreateMusicSuggestionDto {
entityType: SuggestionEntity.MUSIC;
title: string;
artist: string;
type: string;
notes?: string;
coverArt?: string;
interface CreateMusicSuggestionDto {
entityType: SuggestionEntity.music;
title: string;
artist: string;
type: string;
notes?: string;
coverArt?: string;
}
export interface CreateArtSuggestionDto {
entityType: SuggestionEntity.ART;
title: string;
artist: string;
interface CreateArtSuggestionDto {
entityType: SuggestionEntity.art;
title: string;
artist: string;
description?: string;
imageUrl: string;
imageUrl: string;
}
export interface CreateShowSuggestionDto {
entityType: SuggestionEntity.SHOW;
title: string;
type: string;
notes?: string;
interface CreateShowSuggestionDto {
entityType: SuggestionEntity.show;
title: string;
type: string;
notes?: string;
coverImage?: string;
}
export interface CreateMangaSuggestionDto {
entityType: SuggestionEntity.MANGA;
title: string;
author: string;
notes?: string;
interface CreateMangaSuggestionDto {
entityType: SuggestionEntity.manga;
title: string;
author: string;
notes?: string;
coverImage?: string;
}
export type CreateSuggestionDto =
type CreateSuggestionDto =
| CreateGameSuggestionDto
| CreateBookSuggestionDto
| CreateMusicSuggestionDto
@@ -106,22 +112,37 @@ export type CreateSuggestionDto =
| CreateShowSuggestionDto
| CreateMangaSuggestionDto;
export interface DeclineSuggestionDto {
interface DeclineSuggestionDto {
reason?: string;
}
export interface AcceptWithEditsDto {
title?: string;
platform?: string;
author?: string;
artist?: string;
isbn?: string;
type?: string;
notes?: string;
interface AcceptWithEditsDto {
title?: string;
platform?: string;
author?: string;
artist?: string;
isbn?: string;
type?: string;
notes?: string;
description?: string;
coverImage?: string;
coverArt?: string;
imageUrl?: string;
tags?: string[];
links?: Array<{ label: string; url: string }>;
coverImage?: string;
coverArt?: string;
imageUrl?: string;
tags?: Array<string>;
links?: Array<{ label: string; url: string }>;
}
export { SuggestionEntity, SuggestionStatus };
export type {
AcceptWithEditsDto,
CreateArtSuggestionDto,
CreateBookSuggestionDto,
CreateGameSuggestionDto,
CreateMangaSuggestionDto,
CreateMusicSuggestionDto,
CreateShowSuggestionDto,
CreateSuggestionDto,
DeclineSuggestionDto,
Suggestion,
SuggestionUser,
};