Commit graph

2034 commits

Author SHA1 Message Date
Yiming Cao
7b387cd967
ci: switch publish workflow to npm trusted publishing (#2680)
Some checks failed
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 22:25:15 -07:00
sanny-io
97d674ecdc
feat: phone validation (#2672) 2026-05-23 21:27:54 -07:00
sanny-io
76febc90d4
fix: invalid prisma schema with format args (#2677)
Some checks failed
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
2026-05-22 08:33:41 -07:00
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
Lukas Wolf
7bc2fe57d7
feat(orm): implement delegateMap attribute (#2676) 2026-05-22 08:31:43 -07:00
Yiming Cao
ed01275e4a
chore: bump Kysely to 0.29 (#2626)
Some checks failed
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 14:34:00 -07:00
Yiming Cao
026450bfe7
fix(orm): make orderBy nulls optional (#2670)
Some checks are pending
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 12:13:11 -07:00
Román Benjámin
e492c937dd
fix(cli): add missing opposite relation fields during db pull when multiple FKs target the same model (#2652) 2026-05-13 09:52:15 -07:00
Yiming Cao
79498daf59
test(fetch-client): restore globalThis.fetch in afterEach (#2668)
Some checks are pending
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
2026-05-12 06:08:38 -07:00
Keath Pavlenko
1a4de21bdc
fix: detect policy plugin by stable id (#2663)
Some checks are pending
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
2026-05-11 18:28:16 -07:00
Erwan JOLY
ce50d3ba48
fix(orm): coerce ISO strings on DateTime input, with strictDateInput opt-in (#2631) (#2632)
Some checks failed
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 05:56:25 -07:00
Yiming Cao
08c11e77dc
fix(better-auth): keep schema-generator import lazy in CJS output (#2658)
Some checks are pending
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 22:48:12 -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
899e74daf6
test(regression): add regression test for issue #2639 (#2657)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 21:47:35 -07:00
Yiming Cao
7283d0e4d1
fix(orm): handle cyclic JSON typedef references in zod factory (#2654) (#2655)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 20:51:04 -07:00
Erwan JOLY
d1db37cee5
fix(orm): format Date as HH:MM:SS for @db.Time / @db.Timetz columns (#2633) (#2634) 2026-05-07 18:02:55 -07:00
Yiming Cao
9bfc3fecf9
feat(orm): implement postgres full-text search (#2653) 2026-05-06 21:47:44 -07:00
ymc9
1997cf3e98 fix(orm): coalesce NULL → '' in single-field _ftsRelevance ORDER BY
`to_tsvector(NULL)` returns NULL and `ts_rank(NULL, ...)` therefore
returns NULL — under Postgres's default `NULLS FIRST` for `ORDER BY DESC`
this would surface NULL-valued rows ahead of any matching ones, an
asymmetry with the multi-field path where `concat_ws(' ', ...)` already
skips NULLs and yields a 0.0 rank. Coalescing the field to `''` aligns
the two paths.

Adds `subtitle: String? @fullText` to the test fixture and a regression
test that orders a NULL-subtitle row against a matching one — without
the fix, the NULL row ranks first under DESC.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 21:07:53 -07:00
ymc9
d0dd954827 feat(orm): add @fullText attribute and Postgres full-text search
Introduces a Prisma-style full-text search capability gated by a new
field-level `@fullText` ZModel attribute. PostgreSQL only — MySQL/SQLite
throw NotSupported. Mirrors the existing `@fuzzy` design.

- Filter operator: `where: { title: { fts: { search, config? } } }`
  emits `to_tsvector(field) @@ to_tsquery(query)` (or with a `::regconfig`
  cast when `config` is provided; otherwise Postgres uses the database's
  `default_text_search_config`).
- OrderBy operator: `_ftsRelevance: { fields, search, config?, sort }`
  emits a single `ts_rank(...)`. Multi-field combines fields with
  `concat_ws(' ', ...)` so AND queries match terms across fields
  (matches Prisma's behavior).
- Type-level gating: the `fts` operator and `_ftsRelevance` orderBy
  appear only on String fields annotated with `@fullText` and only when
  the schema's provider is `postgresql`. Slicing's `'FullText'` filter
  kind controls availability of the runtime operator.
- Cursor pagination is rejected when combined with `_ftsRelevance`
  (parallel to `_fuzzyRelevance`).

Also refactors `buildOrderBy` to dispatch to small per-branch helpers
(`applyScalarOrderBy`, `applyAggregationOrderBy`, `applyRelationOrderBy`,
`applyFuzzyRelevanceOrderBy`, `applyFtsRelevanceOrderBy`).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 11:34:30 -07:00
Yiming Cao
9d147b931a
feat(fetch-client): implement fetch-based CRUD API client (#2651)
Some checks failed
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 08:28:12 -07:00
ymc9
f0fa5ea4ce chore: run test:generate during build for orm/schema/zod
Some checks are pending
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
Adds `pnpm test:generate` to the build scripts of @zenstackhq/orm,
@zenstackhq/schema, and @zenstackhq/zod so test fixtures are
regenerated as part of `pnpm build`. Includes the resulting
regeneration of packages/schema/test/schema/schema.ts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 22:58:21 -07:00
Yiming Cao
2ef5a99392
refactor(orm): make ZenStackPromise compatible with standard Promise signature (#2650)
Some checks are pending
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 19:49:13 -07:00
Yiming Cao
d5e790061a
fix(orm, zod): allow null in inferred type of required Json fields (#2647) (#2649)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 19:14:07 -07:00
Augustin
090be2c42f
fix(zod): json type compatibility between inferred zod types and @zenstackhq/orm types (#2641)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 17:17:08 -07:00
Yiming Cao
8ddbfdebdc
feat(orm): add field-level @fuzzy attribute to gate fuzzy search (#2642)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 12:41:09 -07:00
Yiming Cao
eff4263c47
refactor(tanstack-query, orm): thread plugin generics through transactions (#2645)
Some checks are pending
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 10:56:06 -07:00
docloulou
679f91fc26
feat(orm): add fuzzy search and relevance ordering (PostgreSQL) (#2573)
Some checks failed
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-05-03 20:11:03 -07:00
Yiming Cao
22e0fd40a9
feat(tanstack-query): add useTransaction hook for sequential transactions (#2637)
Some checks are pending
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
2026-05-03 18:33:15 -07:00
Yiming Cao
a31a32ef09
fix(tanstack-query): support DbNull/JsonNull/AnyNull serialization over the wire (#2630) 2026-04-29 23:43:57 -07:00
ymc9
516a2a2d81 update test 2026-04-29 23:06:51 -07:00
ymc9
67da884019 fix(tanstack-query): support DbNull/JsonNull/AnyNull serialization over the wire
Register SuperJSON custom serializers for the three JSON null sentinels in
both the client-helpers fetch layer and the server's registerCustomSerializers,
so they survive HTTP round-trips when used as query filters or mutation input.
Re-export the singletons from all tanstack-query framework entry points
(react, vue, svelte) for convenient user access.

Fixes #2278

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 22:59:43 -07:00
Yiming Cao
9cef0272e7
chore: upgrade to TypeScript 6 (#2629) 2026-04-29 20:41:27 -07:00
Yiming Cao
2a10bcae09
fix(orm): export UncheckedCreateInput/CheckedCreateInput and add XOR to UpdateInput (#2627)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 14:44:21 -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
Pavel Kudinov
0bc1f4849d
fix(better-auth): array support (#2617) 2026-04-27 18:12:13 -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
Yiming Cao
f2a1986222
fix(better-auth): lazy-load schema-generator and expose as separate entry point (#2611)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 17:04:50 -07:00
Yiming Cao
9ed7d2ae11
perf(policy): use EXISTS instead of COUNT/SUM for pre-create and pre-update policy checks (#2609) 2026-04-22 21:08:08 -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
09ca875066
test(regression): add regression test for issue #2538 (#2607) 2026-04-22 16:32:01 -07:00
ymc9
fa94d38bb2 test(regression): add regression test for issue #2538
Adds a regression test for nested collection predicates in access
policies generating valid SQL (issue #2538).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 15:59:06 -07:00
Yiming Cao
40c45944cc
fix(orm): resolve implicit m2m join table schema for non-public PostgreSQL schemas (#2606)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 15:21:43 -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
Eugen Istoc
6f967a9436
fix(server): declare h3 as optional peer dependency (#2601) (#2602) 2026-04-22 10:08:41 -07:00
Yiming Cao
14e1d55544
chore: fix up test case (#2600) 2026-04-21 17:33:06 -07:00
Lukas Kahwe Smith
bfdfce13c0
fix(orm): accept plain date strings in DateTime @db.Date field filters (#2572)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-04-21 16:46:30 -07:00
Jesús Gómez
b749cd0012
fix(cli): fix race condition during push db (#2491) (#2587) 2026-04-21 09:22:12 -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