| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2026-06-19 | 2.7 kB | |
| v0.42.0 source code.tar.gz | 2026-06-19 | 2.8 MB | |
| v0.42.0 source code.zip | 2026-06-19 | 3.5 MB | |
| Totals: 3 Items | 6.3 MB | 0 | |
A feature release that rounds out two areas: multitenancy and real-time
docs. @daloyjs/core gains a secure-by-default tenancy() primitive and an
auto-mounted interactive AsyncAPI UI (the WebSocket counterpart to the
Scalar / Swagger / Redoc OpenAPI viewers), plus a WebSocket close-lifecycle fix.
create-daloy publishes at the same version in lockstep.
Added
- Multitenancy via
tenancy()at@daloyjs/core/tenancy— a dependency-freeHooksbundle that resolves the calling tenant once per request and exposes it onctx.state.tenant. Pluggable resolution (tenantFromSubdomainPSL-aware,tenantFromHeader,tenantFromPathPrefix,tenantFromClaim, or a custom(ctx) => string, tried in array order). Secure-by-default: refuse-unresolved (no ambient "default" tenant leak), format-validated ids (rejects key/log-injection and cache-poisoning payloads before they reach a key), no-enumeration404for unknown tenants, and host-spoof-safe subdomain resolution. AtenantScope()key helper drops straight intorateLimitkeyGeneratorandconcurrencyLimit/idempotency/responseCachescopeto partition each per tenant (CWE-524 cross-tenant cached-response defense). Runnableexamples/multitenancy-demo.ts. - Interactive AsyncAPI UI via
asyncapi: true(mirroringdocs: true) — auto-mountsGET /asyncapi(the official AsyncAPI React component, loaded from a CDN via a<script>tag exactly like the OpenAPI viewers — no build step, no runtime dependency), plusGET /asyncapi.jsonandGET /asyncapi.yaml. The document is generated lazily soapp.ws()routes registered after construction are included."auto"skips production; the object form (AsyncAPIRouteOptions) exposes custom paths,servers, UIconfiguration, and SRI-pinnableassets. The UI page ships the same hardened response as the OpenAPI docs (strict CSP scoped to the asset origin +connect-src 'self',nosniff,no-referrer). HTTPopenapi.serversare mapped to AsyncAPIws/wssservers when none are given. Runnableexamples/websocket-demo.tsandexamples/scheduler-demo.ts.
Fixed
- WebSocket close lifecycle (Node adapter). A socket error arriving after
the close handshake — e.g. a peer that resets the TCP connection right after
closing, or a
terminate()racing the OS — no longer fires the handler'serror()callback afterclose()already fired. This restores the "no events after close" contract and prevents double-running handler cleanup.
Full changelog: https://github.com/daloyjs/daloy/compare/v0.41.0...v0.42.0