auth/signup_route_schema.ts

Hono-free wire schemas + route shape for POST /signup.

Split from signup_routes.ts (whose handler pulls hono/cookie via session_middleware to set the new session cookie) so cross-process test suites can build the signup route shape — and assert on the response shape — without dragging the in-process Hono session handler, and its optional hono peer, onto a backend-spawning consumer. signup_routes.ts imports these back and attaches the live handler; single source of truth for the wire shape.

view source

Declarations
#

4 declarations

create_signup_route_shape
#

auth/signup_route_schema.ts view source

(options: SignupRouteShapeOptions): Omit<RouteSpec, "handler"> import {create_signup_route_shape} from '@fuzdev/fuz_app/auth/signup_route_schema.js';

The POST /signup route shape minus its handler — pure hono-free data. create_signup_route_specs spreads this and attaches the live handler; cross-process surface builders spread it with a stub handler. Single source of truth — the shape can't drift between the live route and the surface.

options

returns

Omit<RouteSpec, "handler">

SignupInput
#

auth/signup_route_schema.ts view source

ZodObject<{ username: ZodPipe<ZodString, ZodTransform<string, string>>; password: ZodString; email: ZodOptional<ZodNullable<ZodString>>; }, $strict> import type {SignupInput} from '@fuzdev/fuz_app/auth/signup_route_schema.js';

Input for POST /signup. email is optional (absent or null = no email) and must match any referenced invite.

SignupOutput
#

auth/signup_route_schema.ts view source

ZodObject<{ ok: ZodLiteral<true>; account: ZodObject<{ id: $ZodBranded<ZodUUID, "Uuid", "out">; username: ZodPipe<ZodString, ZodTransform<string, string>>; }, $strict>; actor: ZodObject<...>; }, $strict> import type {SignupOutput} from '@fuzdev/fuz_app/auth/signup_route_schema.js';

Output for POST /signup.

Session cookie is the operative side effect. The returned account and actor mirror BootstrapOutput so cross-process per-test setup can read the per-test identity straight off the signup response.

SignupRouteShapeOptions
#

auth/signup_route_schema.ts view source

SignupRouteShapeOptions import type {SignupRouteShapeOptions} from '@fuzdev/fuz_app/auth/signup_route_schema.js';

Option inputs that shape the signup route metadata (not its handler).

signup_account_rate_limited

Whether a per-account signup rate limiter is wired — toggles rate_limit.

type boolean

Depends on
#

Imported by
#