Skip to content

Commit

Permalink
fix: package versions
Browse files Browse the repository at this point in the history
  • Loading branch information
0xcadams committed Jan 4, 2025
1 parent 1c382b8 commit d7d96f5
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 570 deletions.
5 changes: 4 additions & 1 deletion integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
"scripts": {
"build-schema": "zero-build-schema -p schema.ts",
"db:generate": "drizzle-kit generate",
"test": "vitest run"
"test": "vitest run",
"postinstall": "pnpm run build-schema"
},
"dependencies": {
"@rocicorp/zero": "^0.10.2024122404",
"drizzle-orm": "^0.38.3",
"drizzle-zero": "workspace:*"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion integration/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const permissions = definePermissions<AuthData, Schema>(schema, () => {
update: {
preMutation: [
(_authData, d) =>
d.exists("medium", (q) => q.where("name", "=", "email")),
d.exists("medium", (q) => q.where("id", "=", "mediumId")),
],
},
// must be logged in to delete
Expand Down
46 changes: 5 additions & 41 deletions integration/zero-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,17 @@
"permissions": {
"medium": {
"row": {
"insert": [],
"update": {
"preMutation": []
},
"delete": []
"update": {}
}
},
"user": {
"row": {
"insert": [],
"update": {
"preMutation": []
},
"delete": []
"update": {}
}
},
"message": {
"row": {
"update": {
"preMutation": [
[
"allow",
{
"type": "simple",
"left": {
"type": "column",
"name": "senderId"
},
"right": {
"type": "static",
"anchor": "authData",
"field": "sub"
},
"op": "="
}
]
]
},
"update": {},
"delete": [
[
"allow",
Expand Down Expand Up @@ -97,23 +70,14 @@
},
"mediumId": {
"type": "string",
"optional": false
"optional": true
},
"senderId": {
"type": "string",
"optional": false
"optional": true
}
},
"relationships": {
"medium": {
"sourceField": [
"mediumId"
],
"destField": [
"id"
],
"destSchema": "medium"
},
"sender": {
"sourceField": [
"senderId"
Expand Down
Loading

0 comments on commit d7d96f5

Please sign in to comment.