Skip to content

Releases: zenstackhq/zenstack

ZenStack Release v2.4.1

07 Aug 02:47
61e07d0
Compare
Choose a tag to compare

Fixes and Improvements

  • Prisma 5.18.0 support

ZenStack Release v2.4.0

06 Aug 04:51
b054f9f
Compare
Choose a tag to compare

Security Fixes

  • Added more reduction to the generated Prisma queries to workaround a Prisma bug (prisma/prisma#21856) that can potentially breach access control #1627

    The background is ZenStack internally uses { AND: [] } to represent constant true and { OR: [] } for constant false. However, Prisma provides inconsistent query results in certain nesting combinations. The fix introduced more query reduction logic to avoid generating such combinations.

    It's recommended that you upgrade ASAP after thorough testing.

Fixes and Improvements

  • RedwoodJS package "@zenstackhq/redwood" now supports Redwood V7 #1553. Special thanks to @ladderschool for identifying the related breaking changes!
  • REST-flavor API: support comma-separated multiple filter values #1573
  • Fixed false-positive validation errors when using polymorphic models with tRPC #1608
  • Fixed Zod schema compilation errors when outputting to a custom directory #1610
  • Fixed "@zenstackhq/swr" plugin build issues which can cause typescript typing errors with certain tsconfig settings
  • Consistently throw Prisma error types #1596
  • Removed createMany from input arg's typing for delegate models to avoid confusion #1577
  • Fixed an excessively strict Zod schema causing rejection during update #1563
  • Fixed the issue that explicitly providing a "@core/enhancer" plugin in ZModel causes data validation to be muted #1562
  • Fixed Prisma schema generation errors when @map is used on a foreign key field #1551
  • Fixed Prisma schema generation errors when very long model names are used

Full Changelog: v2.3.3...v2.4.0

Thanks to @irvinzz for helping with this release!

ZenStack Release v2.3.3

19 Jul 23:15
bf2acfd
Compare
Choose a tag to compare

What's Changed

  • Update Prisma dependencies to 5.17.x

Full Changelog: v2.3.2...v2.3.3

ZenStack Release v2.3.2

15 Jul 04:08
085bb52
Compare
Choose a tag to compare

What's Changed

  • Update superjson dependency

Full Changelog: v2.3.1...v2.3.2

ZenStack Release v2.3.1

15 Jul 03:14
5034fdc
Compare
Choose a tag to compare

What's Changed

  • Fixed incorrect prisma query executed when count uses a where filter involving a polymorphic base field #1585
  • Fixed over-strict typing generated for auth() access #1589
  • Fixed compatibility issue between createManyAndReturn and polymorphism #1576
  • Fixed the issue that field-level override rules don't work with non-optional to-one relations #1574

Full Changelog: v2.3.0...v2.3.1

ZenStack Release v2.3.0

12 Jul 17:43
e40779e
Compare
Choose a tag to compare

New Features

  • The new check() policy function that allows you to delegate a models' permission checking to its relations. #276

    model Todo {
        ...
        list List @relation(fields: [listId], references: [id])
    
        // if the parent list is readable, grant full access to this Todo entity
        @@allow('all', check(list, 'read'))
    }

    You can use this feature to remove duplicated policy rules and keep the schema DRY. See a full guide here.

  • Prisma 5.16.x is now supported. The new Prisma version introduced a typing breaking change. An adaptation is added in this version of ZenStack.

Documentation

Fixes and Improvements

  • Runtime error with disconnecting a self-relation #1530
  • Incorrect query result when using Prisma.DbNull to filter JSON fields #1533
  • Fixed the issue that using @length on a @password field checks the length of hash password rather than the original value #1502
  • Typing conflict with Prisma client extension (with polymorphism or auth() in @default() is used) #1493
  • IDE formatting issue when Unsupported type is used #1517
  • Runtime error when creating a polymorphic model that inherits from an abstract model #1560
  • Set timeout for checking newer versions when running CLI to avoid hangs under unstable network #1529
  • Typing issue in generated hooks for vue-query #1564
  • Excluded create and upsert for delegate models from generated hooks and trpc routers, as they cannot be directly created.
  • When generation @relation for delegate models, user-provided relation name should be used if it exists #1575 by @irvinzz
  • SWR is now added as a peer dependency of @zenstackhq/swr plugin.
  • The ZenStack monorepo has enabled corepack to enforce a consistent version of pnpm.

New Contributors

Thanks to @jasonmacdonald @benjamintd @irvinzz @mentorkadriu for contributing to this release! ❤️

Full Changelog: v2.2.4...v2.3.0

ZenStack Release v2.2.4

20 Jun 12:13
b06cee6
Compare
Choose a tag to compare

What's Changed

This release contains several fixes related to polymorphic models.

  • When a concrete model is created with an explicit id field, make sure the field is pushed down to the base model's payload#1518
  • Make sure concrete model's fields are included when its included from a deeply nested context #1522
  • Convert polymorphic model's createMany payload into regular create #1520

Full Changelog: v2.2.3...v2.2.4

ZenStack Release v2.2.3

14 Jun 15:23
0fa292c
Compare
Choose a tag to compare

What's Changed

  • Fixed an incorrect validation error when checking for cross-model field comprisons.

Full Changelog: v2.2.2...v2.2.3

ZenStack Release v2.2.2

14 Jun 14:20
a2d3377
Compare
Choose a tag to compare

What's Changed

  • Fixed incorrect identification of cross-model field comparison that hindered performance #1506 #1507.
  • Improved validation of cross-model field comparison.
  • Fixed the regression that when a field-level policy has no @allow rule, the access is always denied #1501

Full Changelog: v2.2.1...v2.2.2

ZenStack Release v2.2.1

11 Jun 02:52
28eca18
Compare
Choose a tag to compare

What's Changed

  • Fixed a typing issue with TanStack vue-query infinite queries.

Full Changelog: v2.2.0...v2.2.1