Skip to content

Releases: zenstackhq/zenstack

ZenStack Release v2.7.4

25 Oct 21:22
df9b0ff
Compare
Choose a tag to compare

What's Changed

Welcome @AmruthPillai as our new contributor ❤️ !

Full Changelog: v2.7.3...v2.7.4

ZenStack Release v2.7.3

22 Oct 18:49
bb5f290
Compare
Choose a tag to compare

What's Changed

  • Include relationships in RESTful API handler results from creates and updates by @thomassnielsen

Full Changelog: v2.7.2...v2.7.3

ZenStack Release v2.7.2

21 Oct 17:14
dbe6bb9
Compare
Choose a tag to compare

What's Changed

  • URL-decode entity IDs in RESTful API handler to deal with ID values that include reserved characters by @thomassnielsen
  • Fixed missing ZModel type checking errors when @relation is used without fields and references properties

Full Changelog: v2.7.1...v2.7.2

ZenStack Release v2.7.1

19 Oct 04:47
5db1a2c
Compare
Choose a tag to compare

What's Changed

Full Changelog: v2.7.0...v2.7.1

ZenStack Release v2.7.0

16 Oct 22:10
4e80c29
Compare
Choose a tag to compare

New Features

Fixes and Improvements

  • Fixed generated code compilation errors when Prisma is set to output to a custom relative output path #1743
  • Removed createManyAndReturn field from "create" payload of polymorphic models to avoid confusion #1738
  • TanStack-Query/SWR hooks optimistic update now supports "upsert" operation #1767 doc
  • Added support to use auth() function inside policy filter functions (has, contains, etc.)
  • Fixed the problem that TanStack-Query optimistic update interfering with queries not managed by ZenStack #1774
  • Added support for boolean fields with default values in generated Zod schemas by @Arkanii
  • Generated OpenAPI spec now has all attributes as non-optional for RESTful flavor since all fields are returned #1744 by @thomassnielsen
  • Fixed polymorphic model query issues when fields are inherited from an indirect abstract ancestor #1770
  • Fixed IDE type-checking issue when importing a zmodel file from an npm package #1760
  • Bumped Prisma peer dependency version to 5.21.x

New Contributors

Welcome @svetch @thomassnielsen @Arkanii as our new contributors! ❤️

Full Changelog: v2.6.2...v2.7.0

ZenStack Release v2.6.2

27 Sep 22:28
be8c1c4
Compare
Choose a tag to compare

What's Changed

  • Upgraded Prisma peer dependency to allow 5.20.x
  • Fixed the issue that when zod plugin runs in "strip" mode, mutation payload can be accidentally truncated due to union ambiguity #1746

Full Changelog: v2.6.1...v2.6.2

ZenStack Release v2.6.1

23 Sep 18:48
6f30022
Compare
Choose a tag to compare

What's Changed

  • Fixed an issue that the policy filters/field-selections generated into polymorphic read are not always wrapped into correct relation layer #1734

Full Changelog: v2.6.0...v2.6.1

ZenStack Release v2.6.0

23 Sep 06:05
cb2e423
Compare
Choose a tag to compare

Security Fixes

This release fixed an important security issue related to polymorphic models.

Background

In a polymorphic model hierarchy, both the base and concrete models inherited from it can have access policies. When reading entities with a base model type, the corresponding concrete model fields are also fetched and returned. However, in this case, the access policies directly defined on the concrete models were not properly enforced in the previous releases, resulting in returning concrete model fields when they should have been excluded. This also happens to fields marked @omit on the concrete models.

The issue only happened when you read with a polymorphic base model (marked with @@delegate). When reading directly with a concrete model type, policies were correctly enforced.

This release fixed the issue. If a concrete model is not readable, its fields are not included, and only the base model's fields are returned. It's recommended that you upgrade ASAP if you're using the polymorphic models feature.

A big THANK YOU 🙏 to @svetch for reporting this issue!

New Features

  • Added a new option to "@core/zod" plugin to specify if the generated schemas should reject, strip, or passthrough fields not recognized #1696 Doc

    Example:

    plugin zod {
        provider = "@core/zod"
        mode = "strip"
    }

Fixes and Improvements

  • Fixed the issue that in certain cases concrete model fields are not returned in a polymorphic read #1698
  • Fixed ZModel type checker issue that fields from abstract base model cannot be accessed from future(). or this. #1695 #1713
  • Fix zod compilation issue when a @@delegate field has a default value #1693
  • Fixed the issue that using auth() in @default() is not effective for createMany and createManyAndReturn #1681
  • TRPC plugin now generates procedures that better conform to PrismaClient's typing: APIs like findMany, count, etc. now has optional parameter type #1707

Full Changelog: v2.5.1...v2.6.0

ZenStack Release v2.5.1

07 Sep 16:40
61b32cb
Compare
Choose a tag to compare

Fixed an unintended change that resulted in a "backLink" field change in model metadata for abstract models. Although I haven't observed any adverse behavior related to it, it's good to upgrade if you're already on v2.5.0.

ZenStack Release v2.5.0

07 Sep 01:51
8297c03
Compare
Choose a tag to compare

New Features

  • TRPC v11 support (preview) docs
  • Prisma Pulse support (preview) docs
  • New zenstack check CLI command for checking ZModel file for errors docs
  • The zenstack generate CLI command now allows you to include/exclude specific plugins. You can use it to exclude plugins like tanstack-query hooks generation during CI docs
  • Updated Prisma peer dependencies to 5.19.x

Security Fixes

  • Fixed the issue that "connect" operation can circumvent "update" policy check for foreign key fields when the operation is initiated from a polymorphic model #1674

    Special thanks to @eqqe for reporting this issue! The background is: when you use the "connect" operator to establish relations between entities, you need to have "update" permission on the entity that gets a foreign key update due to the "connect". However, this permission was not properly checked if the update is initiated from a polymorphic model in previous releases.

Fixes and Improvements

  • The @@validate data validation attribute is added with a new "path" parameter to indicate the path of the field that caused the error. Thanks @j0rdanba1n for proposing and implementing this! docs
  • Fixed inconsistent filtering/stripping behavior for field-level policies when findMany and count APIs #1644
  • Fixed the issue that polymorphic entities returned in a nested read don't contain fields from base #1645
  • Fixed the check() attribute function's compatibility with post-update policies #1642
  • Fixed post-update policy validation issue with deeply nested field access #1648
  • Replaced "decimal.js" dependency with the more lightweight "decimal.js-light" in @zenstackhq/runtime #1571
  • Fixed incorrect OpenAPI spec generated for the Meta section #1549
  • Fixed the code generation compilation errors when @core/enhance plugin is configured with a custom output directory #1667
  • Fixed @zenstackhq/runtime's compatibility issue with CloudFlare Workers. Please make sure you import enhance from @zenstackhq/runtime/edge when using edge runtime #1672.

New Contributors

Full Changelog: v2.4.1...v2.5.0