generated from nhcarrigan/template
feat: initial scaffolding
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
# shared-types
|
||||
|
||||
This library was generated with [Nx](https://nx.dev).
|
||||
@@ -0,0 +1,8 @@
|
||||
import nhcarrigan from '@nhcarrigan/eslint-config';
|
||||
|
||||
export default [
|
||||
...nhcarrigan,
|
||||
{
|
||||
ignores: ['**/dist', '**/out-tsc', 'node_modules'],
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "shared-types",
|
||||
"$schema": "../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "shared-types/src",
|
||||
"projectType": "library",
|
||||
"tags": [],
|
||||
"// targets": "to see all targets run: nx show project shared-types --web",
|
||||
"targets": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export * from './lib/game.types';
|
||||
export * from './lib/book.types';
|
||||
export * from './lib/music.types';
|
||||
export * from './lib/auth.types';
|
||||
@@ -0,0 +1,20 @@
|
||||
export interface User {
|
||||
id: string;
|
||||
email: string;
|
||||
username: string;
|
||||
avatarUrl?: string;
|
||||
discordId: string;
|
||||
}
|
||||
|
||||
export interface JwtPayload {
|
||||
sub: string; // user id
|
||||
email: string;
|
||||
username: string;
|
||||
iat?: number;
|
||||
exp?: number;
|
||||
}
|
||||
|
||||
export interface AuthResponse {
|
||||
accessToken: string;
|
||||
user: User;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
export enum BookStatus {
|
||||
READING = 'READING',
|
||||
FINISHED = 'FINISHED',
|
||||
TO_READ = 'TO_READ',
|
||||
}
|
||||
|
||||
export interface Book {
|
||||
id: string;
|
||||
title: string;
|
||||
author: string;
|
||||
isbn?: string;
|
||||
status: BookStatus;
|
||||
dateAdded: Date;
|
||||
dateFinished?: 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;
|
||||
coverImage?: string;
|
||||
}
|
||||
|
||||
export interface UpdateBookDto extends Partial<CreateBookDto> {
|
||||
dateFinished?: Date;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
export enum GameStatus {
|
||||
PLAYING = 'PLAYING',
|
||||
COMPLETED = 'COMPLETED',
|
||||
BACKLOG = 'BACKLOG',
|
||||
}
|
||||
|
||||
export interface Game {
|
||||
id: string;
|
||||
title: string;
|
||||
platform?: string;
|
||||
status: GameStatus;
|
||||
dateAdded: Date;
|
||||
dateCompleted?: Date;
|
||||
rating?: number;
|
||||
notes?: string;
|
||||
coverImage?: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export interface CreateGameDto {
|
||||
title: string;
|
||||
platform?: string;
|
||||
status: GameStatus;
|
||||
rating?: number;
|
||||
notes?: string;
|
||||
coverImage?: string;
|
||||
}
|
||||
|
||||
export interface UpdateGameDto extends Partial<CreateGameDto> {
|
||||
dateCompleted?: Date;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
export enum MusicType {
|
||||
ALBUM = 'ALBUM',
|
||||
SINGLE = 'SINGLE',
|
||||
EP = 'EP',
|
||||
}
|
||||
|
||||
export enum MusicStatus {
|
||||
LISTENING = 'LISTENING',
|
||||
COMPLETED = 'COMPLETED',
|
||||
WANT_TO_LISTEN = 'WANT_TO_LISTEN',
|
||||
}
|
||||
|
||||
export interface Music {
|
||||
id: string;
|
||||
title: string;
|
||||
artist: string;
|
||||
type: MusicType;
|
||||
status: MusicStatus;
|
||||
dateAdded: Date;
|
||||
dateCompleted?: 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;
|
||||
coverArt?: string;
|
||||
}
|
||||
|
||||
export interface UpdateMusicDto extends Partial<CreateMusicDto> {
|
||||
dateCompleted?: Date;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"importHelpers": true,
|
||||
"noImplicitOverride": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noPropertyAccessFromIndexSignature": true
|
||||
},
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.lib.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user