Releases: RobinTail/zod-sockets
Releases · RobinTail/zod-sockets
v5.0.0
Version 5 is for Ociel
- Supported Node.js version:
^20.19.0 || ^22.12.0 || ^24.0.0
:- Pure ESM distribution: all these versions support
require(ESM)
syntax;
- Pure ESM distribution: all these versions support
- Supported Zod version:
^4.1.0
:- Imports may be changed from
zod/v4
to justzod
; - Dropped support of examples that are given as
example
property of.meta()
argument; - Dropped support of examples given within an object-based value of
examples
property of.meta()
argument;
- Imports may be changed from
- Dropped support for depicting
z.date()
without transformations:- Use either
z.iso.datetime().transform((str) => new Date(str))
for input schema, - Or
z.date().transform((date) => date.toISOString()).pipe(z.iso.datetime())
for output schema.
- Use either
- z.string().meta({ example: "test" });
- z.string().meta({ examples: { one: { value: "test" } } });
+ z.string().meta({ examples: ["test"] });
Full Changelog: v4.1.2...v5.0.0
v4.1.2
What's Changed
- Bump @types/node from 24.1.0 to 24.2.0 by @dependabot[bot] in #533
- Bump @types/ramda from 0.30.2 to 0.31.0 by @dependabot[bot] in #532
- Bump typescript-eslint from 8.38.0 to 8.39.0 by @dependabot[bot] in #531
- Bump zod from 4.0.10 to 4.0.14 by @dependabot[bot] in #534
Full Changelog: v4.1.1...v4.1.2
v4.1.1
v4.1.0
v4.0.1
Patch
- Compatibility adjustment for Zod 3.25.75 by @RobinTail in #518
Chores
- Upgrading all dependencies. by @RobinTail in #498
- dependabot in #495, #496, #494, #493, #497, #504, #503, #500, #501, #499, #507, #505, #508, #509, #506, #510, #514, #515, #516, #513, #512, #520, #519, #517, #518
Full Changelog: v4.0.0...v4.0.1
v4.0.0
Version 4 is for Sheila
- Switched to Zod 4:
- Minimum supported version: 3.25.56;
- All imports must be changed to "zod/v4";
- Read the Explanation of the versioning strategy;
- Changes to
Documentation
:- Generating Documentation is mostly delegated to Zod 4
z.toJSONSchema()
; - Zod Sockets implements some overrides and improvements to fit it into AsyncAPI 3.0.0 that extends JSON Schema;
- Feat: supporting circular/recursive schemas: https://zod.dev/api#recursive-objects;
- Generating Documentation is mostly delegated to Zod 4
- Changes to
Integration
:- The
optionalPropStyle
option removed fromIntegration
class constructor: - Use
.optional()
to add question mark to the object property as well asundefined
to its type; - Use
.or(z.undefined())
to addundefined
to the type of the object property; - See the reasoning;
- Properties assigned with
z.any()
orz.unknown()
schema are now typed as required:- Read the details here;
- Added types generation for
z.never()
,z.void()
andz.unknown()
schemas; - The fallback type for unsupported schemas and unclear transformations in response changed from
any
tounknown
; - Supporting
z.templateLiteral()
andz.nonoptional()
schemas;
- The
- Method
Action::example()
removed — use the.meta({ examples })
method of its schema; - Property
examples
removed from the argument ofcreateSimpleConfig()
andConfig::addNamespace()
:- use the
.meta({ examples })
method of the corresponding schema;
- use the
- The property
originalError
renamed tocause
forInputValidationError
andOutputValidationError
.
- import { z } from "zod";
+ import { z } from "zod/v4";
createSimpleConfig({
emission: {
event: {
- schema: z.tuple([z.string()]),
+ schema: z.tuple([z.string().meta({ examples: ["test"] })]),
},
},
- examples: {
- event: {
- payload: ["test"],
- },
- },
});
const action = actionsFactory
- .build({ input: z.tuple([z.string()]) })
+ .build({ input: z.tuple([z.string().meta({ examples: ["test"] })]) })
- .example("input", ["test"]);
v3.0.0
Version 3 is for Whispering Wind Bear Spirit
- Drop support for Node 18 (end of life);
- The deprecated
serializer
property on theIntegration
constructor argument removed.
Full Changelog: v2.3.0...v3.0.0
v2.3.0
Feature
- Supporting Node 24 #471
Chores
- Updating compatibility test by @RobinTail in #446
- Replacing unicorn plugin for node protocol constraints by @RobinTail in #414
- Fix
@asyncapi/cli
version in CI by @RobinTail in #438- Revert
@asyncapi/cli
after fix by @RobinTail in #439
- Revert
- Dependencies #362, #361, #363, #364, #367, #368, #366, #365, #374, #371, #369, #373, #372, #370, #378, #377, #376, #375, #379, #380, #381, #387, #385, #383, #386, #384, #382, #388, #391, #390, #389, #397, #396, #395, #393, #392, #394, #403, #402, #401, #400, #399, #398, #413, #408, #410, #412, #409, #411, #406, #405, #404, #420, #421, #422, #419, #418, #416, #415, #417, #423, #427, #426, #425, #424, #428, #430, #433, #434, #432, #431, #429, #435, #436, #443, #442, #441, #440, #444, #445, #447, #448, #449, #451, #452, #453, #454, #456, #455, #457, #458, #459, #460, #461, #463, #469, #468, #466, #465, #464
Full Changelog: v2.2.0...v2.3.0
v2.2.0
Changes
- Getting rid of serializer by @RobinTail in #360
Chores
- Bump typescript from 5.6.3 to 5.7.2 by @dependabot in #342
- Bump yaml from 2.6.0 to 2.6.1 by @dependabot in #341
- Bump typescript-eslint from 8.15.0 to 8.16.0 by @dependabot in #340
- Bump @types/node from 22.9.0 to 22.9.3 by @dependabot in #339
- Bump eslint-plugin-unicorn from 56.0.0 to 56.0.1 by @dependabot in #338
- Using Typescript-ESlint config helper by @RobinTail in #343
- Bump @types/node from 22.9.3 to 22.10.0 by @dependabot in #346
- Bump prettier from 3.3.3 to 3.4.1 by @dependabot in #345
- Bump the vitest group with 2 updates by @dependabot in #344
- Bump eslint from 9.15.0 to 9.16.0 by @dependabot in #350
- Bump @types/node from 22.10.0 to 22.10.1 by @dependabot in #349
- Bump typescript-eslint from 8.16.0 to 8.17.0 by @dependabot in #348
- Upgrading vitest while preserving Vite 6 by @dependabot in #347
- Bump typescript-eslint from 8.17.0 to 8.18.0 by @dependabot in #353
- Bump @arethetypeswrong/cli from 0.17.0 to 0.17.1 by @dependabot in #352
- Bump prettier from 3.4.1 to 3.4.2 by @dependabot in #351
- Bump nanoid from 3.3.7 to 3.3.8 by @dependabot in #354
- Bump typescript-eslint from 8.18.0 to 8.18.1 by @dependabot in #358
- Bump ansis from 3.3.2 to 3.4.0 by @dependabot in #357
- Bump @types/node from 22.10.1 to 22.10.2 by @dependabot in #356
- Bump eslint from 9.16.0 to 9.17.0 by @dependabot in #355
- Bump zod from 3.23.8 to 3.24.1 by @dependabot in #359
Full Changelog: v2.1.1...v2.2.0
v2.1.1
Fix
- Removing redundant
event
argument inAction::execute()
by @RobinTail in #252
Chores
- Upgrading all dependencies by @RobinTail in #253
- Replacing ESLint
import-x
plugin withallowed-dependencies
by @RobinTail in #256 - Testing compatibility with express 5 and express-zod-api 20.14 by @RobinTail in #297
- Upgrading all dependencies. by @RobinTail in #308
- Adjusting tests by @RobinTail in #333
- Compatibility with Express Zod API v21 by @RobinTail in #334
Full Changelog: v2.1.0...v2.1.1