ZigBase 0.7.1
·
893 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Features
- TypeScript client codegen now emits precise typed I/O for custom auth methods. Enable a custom method in the new struct form —
.custom = &.{ .{ .slug = "corp-sso", .Initiate = .{ .Input = …, .Output = … }, .Complete = .{ .Input = …, .Output = … } } }— andzig build gen-clientreflects the declared Zig types intozb.auth.<col>.<method>.{initiate,complete}interfaces (named by the Zig type, like the typedzb.rpc.*route surface). AvoidInput omits the input argument; avoidOutput maps toPromise<void>. Bare-string slugs (.custom = .{"slug"}) stay fully back-compatible and untyped. Typed customs are a build-time feature (the runtime-introspection typegen tier keeps them untyped, exactly like typed routes).
Fixes
- Exported
zigbase.Tx— the transaction scope passed to actx.tx(T, fn(*Tx) ...)callback. It was referenced in the docs but never re-exported from the public API, so consumers could not name the callback's parameter type. - The comptime per-auth-method
.rate_limit = .{ .custom = .{ .max = …, .window_s = … } }config form now compiles (it previously failed with a@tagName-on-a-struct error; only the.default/.offenum-literal forms worked). - The TypeScript client generator (
zig build gen-client) no longer hits the comptime branch-quota limit on apps with larger custom-route tables.
Internal
- golfsim example: added demos for per-device session management (
.session_store = .table+ctx.auth().revokeAllSessions/listActiveSessions/revoke), an atomic hold→booking convert viactx.tx(), a best-effort booking-confirmation webhook viactx.http(), and KV write-side seeding fromonBootstrap. Added a deterministic e2e suite that freezes time withZIGBASE_FAKE_NOWand captures the outbound webhook. Fixed a latent date-formatting bug in golfsim'sisoFromEpoch(signed-integer{d:0>N}emitted a+sign, breaking hold creation). - plugins example: demonstrates the comptime
.rate_limit = .{ .custom = … }per-method config, and documents field-key rotation (ZIGBASE_FIELD_KEY_V<n>+zigbase rewrap) in its README.