@kittlekit/crud-fastify
v0.1.1
Published
Fastify route helpers for Kittlekit CRUD packages
Downloads
32
Readme
@kittlekit/crud-fastify
Fastify route helper layer for the Kittlekit CRUD package family.
What This Package Is
Use this package when your CRUD interface is exposed via Fastify and you want framework-specific routing logic separated from:
- CRUD core contracts
- DB-specific execution helpers
Install
npm install @kittlekit/crud-fastify @kittlekit/crud-core fastify zod zod-openapiMain Exports
mergeCrudSchematoCrudJsonSchemaresolveCrudAbilityGuardbuildCrudPreHandlersvalidateCrudAbilitiesbuildListRouteOptionsbuildDetailRouteOptionsbuildCreateRouteOptionsbuildUpdateRouteOptionsbuildDeleteRouteOptions
How It Works
This package expects injected adapters for:
- auth/ability guards
- validation hooks
That lets each application keep its own auth/session and error model while reusing route-builder behavior.
Typical Usage
Use this package in a local wrapper that injects:
- tenant/platform auth guards
- body/query/params validation functions
- app-specific route defaults
That is how the server in this repository uses it.
Relationship to Other Packages
crud-core -> crud-fastify -> host app route handlersOut of Scope
- direct DB operations
- audit/event/cache implementations
- non-Fastify runtimes
Publish
npm run build --workspace @kittlekit/crud-fastify
npm publish --workspace @kittlekit/crud-fastify --access publicExamples
- smoke setup:
sandbox/crud-smoke - server wrapper reference:
server/src/core/crudFactory.routes.ts
Release Notes
0.1.0
- first public extraction of Fastify CRUD route helpers and middleware composition
