zenstack/samples/nuxt/server/api/model/[...].ts
Yiming Cao 2c9db43cc2
feat(cli): implement watch mode for generate (#573)
* feat(cli): implement watch mode for generate

* chore(root): update pnpm-lock.yaml

* chore(cli): track all model declaration and removed paths, logs in past tense

* fix(cli): typo, unused double array from

* fix(orm): preserve zod validation errors when validating custom json types

* update

* chore(cli): move import, fix parallel generation on watch

* feat(common-helpers): implement single-debounce

* chore(cli): use single-debounce for debouncing

* feat(common-helpers): implement single-debounce

* fix(common-helpers): re run single-debounce

* fix(tanstack): avoid invalidating queries for custom proc mutations

* add missing file

* fix formatting

---------

Co-authored-by: FTB_lag <tabolskyy.git@gmail.com>
2026-01-08 16:12:14 +08:00

13 lines
516 B
TypeScript

import { RPCApiHandler } from '@zenstackhq/server/api';
import { createEventHandler } from '@zenstackhq/server/nuxt';
import { db } from '~~/server/utils/db';
import { schema } from '~~/zenstack/schema';
const handler = createEventHandler({
apiHandler: new RPCApiHandler({ schema, log: ['debug', 'error'] }),
// fully open ZenStackClient is used here for demo purposes only, in a real application,
// you should use one with access policies enabled
getClient: () => db,
});
export default handler;