Skip to content

Commit 692b714

Browse files
authored
merge dev to main (v2.17.2) (#2204)
2 parents 1da7440 + 6d11737 commit 692b714

File tree

16 files changed

+75
-20
lines changed

16 files changed

+75
-20
lines changed

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,26 @@ async function getPosts(userId: string) {
9090
Server adapter packages help you wrap an access-control-enabled Prisma client into backend CRUD APIs that can be safely called from the frontend. Here's an example for Next.js:
9191

9292
```ts
93-
// pages/api/model/[...path].ts
93+
// /src/app/api/model/[...path]/route.ts
9494

95-
import { requestHandler } from '@zenstackhq/next';
95+
import { NextRequestHandler } from '@zenstackhq/server/next';
96+
import type { NextRequest } from 'next/server';
9697
import { enhance } from '@zenstackhq/runtime';
9798
import { getSessionUser } from '@lib/auth';
9899
import { prisma } from '@lib/db';
99100

100101
// Mount Prisma-style APIs: "/api/model/post/findMany", "/api/model/post/create", etc.
101102
// Can be configured to provide standard RESTful APIs (using JSON:API) instead.
102-
export default requestHandler({
103-
getPrisma: (req, res) => enhance(prisma, { user: getSessionUser(req, res) }),
104-
});
103+
104+
function getPrisma(req: NextRequest) {
105+
// getSessionUser extracts the current session user from the request, its
106+
// implementation depends on your auth solution
107+
return enhance(prisma, { user: getSessionUser(req) });
108+
}
109+
110+
const handler = NextRequestHandler({ getPrisma, useAppDir: true });
111+
112+
export { handler as GET, handler as POST, handler as PUT, handler as PATCH, handler as DELETE };
105113
```
106114

107115
### 4. Generated client libraries (hooks) for data access

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zenstack-monorepo",
3-
"version": "2.17.1",
3+
"version": "2.17.2",
44
"description": "",
55
"scripts": {
66
"build": "pnpm -r --filter=\"!./packages/ide/*\" build",

packages/ide/jetbrains/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
}
1010

1111
group = "dev.zenstack"
12-
version = "2.17.1"
12+
version = "2.17.2"
1313

1414
repositories {
1515
mavenCentral()

packages/ide/jetbrains/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jetbrains",
3-
"version": "2.17.1",
3+
"version": "2.17.2",
44
"displayName": "ZenStack JetBrains IDE Plugin",
55
"description": "ZenStack JetBrains IDE plugin",
66
"homepage": "https://zenstack.dev",

packages/language/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zenstackhq/language",
3-
"version": "2.17.1",
3+
"version": "2.17.2",
44
"displayName": "ZenStack modeling language compiler",
55
"description": "ZenStack modeling language compiler",
66
"homepage": "https://zenstack.dev",

packages/misc/redwood/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstackhq/redwood",
33
"displayName": "ZenStack RedwoodJS Integration",
4-
"version": "2.17.1",
4+
"version": "2.17.2",
55
"description": "CLI and runtime for integrating ZenStack with RedwoodJS projects.",
66
"repository": {
77
"type": "git",

packages/plugins/openapi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstackhq/openapi",
33
"displayName": "ZenStack Plugin and Runtime for OpenAPI",
4-
"version": "2.17.1",
4+
"version": "2.17.2",
55
"description": "ZenStack plugin and runtime supporting OpenAPI",
66
"main": "index.js",
77
"repository": {

packages/plugins/swr/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstackhq/swr",
33
"displayName": "ZenStack plugin for generating SWR hooks",
4-
"version": "2.17.1",
4+
"version": "2.17.2",
55
"description": "ZenStack plugin for generating SWR hooks",
66
"main": "index.js",
77
"repository": {

packages/plugins/tanstack-query/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstackhq/tanstack-query",
33
"displayName": "ZenStack plugin for generating tanstack-query hooks",
4-
"version": "2.17.1",
4+
"version": "2.17.2",
55
"description": "ZenStack plugin for generating tanstack-query hooks",
66
"main": "index.js",
77
"exports": {

packages/plugins/trpc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstackhq/trpc",
33
"displayName": "ZenStack plugin for tRPC",
4-
"version": "2.17.1",
4+
"version": "2.17.2",
55
"description": "ZenStack plugin for tRPC",
66
"main": "index.js",
77
"repository": {

0 commit comments

Comments
 (0)