This commit is contained in:
commit
421043c9b5
67 changed files with 3455 additions and 0 deletions
32
types/config/auth.ts
Normal file
32
types/config/auth.ts
Normal file
|
@ -0,0 +1,32 @@
|
|||
type JWTConfig = {
|
||||
secret: string;
|
||||
expiration: string | number;
|
||||
issuer: string;
|
||||
algorithm: string;
|
||||
};
|
||||
|
||||
interface CookieOptions {
|
||||
secure?: boolean;
|
||||
httpOnly?: boolean;
|
||||
sameSite?: "Strict" | "Lax" | "None";
|
||||
path?: string;
|
||||
domain?: string;
|
||||
}
|
||||
|
||||
interface UserSession {
|
||||
id: string;
|
||||
username: string;
|
||||
email: string;
|
||||
isVerified: boolean;
|
||||
displayName: string | null;
|
||||
createdAt: string; // ISO date string
|
||||
updatedAt?: string; // ISO date string, optional
|
||||
iat?: number; // issued at (added by JWT libs)
|
||||
exp?: number; // expiration (added by JWT libs)
|
||||
}
|
||||
|
||||
interface SessionData extends UserSession {
|
||||
userAgent: string;
|
||||
}
|
||||
|
||||
export type { JWTConfig, CookieOptions, UserSession, SessionData };
|
25
types/config/database.ts
Normal file
25
types/config/database.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
type CassandraConfig = {
|
||||
host: string;
|
||||
port: number;
|
||||
keyspace: string;
|
||||
username: string;
|
||||
password: string;
|
||||
datacenter: string;
|
||||
contactPoints: string[];
|
||||
authEnabled: boolean;
|
||||
};
|
||||
|
||||
type SqlMigration = {
|
||||
id: string;
|
||||
name: string;
|
||||
upSql: string;
|
||||
downSql?: string | undefined;
|
||||
};
|
||||
|
||||
type ConnectionOptions = {
|
||||
withKeyspace?: boolean;
|
||||
timeout?: number;
|
||||
logging?: boolean;
|
||||
};
|
||||
|
||||
export type { CassandraConfig, SqlMigration, ConnectionOptions };
|
7
types/config/environment.ts
Normal file
7
types/config/environment.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
type Environment = {
|
||||
port: number;
|
||||
host: string;
|
||||
development: boolean;
|
||||
};
|
||||
|
||||
export type { Environment };
|
3
types/config/index.ts
Normal file
3
types/config/index.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
export * from "./environment";
|
||||
export * from "./database";
|
||||
export * from "./auth";
|
Loading…
Add table
Add a link
Reference in a new issue