api
Some checks failed
Cloudflare Worker API Template / Deploy to ${{ github.ref_name }} environment (pull_request) Failing after 15s
Some checks failed
Cloudflare Worker API Template / Deploy to ${{ github.ref_name }} environment (pull_request) Failing after 15s
This commit is contained in:
39
src/types/index.ts
Normal file
39
src/types/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { Context } from 'hono';
|
||||
|
||||
// Define the structure of user data from the database
|
||||
export interface UserData {
|
||||
id: number;
|
||||
uid: string;
|
||||
email: string;
|
||||
firebase_uid?: string;
|
||||
firstname?: string;
|
||||
lastname?: string;
|
||||
company_name?: string;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
// Define the structure of the environment variables
|
||||
export interface Env {
|
||||
CF_TEMPLATE_DB?: D1Database; // D1Database type from @cloudflare/workers-types
|
||||
DECRYPT_API_URL?: string;
|
||||
DECRYPT_API_KEY?: string;
|
||||
}
|
||||
|
||||
// Extend the Hono context with our custom types
|
||||
export interface CustomContext extends Context {
|
||||
env: Env;
|
||||
get: (key: string) => string | undefined;
|
||||
set: (key: string, value: any) => void;
|
||||
}
|
||||
|
||||
// Response type for the user profile endpoint
|
||||
export interface UserProfileResponse {
|
||||
id: number;
|
||||
name: string;
|
||||
email: string;
|
||||
color: string;
|
||||
leaveBalances: {
|
||||
[key: string]: number;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user