Saving all progress

This commit is contained in:
Luke Hagar
2025-03-19 22:47:50 -05:00
parent 5c6e8a1e4f
commit 00593b402b
14988 changed files with 2598505 additions and 1 deletions

15
dist/middleware/apiDocGenerator.js vendored Normal file
View File

@@ -0,0 +1,15 @@
import { openApiStore } from '../store/openApiStore.js';
export const apiDocGenerator = async (c, next) => {
await next();
// Record the API call in OpenAPI format
openApiStore.recordEndpoint(c.req.path, c.req.method.toLowerCase(), {
query: Object.fromEntries(new URL(c.req.url).searchParams),
body: await c.req.json().catch(() => null),
contentType: c.req.header('content-type') || 'application/json',
}, {
status: c.res.status,
body: await c.res.clone().json().catch(() => null),
contentType: c.res.headers.get('content-type') || 'application/json',
});
};
//# sourceMappingURL=apiDocGenerator.js.map