Skip to content

Commit 02a4a17

Browse files
authored
merge dev to main (#644)
2 parents 1b4d839 + 32d5b26 commit 02a4a17

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2762
-996
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ The `zenstack` CLI transpiles the ZModel into a standard Prisma schema, which yo
6262
At runtime, transparent proxies are created around Prisma clients for intercepting queries and mutations to enforce access policies.
6363

6464
```ts
65-
import { withPolicy } from '@zenstackhq/runtime';
65+
import { enhance } from '@zenstackhq/runtime';
6666

6767
// a regular Prisma client
6868
const prisma = new PrismaClient();
6969

7070
async function getPosts(userId: string) {
7171
// create an enhanced Prisma client that has access control enabled
72-
const enhanced = withPolicy(prisma, { user: userId });
72+
const enhanced = enhance(prisma, { user: userId });
7373

7474
// only posts that're visible to the user will be returned
7575
return enhanced.post.findMany();
@@ -84,14 +84,14 @@ Server adapter packages help you wrap an access-control-enabled Prisma client in
8484
// pages/api/model/[...path].ts
8585

8686
import { requestHandler } from '@zenstackhq/next';
87-
import { withPolicy } from '@zenstackhq/runtime';
87+
import { enhance } from '@zenstackhq/runtime';
8888
import { getSessionUser } from '@lib/auth';
8989
import { prisma } from '@lib/db';
9090

9191
// Mount Prisma-style APIs: "/api/model/post/findMany", "/api/model/post/create", etc.
9292
// Can be configured to provide standard RESTful APIs (using JSON:API) instead.
9393
export default requestHandler({
94-
getPrisma: (req, res) => withPolicy(prisma, { user: getSessionUser(req, res) }),
94+
getPrisma: (req, res) => enhance(prisma, { user: getSessionUser(req, res) }),
9595
});
9696
```
9797

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "zenstack-monorepo",
3-
"version": "1.0.0-beta.19",
3+
"version": "1.0.0-beta.20",
44
"description": "",
55
"scripts": {
66
"build": "pnpm -r build",
77
"test": "ZENSTACK_TEST=1 pnpm -r run test --silent --forceExit",
88
"test-ci": "ZENSTACK_TEST=1 pnpm -r run test --silent --forceExit",
99
"lint": "pnpm -r lint",
1010
"publish-all": "pnpm --filter \"./packages/**\" -r publish --access public",
11-
"publish-preview": "pnpm --filter \"./packages/**\" -r publish --force --registry http://localhost:4873"
11+
"publish-preview": "pnpm --filter \"./packages/**\" -r publish --force --registry https://dolphin-app-nyvr5.ondigitalocean.app/"
1212
},
1313
"keywords": [],
1414
"author": "",

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": "1.0.0-beta.19",
3+
"version": "1.0.0-beta.20",
44
"displayName": "ZenStack modeling language compiler",
55
"description": "ZenStack modeling language compiler",
66
"homepage": "https://zenstack.dev",

packages/plugins/openapi/package.json

Lines changed: 2 additions & 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": "1.0.0-beta.19",
4+
"version": "1.0.0-beta.20",
55
"description": "ZenStack plugin and runtime supporting OpenAPI",
66
"main": "index.js",
77
"repository": {
@@ -31,6 +31,7 @@
3131
"lower-case-first": "^2.0.2",
3232
"openapi-types": "^12.1.0",
3333
"tiny-invariant": "^1.3.1",
34+
"upper-case-first": "^2.0.2",
3435
"yaml": "^2.2.1",
3536
"zod": "3.21.1",
3637
"zod-validation-error": "^0.2.1"

packages/plugins/openapi/src/rpc-generator.ts

Lines changed: 88 additions & 84 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)