Skip to content

Commit 0fa292c

Browse files
authored
merge dev to main (v2.2.3) (#1514)
2 parents a2d3377 + 908048b commit 0fa292c

File tree

17 files changed

+48
-16
lines changed

17 files changed

+48
-16
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ Thank you for your support!
234234

235235
<table>
236236
<tr>
237+
<td align="center"><a href="https://github.com/Mermaid-Chart"><img src="https://avatars.githubusercontent.com/u/117662492?s=200&v=4" width="100" style="border-radius:50%" alt="Mermaid Chart"/><br />Mermaid Chart</a></td>
237238
<td align="center"><a href="https://github.com/coderabbitai"><img src="https://avatars.githubusercontent.com/u/132028505?v=4" width="100" style="border-radius:50%" alt="CodeRabbit"/><br />CodeRabbit</a></td>
238239
<td align="center"><a href="https://github.com/j0hannr"><img src="https://avatars.githubusercontent.com/u/52762073?v=4" width="100" style="border-radius:50%" alt="Johann Rohn"/><br />Johann Rohn</a></td>
239240

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.2.2",
3+
"version": "2.2.3",
44
"description": "",
55
"scripts": {
66
"build": "pnpm -r 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.2.2"
12+
version = "2.2.3"
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.2.2",
3+
"version": "2.2.3",
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.2.2",
3+
"version": "2.2.3",
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.2.2",
4+
"version": "2.2.3",
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.2.2",
4+
"version": "2.2.3",
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.2.2",
4+
"version": "2.2.3",
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.2.2",
4+
"version": "2.2.3",
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.2.2",
4+
"version": "2.2.3",
55
"description": "ZenStack plugin for tRPC",
66
"main": "index.js",
77
"repository": {

packages/runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstackhq/runtime",
33
"displayName": "ZenStack Runtime Library",
4-
"version": "2.2.2",
4+
"version": "2.2.3",
55
"description": "Runtime of ZenStack for both client-side and server-side environments.",
66
"repository": {
77
"type": "git",

packages/schema/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publisher": "zenstack",
44
"displayName": "ZenStack Language Tools",
55
"description": "Build scalable web apps with minimum code by defining authorization and validation rules inside the data schema that closer to the database",
6-
"version": "2.2.2",
6+
"version": "2.2.3",
77
"author": {
88
"name": "ZenStack Team"
99
},

packages/schema/src/language-server/validator/expression-validator.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ export default class ExpressionValidator implements AstValidator<Expression> {
140140
accept('error', 'incompatible operand types', { node: expr });
141141
}
142142

143-
this.validateCrossModelFieldComparison(expr, accept);
143+
if (expr.operator !== '&&' && expr.operator !== '||') {
144+
this.validateCrossModelFieldComparison(expr, accept);
145+
}
144146
break;
145147
}
146148

packages/sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zenstackhq/sdk",
3-
"version": "2.2.2",
3+
"version": "2.2.3",
44
"description": "ZenStack plugin development SDK",
55
"main": "index.js",
66
"scripts": {

packages/server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zenstackhq/server",
3-
"version": "2.2.2",
3+
"version": "2.2.3",
44
"displayName": "ZenStack Server-side Adapters",
55
"description": "ZenStack server-side adapters",
66
"homepage": "https://zenstack.dev",

packages/testtools/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zenstackhq/testtools",
3-
"version": "2.2.2",
3+
"version": "2.2.3",
44
"description": "ZenStack Test Tools",
55
"main": "index.js",
66
"private": true,

tests/integration/tests/enhancements/with-policy/cross-model-field-comparison.test.ts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { loadSchema } from '@zenstackhq/testtools';
1+
import { loadModel, loadSchema } from '@zenstackhq/testtools';
22

33
describe('Cross-model field comparison', () => {
44
it('to-one relation', async () => {
@@ -997,4 +997,33 @@ describe('Cross-model field comparison', () => {
997997
dbTeam2.asset.update({ where: { id: asset.id }, data: { name: 'Asset2' } })
998998
).toBeRejectedByPolicy();
999999
});
1000+
1001+
it('with auth case 4', async () => {
1002+
await loadModel(`
1003+
model User {
1004+
id Int @id @default(autoincrement())
1005+
foos Foo[]
1006+
bars Bar[]
1007+
@@allow('all', true)
1008+
}
1009+
1010+
model Foo {
1011+
id Int @id @default(autoincrement())
1012+
user User @relation(fields: [userId], references: [id])
1013+
userId Int
1014+
bar Bar @relation(fields: [barId], references: [id])
1015+
barId Int @unique
1016+
@@allow('all', bar.private && bar.user == auth())
1017+
}
1018+
1019+
model Bar {
1020+
id Int @id @default(autoincrement())
1021+
user User @relation(fields: [userId], references: [id])
1022+
userId Int
1023+
foo Foo?
1024+
private Boolean
1025+
@@allow('all', true)
1026+
}
1027+
`);
1028+
});
10001029
});

0 commit comments

Comments
 (0)