@kozojs/core 0.2.7 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,160 +0,0 @@
1
- import * as hono from 'hono';
2
- import { Context, Next, Hono } from 'hono';
3
-
4
- interface LoggerOptions {
5
- prefix?: string;
6
- colorize?: boolean;
7
- }
8
- /**
9
- * Request logger middleware
10
- */
11
- declare function logger(options?: LoggerOptions): (c: Context, next: Next) => Promise<void>;
12
-
13
- interface CorsOptions {
14
- origin?: string | string[] | ((origin: string) => string | undefined | null);
15
- allowMethods?: string[];
16
- allowHeaders?: string[];
17
- exposeHeaders?: string[];
18
- maxAge?: number;
19
- credentials?: boolean;
20
- }
21
- /**
22
- * CORS middleware wrapper
23
- */
24
- declare function cors(options?: CorsOptions): hono.MiddlewareHandler;
25
-
26
- interface RateLimitOptions {
27
- max: number;
28
- window: number;
29
- keyGenerator?: (c: Context) => string;
30
- message?: string;
31
- }
32
- /**
33
- * Simple rate limiting middleware
34
- * For production, replace in-memory store with Redis
35
- */
36
- declare function rateLimit(options: RateLimitOptions): (c: Context, next: Next) => Promise<(Response & hono.TypedResponse<{
37
- error: string;
38
- }, 429, "json">) | undefined>;
39
- /**
40
- * Clear rate limit store (for testing)
41
- */
42
- declare function clearRateLimitStore(): void;
43
-
44
- declare class HttpError extends Error {
45
- statusCode: number;
46
- details?: unknown | undefined;
47
- constructor(statusCode: number, message: string, details?: unknown | undefined);
48
- }
49
- declare class BadRequestError extends HttpError {
50
- constructor(message?: string, details?: unknown);
51
- }
52
- declare class UnauthorizedError extends HttpError {
53
- constructor(message?: string);
54
- }
55
- declare class ForbiddenError extends HttpError {
56
- constructor(message?: string);
57
- }
58
- declare class NotFoundError extends HttpError {
59
- constructor(message?: string);
60
- }
61
- declare class ConflictError extends HttpError {
62
- constructor(message?: string, details?: unknown);
63
- }
64
- declare class InternalServerError extends HttpError {
65
- constructor(message?: string);
66
- }
67
- /**
68
- * Global error handler middleware
69
- */
70
- declare function errorHandler(): (c: Context, next: Next) => Promise<(Response & hono.TypedResponse<{
71
- details?: undefined;
72
- error: string;
73
- status: number;
74
- }, any, "json">) | (Response & hono.TypedResponse<{
75
- error: string;
76
- status: number;
77
- }, 500, "json">) | undefined>;
78
-
79
- type ManifestHttpMethod = 'get' | 'post' | 'put' | 'patch' | 'delete';
80
- /**
81
- * A single route entry as written to routes-manifest.json
82
- */
83
- interface ManifestRoute {
84
- /** URL path, e.g. /users/:id */
85
- path: string;
86
- /** HTTP method (lowercase) */
87
- method: ManifestHttpMethod;
88
- /** Absolute or project-relative path to the handler file */
89
- handler: string;
90
- /** Named URL params extracted from the path, e.g. ['id'] */
91
- params: string[];
92
- /** Whether the handler module exports a body schema */
93
- hasBodySchema: boolean;
94
- /** Whether the handler module exports a query schema */
95
- hasQuerySchema: boolean;
96
- }
97
- /**
98
- * The shape of routes-manifest.json
99
- */
100
- interface RoutesManifest {
101
- version: number;
102
- generatedAt: string;
103
- routes: ManifestRoute[];
104
- }
105
- interface FileSystemRoutingOptions {
106
- /**
107
- * Path to the routes-manifest.json file.
108
- * Defaults to `./routes-manifest.json` relative to cwd.
109
- */
110
- manifestPath?: string;
111
- /**
112
- * If true, log registered routes to stdout.
113
- * @default false
114
- */
115
- verbose?: boolean;
116
- /**
117
- * Called when the manifest is missing or unreadable.
118
- * Defaults to a silent no-op (backward-compatible behaviour).
119
- */
120
- onMissingManifest?: (reason: Error) => void;
121
- /**
122
- * Custom log function used when `verbose` is true.
123
- * Defaults to `console.log`.
124
- */
125
- logger?: (...args: unknown[]) => void;
126
- }
127
- /**
128
- * Register all routes declared in `routes-manifest.json` onto a Hono app.
129
- *
130
- * This function is **not** a Hono middleware in the classical sense — it is an
131
- * *async initializer* that must be awaited before the server starts accepting
132
- * requests. Calling it early (before user-defined routes) guarantees that
133
- * manifest routes take precedence.
134
- *
135
- * @example
136
- * ```ts
137
- * import { Hono } from 'hono';
138
- * import { applyFileSystemRouting } from '@kozojs/core/middleware';
139
- *
140
- * const app = new Hono();
141
- * await applyFileSystemRouting(app, { manifestPath: './routes-manifest.json' });
142
- *
143
- * // User-defined routes registered AFTER are appended normally
144
- * app.get('/health', c => c.json({ ok: true }));
145
- * ```
146
- */
147
- declare function applyFileSystemRouting(app: Hono<any>, options?: FileSystemRoutingOptions): Promise<void>;
148
- /**
149
- * Alternative factory that returns an async function you can call with a Hono
150
- * app. Useful when you want to pre-configure options and apply them later.
151
- *
152
- * @example
153
- * ```ts
154
- * const fsr = createFileSystemRouting({ verbose: true });
155
- * await fsr(app);
156
- * ```
157
- */
158
- declare function createFileSystemRouting(options?: FileSystemRoutingOptions): (app: Hono<any>) => Promise<void>;
159
-
160
- export { type CorsOptions, type FileSystemRoutingOptions, BadRequestError as HttpBadRequestError, ConflictError as HttpConflictError, HttpError, ForbiddenError as HttpForbiddenError, InternalServerError as HttpInternalServerError, NotFoundError as HttpNotFoundError, UnauthorizedError as HttpUnauthorizedError, type LoggerOptions, type ManifestHttpMethod, type ManifestRoute, type RateLimitOptions, type RoutesManifest, applyFileSystemRouting, clearRateLimitStore, cors, createFileSystemRouting, errorHandler, logger, rateLimit };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/middleware/logger.ts","../../src/middleware/cors.ts","../../src/middleware/rate-limit.ts","../../src/middleware/error-handler.ts","../../src/middleware/fileSystemRouting.ts"],"sourcesContent":["import type { Context, Next } from 'hono';\r\n\r\nexport interface LoggerOptions {\r\n prefix?: string;\r\n colorize?: boolean;\r\n}\r\n\r\n/**\r\n * Request logger middleware\r\n */\r\nexport function logger(options: LoggerOptions = {}) {\r\n const { prefix = '🌐', colorize = true } = options;\r\n\r\n return async (c: Context, next: Next) => {\r\n const start = Date.now();\r\n const method = c.req.method;\r\n const path = new URL(c.req.url).pathname;\r\n\r\n await next();\r\n\r\n const duration = Date.now() - start;\r\n const status = c.res.status;\r\n\r\n const statusColor = status >= 500 ? 'šŸ”“' : status >= 400 ? '🟔' : '🟢';\r\n const log = `${prefix} ${method.padEnd(6)} ${path} ${statusColor} ${status} ${duration}ms`;\r\n \r\n console.log(log);\r\n };\r\n}\r\n","import { cors as honoCors } from 'hono/cors';\r\n\r\nexport interface CorsOptions {\r\n origin?: string | string[] | ((origin: string) => string | undefined | null);\r\n allowMethods?: string[];\r\n allowHeaders?: string[];\r\n exposeHeaders?: string[];\r\n maxAge?: number;\r\n credentials?: boolean;\r\n}\r\n\r\n/**\r\n * CORS middleware wrapper\r\n */\r\nexport function cors(options: CorsOptions = {}) {\r\n return honoCors({\r\n origin: options.origin || '*',\r\n allowMethods: options.allowMethods || ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'],\r\n allowHeaders: options.allowHeaders || ['Content-Type', 'Authorization'],\r\n exposeHeaders: options.exposeHeaders || [],\r\n maxAge: options.maxAge || 86400,\r\n credentials: options.credentials || false\r\n });\r\n}\r\n","import type { Context, Next } from 'hono';\n\nexport interface RateLimitOptions {\n max: number;\n window: number; // in seconds\n keyGenerator?: (c: Context) => string;\n message?: string;\n}\n\n// In-memory store (use Redis in production)\nconst store = new Map<string, { count: number; resetAt: number }>();\n\n/**\n * Simple rate limiting middleware\n * For production, replace in-memory store with Redis\n */\nexport function rateLimit(options: RateLimitOptions) {\n const {\n max = 100,\n window = 60,\n keyGenerator = (c: Context) =>\n c.req.header('x-forwarded-for') ?? c.req.header('x-real-ip') ?? 'anonymous',\n message = 'Too many requests',\n } = options;\n\n return async (c: Context, next: Next) => {\n const key = keyGenerator(c);\n const now = Date.now();\n const windowMs = window * 1000;\n\n let record = store.get(key);\n\n if (!record || now > record.resetAt) {\n record = { count: 0, resetAt: now + windowMs };\n }\n\n record.count++;\n store.set(key, record);\n\n // Set rate limit headers\n c.header('X-RateLimit-Limit', String(max));\n c.header('X-RateLimit-Remaining', String(Math.max(0, max - record.count)));\n c.header('X-RateLimit-Reset', String(Math.ceil(record.resetAt / 1000)));\n\n if (record.count > max) {\n return c.json({ error: message }, 429);\n }\n\n await next();\n };\n}\n\n/**\n * Clear rate limit store (for testing)\n */\nexport function clearRateLimitStore() {\n store.clear();\n}\n","import type { Context, Next } from 'hono';\r\n\r\nexport class HttpError extends Error {\r\n constructor(\r\n public statusCode: number,\r\n message: string,\r\n public details?: unknown\r\n ) {\r\n super(message);\r\n this.name = 'HttpError';\r\n }\r\n}\r\n\r\nexport class BadRequestError extends HttpError {\r\n constructor(message = 'Bad Request', details?: unknown) {\r\n super(400, message, details);\r\n }\r\n}\r\n\r\nexport class UnauthorizedError extends HttpError {\r\n constructor(message = 'Unauthorized') {\r\n super(401, message);\r\n }\r\n}\r\n\r\nexport class ForbiddenError extends HttpError {\r\n constructor(message = 'Forbidden') {\r\n super(403, message);\r\n }\r\n}\r\n\r\nexport class NotFoundError extends HttpError {\r\n constructor(message = 'Not Found') {\r\n super(404, message);\r\n }\r\n}\r\n\r\nexport class ConflictError extends HttpError {\r\n constructor(message = 'Conflict', details?: unknown) {\r\n super(409, message, details);\r\n }\r\n}\r\n\r\nexport class InternalServerError extends HttpError {\r\n constructor(message = 'Internal Server Error') {\r\n super(500, message);\r\n }\r\n}\r\n\r\n/**\r\n * Global error handler middleware\r\n */\r\nexport function errorHandler() {\r\n return async (c: Context, next: Next) => {\r\n try {\r\n await next();\r\n } catch (err) {\r\n if (err instanceof HttpError) {\r\n return c.json({\r\n error: err.message,\r\n status: err.statusCode,\r\n ...(err.details ? { details: err.details } : {})\r\n }, err.statusCode as any);\r\n }\r\n\r\n // Unknown error\r\n console.error('Unhandled error:', err);\r\n return c.json({\r\n error: 'Internal Server Error',\r\n status: 500\r\n }, 500);\r\n }\r\n };\r\n}\r\n","import { readFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport type { Hono } from 'hono';\n\n// ============================================\n// MANIFEST TYPES\n// ============================================\n\nexport type ManifestHttpMethod = 'get' | 'post' | 'put' | 'patch' | 'delete';\n\n/**\n * A single route entry as written to routes-manifest.json\n */\nexport interface ManifestRoute {\n /** URL path, e.g. /users/:id */\n path: string;\n /** HTTP method (lowercase) */\n method: ManifestHttpMethod;\n /** Absolute or project-relative path to the handler file */\n handler: string;\n /** Named URL params extracted from the path, e.g. ['id'] */\n params: string[];\n /** Whether the handler module exports a body schema */\n hasBodySchema: boolean;\n /** Whether the handler module exports a query schema */\n hasQuerySchema: boolean;\n}\n\n/**\n * The shape of routes-manifest.json\n */\nexport interface RoutesManifest {\n version: number;\n generatedAt: string;\n routes: ManifestRoute[];\n}\n\n// ============================================\n// OPTIONS\n// ============================================\n\nexport interface FileSystemRoutingOptions {\n /**\n * Path to the routes-manifest.json file.\n * Defaults to `./routes-manifest.json` relative to cwd.\n */\n manifestPath?: string;\n\n /**\n * If true, log registered routes to stdout.\n * @default false\n */\n verbose?: boolean;\n\n /**\n * Called when the manifest is missing or unreadable.\n * Defaults to a silent no-op (backward-compatible behaviour).\n */\n onMissingManifest?: (reason: Error) => void;\n\n /**\n * Custom log function used when `verbose` is true.\n * Defaults to `console.log`.\n */\n logger?: (...args: unknown[]) => void;\n}\n\n// ============================================\n// INTERNAL HELPERS\n// ============================================\n\n/**\n * Read and parse routes-manifest.json.\n * Returns null when the file does not exist or is malformed.\n */\nasync function readManifest(\n manifestPath: string,\n onMissing: (err: Error) => void,\n): Promise<RoutesManifest | null> {\n try {\n const raw = await readFile(manifestPath, 'utf-8');\n return JSON.parse(raw) as RoutesManifest;\n } catch (err) {\n onMissing(err instanceof Error ? err : new Error(String(err)));\n return null;\n }\n}\n\n/**\n * Dynamically import a route handler module and return its default export.\n * Accepts both absolute paths and file:// URLs.\n */\nasync function importHandler(handlerPath: string): Promise<((...args: any[]) => any) | null> {\n try {\n const url = handlerPath.startsWith('file://')\n ? handlerPath\n : pathToFileURL(handlerPath).href;\n const mod = await import(url);\n if (typeof mod.default !== 'function') {\n console.warn(\n `[kozo:fsr] Skipping ${handlerPath}: no default export function`,\n );\n return null;\n }\n return mod.default as (...args: any[]) => any;\n } catch (err) {\n console.warn(\n `[kozo:fsr] Failed to import handler ${handlerPath}:`,\n (err as Error).message,\n );\n return null;\n }\n}\n\n// ============================================\n// MIDDLEWARE FACTORY\n// ============================================\n\n/**\n * Register all routes declared in `routes-manifest.json` onto a Hono app.\n *\n * This function is **not** a Hono middleware in the classical sense — it is an\n * *async initializer* that must be awaited before the server starts accepting\n * requests. Calling it early (before user-defined routes) guarantees that\n * manifest routes take precedence.\n *\n * @example\n * ```ts\n * import { Hono } from 'hono';\n * import { applyFileSystemRouting } from '@kozojs/core/middleware';\n *\n * const app = new Hono();\n * await applyFileSystemRouting(app, { manifestPath: './routes-manifest.json' });\n *\n * // User-defined routes registered AFTER are appended normally\n * app.get('/health', c => c.json({ ok: true }));\n * ```\n */\nexport async function applyFileSystemRouting(\n app: Hono<any>,\n options: FileSystemRoutingOptions = {},\n): Promise<void> {\n const {\n manifestPath = resolve(process.cwd(), 'routes-manifest.json'),\n verbose = false,\n onMissingManifest = () => {\n // Silent by default — backward-compatible\n },\n logger = console.log,\n } = options;\n\n const manifest = await readManifest(manifestPath, onMissingManifest);\n\n // Gracefully skip when no manifest exists\n if (!manifest) return;\n\n const log = logger;\n\n if (verbose) {\n log(\n `\\nšŸ“‹ [kozo:fsr] Loading ${manifest.routes.length} route(s) from manifest\\n`,\n );\n }\n\n for (const route of manifest.routes) {\n const handler = await importHandler(route.handler);\n if (!handler) continue;\n\n // Register on the Hono app using the correct HTTP method\n (app as any)[route.method](route.path, handler);\n\n if (verbose) {\n log(\n ` ${route.method.toUpperCase().padEnd(6)} ${route.path} → ${route.handler}`,\n );\n }\n }\n\n if (verbose) {\n log('');\n }\n}\n\n// ============================================\n// CONVENIENCE: createFileSystemRouting\n// ============================================\n\n/**\n * Alternative factory that returns an async function you can call with a Hono\n * app. Useful when you want to pre-configure options and apply them later.\n *\n * @example\n * ```ts\n * const fsr = createFileSystemRouting({ verbose: true });\n * await fsr(app);\n * ```\n */\nexport function createFileSystemRouting(options: FileSystemRoutingOptions = {}) {\n return (app: Hono<any>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