Releases: zenstackhq/zenstack
ZenStack Release v2.12.1
What's Changed
- Intercepting Prisma client extension's
$parent
property and return enhanced PrismaClient by @Gabrola - Fixed the issue that installing Prisma client extensions causes losing some ZenStack enhancements #2014 by @Gabrola
- Refixed #1997 about injecting default foreign key values in nested creates
Full Changelog: v2.12.0...v2.12.1
ZenStack Release v2.12.0
What's Changed
- Prisma 6.4 support
- A new type helper
Enhanced
is added to infer the ZenStack-enhanced PrismaClient typing doc - [json type] Fixed incorrect incorrect typing of mutation payload #1991
- [delegate] Fixed unique constraint name conflict issue in generated Prisma schema #1992 by @diesal11
- [policy] Fixed the issue that foreign key with default value is incorrectly set in a nested create context #1997 by @Gabrola
- [zod] Clean up Zod schemas to exclude auxiliary fields generated for polymorphic models #1993
- [delegate] Fixed error when executing
updateMany
on polymorphic models #1998 - [zmodel] Validate regex correctness in ZModel
- [password] Fixed the false validation error when
@password
and@@validate
are used on the same model #2000 - [policy] Fixed the false policy rejection involving field-level policies and nested updated #2007
New Contributors
Welcome @diesal11 and @Gabrola as our new contributors ❤️!
Full Changelog: v2.11.6...v2.12.0
ZenStack Release v2.11.6
What's Changed
- Improving query performance by only selecting fields for evaluating field-level policies only if the corresponding field is selected #1978
Full Changelog: v2.11.5...v2.11.6
ZenStack Release v2.11.5
ZenStack Release v2.11.4
ZenStack Release v2.11.3
What's Changed
- Support for Prisma 6.2's new updateManyAndReturn
- When a field has a default value involving
auth()
, a dummy default value is generated in the logical prisma schema to indicate the field doesn't require a value during create
Full Changelog: v2.11.2...v2.11.3
ZenStack Release v2.11.2
What's Changed
- Fixed the issue that
createManyAndReturn
throws an error when model contains array fields #1955
Full Changelog: v2.11.1...v2.11.2
ZenStack Release v2.11.1
What's Changed
- Updated max supported Prisma version to 6.2.x
- Added the new ulid() attribute function
NOTE:
Prisma 6.2 added a new updateManyAndReturn
API to PrismaClient. This API is not supported by ZenStack-enhanced PrismaClient yet. We'll complete the adaptation and testing soon.
Full Changelog: v2.11.0...v2.11.1
ZenStack Release v2.11.0
🥳 Happy New Year 🥳
Wish you all enjoyed the holidays and are having a great start of 2025!
New Features
-
Field encryption 🔑
Thanks @genu for implementing this much-desired (preview) feature! This feature allows you to mark fields with the
@encrypted
attribute and create an enhanced PrismaClient that transparently encrypt/decrypt the field values. See how to use it here. -
New attribute functions for access policies:
- currentModel(): return the name of the model for which the policy rule is defined.
- currentOperation(): return the operation for which the policy rule is defined for.
These functions are handy for implementing fine-grained RBAC where users are assigned permissions for specific resources and operations. E.g.:
model Resource { ... owner User @relation(...) @@allow('all', owner.roles?[ permissions?[resource == currentModel() && action == currentOperation() ]]) }
Fixes and Improvements
- [openapi] generate "id" field type according to its declared type in ZModel #1908
- [zmodel] check for cyclic model inheritance and report errors
- [delegate] fixed incorrect injection when
check()
function is used with delegate models #1930 - [delegate] fixed errors when selecting "_count" of relation fields defined in delegate base models #1467
- [rest-api] return an empty object response with status 200 for "DELETE" route #1668
- [delegate] don't inherit
@@schema
attribute from base if the attribute is already defined in a sub model #1647
Full Changelog: v2.10.2...v2.11.0