generated from nhcarrigan/template
feat: scaffolding
This commit is contained in:
@@ -1,8 +1,21 @@
|
||||
import nhcarrigan from '@nhcarrigan/eslint-config';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { dirname } from 'path';
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
export default [
|
||||
...nhcarrigan,
|
||||
{
|
||||
ignores: ['**/dist', '**/out-tsc', 'node_modules'],
|
||||
},
|
||||
{
|
||||
files: ['**/*.ts'],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
project: './tsconfig.lib.json',
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "@library/shared-types",
|
||||
"version": "0.0.1"
|
||||
}
|
||||
@@ -1,4 +1,9 @@
|
||||
export * from './lib/game.types';
|
||||
export * from './lib/book.types';
|
||||
export * from './lib/music.types';
|
||||
export * from './lib/auth.types';
|
||||
/**
|
||||
* @copyright 2026 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 type * from "./lib/auth.types";
|
||||
@@ -1,3 +1,9 @@
|
||||
/**
|
||||
* @copyright 2026 NHCarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
export interface User {
|
||||
id: string;
|
||||
email: string;
|
||||
@@ -7,7 +13,10 @@ export interface User {
|
||||
}
|
||||
|
||||
export interface JwtPayload {
|
||||
sub: string; // user id
|
||||
/**
|
||||
* User id.
|
||||
*/
|
||||
sub: string;
|
||||
email: string;
|
||||
username: string;
|
||||
iat?: number;
|
||||
|
||||
@@ -1,34 +1,40 @@
|
||||
/**
|
||||
* @copyright 2026 NHCarrigan
|
||||
* @copyright 2026 NHCarrigan
|
||||
* @license Naomi's Public License
|
||||
*/
|
||||
|
||||
export enum BookStatus {
|
||||
READING = 'READING',
|
||||
FINISHED = 'FINISHED',
|
||||
TO_READ = 'TO_READ',
|
||||
reading = "READING",
|
||||
finished = "FINISHED",
|
||||
toRead = "TO_READ",
|
||||
}
|
||||
|
||||
export interface Book {
|
||||
id: string;
|
||||
title: string;
|
||||
author: string;
|
||||
isbn?: string;
|
||||
status: BookStatus;
|
||||
dateAdded: Date;
|
||||
id: string;
|
||||
title: string;
|
||||
author: string;
|
||||
isbn?: string;
|
||||
status: BookStatus;
|
||||
dateAdded: Date;
|
||||
dateFinished?: Date;
|
||||
rating?: number;
|
||||
notes?: string;
|
||||
coverImage?: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
rating?: number;
|
||||
notes?: string;
|
||||
coverImage?: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export interface CreateBookDto {
|
||||
title: string;
|
||||
author: string;
|
||||
isbn?: string;
|
||||
status: BookStatus;
|
||||
rating?: number;
|
||||
notes?: string;
|
||||
title: string;
|
||||
author: string;
|
||||
isbn?: string;
|
||||
status: BookStatus;
|
||||
rating?: number;
|
||||
notes?: string;
|
||||
coverImage?: string;
|
||||
}
|
||||
|
||||
export interface UpdateBookDto extends Partial<CreateBookDto> {
|
||||
dateFinished?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,32 +1,38 @@
|
||||
/**
|
||||
* @copyright 2026 NHCarrigan
|
||||
* @copyright 2026 NHCarrigan
|
||||
* @license Naomi's Public License
|
||||
*/
|
||||
|
||||
export enum GameStatus {
|
||||
PLAYING = 'PLAYING',
|
||||
COMPLETED = 'COMPLETED',
|
||||
BACKLOG = 'BACKLOG',
|
||||
playing = "PLAYING",
|
||||
completed = "COMPLETED",
|
||||
backlog = "BACKLOG",
|
||||
}
|
||||
|
||||
export interface Game {
|
||||
id: string;
|
||||
title: string;
|
||||
platform?: string;
|
||||
status: GameStatus;
|
||||
dateAdded: Date;
|
||||
id: string;
|
||||
title: string;
|
||||
platform?: string;
|
||||
status: GameStatus;
|
||||
dateAdded: Date;
|
||||
dateCompleted?: Date;
|
||||
rating?: number;
|
||||
notes?: string;
|
||||
coverImage?: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
rating?: number;
|
||||
notes?: string;
|
||||
coverImage?: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export interface CreateGameDto {
|
||||
title: string;
|
||||
platform?: string;
|
||||
status: GameStatus;
|
||||
rating?: number;
|
||||
notes?: string;
|
||||
title: string;
|
||||
platform?: string;
|
||||
status: GameStatus;
|
||||
rating?: number;
|
||||
notes?: string;
|
||||
coverImage?: string;
|
||||
}
|
||||
|
||||
export interface UpdateGameDto extends Partial<CreateGameDto> {
|
||||
dateCompleted?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,40 +1,46 @@
|
||||
/**
|
||||
* @copyright 2026 NHCarrigan
|
||||
* @copyright 2026 NHCarrigan
|
||||
* @license Naomi's Public License
|
||||
*/
|
||||
|
||||
export enum MusicType {
|
||||
ALBUM = 'ALBUM',
|
||||
SINGLE = 'SINGLE',
|
||||
EP = 'EP',
|
||||
album = "ALBUM",
|
||||
single = "SINGLE",
|
||||
ep = "EP",
|
||||
}
|
||||
|
||||
export enum MusicStatus {
|
||||
LISTENING = 'LISTENING',
|
||||
COMPLETED = 'COMPLETED',
|
||||
WANT_TO_LISTEN = 'WANT_TO_LISTEN',
|
||||
listening = "LISTENING",
|
||||
completed = "COMPLETED",
|
||||
wantToListen = "WANT_TO_LISTEN",
|
||||
}
|
||||
|
||||
export interface Music {
|
||||
id: string;
|
||||
title: string;
|
||||
artist: string;
|
||||
type: MusicType;
|
||||
status: MusicStatus;
|
||||
dateAdded: Date;
|
||||
id: string;
|
||||
title: string;
|
||||
artist: string;
|
||||
type: MusicType;
|
||||
status: MusicStatus;
|
||||
dateAdded: Date;
|
||||
dateCompleted?: Date;
|
||||
rating?: number;
|
||||
notes?: string;
|
||||
coverArt?: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
rating?: number;
|
||||
notes?: string;
|
||||
coverArt?: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export interface CreateMusicDto {
|
||||
title: string;
|
||||
artist: string;
|
||||
type: MusicType;
|
||||
status: MusicStatus;
|
||||
rating?: number;
|
||||
notes?: string;
|
||||
title: string;
|
||||
artist: string;
|
||||
type: MusicType;
|
||||
status: MusicStatus;
|
||||
rating?: number;
|
||||
notes?: string;
|
||||
coverArt?: string;
|
||||
}
|
||||
|
||||
export interface UpdateMusicDto extends Partial<CreateMusicDto> {
|
||||
dateCompleted?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user