Skip to content

Releases: RobinTail/zod-sockets

v5.0.0

29 Aug 12:26
83ec4bd
Compare
Choose a tag to compare

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;
  • Supported Zod version: ^4.1.0:
    • Imports may be changed from zod/v4 to just zod;
    • 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;
  • 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.
- 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

05 Aug 04:31
Compare
Choose a tag to compare

What's Changed

Full Changelog: v4.1.1...v4.1.2

v4.1.1

28 Jul 10:53
Compare
Choose a tag to compare

Fix

  • Readme update regarding new way to set examples

Chores

Full Changelog: v4.1.0...v4.1.1

v4.1.0

21 Jul 04:41
Compare
Choose a tag to compare

Feat

  • Supporting zod@^4.0.5:
    • Imports may be changed from zod/v4 to just zod;

Chores

Full Changelog: v4.0.1...v4.1.0

v4.0.1

08 Jul 08:21
Compare
Choose a tag to compare

Patch

Chores

Full Changelog: v4.0.0...v4.0.1

v4.0.0

09 Jun 13:04
b95c77a
Compare
Choose a tag to compare

Version 4 is for Sheila

  • Switched to Zod 4:
  • 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;
  • Changes to Integration:
    • The optionalPropStyle option removed from Integration class constructor:
    • Use .optional() to add question mark to the object property as well as undefined to its type;
    • Use .or(z.undefined()) to add undefined to the type of the object property;
    • See the reasoning;
    • Properties assigned with z.any() or z.unknown() schema are now typed as required:
    • Added types generation for z.never(), z.void() and z.unknown() schemas;
    • The fallback type for unsupported schemas and unclear transformations in response changed from any to unknown;
    • Supporting z.templateLiteral() and z.nonoptional() schemas;
  • Method Action::example() removed — use the .meta({ examples }) method of its schema;
  • Property examples removed from the argument of createSimpleConfig() and Config::addNamespace():
    • use the .meta({ examples }) method of the corresponding schema;
  • The property originalError renamed to cause for InputValidationError and OutputValidationError.
- 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

12 May 18:45
cd20d4f
Compare
Choose a tag to compare

Version 3 is for Whispering Wind Bear Spirit

  • Drop support for Node 18 (end of life);
  • The deprecated serializer property on the Integration constructor argument removed.

Full Changelog: v2.3.0...v3.0.0

v2.3.0

12 May 18:00
Compare
Choose a tag to compare

Feature

  • Supporting Node 24 #471

Chores

Full Changelog: v2.2.0...v2.3.0

v2.2.0

21 Dec 12:19
Compare
Choose a tag to compare

Changes

Chores

Full Changelog: v2.1.1...v2.2.0

v2.1.1

20 Nov 10:57
Compare
Choose a tag to compare

Fix

  • Removing redundant event argument in Action::execute() by @RobinTail in #252

Chores

Full Changelog: v2.1.0...v2.1.1