Commit graph

459 commits

Author SHA1 Message Date
github-actions[bot]
87644178b3
[CI] Bump version 3.7.1 (#2678)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-05-22 08:31:58 -07:00
github-actions[bot]
b53e908a5d
[CI] Bump version 3.7.0 (#2656)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-05-07 22:35:13 -07:00
Yiming Cao
d30ebade7f
fix(policy): resolve inherited fields in delegate sub-type create policy checks (#2623)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 18:23:37 -07:00
github-actions[bot]
80c0bd6d68
[CI] Bump version 3.6.4 (#2624)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-04-27 17:50:05 -07:00
github-actions[bot]
8609d5b3e3
[CI] Bump version 3.6.3 (#2613)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-04-24 21:21:24 -07:00
ymc9
a49e778627 perf(policy): use EXISTS instead of COUNT/SUM for pre-create and pre-update policy checks
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 16:33:59 -07:00
Yiming Cao
1cf4345ffa
fix(policy): join base table when loading before-update entities for @@delegate sub-models (#2605)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 11:59:30 -07:00
github-actions[bot]
fd8db57ef2
[CI] Bump version 3.6.2 (#2604)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-04-22 10:54:53 -07:00
github-actions[bot]
a1374c042f
[CI] Bump version 3.6.1 (#2598)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-04-21 08:52:19 -07:00
Yiming Cao
b8209d7eeb
chore: migrate from tsup to tsdown (#2580) 2026-04-15 12:13:34 -07:00
github-actions[bot]
3dc922d6a9
[CI] Bump version 3.6.0 (#2571)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-04-11 19:18:20 -07:00
github-actions[bot]
df9b35ea64
[CI] Bump version 3.5.6 (#2560)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-04-06 13:14:51 -07:00
github-actions[bot]
0495333ca3
[CI] Bump version 3.5.5 (#2553)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-04-03 14:13:43 -07:00
github-actions[bot]
263074ce78
[CI] Bump version 3.5.4 (#2545)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-04-02 10:23:46 -07:00
Yiming Cao
f5753eec2d
chore(policy): improve JSDoc comments and code formatting in expression files (#2544)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 09:35:56 -07:00
Lukas Wolf
28ae08d739
fix(policy): currentModel and currentOperation inside of collection predicates (#2537) 2026-03-31 22:35:16 -07:00
ymc9
a0a6424c5d Revert "fix(policy): skip m2m update-policy check for newly created side on connect"
This reverts commit 59d302d199.
2026-03-31 20:13:14 -07:00
ymc9
59d302d199 fix(policy): skip m2m update-policy check for newly created side on connect
When creating a model with a nested many-to-many `connect`, the join table
insert triggered an update-policy check on the just-created entity. Because
the connection doesn't exist yet at check time, relation-based policies
(e.g. `parents?[id == auth().id]`) always evaluated to false, causing a
spurious "not updatable" error.

Fix by embedding a lightweight marker in the insert query's end-modifier
comment so the policy handler can identify the newly-created side and skip
its circular update check. The connected side's update policy is still
enforced. Adds regression test for issue #2531.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 20:06:12 -07:00
github-actions[bot]
80f364a2f0
[CI] Bump version 3.5.3 (#2533)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-03-30 18:40:07 -07:00
Yiming Cao
4686720178
fix(orm): fix PostgreSQL type mismatch when @db.Uuid fields used in policy expressions (#2532)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 18:39:53 -07:00
Yiming Cao
85d8b6bf2f
chore: add package metadata to all public packages (#2530)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 13:02:21 -07:00
github-actions[bot]
e79ea0cbad
[CI] Bump version 3.5.2 (#2523) 2026-03-26 08:26:49 -07:00
ymc9
3145ba686b fix(cli): regression of CLI plugin resolution 2026-03-24 19:02:25 -07:00
github-actions[bot]
8b1046b2c7
[CI] Bump version 3.5.0 (#2511)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-03-23 16:31:36 -07:00
Pavel Kudinov
ece062f02b
fix(policy): allow dangerous raw SQL opt-in (#2502) 2026-03-20 12:58:50 -07:00
Eugen Istoc
12aeb7bd18
feat(orm): add result plugin extension point (#2442)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 15:33:50 -07:00
Yiming Cao
49395f7280
perf(orm): avoid unnecessary pre-mutation read and transactions (#2484) 2026-03-14 12:18:11 -07:00
github-actions[bot]
2c32dc329e
[CI] Bump version 3.4.6 (#2477)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-03-11 11:40:16 -07:00
Pavel Kudinov
20832441c7
fix(policy): handle DefaultInsertValueNode in createManyAndReturn (#2461)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 16:06:28 -08:00
github-actions[bot]
bd2b111b8e
[CI] Bump version 3.4.5 (#2457)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-03-06 22:26:46 -08:00
github-actions[bot]
07586f24cf
[CI] Bump version 3.4.4 (#2450)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-03-04 18:48:24 -08:00
github-actions[bot]
518cbb7ddf
[CI] Bump version 3.4.3 (#2436)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-03-03 09:34:03 -08:00
github-actions[bot]
f58550e262
[CI] Bump version 3.4.2 (#2430)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-03-01 20:26:23 -08:00
github-actions[bot]
3336505ed6
[CI] Bump version 3.4.1 (#2422)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-02-27 19:37:57 -08:00
Yiming Cao
75bc4a1937
fix(policy): wrong table alias used when injecting for field policies (#2413) 2026-02-26 21:02:36 -05:00
github-actions[bot]
2da0c214dc
[CI] Bump version 3.4.0 (#2408)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-02-25 22:40:51 -05:00
Yiming Cao
ca8f43721b
fix(orm): use compact alias names when transforming ORM queries to Kysely (#2406) 2026-02-25 12:41:17 -05:00
Yiming Cao
fc703b8f42
chore: clean up repo merging stale files (#2370) 2026-02-11 11:51:44 +08:00
ymc9
2564cd457b Merge remote-tracking branch 'v3/dev' into dev 2026-02-10 16:20:19 +08:00
github-actions[bot]
274871b858
chore: bump version 3.3.3 (#659)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-02-06 16:14:11 +08:00
github-actions[bot]
392b8a2da5
chore: bump version 3.3.2 (#648)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-02-01 20:59:52 +08:00
github-actions[bot]
646267d736
chore: bump version 3.3.1 (#642)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-01-31 16:07:23 +08:00
github-actions[bot]
3392104d04
chore: bump version 3.3.0 (#635)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-01-30 16:22:01 +08:00
Yiming Cao
209312a27b
fix(orm): properly handle literal array values in policy evaluation for postgres (#628) 2026-01-29 00:15:07 +08:00
Yiming Cao
99f68e2f7b
feat(orm): mysql support (#616)
* WIP(orm): mysql support

* WIP: more progress with fixing tests

* WIP: get all client api tests pass

* WIP: get all tests pass

* fix executor

* add MySQL to CI matrix

* fix sqlite test runs

* fix test

* fix delete readback check

* set mysql container max connections

* fix tests

* fix test

* refactor: extract duplicated mysql/pg code into base class

* address PR comments

* refactor: remove order by duplicated code

* refactor: optimize stripTableReference

* addressing PR comments

* fix tests
2026-01-24 23:21:36 +08:00
Mike Willbanks
077f03f732
feat(zmodel): collection predicate binding (#548)
* feat: audit policy collection aliases

provides a means to alias collections in @@allow collections by extending the ast
this allows for utilizing collections inside of @@allow like:

```
memberships?[m,
    auth().memberships?[
        tenantId == m.tenantId ...
    ]
  ]
```

* fix: code review comments + syntax fixes

* refactor: extract collection predicate binding to its own language construct (#2)

- adjusted language processing chain accordingly
- fixed several issues in policy transformer/evaluator
- more test cases

* addressing PR comments

---------

Co-authored-by: Yiming Cao <yiming@whimslab.io>
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-01-18 14:08:10 +08:00
Yiming Cao
2c1ffaca59
feat(orm): implement client API extensions, refactor query args extension (#603)
* feat(orm): implement client API extensions, refactor query args extension

* address PR comments

* Fix upsert validation to merge $create and $update schemas (#604)

* Initial plan

* fix: merge $create and $update schemas for upsert validation

- Handle upsert operation specially to match TypeScript type behavior
- When both $create and $update schemas exist, merge them for upsert
- Add test case to verify the fix works correctly

Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>

* fix: improve comment accuracy about Zod merge behavior

Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>

* minor fixes

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
2026-01-18 13:04:03 +08:00
Yiming Cao
233b47d2ed
feat: plugin-extended query args (#599)
https://discord.com/channels/1035538056146595961/1460921516936925388
2026-01-16 20:52:42 +08:00
github-actions[bot]
f54093db51
chore: bump version 3.2.1 (#587)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-01-11 16:44:20 +08:00
Yiming Cao
e4b79d0c6f
feat: field-level access control (#557)
* WIP

* WIP: implement read policies

* fix tests

* Update packages/plugins/policy/src/policy-handler.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix name mapper

* fix tests

* fix build

* implement update field-level policies

* update tests

* update tests

* add more tests

* add more tests

* simplify queries

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-05 18:14:23 +08:00