move environment to src/environment add smtp env vars, move some other items
Some checks failed
Code quality checks / biome (push) Failing after 13s
Some checks failed
Code quality checks / biome (push) Failing after 13s
This commit is contained in:
parent
421043c9b5
commit
00a7417936
30 changed files with 470 additions and 42 deletions
|
@ -2,6 +2,7 @@ type Environment = {
|
|||
port: number;
|
||||
host: string;
|
||||
development: boolean;
|
||||
fqdn: string;
|
||||
};
|
||||
|
||||
export type { Environment };
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
export * from "./environment";
|
||||
export * from "./database";
|
||||
export * from "./auth";
|
||||
export * from "./mailer";
|
||||
|
|
42
types/config/mailer.ts
Normal file
42
types/config/mailer.ts
Normal file
|
@ -0,0 +1,42 @@
|
|||
type MailerConfig = {
|
||||
address: string;
|
||||
port: number;
|
||||
from: string;
|
||||
username: string;
|
||||
password: string;
|
||||
secure: boolean;
|
||||
pool: boolean;
|
||||
connectionTimeout: number;
|
||||
socketTimeout: number;
|
||||
maxConnections: number;
|
||||
maxMessages: number;
|
||||
replyTo: string;
|
||||
};
|
||||
|
||||
type EmailOptions = {
|
||||
to: string | string[];
|
||||
subject: string;
|
||||
text?: string;
|
||||
html?: string;
|
||||
from?: string;
|
||||
replyTo?: string;
|
||||
cc?: string | string[];
|
||||
bcc?: string | string[];
|
||||
attachments?: EmailAttachment[];
|
||||
};
|
||||
|
||||
type EmailAttachment = {
|
||||
filename: string;
|
||||
content?: Buffer | string;
|
||||
path?: string;
|
||||
contentType?: string;
|
||||
cid?: string; // content-ID for embedded images
|
||||
};
|
||||
|
||||
type EmailResult = {
|
||||
success: boolean;
|
||||
messageId?: string;
|
||||
error?: string;
|
||||
};
|
||||
|
||||
export type { MailerConfig, EmailOptions, EmailAttachment, EmailResult };
|
|
@ -10,4 +10,24 @@ type validationResult = {
|
|||
name?: string;
|
||||
};
|
||||
|
||||
export type { genericValidation, validationResult };
|
||||
interface UrlValidationOptions {
|
||||
failOnTrailingSlash?: boolean;
|
||||
removeTrailingSlash?: boolean;
|
||||
allowedProtocols?: string[];
|
||||
requireProtocol?: boolean;
|
||||
allowLocalhost?: boolean;
|
||||
allowIP?: boolean;
|
||||
maxLength?: number;
|
||||
}
|
||||
|
||||
interface UrlValidationResult extends validationResult {
|
||||
url?: string;
|
||||
normalizedUrl?: string;
|
||||
}
|
||||
|
||||
export type {
|
||||
genericValidation,
|
||||
validationResult,
|
||||
UrlValidationOptions,
|
||||
UrlValidationResult,
|
||||
};
|
||||
|
|
8
types/server/requests/base.ts
Normal file
8
types/server/requests/base.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
interface BaseResponse {
|
||||
code: number;
|
||||
success: boolean;
|
||||
error?: string;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export type { BaseResponse };
|
17
types/server/requests/health.ts
Normal file
17
types/server/requests/health.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import type { BaseResponse } from "./base";
|
||||
|
||||
interface HealthResponse extends BaseResponse {
|
||||
timestamp?: string;
|
||||
requestTime?: string;
|
||||
services?: {
|
||||
cassandra: {
|
||||
status: string;
|
||||
hosts: number;
|
||||
};
|
||||
redis: {
|
||||
status: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export type { HealthResponse };
|
|
@ -1 +1,3 @@
|
|||
export * from "./user";
|
||||
export * from "./health";
|
||||
export * from "./base";
|
||||
|
|
|
@ -1,10 +1,3 @@
|
|||
interface BaseResponse {
|
||||
code: number;
|
||||
success: boolean;
|
||||
error?: string;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
interface UserResponse {
|
||||
id: string;
|
||||
username: string;
|
||||
|
@ -25,4 +18,4 @@ interface UserRow {
|
|||
updated_at: Date;
|
||||
}
|
||||
|
||||
export type { BaseResponse, UserResponse, UserRow };
|
||||
export type { UserResponse, UserRow };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue