refactor: enhance resource schema validation with comprehensive Zod types#151
Merged
Conversation
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.0.25-pr.151.d222362Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.0.25-pr.151.d222362"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.0.25-pr.151.d222362"
}
}
Preview published to npm registry — try new features instantly! |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
kfirstri
reviewed
Jan 29, 2026
| "@rollup/rollup-linux-x64-gnu": "^4.56.0" | ||
| } | ||
| }, | ||
| "packageManager": "yarn@4.12.0+sha256.1fe4e1193cbcd13a48d8f436bb17d3c672b049a5e32a758aab9866a073db1702" |
kfirstri
reviewed
Jan 29, 2026
Collaborator
There was a problem hiding this comment.
lets remove some of the huge commends, and also we don't need to export everything since it's not used progrematically.
| * Field-level RLS - controls which fields users can access within records | ||
| * Only allows: read, write, create, update, delete | ||
| */ | ||
| const FieldRLSSchema = z.strictObject({ |
Contributor
There was a problem hiding this comment.
this is verified against the apper codebase?
I remember only read and write being supported in FLS, might be wrong
kfirstri
reviewed
Jan 29, 2026
| /** | ||
| * Property definition - recursive structure for field definitions | ||
| */ | ||
| type PropertyDefinitionType = { |
Collaborator
There was a problem hiding this comment.
we can infer types, no need to write them twice
3cc8947 to
8d2b047
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds comprehensive Zod schema validation for Entity, Agent, and Function resources to align with backend requirements. The changes enforce strict validation for row-level security (RLS) conditions with recursive schemas, tool configurations for agents, nested property definitions for entities, and improved function schema validation. Error handling has been enhanced to include resource file paths when validation fails, making debugging easier.
Related Issue
None
Type of Change
Changes Made
modelfield and deprecated emptytriggersfield, strengthened name validation to prevent dots, addedFunctionDeploySchemafor deployment validation, and improved error messages for entry points and file arrayssafeParse()and include resource file paths in validation error messagestask.jsonentity to use correctpropertiesstructure instead of deprecatedfieldsformatTesting
npm test)Checklist
Additional Notes
These schema changes enforce stricter validation matching backend expectations. Key improvements include:
Breaking Changes: Existing projects must update their configurations:
type: "object"andpropertiesstructure (notfields)descriptionandinstructionsfields🤖 Generated by Claude | 2026-01-31 09:45 UTC