Open
Conversation
8593f52 to
410a94e
Compare
410a94e to
55c81fb
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.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
chanfana@3.3.0
Minor Changes
#316
d30cc36Thanks @G4brym! - Add customizable pagination and ordering parameter names to ListEndpoint viapageFieldName,perPageFieldName,orderByFieldName, andorderByDirectionFieldNameclass properties.Breaking change for subclasses overriding
optionFields:optionFieldsis now a computed getter derived from the four*FieldNameproperties. Subclasses that previously overrodeoptionFieldsdirectly should instead override the individual field name properties.#317
39c89d2Thanks @G4brym! - AddvalidateResponserouter option to validate and sanitize response bodies against their Zod schemas at runtime.When enabled, responses are parsed through
z.object().parseAsync(), which strips unknown fields and validates required fields/types. This prevents accidental data leaks (e.g., internal fields likepasswordHashreaching the client) and catches handler bugs where the response doesn't match the declared schema.Behavior:
200response schemaResponseobjects withapplication/jsoncontent are cloned, validated, and reconstructed with corrected headers500 Internal Server Error(code7013) and log the full error viaconsole.errorNew exports:
ResponseValidationException— thrown when a handler's response doesn't match its declared schema (status 500, code 7013,isVisible: false)#315
47d304aThanks @G4brym! - AddSerializerContextparameter to auto endpoint serializer function, providing access to filters and options for context-aware serialization.The serializer signature changes from
(obj: object) => objectto(obj: object, context?: SerializerContext) => object. TheSerializerContexttype contains:filters—Array<FilterCondition>: the active filter conditions for the current requestoptions— pagination and ordering options (page,per_page,order_by,order_by_direction)Context passed per endpoint type:
ListEndpoint/ReadEndpoint{ filters, options }UpdateEndpoint/DeleteEndpoint{ filters }CreateEndpoint{ filters: [] }New exports:
SerializerContext— type for the serializer's second parameterPatch Changes
662ff72Thanks @G4brym! - Include CHANGELOG.md in the npm package so AI agents and tools can read the project's change history. Also add a changelog page to the documentation site.