Skip to content

Releases: TheAppleFreak/moleculer-zod-validator

v3.3.1

22 Jun 08:33
Compare
Choose a tag to compare

Minor documentation update

v3.3.0

22 Jun 08:13
e340db3
Compare
Choose a tag to compare
  • Added the .return propertyy to ZodParams. This is a utility to store return types that can be used for typing action calls elsewhere.
  • Updated dev dependencies

v3.2.0

02 May 11:31
f8afb7d
Compare
Choose a tag to compare
  • Added support for the .refine and .superRefine methods. These add additional flexibility for validation. This closes #7.
  • Added new unit tests for both methods

v3.1.0

21 Apr 06:43
fd68d7a
Compare
Choose a tag to compare

Type inference now works (mostly) as expected! While the runtime behavior of the package worked as expected during work on 3.0.0 and was what I had been testing, I somehow was completely unaware that type inference was completely broken. It's a bit embarrassing for me, to be honest. It took more energy than I had anticipated to make it work, but type inferences now behave when using typeof .call and typeof .context almost exactly as they do in Zod with z.input<typeof validator> and z.infer<typeof validator>/z.output<typeof validator>. This closes Issues #2 and #5 in the process.

I do say almost, as there is an important note that is worth mentioning. There's a known upstream bug in Zod where using .catchall() results in bugged TypeScript type inference. While I could have left that behavior in ZodParams for parity with Zod, the sudden introduction of that behavior could break builds (it already broke one of our tests, through no fault of my own), so for the time being I've disabled catchall type inference in ZodParams. When the bug is fixed upstream, I'll reenable that behavior here.

Beyond all of this, there should be no other changes and everything should Just Work™ as expected.

v3.0.1

14 Apr 04:16
3253441
Compare
Choose a tag to compare

Rerelease to hopefully get the readme showing up on NPM as it should. No changes have been made from v3.0.0.

  • BREAKING CHANGE - The minimum compatible Node.js version is now Node.js v17.0.0. This is due to the requirement of the structuredClone function in the fastest-validator fallback (described below), which in Node.js is only available in v17.0.0 and above.
  • Added support for passing in fastest-validator schemas. This is required because the $node internal services built into Moleculer assume that fastest-validator is the current validator, which poses a problem given as moleculer-zod-validator had no idea what to do with those schemas. By checking for the existence of property in the Zod schema that is not used in fastest-validator, this can now automatically switch into a failsafe that uses fastest-validator instead.

v3.0.0

14 Apr 03:58
411043c
Compare
Choose a tag to compare
  • BREAKING CHANGE - The minimum compatible Node.js version is now Node.js v17.0.0. This is due to the requirement of the structuredClone function in the fastest-validator fallback (described below), which in Node.js is only available in v17.0.0 and above.
  • Added support for passing in fastest-validator schemas. This is required because the $node internal services built into Moleculer assume that fastest-validator is the current validator, which poses a problem given as moleculer-zod-validator had no idea what to do with those schemas. By checking for the existence of property in the Zod schema that is not used in fastest-validator, this can now automatically switch into a failsafe that uses fastest-validator instead.

v2.0.0

24 Jan 14:10
fc58cfb
Compare
Choose a tag to compare

Added support for parameter transformations! Read the docs for more information on it. Please note this is a breaking change.

v1.0.2 - listen I swear I know how to code

17 Jan 07:15
14448d2
Compare
Choose a tag to compare

protip for any aspiring typescript devs out there: when you're publishing, remember to include your build output in the tarball you publish

v1.0.1

17 Jan 07:07
Compare
Choose a tag to compare

Turns out publishing a tarball with no build files included is a bad idea. Who knew?

v1.0.0

17 Jan 06:44
058435d
Compare
Choose a tag to compare

Initial release