first commit
This commit is contained in:
11
types/category.ts
Normal file
11
types/category.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export interface Category {
|
||||
ID: number;
|
||||
CreatedAt: string;
|
||||
UpdatedAt: string;
|
||||
DeletedAt: string | null;
|
||||
title: string;
|
||||
slug: string;
|
||||
description: string;
|
||||
parent_id?: number | null;
|
||||
children?: Category[];
|
||||
}
|
||||
15
types/hero.ts
Normal file
15
types/hero.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export interface Hero {
|
||||
ID: number;
|
||||
CreatedAt: string;
|
||||
UpdatedAt: string;
|
||||
DeletedAt: string | null;
|
||||
color: string;
|
||||
title: string;
|
||||
text1: string;
|
||||
text2: string;
|
||||
text4: string;
|
||||
text5: string;
|
||||
image: string;
|
||||
is_active: boolean;
|
||||
}
|
||||
|
||||
50
types/next-auth.d.ts
vendored
Normal file
50
types/next-auth.d.ts
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
|
||||
import NextAuth, { DefaultSession } from "next-auth"
|
||||
import { JWT } from "next-auth/jwt"
|
||||
|
||||
declare module "next-auth" {
|
||||
interface Session {
|
||||
user: {
|
||||
id: number
|
||||
email: string
|
||||
username: string
|
||||
first_name: string
|
||||
last_name: string
|
||||
is_admin: boolean
|
||||
is_active?: boolean
|
||||
email_verified?: boolean
|
||||
} & DefaultSession["user"]
|
||||
accessToken?: string
|
||||
refreshToken?: string
|
||||
error?: string
|
||||
}
|
||||
|
||||
interface User {
|
||||
id: number
|
||||
email: string
|
||||
username: string
|
||||
first_name: string
|
||||
last_name: string
|
||||
is_admin: boolean
|
||||
is_active?: boolean
|
||||
email_verified?: boolean
|
||||
access_token?: string
|
||||
refresh_token?: string
|
||||
}
|
||||
}
|
||||
|
||||
declare module "next-auth/jwt" {
|
||||
interface JWT {
|
||||
id: number
|
||||
email: string
|
||||
username: string
|
||||
first_name: string
|
||||
last_name: string
|
||||
is_admin: boolean
|
||||
is_active?: boolean
|
||||
accessToken?: string
|
||||
refreshToken?: string
|
||||
accessTokenExpires?: number
|
||||
error?: string
|
||||
}
|
||||
}
|
||||
49
types/post.ts
Normal file
49
types/post.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
export interface PostCategory {
|
||||
ID: number;
|
||||
CreatedAt: string;
|
||||
UpdatedAt: string;
|
||||
DeletedAt: string | null;
|
||||
title: string;
|
||||
slug: string;
|
||||
description: string;
|
||||
parent_id?: number;
|
||||
}
|
||||
|
||||
export interface PostTag {
|
||||
ID: number;
|
||||
CreatedAt: string;
|
||||
UpdatedAt: string;
|
||||
DeletedAt: string | null;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface Post {
|
||||
ID: number;
|
||||
CreatedAt: string;
|
||||
UpdatedAt: string;
|
||||
DeletedAt: string | null;
|
||||
title: string;
|
||||
images: string; // JSON string or path
|
||||
content: string;
|
||||
slug: string;
|
||||
categories: PostCategory[];
|
||||
tags: PostTag[];
|
||||
}
|
||||
|
||||
export interface PostResponse {
|
||||
data: Post[];
|
||||
meta: {
|
||||
page: number;
|
||||
per_page: number;
|
||||
total: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface PostFormData {
|
||||
title: string;
|
||||
content: string;
|
||||
category_ids: number[];
|
||||
tags: string[]; // Tag names to be processed/created backend-side or IDs if selecting existing
|
||||
images: File | null;
|
||||
is_active: boolean; // Assuming there might be an active state, though not explicitly in the sample JSON, standard for CMS
|
||||
}
|
||||
34
types/security.ts
Normal file
34
types/security.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
export interface CorsWhitelistItem {
|
||||
ID: number;
|
||||
CreatedAt: string;
|
||||
UpdatedAt: string;
|
||||
DeletedAt: string | null;
|
||||
origin: string;
|
||||
description: string;
|
||||
is_active: boolean;
|
||||
created_by?: string;
|
||||
}
|
||||
|
||||
export interface CorsBlacklistItem {
|
||||
ID: number;
|
||||
CreatedAt: string;
|
||||
UpdatedAt: string;
|
||||
DeletedAt: string | null;
|
||||
origin: string;
|
||||
reason: string;
|
||||
is_active: boolean;
|
||||
created_by?: string;
|
||||
}
|
||||
|
||||
export interface RateLimitItem {
|
||||
ID: number;
|
||||
CreatedAt: string;
|
||||
UpdatedAt: string;
|
||||
DeletedAt: string | null;
|
||||
name: string;
|
||||
description: string;
|
||||
max_requests: number;
|
||||
window_seconds: number;
|
||||
is_active: boolean;
|
||||
updated_by?: string;
|
||||
}
|
||||
25
types/setting.ts
Normal file
25
types/setting.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
export interface Setting {
|
||||
ID: number;
|
||||
CreatedAt: string;
|
||||
UpdatedAt: string;
|
||||
DeletedAt: string | null;
|
||||
title: string;
|
||||
meta_title: string;
|
||||
meta_description: string;
|
||||
phone: string;
|
||||
url: string;
|
||||
email: string;
|
||||
facebook: string;
|
||||
x: string;
|
||||
instagram: string;
|
||||
whatsapp: string;
|
||||
pinterest: string;
|
||||
linkedin: string;
|
||||
address: string;
|
||||
slogan: string;
|
||||
copyright: string;
|
||||
map_embed: string;
|
||||
w_logo: string;
|
||||
b_logo: string;
|
||||
is_active: boolean;
|
||||
}
|
||||
15
types/sweetalert2.d.ts
vendored
Normal file
15
types/sweetalert2.d.ts
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import type Swal from 'sweetalert2'
|
||||
|
||||
declare module '#app' {
|
||||
interface NuxtApp {
|
||||
$swal: typeof Swal
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'vue' {
|
||||
interface ComponentCustomProperties {
|
||||
$swal: typeof Swal
|
||||
}
|
||||
}
|
||||
|
||||
export {}
|
||||
17
types/tag.ts
Normal file
17
types/tag.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export interface Tag {
|
||||
ID: number;
|
||||
CreatedAt: string;
|
||||
UpdatedAt: string;
|
||||
DeletedAt: string | null;
|
||||
name: string;
|
||||
posts?: any[]; // For now just any[], can be Post[]
|
||||
}
|
||||
|
||||
export interface TagResponse {
|
||||
data: Tag[];
|
||||
meta: {
|
||||
page: number;
|
||||
per_page: number;
|
||||
total: number;
|
||||
};
|
||||
}
|
||||
24
types/user.ts
Normal file
24
types/user.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
export interface Profile {
|
||||
ID: number;
|
||||
CreatedAt: string;
|
||||
UpdatedAt: string;
|
||||
DeletedAt: string | null;
|
||||
user_id: number;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
avatar_url?: string;
|
||||
}
|
||||
|
||||
export interface User {
|
||||
ID: number;
|
||||
CreatedAt: string;
|
||||
UpdatedAt: string;
|
||||
DeletedAt: string | null;
|
||||
username: string;
|
||||
email: string;
|
||||
email_verified: boolean;
|
||||
email_verified_at: string | null;
|
||||
is_admin: boolean;
|
||||
avatar_url?: string;
|
||||
profiles: Profile[];
|
||||
}
|
||||
Reference in New Issue
Block a user