Releases: 0xPolygon/apps-team-packages
Release list
@polygonlabs/zod-to-openapi-heyapi@3.0.0
Major Changes
-
#86
34f408dThanks @MaximusHaximus! - Generated clients'TransportErrorandResponseValidationErrornow extend@polygonlabs/verror'sVErrorinstead of the bareErrorglobal, so consumers getVError.info(),serializeError(), and cause-chain helpers for free on wrapper-emitted errors.Breaking change
Install the new required runtime peer dependency, then regenerate your client:
pnpm add @polygonlabs/verror
Behaviour changes
.messagenow includes the accumulated cause message. The as-constructed message alone is available as.shortMessage.ResponseValidationError.bodyis now a getter backed byVError'sinfobag —error.bodystill reads the same way, andVError.info(error).body/serializeError(error)now see it too.isTransportError,isResponseValidationError,isWrapperError, and their marker symbols are unchanged — existing narrowing code keeps working.
@polygonlabs/zod-to-openapi-heyapi@2.1.0
Minor Changes
-
#83
340bdb2Thanks @MaximusHaximus! -schemasFromnow resolves from the consumer's perspective —'#schemas'aliases workThe codegen-time audit used to dynamic-import
schemasFromwith the plugin's own install location as the resolution referrer, so a consumer'spackage.json#importsalias ('#schemas') could never resolve — the documented same-package recipe failed for every real installation, while bare package names worked only via the package manager's store layout. The audit now anchors resolution at the codegen output directory — the exact location the generated client's emittedimport { Name } from '<schemasFrom>'statements resolve from — so audit-time and consumer-runtime resolution are identical by construction, includingimportsaliases with their conditions,exportsmaps, and the running process's--conditionsflags.'#schemas'is the canonicalschemasFromfor schemas living in the same package as the codegen: declare the alias underimportsand point it at the schema barrel. No packagename,exportsentry, or self-dependency is needed.- If you adopted the
"<name>": "link:."self-dependency workaround from the 2.0.4 docs: remove the self-link (and theexportsentry, if nothing else consumes it) and switchschemasFromto a#alias. - Package specifiers (
@org/pkg,@org/pkg/zod) for separate schemas packages are unchanged. - Relative paths are now rejected with guidance instead of being undefined behavior: the emitted import must resolve identically from anywhere in the consumer package, which only aliases and package names do.
registryPlugin(the advanced API) gains an optionaloutputDiroption;defineRegistryClientConfigwires it automatically fromoutput.
@polygonlabs/zod-to-openapi-heyapi@2.0.4
Patch Changes
-
#81
c514a10Thanks @MaximusHaximus! - Report 2xx bodies that fail response validation asResponseValidationErrorinstead ofTransportErrorFixed
- A success (2xx) response body that failed
parseAsyncagainst the registered response schema surfaced as aTransportError— the response transformer'sZodErrorwas intercepted by the SDK wrapper's genericinstanceof Errortransport branch, so the single most important thing the codec client detects (a producer's contract drift on a success body) was reported as a network failure. It now surfaces as aResponseValidationErrorcarrying the parse issues (cause) and the offending post-JSON.parsebody (body), in boththrowOnErrormodes and for every wrapper flavour — full error-decoding wrappers, input-only wrappers, and pass-through ops.
Docs
schemasFrom: '#schemas'(apackage.json#importsalias) was documented but has never worked: Node resolves#aliases against the package containing the importing module, and the plugin dynamic-importsschemasFromfrom its own install location, where the consumer's alias is not defined. The README, option JSDoc, and the codegen-time error hint now describe the working pattern for schemas living inside the codegen package — give the package aname+exportsentry, self-link it ("<name>": "link:."in devDependencies), and pass the package's own name.
- A success (2xx) response body that failed
@polygonlabs/zod-codecs@1.2.0
Minor Changes
-
#81
d46e7d4Thanks @MaximusHaximus! - AddSafeIntegerCodec— wire integer string ↔ runtimenumberFor string-transported integers that fit a plain JS
number— query and path parameters (chain ids, page numbers, limits, counts) always arrive as strings, and the runtime wants anumber. Decoding rejects values outside the safe-integer range, so an oversized digit string fails loudly instead of silently rounding.This is the sanctioned replacement for
z.coerce.number()in registry contracts: in zod v4 a coercing schema's input type isunknown, so the generated OpenAPI documents the parameter as optional and nullable regardless of intent. The codec declares both the wire and runtime sides honestly. For range-constrained parameters, roll a local codec with a constrained output schema (example in the codec's JSDoc).
@polygonlabs/openapi-registry@3.0.0
Major Changes
-
#81
9edc162Thanks @MaximusHaximus! -registerPathnow rejects coercing schemas (z.coerce.*) in parameter positionsBreaking change
TypedRegistry.registerPaththrows at generate time whenrequest.params,request.query, orrequest.headerscontains a coercing schema (z.coerce.number(),z.coerce.date(), …), including when wrapped in.optional()/.default()/.nullable().Why: in zod v4 a coercing schema's input type is
unknown, so the generated OpenAPI marks the parameterrequired: false, nullable: trueregardless of the author's intent — a required parameter silently documents as optional-and-nullable, and every codegen consumer inherits the misdocumented contract. The audit turns that silent corruption into a loud error on the engineer's machine, in the same spirit as the sealed shared-registry conflict check.Migration
- Parameter converted by the server binding: declare the logical type plainly —
z.coerce.number().int()→z.number().int(). - Wire string with a different runtime type: use a codec that declares both sides — e.g.
Int64Codec/IsoDateCodecfrom@polygonlabs/zod-codecs. Codecs (z.codec(...)) are unaffected by the audit. - Request bodies are not audited — JSON bodies carry typed values on the wire.
The check is also exported directly as
assertNoCoercingParamSchemasfor use outsideTypedRegistry. - Parameter converted by the server binding: declare the logical type plainly —
Minor Changes
-
#81
0fcf6b3Thanks @MaximusHaximus! - Make the auto-injected standard error responses configurable per registrynew TypedRegistry({ standardErrorResponses })now controls the framework-emitted error responses injected into everyregisterPathcall:false— inject nothing; every route documents exactly the responses it declares.{ serverError?, validationError?, notAuthenticated? }— override the schema for individual slots; omitted slots keep their defaults.- Omitted — unchanged default behaviour.
The default shapes document
@polygonlabs/express's error middleware, which is correct for services using it but wrong for any other producer: a spec authored with this registry for a non-Express backend would otherwise advertise 500/400/401 shapes its server never emits, and the injectedErrorResponsecomponent name can collide with the service's own same-named schema of a different shape. The injection rules (when a 400/401/500 is added) are unchanged — only the shapes are configurable.The option is mirrored at the type level: the
Opsaccumulator reports the configured schema types (or omits the slots entirely underfalse), soOperationsOfconsumers and codegen'd clients see the shapes the runtime registry actually holds.inferStandardErrorResponsesaccepts the same options as an optional second argument; existing single-argument calls are unaffected.
@polygonlabs/express@5.0.0
@polygonlabs/sync-github-releases@1.0.5
Patch Changes
-
#79
fbc9df6Thanks @MaximusHaximus! - Fixed a silent no-op when a target repo pins a different pnpm version than the
one running the tool. Package discovery shells out topnpm m lsinside the
clone; if that repo'spackageManagerfield names a version other than the
active pnpm, pnpm refuses to run at all. The failure was swallowed, so the run
reporteddiscovered 0 package(s),skip: no changelog matchfor every
release, anderrors=0— indistinguishable from a repo that genuinely had
nothing to sync.Enumeration now retries once with the package-manager version check waived. The
retry is a fallback rather than the default path, because the flag that waives
the check postdates pnpm 10 and passing it up front would break enumeration for
anyone on an older pnpm.When enumeration still fails and the repo does have a root
package.json, the
run now says so explicitly instead of reporting a clean pass. Repos with no root
package.jsonhave nothing to enumerate and stay quiet as before.
@polygonlabs/zod-to-openapi-heyapi@2.0.3
Patch Changes
-
#75
17845a2Thanks @MaximusHaximus! - Raise the minimum supported@hey-api/openapi-tsto 0.97.3, which resolves a security advisory affecting earlier releases.The
@hey-api/openapi-tspeer dependency floor is now>=0.97.3(previously>=0.95.0). Update your@hey-api/openapi-tsdependency to 0.97.3 or later and regenerate your clients — the bundled runtime templates (client.gen.tsand friends) change between these versions.
@polygonlabs/zod-to-openapi-heyapi@2.0.2
Patch Changes
-
#73
006cf08Thanks @MaximusHaximus! - Ship the LICENSE file inside the published npm packageThe previous release added the Apache-2.0 license at the repo root and
declared it in package.json, but npm only auto-includes a LICENSE file
in the packed tarball when it lives in the same directory as the
package's own package.json. The license metadata was correct but the
actual license text was missing from the published package — this adds
it.
@polygonlabs/zod-to-openapi-heyapi@2.0.1
Patch Changes
- #71
aa81b1aThanks @MaximusHaximus! - Add Apache-2.0 license: the package now declares"license": "Apache-2.0"in itspackage.json, and the repository carries the full Apache License 2.0 text. Previously no license was declared.