Releases
Monorepo-v2.0.0
2.0.0 (2024-02-19)
Features
a better "zod" plugin (#521 ) (2280f83 )
add "loadPath" options to runtime API and server adapter options (#696 ) (fc50deb )
add @@auth option for declaring auth model (#787 ) (c390de1 )
add CLI config file support (#328 ) (4668ee9 )
Add multi-schema file support (#368 ) (4e57b96 )
add prisma passthrough attribute for working around discripancies between zmodel and prisma (#245 ) (cef96d4 )
add support for comparing fields in the same model (#631 ) (4776685 )
add support for filter operator functions (#289 ) (7914470 )
add support for type modifier attributes (#240 ) (a05d320 )
add switch to zod plugin to control whether unchecked input types are generated (#693 ) (cea2019 )
add zenstack CLI repl command (#808 ) (616be65 )
allow specifying zmodel location in package.json (#879 ) (bb149bd )
allow to use custom fetch with generated hooks (#556 ) (2a6b31a )
always use superjson to serialize/deserialize in the api layer (#585 ) (46fec66 )
automatic optimistic update for tanstack hooks (#830 ) (93dc7df )
CLI improvements (#694 ) (eba3390 )
copy nextjs adapter over to server
package (#420 ) (f79902a )
express.js adapter (#271 ) (e12fc5a )
field-level access control (#638 ) (9a6f39b )
field-level policy override (#889 ) (271d568 )
flexible 'createRouter' typings (#654 ) (e147412 )
fluent API support (#666 ) (4ae5a96 )
generate openapi doc with 3.1.0 version (fe74a80 )
generate openapi doc with 3.1.0 version (#304 ) (920b13e )
implement filter operators in restful service (#411 ) (52f44c5 )
implement openapi security inferrence and override (#341 ) (2860f00 )
implement tanstack-query generator plugin (#413 ) (9351fc9 )
implementing access control for Prisma Pulse (#643 ) (d8c2e87 )
implementing sveltekit adapter and refactor server package (#418 ) (53716c9 )
import statment validation (#369 ) (782a449 )
improved automatic query invalidation for tanstack-query (#790 ) (42d654f )
improvements of openapi plugin (#335 ) (3b9e356 )
include raw zod errors in response (#691 ) (b5da998 )
infinite query for swr plugin (#680 ) (757ccb5 )
infinite query support for tanstack-query (#679 ) (3300499 )
JetBrains plugin for ZModel (#904 ) (c79be9e )
let zenstack init
install exact versions for zenstack package… (#313 ) (38c97bd )
make nextjs adapter support next 13 app dir (#483 ) (a078b23 )
make parameters of transactions configurable (#988 ) (d0745b1 )
Make ZModel color schema looks cool and consistent (#791 ) (6dabb02 ), closes #716
more flexible "createRouter" typings (#651 ) (d2bffb6 )
more flexible "in" operator and filter expressions (#367 ) (170bc73 )
more flexible formating for zmodel and generated prisma file (#388 ) (4d7699f )
Nuxt server adapter and tanstack-query for "vue" hooks generation (#757 ) (033d95d )
OpenAPI & fastify adapter (#254 ) (dd9963c )
optimistic update support for SWR (#860 ) (0ca4670 )
options for logging queries sent to prisma (#488 ) (ccfb2b0 )
polymorphism (#990 ) (bac3683 )
react-hooks generator and runtime targeting @tanstack/react-query (#309 ) (21ccddb )
RedwoodJS integration package (#911 ) (e4aeee3 )
release-main-config.json: bump release version to 2.0.0 for the upcoming release (59cf941 )
restful style openapi spec generation (#410 ) (4ebaa1f )
RESTful style server API handler (#405 ) (f07ccdd )
runtime support for custom @[@auth](https://github.com/auth)
model (#793 ) (08b9677 )
support "Unsupported" field type (#366 ) (e232271 )
support now()
function in policy rules (#480 ) (7de7623 )
support abstract model (#308 ) (2fa3aee )
support configuring what models to include for zod and trpc plugins (#747 ) (a5d15a3 )
support multi-id-field models (@@id ([f1, f2, ...])) (#243 ) (7e55e65 )
Support multiple levels inheritance (#863 ) (2d43692 )
support Prisma v5 (#587 ) (b0d9154 )
support Prisma view (#579 ) (af151b7 )
support self relations (#244 ) (93cb6bf )
support using collection predicate expression with auth()
(#831 ) (ff1e8a5 )
Support ZModel format command in CLI (#869 ) (bf85ceb )
swr plugin (#419 ) (3ee7821 )
tanstack-query v5 support (#788 ) (0d04d8e )
trpc plugin, add "generateModelActions" option to control what operations to generate (#482 ) (8693852 )
trpc plugin, generate client helpers to provide prisima-like typing (#510 ) (c41980d )
zod plugin and zod validation for open-api requests (#262 ) (51c094e )
Bug Fixes
[ZModelCodeGenerator] Remove the extra space between the collection predicate operator (#839 ) (9a0895b )
zenstackhq#300 : handle invalid json in openapi query params gracefully (#303 ) (8bdc827 )
zenstackhq#329 : normalize testtools workspace root path for win32 (#330 ) (15ab420 )
add "exports" to generated package.json, make trpc code-gen compatible with vite (#677 ) (df67f30 )
add "interactiveTransactions" preview features for lower version of Prisma (#569 ) (bd5666a )
add CheckSelect
type into code for Prisma version backward compatibility (#619 ) (3e09a3a )
add directUrl support to schema datasource decl (#434 ) (8b29eed )
add enum import to zod generation (#528 ) (2a4b5cc )
add eslint ignore to generated trpc helper source (#759 ) (f7e8a08 )
add IntField as a valid mapping to TinyInt (#822 ) (db9cc7f )
add missing "/runtime" exports to tanstack-query (#688 ) (a3064dc )
add missing attribute parameters and loosen keyword restrictions (#394 ) (ef7acd7 )
add missing exports for the generated .zenstack package (#760 ) (8ac0915 )
add missing MSSQL related stdlib declarations and parameters (#748 ) (4e6531e )
add missing parameters to [@db](https://github.com/db).Decimal
(#475 ) (8b98e6b )
add package.json exports (#597 ) (8ccfc93 )
add support for @@schema attribute, and allow arbitrary fields in datasource (#250 ) (9d45384 )
add the missing "count" schema/router for zod/trpc (#667 ) (6e9a3b3 )
allow "view" and "import" as identifier (#750 ) (2e15dfb )
allow models without field declarations (#749 ) (43322e1 )
auth() cannot be resolved if the auth model is marked @@ignore (#844 ) (73f2cec )
automatically enable "@core/zod" plugin when there're validation rules (#535 ) (0519421 )
avoid generating error log when getting machine id (#977 ) (c50e013 )
avoid return loaded prisma if undefined (#461 ) (cfca402 )
batch bug fixes (#273 ) (e1600c8 )
better cli reporting of missing/invalid config file (#354 ) (ed99ea4 )
bug fixes for openapi plugin (#432 ) (e76ee35 )
bug in enhancement proxy for detecting nested transactions (#941 ) (85a0525 )
bug with NOT clause reduction when condition is an array (#848 ) (debd35b )
bugs related to model name casing (#645 ) (32d5b26 )
build, lint and etc. (#833 ) (cccbc3c )
canonicalize plugin's output folder detection; don't generate aux field unnecessarily (#423 ) (9eaf235 )
change back to loading from literal ".zenstack" path otherwise Vercel breaks :( (#701 ) (2d41a9f )
change openapi plugin's default flavor to "rpc" (#439 ) (ec65e53 )
clean up peer dependencies (#218 ) (a9283cd )
clean up zod generation (#883 ) (909281f )
clean up zod generation (#883 ) (9d4a8ed )
client-extension test failures (#874 ) (f2ab6a5 )
condition error in zod generator (#810 ) (eb6ef1f )
conditions hoisted from nested read overwrites toplevel where conditions (#635 ) (9a35f88 )
deal with payload field value with undefined (#778 ) (e41fc74 )
decimal field zod validation (#660 ) (522df7a )
deprecated cuid
dependency & clean up CI file (#359 ) (9f79e51 )
deprecated import from "@prisma/client/runtime" (#398 ) (da7d88c )
disable eslint in generated hooks, refactor package inter-dependencies (9e84126 )
disable textmate bundle when JetBrains plugin is uninstalled (#918 ) (7e9cc35 )
don't import unused enum when generating policy guards (#686 ) (a5c110b )
duplicated zod schema imported when there're multiple fields with an enum type (#633 ) (4b70853 )
enable auto completion inside attribute (#949 ) (20d5bfc )
enhanced client doesn't work with client extensions that add new model methods (7dec167 )
enhanced client doesn't work with client extensions that add new model methods (#851 ) (ea564c9 )
ensure prisma installation during init (#220 ) (a333067 )
expression context check issue on initial loading (#544 ) (05b5554 )
fastify plugin correctly returning the reply #684 (#685 ) (7a04ce5 )
fix policy generation for collection predicate expressions (#706 ) (b8a875e )
fix react-query code-gen and improve mutation options merging (#314 ) (51484a7 )
fix the incorrect query args reduction when there're mixed boolean operators (#690 ) (c0c5a16 )
generate .zenstack to the node_modules of the real path of runtime folder (52e9f82 )
generate .zenstack with the same level of @zenstackhq (#464 ) (2bb0b2b )
generate both cjs and esm builds for swr plugin (#892 ) (385839f )
generate foreign key field in zod schemas (#868 ) (124a0a2 )
handle @@ignore models properly in plugins (#283 ) (6f7cb0e )
handle foreign key field-level access check during relation update (#847 ) (3c8cba7 )
handle invalid json in openapi query params gracefully (68a08a3 )
handle invalid request path properly in openapi handler (bda4a4f )
handle invalid request path properly in openapi handler (#305 ) (955e657 )
hooks generation emits Provider export for backward compatibility (#594 ) (ca3ebda )
improve binary & unary expression applicability check (#589 ) (eb2d896 )
improve clarity of dealing with auth()
during policy generation (#293 ) (c3b456a )
improve consistency of generated guard code (#616 ) (1b7b5bd )
improve error messages (#502 ) (c8e5724 )
improve generated typing for polymorphic models (#1002 ) (7b453f7 )
improve stacktrace of errors generated by proxied Prisma methods (#484 ) (1b67eba )
incorrect policy code generated when the rule only contains a single field reference (#511 ) (0ea071b )
incorrect policy injection for nested to-one relation inside a to-many parent (#777 ) (876e013 )
incorrect relation owner analysis (bb64b8a )
incorrect relation owner analysis (#610 ) (c89012b )
incorrect reverse query built for to-many relation (d2ad3a5 )
incorrect reverse query built for to-many relation (#815 ) (2c345e1 )
incremental bugfixes (#211 ) (8e73b0b )
Inherited fields from abstract model should be on the top (#487 ) (6d1afc1 ), closes #486
invalid query sent to Prisma when doing nested update with multi-id (#553 ) (24760be )
issue #627 (#628 ) (2ef93cb )
issue 599, throw error if the given user context doesn't contain full id fields (#629 ) (4bc72a8 )
issue 961, incorrect policy injection for nested updateMany
(bf690a0 )
issue 961, incorrect policy injection for nested updateMany
(#962 ) (2b2bfcf )
issue with client typing generation in trpc plugin (#673 ) (576c4f7 )
issue with connecting multiple relations (#450 ) (dd6be95 )
issue with dealing with result read-back for nextjs and react hooks (8e630e0 )
issue with dealing with result read-back for nextjs and react hooks (#223 ) (fb1ec3d )
lint issue in generated swr/tanstack hooks (#877 ) (4577232 )
Load plugin models in vscode extension (#336 ) (4e27a00 )
make core plugins compile generated ts files by default (#373 ) (4bf1304 )
make sure auxiliary fields in nested entities are stripped (#387 ) (5616c05 )
make sure Buffer is imported (#596 ) (76a0bac )
make sure zod schemas are lazily loaded (#265 ) (b7548d1 )
make sure zod schemas have type annotations (#574 ) (51985b1 )
misc fixes about server adapters and more tests (#431 ) (764ff2a )
missing string quote during function arg gen (#234 ) (88828e3 )
more precise Zod refinement types (#678 ) (1564fe3 )
more tests and bump version (#225 ) (cabe9dc )
nullify field instead of reject when an optional relation field is not readable (#588 ) (fc16008 )
number literal precision issue (#659 ) (6275701 )
open-api issues (#446 ) (2855647 )
openapi - do not generate "id" field in create input if the field has default value (#758 ) (787a244 )
openapi generator relation handling (#320 ) (f1c9765 )
openapi plugin - make sure components are generated even model is marked ignored (#422 ) (a5848ea )
openapi plugin bugs - relation handling and spec version (#317 ) (dd62f8d )
optimize generated trpc typing and fix "select" issue (#972 ) (c0d60a0 )
optimize the way how generated packages are loaded in test environment (#549 ) (18267f6 )
policy generation error when field-level rules contain "this" expression (#670 ) (dc106a9 )
Policy generator error for Auth() with multiple level member access (#922 ) (ecf0c19 )
policy generator fails on Windows for custom output path (#583 ) (32c7279 )
post-update rules incorrectly reject update (#826 ) (d921a7c )
post-update rules incorrectly reject update (#826 ) (e85831e )
prisma schema generation issue with calling attribute function with literal (#930 ) (91fe8e7 )
proceed with linking even if zmodel contains parsing error (#327 ) (9138da6 )
properly handle nullable fields in openapi generator (#906 ) (0e422ad )
query injection error when create (in array form) is nested inside an update (#865 ) (ca55bf6 )
reference resolution issue inside collection predicate expressions (#927 ) (d8dce13 )
remove warning in vercel environment (#954 ) (0aa69d9 )
repl in pnpm environment, improve relative path module loading (#866 ) (e7d29fd )
report validation error when binary expressions have arrays (#719 ) (2e9fe67 )
require with default (#546 ) (1e9fe1c )
resolve member access expr only in the context of operand type (#761 ) (ccae413 )
resolve to the correct enum in field attribute when there's ambiguity (#513 ) (3b07a1e )
rest api should return error reason (#507 ) (4b389fb )
rest-api, wrong links generated for to-one relationship (#481 ) (21affec )
shadowDatabaseUrl typo in prisma generator (#452 ) (7ddeec5 )
short-circuit post-read check when policy rules don't depend on model fields (#376 ) (a54eba4 )
Show the correct incomplete error for multiple level inheritance (#916 ) (b71c1c5 )
Show validation error for the field comparison not in the same model (#912 ) (8d5bfe4 )
stricter binary operation operand type compatibility check (#846 ) (03315cc )
Support code action of generating relation fields for both sides (#281 ) (be0a88d )
support default values in generated zod schemas (#914 ) (0f73e56 )
support for custom prisma client output path (#514 ) (5f3669e )
support for string escaping in ZModel (#668 ) (f034839 )
Support implicit many-to-many (#286 ) (317ba8d )
support loading plugin.zmodel from a relative path (#837 ) (66ab915 )
support object literal in plugin fields processing (#351 ) (8284988 )
support postgres extensions (#718 ) (cdc98e0 )
support string literal keys for object expressions in ZModel (#752 ) (22b1bf9 )
swr hooks support no revalidation (#871 ) (673bdd3 )
tanstack-query build issues and bugs in optimistic update (#843 ) (08d317d )
tanstack-query, fix the incorrect query typing when user provides a custom selector (#967 ) (cc98e30 )
trpc client helper bugs (#532 ) (4097915 )
trpc mutation route should return undefined when result is not readable (#227 ) (a3926c2 )
trpc plugin, generate schema for supporting unchecked input in mutation routes (#512 ) (304979f )
typing generated for options parameter in the hooks method (#946 ) (acb23d1 )
typing of policy definition (#640 ) (acd0753 )
undefined field access when selecting with _count (#403 ) (d90d7c8 )
update langium version (26dd30f )
update langium version (#290 ) (23180ce )
update rule check for connect with implicit many-to-many relation (#565 ) (ffdad27 )
Update start line of JsDoc comments in zmodel to start with two … (#428 ) (a3473ea )
use find-up to find correct package manager in mono repo (#249 ) (5e4e1d6 )
User model not found when using policy in the imported model (#457 ) (dd36959 )
Validation errors when using true or false as prefix of id (#530 ) (551b33d )
VsCode error textDocument/codeAction failed (#915 ) (3afe42f )
vscode language accidentally bundles prisma packages (#625 ) (f6b68da )
vscode language accidentally bundles prisma packages (#623 ) (a81913e )
vscode, skip validation when there's parsing/lexer error (#222 ) (33fd6d2 )
when field policy only has deny rule, access should be allowed when the rule doesn't satisfy (#818 ) (62a8200 )
workflows: correct paths for config-file and manifest-file in release-please-action configuration to match actual file locations (b195c9f )
wrap generated trpc routes with error handling (#338 ) (7012ef5 )
wrong dev dependency in cli project (#318 ) (181f9ef )
wrong endpoint requested in generated SWR hooks (#503 ) (3078e12 )
wrong payload injected for nested create in update (#715 ) (d8f0954 )
wrong return type of generated count
hook (#347 ) (2035319 )
wrong type generated for groupBy
hook (#344 ) (83fd21e )
wrong validation error when relation field is marked @id instead of @unique (#395 ) (9a18af6 )
zenstack generate fails when path contains space (#845 ) (e99ad2c )
zod and openapi generation error when "fullTextSearch" is enabled (#658 ) (0cb7cd1 )
zod plugin issue with lower-case model names (#396 ) (d6fba93 )
zod schema compilation errors in pnpm environment due to peer dependencies (#568 ) (858b075 )
zod typing for DateTime
field, improve overall code generation (#363 ) (e93ca5b )
Performance Improvements
improve runtime performance by removing expensive verbose logging (#371 ) (0d7a2bf )
You can’t perform that action at this time.