@beignet/core 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +173 -0
- package/README.md +821 -30
- package/dist/application/index.d.ts +28 -2
- package/dist/application/index.d.ts.map +1 -1
- package/dist/application/index.js +140 -12
- package/dist/application/index.js.map +1 -1
- package/dist/client/client.d.ts +2 -2
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +136 -48
- package/dist/client/client.js.map +1 -1
- package/dist/client/error-messages.d.ts +14 -0
- package/dist/client/error-messages.d.ts.map +1 -0
- package/dist/client/error-messages.js +23 -0
- package/dist/client/error-messages.js.map +1 -0
- package/dist/client/index.d.ts +8 -4
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +6 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/types.d.ts +35 -5
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client-only.d.ts +8 -0
- package/dist/client-only.d.ts.map +1 -0
- package/dist/client-only.js +8 -0
- package/dist/client-only.js.map +1 -0
- package/dist/config/index.d.ts +5 -5
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +2 -2
- package/dist/config/index.js.map +1 -1
- package/dist/contracts/catalog-errors.d.ts +27 -0
- package/dist/contracts/catalog-errors.d.ts.map +1 -0
- package/dist/contracts/catalog-errors.js +69 -0
- package/dist/contracts/catalog-errors.js.map +1 -0
- package/dist/contracts/contract-builder.d.ts +15 -12
- package/dist/contracts/contract-builder.d.ts.map +1 -1
- package/dist/contracts/contract-builder.js +15 -41
- package/dist/contracts/contract-builder.js.map +1 -1
- package/dist/contracts/contract-group.d.ts +11 -8
- package/dist/contracts/contract-group.d.ts.map +1 -1
- package/dist/contracts/contract-group.js +13 -40
- package/dist/contracts/contract-group.js.map +1 -1
- package/dist/contracts/contract-like.d.ts +1 -1
- package/dist/contracts/contract-like.d.ts.map +1 -1
- package/dist/contracts/index.d.ts +13 -9
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +9 -5
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/openapi-meta.d.ts +48 -0
- package/dist/contracts/openapi-meta.d.ts.map +1 -1
- package/dist/contracts/openapi-meta.js +3 -0
- package/dist/contracts/openapi-meta.js.map +1 -1
- package/dist/contracts/path-template.d.ts +1 -1
- package/dist/contracts/path-template.js +2 -2
- package/dist/contracts/path-template.js.map +1 -1
- package/dist/contracts/schema-shape.d.ts +37 -0
- package/dist/contracts/schema-shape.d.ts.map +1 -0
- package/dist/contracts/schema-shape.js +61 -0
- package/dist/contracts/schema-shape.js.map +1 -0
- package/dist/contracts/success-status.d.ts +32 -0
- package/dist/contracts/success-status.d.ts.map +1 -0
- package/dist/contracts/success-status.js +18 -0
- package/dist/contracts/success-status.js.map +1 -0
- package/dist/contracts/types.d.ts +25 -5
- package/dist/contracts/types.d.ts.map +1 -1
- package/dist/contracts/types.js.map +1 -1
- package/dist/contracts/utils.d.ts +1 -1
- package/dist/contracts/utils.d.ts.map +1 -1
- package/dist/contracts/utils.js +1 -1
- package/dist/contracts/utils.js.map +1 -1
- package/dist/domain/events.d.ts +1 -1
- package/dist/domain/events.d.ts.map +1 -1
- package/dist/domain/events.js +1 -1
- package/dist/domain/events.js.map +1 -1
- package/dist/domain/index.d.ts +3 -3
- package/dist/domain/index.d.ts.map +1 -1
- package/dist/domain/index.js +3 -3
- package/dist/domain/index.js.map +1 -1
- package/dist/errors/catalog.d.ts +9 -1
- package/dist/errors/catalog.d.ts.map +1 -1
- package/dist/errors/catalog.js +7 -1
- package/dist/errors/catalog.js.map +1 -1
- package/dist/errors/http.d.ts +10 -0
- package/dist/errors/http.d.ts.map +1 -1
- package/dist/errors/http.js +11 -1
- package/dist/errors/http.js.map +1 -1
- package/dist/errors/index.d.ts +4 -4
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +4 -4
- package/dist/errors/index.js.map +1 -1
- package/dist/errors/response.d.ts +4 -1
- package/dist/errors/response.d.ts.map +1 -1
- package/dist/errors/response.js.map +1 -1
- package/dist/events/index.d.ts +10 -12
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +10 -10
- package/dist/events/index.js.map +1 -1
- package/dist/idempotency/index.d.ts +5 -3
- package/dist/idempotency/index.d.ts.map +1 -1
- package/dist/idempotency/index.js.map +1 -1
- package/dist/jobs/index.d.ts +148 -16
- package/dist/jobs/index.d.ts.map +1 -1
- package/dist/jobs/index.js +174 -14
- package/dist/jobs/index.js.map +1 -1
- package/dist/notifications/index.d.ts +14 -16
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +14 -14
- package/dist/notifications/index.js.map +1 -1
- package/dist/openapi/index.d.ts +8 -3
- package/dist/openapi/index.d.ts.map +1 -1
- package/dist/openapi/index.js +41 -29
- package/dist/openapi/index.js.map +1 -1
- package/dist/openapi/schema-introspector.d.ts +37 -0
- package/dist/openapi/schema-introspector.d.ts.map +1 -1
- package/dist/openapi/schema-introspector.js +23 -17
- package/dist/openapi/schema-introspector.js.map +1 -1
- package/dist/outbox/index.d.ts +18 -4
- package/dist/outbox/index.d.ts.map +1 -1
- package/dist/outbox/index.js +104 -4
- package/dist/outbox/index.js.map +1 -1
- package/dist/ports/audit.d.ts +56 -10
- package/dist/ports/audit.d.ts.map +1 -1
- package/dist/ports/audit.js +71 -3
- package/dist/ports/audit.js.map +1 -1
- package/dist/ports/auth.d.ts +92 -0
- package/dist/ports/auth.d.ts.map +1 -1
- package/dist/ports/auth.js +92 -0
- package/dist/ports/auth.js.map +1 -1
- package/dist/ports/events.d.ts +2 -2
- package/dist/ports/events.d.ts.map +1 -1
- package/dist/ports/index.d.ts +62 -33
- package/dist/ports/index.d.ts.map +1 -1
- package/dist/ports/index.js +28 -34
- package/dist/ports/index.js.map +1 -1
- package/dist/ports/policy.d.ts +32 -3
- package/dist/ports/policy.d.ts.map +1 -1
- package/dist/ports/policy.js +13 -2
- package/dist/ports/policy.js.map +1 -1
- package/dist/ports/testing.d.ts +1030 -2
- package/dist/ports/testing.d.ts.map +1 -1
- package/dist/ports/testing.js +1031 -1
- package/dist/ports/testing.js.map +1 -1
- package/dist/ports/unbound.d.ts +21 -0
- package/dist/ports/unbound.d.ts.map +1 -0
- package/dist/ports/unbound.js +57 -0
- package/dist/ports/unbound.js.map +1 -0
- package/dist/ports/unit-of-work.d.ts +1 -1
- package/dist/ports/unit-of-work.d.ts.map +1 -1
- package/dist/ports/unit-of-work.js +1 -1
- package/dist/ports/unit-of-work.js.map +1 -1
- package/dist/providers/index.d.ts +3 -2
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +3 -2
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/instrumentation.d.ts +46 -5
- package/dist/providers/instrumentation.d.ts.map +1 -1
- package/dist/providers/instrumentation.js +25 -6
- package/dist/providers/instrumentation.js.map +1 -1
- package/dist/providers/metadata.d.ts +39 -0
- package/dist/providers/metadata.d.ts.map +1 -0
- package/dist/providers/metadata.js +169 -0
- package/dist/providers/metadata.js.map +1 -0
- package/dist/providers/provider.d.ts +114 -9
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/provider.js +3 -20
- package/dist/providers/provider.js.map +1 -1
- package/dist/schedules/index.d.ts +94 -13
- package/dist/schedules/index.d.ts.map +1 -1
- package/dist/schedules/index.js +66 -12
- package/dist/schedules/index.js.map +1 -1
- package/dist/server/audit-context.d.ts +29 -0
- package/dist/server/audit-context.d.ts.map +1 -0
- package/dist/server/audit-context.js +44 -0
- package/dist/server/audit-context.js.map +1 -0
- package/dist/server/context.d.ts +141 -0
- package/dist/server/context.d.ts.map +1 -0
- package/dist/server/context.js +39 -0
- package/dist/server/context.js.map +1 -0
- package/dist/server/contract-like.d.ts +1 -1
- package/dist/server/contract-like.d.ts.map +1 -1
- package/dist/server/contract-like.js +1 -1
- package/dist/server/contract-like.js.map +1 -1
- package/dist/server/health.d.ts +2 -2
- package/dist/server/health.d.ts.map +1 -1
- package/dist/server/hooks/auth.d.ts +89 -65
- package/dist/server/hooks/auth.d.ts.map +1 -1
- package/dist/server/hooks/auth.js +84 -55
- package/dist/server/hooks/auth.js.map +1 -1
- package/dist/server/hooks/cors.d.ts +1 -1
- package/dist/server/hooks/cors.d.ts.map +1 -1
- package/dist/server/hooks/errors.d.ts +2 -2
- package/dist/server/hooks/errors.d.ts.map +1 -1
- package/dist/server/hooks/errors.js +2 -2
- package/dist/server/hooks/errors.js.map +1 -1
- package/dist/server/hooks/idempotency.d.ts +78 -0
- package/dist/server/hooks/idempotency.d.ts.map +1 -0
- package/dist/server/hooks/idempotency.js +154 -0
- package/dist/server/hooks/idempotency.js.map +1 -0
- package/dist/server/hooks/index.d.ts +8 -7
- package/dist/server/hooks/index.d.ts.map +1 -1
- package/dist/server/hooks/index.js +6 -5
- package/dist/server/hooks/index.js.map +1 -1
- package/dist/server/hooks/logging.d.ts +2 -2
- package/dist/server/hooks/logging.d.ts.map +1 -1
- package/dist/server/hooks/logging.js +1 -1
- package/dist/server/hooks/logging.js.map +1 -1
- package/dist/server/hooks/rate-limit.d.ts +25 -7
- package/dist/server/hooks/rate-limit.d.ts.map +1 -1
- package/dist/server/hooks/rate-limit.js +47 -12
- package/dist/server/hooks/rate-limit.js.map +1 -1
- package/dist/server/hooks.d.ts +1 -1
- package/dist/server/hooks.d.ts.map +1 -1
- package/dist/server/hooks.js +1 -1
- package/dist/server/hooks.js.map +1 -1
- package/dist/server/http.d.ts +84 -6
- package/dist/server/http.d.ts.map +1 -1
- package/dist/server/index.d.ts +36 -12
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +24 -8
- package/dist/server/index.js.map +1 -1
- package/dist/server/instrumentation.d.ts +108 -0
- package/dist/server/instrumentation.d.ts.map +1 -0
- package/dist/server/instrumentation.js +297 -0
- package/dist/server/instrumentation.js.map +1 -0
- package/dist/server/openapi.d.ts +3 -3
- package/dist/server/openapi.d.ts.map +1 -1
- package/dist/server/openapi.js +1 -1
- package/dist/server/openapi.js.map +1 -1
- package/dist/server/providers/index.d.ts +3 -3
- package/dist/server/providers/index.d.ts.map +1 -1
- package/dist/server/providers/index.js +3 -3
- package/dist/server/providers/index.js.map +1 -1
- package/dist/server/providers/loadProviderConfig.d.ts +2 -2
- package/dist/server/providers/loadProviderConfig.d.ts.map +1 -1
- package/dist/server/providers/loadProviderConfig.js +2 -2
- package/dist/server/providers/loadProviderConfig.js.map +1 -1
- package/dist/server/request-context.d.ts +67 -0
- package/dist/server/request-context.d.ts.map +1 -0
- package/dist/server/request-context.js +79 -0
- package/dist/server/request-context.js.map +1 -0
- package/dist/server/server-context.d.ts +38 -0
- package/dist/server/server-context.d.ts.map +1 -0
- package/dist/server/server-context.js +38 -0
- package/dist/server/server-context.js.map +1 -0
- package/dist/server/server.d.ts +148 -35
- package/dist/server/server.d.ts.map +1 -1
- package/dist/server/server.js +482 -145
- package/dist/server/server.js.map +1 -1
- package/dist/server/types.d.ts +2 -2
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/types.js +2 -2
- package/dist/server/types.js.map +1 -1
- package/dist/server/use-case-route.d.ts +263 -0
- package/dist/server/use-case-route.d.ts.map +1 -0
- package/dist/server/use-case-route.js +77 -0
- package/dist/server/use-case-route.js.map +1 -0
- package/dist/server-only.d.ts +8 -0
- package/dist/server-only.d.ts.map +1 -0
- package/dist/server-only.js +8 -0
- package/dist/server-only.js.map +1 -0
- package/dist/tasks/index.d.ts +139 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/index.js +98 -0
- package/dist/tasks/index.js.map +1 -0
- package/dist/testing/index.d.ts +611 -5
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +434 -4
- package/dist/testing/index.js.map +1 -1
- package/dist/tracing/index.d.ts +89 -0
- package/dist/tracing/index.d.ts.map +1 -0
- package/dist/tracing/index.js +101 -0
- package/dist/tracing/index.js.map +1 -0
- package/dist/uploads/client.d.ts +278 -0
- package/dist/uploads/client.d.ts.map +1 -0
- package/dist/uploads/client.js +428 -0
- package/dist/uploads/client.js.map +1 -0
- package/dist/uploads/index.d.ts +361 -0
- package/dist/uploads/index.d.ts.map +1 -0
- package/dist/uploads/index.js +543 -0
- package/dist/uploads/index.js.map +1 -0
- package/package.json +34 -3
- package/src/application/index.ts +193 -10
- package/src/client/client.ts +148 -150
- package/src/client/error-messages.ts +35 -0
- package/src/client/index.ts +12 -4
- package/src/client/types.ts +44 -5
- package/src/client-only.ts +7 -0
- package/src/config/index.ts +6 -6
- package/src/contracts/catalog-errors.ts +115 -0
- package/src/contracts/contract-builder.ts +39 -76
- package/src/contracts/contract-group.ts +33 -68
- package/src/contracts/contract-like.ts +1 -1
- package/src/contracts/index.ts +24 -11
- package/src/contracts/openapi-meta.ts +55 -0
- package/src/contracts/path-template.ts +2 -2
- package/src/contracts/schema-shape.ts +75 -0
- package/src/contracts/success-status.ts +68 -0
- package/src/contracts/types.ts +32 -5
- package/src/contracts/utils.ts +5 -2
- package/src/domain/events.ts +6 -2
- package/src/domain/index.ts +3 -3
- package/src/errors/catalog.ts +9 -1
- package/src/errors/http.ts +11 -1
- package/src/errors/index.ts +4 -4
- package/src/errors/response.ts +4 -1
- package/src/events/index.ts +12 -26
- package/src/idempotency/index.ts +5 -3
- package/src/jobs/index.ts +340 -29
- package/src/notifications/index.ts +17 -27
- package/src/openapi/index.ts +73 -38
- package/src/openapi/schema-introspector.ts +68 -17
- package/src/outbox/index.ts +151 -6
- package/src/ports/audit.ts +120 -11
- package/src/ports/auth.ts +132 -0
- package/src/ports/events.ts +2 -2
- package/src/ports/index.ts +104 -35
- package/src/ports/policy.ts +50 -3
- package/src/ports/testing.ts +2220 -33
- package/src/ports/unbound.ts +64 -0
- package/src/ports/unit-of-work.ts +6 -2
- package/src/providers/index.ts +16 -3
- package/src/providers/instrumentation.ts +93 -8
- package/src/providers/metadata.ts +234 -0
- package/src/providers/provider.ts +168 -9
- package/src/schedules/index.ts +173 -23
- package/src/server/audit-context.ts +45 -0
- package/src/server/context.ts +224 -0
- package/src/server/contract-like.ts +1 -1
- package/src/server/health.ts +2 -2
- package/src/server/hooks/auth.ts +175 -158
- package/src/server/hooks/cors.ts +1 -1
- package/src/server/hooks/errors.ts +7 -4
- package/src/server/hooks/idempotency.ts +263 -0
- package/src/server/hooks/index.ts +15 -12
- package/src/server/hooks/logging.ts +3 -3
- package/src/server/hooks/rate-limit.ts +85 -17
- package/src/server/hooks.ts +1 -1
- package/src/server/http.ts +112 -6
- package/src/server/index.ts +63 -12
- package/src/server/instrumentation.ts +470 -0
- package/src/server/openapi.ts +4 -4
- package/src/server/providers/index.ts +6 -3
- package/src/server/providers/loadProviderConfig.ts +4 -4
- package/src/server/request-context.ts +116 -0
- package/src/server/server-context.ts +44 -0
- package/src/server/server.ts +1045 -229
- package/src/server/types.ts +2 -2
- package/src/server/use-case-route.ts +430 -0
- package/src/server-only.ts +7 -0
- package/src/tasks/index.ts +275 -0
- package/src/testing/index.ts +1153 -6
- package/src/tracing/index.ts +176 -0
- package/src/uploads/client.ts +861 -0
- package/src/uploads/index.ts +1071 -0
- package/dist/ports/mailer.d.ts +0 -6
- package/dist/ports/mailer.d.ts.map +0 -1
- package/dist/ports/mailer.js +0 -2
- package/dist/ports/mailer.js.map +0 -1
- package/dist/ports/schedules.d.ts +0 -9
- package/dist/ports/schedules.d.ts.map +0 -1
- package/dist/ports/schedules.js +0 -2
- package/dist/ports/schedules.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,178 @@
|
|
|
1
1
|
# @beignet/core
|
|
2
2
|
|
|
3
|
+
## 0.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8bcb31f: Mark package READMEs with Beignet's experimental alpha status and 0.0.x stability expectations.
|
|
8
|
+
- 5d5e303: Add a database test harness that coordinates app-owned database fixtures, factory sequence resets, seed execution, and cleanup.
|
|
9
|
+
- 31c7e66: Deepen DB, outbox, and jobs devtools panels with domain-specific metrics, correlation fields, attempt/retry context, and richer row details. Provider instrumentation now adds provider names to typed provider events so those panels can group provider work consistently.
|
|
10
|
+
- 8297c7c: Add contract, route, location, and status diagnostics to framework validation and response contract errors.
|
|
11
|
+
- 4c1cb16: Formalize provider package manifest metadata with exported core types and
|
|
12
|
+
validation, and have doctor warn on malformed installed provider metadata before
|
|
13
|
+
using provider-derived diagnostics.
|
|
14
|
+
- ac78cdf: Make `createAuthHooks` the single route-scoped auth hook API. The factory is
|
|
15
|
+
now curried — `createAuthHooks<AppContext>()({ resolve })` — so added context
|
|
16
|
+
fields are inferred from `resolve` instead of passed as a type argument, and a
|
|
17
|
+
new optional `headers` schema validates the raw lowercase request header
|
|
18
|
+
record before `resolve` runs, giving `resolve` typed credential headers
|
|
19
|
+
without contract casts. On `required()` hooks a header schema failure returns
|
|
20
|
+
a framework-owned 401; `optional()` hooks skip auth resolution; `public()`
|
|
21
|
+
hooks never parse headers. `defineRouteHook` (and the `RouteHookBuilder`
|
|
22
|
+
types) are removed — write non-auth route hooks as plain `RouteHook` object
|
|
23
|
+
literals.
|
|
24
|
+
- 2da5a05: Report installed-but-unregistered optional providers as informational doctor
|
|
25
|
+
hints. Provider packages can declare `registration.severity: "hint"` in their
|
|
26
|
+
`beignet.provider` manifest metadata, and `@beignet/devtools` now uses it, so
|
|
27
|
+
removing `createDevtoolsProvider()` from `server/providers.ts` no longer fails
|
|
28
|
+
`beignet doctor --strict`.
|
|
29
|
+
- 780955c: Add Drizzle/Turso-backed durable idempotency storage with setup SQL, root and transaction-client ports, and Unit of Work rollback coverage for idempotency and outbox writes.
|
|
30
|
+
- 1a79090: Emit Node-compatible ESM: all relative imports in published packages now carry explicit .js extensions, fixing ERR_MODULE_NOT_FOUND when running the CLI or importing package dist files under plain Node.
|
|
31
|
+
- 7fe855b: Add OpenAPI schema converters and operation overrides for custom schemas, multipart uploads, binary responses, and streaming media.
|
|
32
|
+
- 079bf59: Clarify unsupported catch-all contract path diagnostics and document that catch-all route files belong to runtime adapters, not individual contracts.
|
|
33
|
+
- 82c48dc: Add canonical test port and context fixtures, and update generated tests to use them.
|
|
34
|
+
- 5a51869: Add schedule run attempt metadata and align durable workflow retry, backoff, terminal failure, and dead-letter documentation.
|
|
35
|
+
- 89390fe: Harden `createRateLimitHooks(...)` against client-controlled inputs. The
|
|
36
|
+
denial response details no longer include the bucket key — clients now see
|
|
37
|
+
only `scope`, `retryAfterSeconds`, and `resetAt` — and each denial emits a
|
|
38
|
+
`rateLimit.denied` instrumentation event with the key, scope, limit, and
|
|
39
|
+
window so operators keep bucket visibility through the devtools `rateLimit`
|
|
40
|
+
watcher. `ip`-scoped limits now default to the last `x-forwarded-for` entry
|
|
41
|
+
(the address appended by the platform's trusted proxy) instead of the
|
|
42
|
+
client-controlled first entry. The new `ipSource` option selects
|
|
43
|
+
`"x-forwarded-for-last"` (default), `"x-forwarded-for-first"`, or a custom
|
|
44
|
+
resolver function, replacing the previous `getClientIp` option.
|
|
45
|
+
- 89390fe: Add `installProviderForTest(...)` to `@beignet/core/testing` for running provider setup against test ports with merged provider-contributed ports and start/stop lifecycle runners, and export the `AnyServiceProvider` type from `@beignet/core/providers`.
|
|
46
|
+
- 303ba07: Define the public HTTP adapter contract and expose the Web Fetch adapter implementation.
|
|
47
|
+
- 2da5a05: Reduce per-request work in server dispatch: the fallback 404/405 hook pipeline is now built once at server creation instead of per unmatched request, unmatched requests scan the route registry with a single pattern test per route, and the registry is re-sorted lazily before the next dispatch instead of on every registration.
|
|
48
|
+
- 493d23b: Make the framework own context assembly with a server context blueprint and first-class service contexts.
|
|
49
|
+
|
|
50
|
+
- `createServer(...)` (and the Next/Web adapters) replace the `createContext` option with `context`. Gate-less contexts keep the plain request-factory shorthand; contexts that declare a `gate` must use the blueprint form `{ gate: (ports) => ports.gate, request, service }`. Returning `gate` from a context factory or hook addition is now a compile error.
|
|
51
|
+
- The gate port gains `gate.attach(ctx)`: it attaches a live, non-enumerable `ctx.gate` getter that re-binds against the receiving object on every access, so identity changes (including auth-hook elevation) can never authorize against a stale context, and spread copies drop the gate loudly instead of silently keeping stale identity. `bind(...)` remains the low-level primitive.
|
|
52
|
+
- Servers expose `createRequestContext(req)` and `createServiceContext(input?)`; the optional `context.service` factory powers schedule, outbox, command, and background contexts. Provider `setup`, `start`, and `stop` receive a late-bound `createServiceContext` so infra providers no longer hand-build background contexts.
|
|
53
|
+
- `createTestContextFactory(...)` now attaches the gate after all `extra` and override fields merge, fixing a stale-identity bug in tests.
|
|
54
|
+
- CLI templates, generators, and doctor diagnostics emit and check the new context blueprint and service-context wrappers.
|
|
55
|
+
|
|
56
|
+
- 493d23b: Fix `.errors()` on contract builders and contract groups to merge with previously declared catalog errors instead of replacing them. Contracts created from a group with shared catalog errors now keep the union of group and route errors at runtime and in inferred client error types, later declarations win when the same catalog key is declared twice, and multiple catalog codes can share one status across calls. Previously, route-level `.errors(...)` silently dropped group-declared errors from contract metadata, losing both server-side code enforcement and client error typing.
|
|
57
|
+
- 44f1192: Move first-party provider diagnostics to package-owned `beignet.provider`
|
|
58
|
+
manifest metadata and have doctor read installed provider package manifests.
|
|
59
|
+
- 2aa77ca: Add static provider metadata and provider wiring diagnostics for generated apps.
|
|
60
|
+
- eda7b59: Clarify that app-owned error details are public response data and should be
|
|
61
|
+
mapped explicitly rather than automatically redacted by the framework.
|
|
62
|
+
- 90c2e48: Add typed operational command definitions and a `beignet make command` generator for feature-owned app commands.
|
|
63
|
+
- ac78cdf: Add `createScheduleRoute(...)` to `@beignet/next` for triggering one registered schedule from a serverless cron route, with the same fail-closed bearer auth and JSON envelope conventions as `createOutboxDrainRoute(...)`. Unknown schedule names throw when the route module loads.
|
|
64
|
+
|
|
65
|
+
The inline schedule runner in `@beignet/core/schedules` now accepts `instrumentation` and `instrumentationContext` options and records `schedule` devtools events (`started`, `completed`, `failed`) itself. Recording failures are isolated from schedule execution and reported to `onHookError`. `createScheduleRoute(...)`, `beignet schedule run`, and generated cron routes use this instead of hand-rolled lifecycle hooks.
|
|
66
|
+
|
|
67
|
+
Security: cron route bearer secrets in `createScheduleRoute(...)` and `createOutboxDrainRoute(...)` are now compared with a timing-safe SHA-256 digest comparison instead of `!==`.
|
|
68
|
+
|
|
69
|
+
- 89390fe: Decouple devtools from app code with server-owned instrumentation.
|
|
70
|
+
|
|
71
|
+
- `@beignet/core/tracing` is a new dependency-free subpath with the W3C trace
|
|
72
|
+
primitives (`TraceContext`, `createTraceContext`, `createChildTraceContext`,
|
|
73
|
+
`parseTraceparent`, `createTraceparent`, `createTraceId`, `createSpanId`).
|
|
74
|
+
App context types now use `Partial<TraceContext>` instead of importing
|
|
75
|
+
`DevtoolsTraceContext` from `@beignet/devtools`.
|
|
76
|
+
- `createServer(...)` owns request instrumentation through a new
|
|
77
|
+
`instrumentation` option (`ServerInstrumentationOptions | false`). The server
|
|
78
|
+
resolves request IDs and trace context before user hooks and context
|
|
79
|
+
creation, passes them to context factories as `requestId` and `trace`,
|
|
80
|
+
writes `x-request-id`/`traceparent` response headers by default, and records
|
|
81
|
+
request/error events into the instrumentation port resolved from final ports
|
|
82
|
+
(`ports.instrumentation`, then `ports.devtools`). The ambient request
|
|
83
|
+
context (`enterActiveRequestContext` and friends) moved into
|
|
84
|
+
`@beignet/core/server`.
|
|
85
|
+
- `createUseCase(...)` instruments runs by default, resolving the
|
|
86
|
+
instrumentation port from `ctx.ports` per run; opt out with
|
|
87
|
+
`instrumentation: false`. App `onRun` observers run in addition.
|
|
88
|
+
- `createInstrumentedAuditLog({ audit, instrumentation })` in
|
|
89
|
+
`@beignet/core/ports` replaces `createDevtoolsAuditLog`.
|
|
90
|
+
- `createServer(...)` gains `validateResponses` (default `true`) to skip
|
|
91
|
+
route-owned response validation, mirroring the client option.
|
|
92
|
+
- Removed from `@beignet/devtools`: `createDevtoolsHooks`,
|
|
93
|
+
`createDevtoolsUseCaseObserver`, `createDevtoolsAuditLog`, and the
|
|
94
|
+
trace/request-context modules. Apps now only need `createDevtoolsProvider()`
|
|
95
|
+
plus the devtools route; deleting both leaves the rest of the app compiling
|
|
96
|
+
and running unchanged.
|
|
97
|
+
- `@beignet/next` cron and upload helpers resolve their instrumentation sink
|
|
98
|
+
with `resolveProviderInstrumentationPort(ctx.ports)` instead of hardcoding
|
|
99
|
+
`ports.devtools`.
|
|
100
|
+
- `beignet create` templates generate the decoupled shape.
|
|
101
|
+
|
|
102
|
+
- 16cc113: Clarify the canonical route registration story and align generated starters on `app-context.ts`.
|
|
103
|
+
- e9c3209: Add reusable actor, tenant, audit assertion, and default-header request helpers for production app tests.
|
|
104
|
+
- ac78cdf: Split the client `validate` config flag into `validateInput` (default false)
|
|
105
|
+
and `validateResponses` (default true). Client-side input validation failures
|
|
106
|
+
now throw a client-source `ContractError` with code `INPUT_VALIDATION_ERROR`
|
|
107
|
+
and no HTTP status instead of a synthetic 422 `VALIDATION_ERROR`. Setting
|
|
108
|
+
`validateResponses: false` returns success bodies as-is and classifies non-2xx
|
|
109
|
+
responses structurally while keeping `INVALID_JSON` transport errors.
|
|
110
|
+
- cca08b1: Align generated apps and package docs around the canonical auth, policy, and AppContext model.
|
|
111
|
+
- ac78cdf: Add server registration and dispatch guarantees. `createServer(...)` now fails
|
|
112
|
+
at startup when a contract's `pathParams` object schema does not match the
|
|
113
|
+
`:param` keys in its path template (non-introspectable Standard Schemas are
|
|
114
|
+
skipped), and when two contracts register the same name, since typed clients,
|
|
115
|
+
OpenAPI operations, and devtools key on contract names. Requests that match a
|
|
116
|
+
registered path with an unregistered method now receive a framework-owned
|
|
117
|
+
`405 METHOD_NOT_ALLOWED` response with an `Allow` header listing the registered
|
|
118
|
+
methods instead of a `404`; `HEAD` is intentionally not mapped to `GET`
|
|
119
|
+
handlers. The 405 flows through the same hook and error-ownership pipeline as
|
|
120
|
+
the 404 fallback, so typed clients surface it as an HTTP error rather than
|
|
121
|
+
contract drift.
|
|
122
|
+
- a67c637: Add Beignet runtime boundary markers and extend `beignet lint` to catch client-safe roots that value-reach server-only code.
|
|
123
|
+
- 7b0f708: Add first-class outbox instrumentation and devtools visibility for delivered, retried, and dead-lettered messages.
|
|
124
|
+
- 246c66c: Add idempotency entry and provider instrumentation testing helpers for app and provider test suites.
|
|
125
|
+
- 242f220: Add provider-focused testing helpers for recording jobs and schedules plus assertions for events, mail, notifications, storage, outbox workflows, and provider intent.
|
|
126
|
+
- 493d23b: Add typed provider-contributed ports. `InferProviderPorts` (replacing
|
|
127
|
+
`ProvidedPortsOfList`) merges the ports a provider list contributes so apps can
|
|
128
|
+
type `ctx.ports` as `AppPorts & InferProviderPorts<typeof providers>` without
|
|
129
|
+
casts. The curried `definePorts<AppPorts>()({ bound, deferred })` form replaces
|
|
130
|
+
throwing stub boilerplate: deferred keys boot as descriptive placeholders and
|
|
131
|
+
`createServer(...)` fails startup with the unbound key list (configurable via
|
|
132
|
+
`onUnboundPorts: "error" | "warn" | "ignore"`). App-local providers can declare
|
|
133
|
+
required ports, app context, and service-context input through the curried
|
|
134
|
+
`createProvider<Requires, Context, ServiceInput>()` form, which types
|
|
135
|
+
`setup({ ports, createServiceContext })` and lifecycle contexts end to end.
|
|
136
|
+
CLI templates and `beignet make` generate and maintain the new forms.
|
|
137
|
+
- 8063d38: Rename the contract front door to `defineContract`/`defineContractGroup`, rename operational commands to tasks (`@beignet/core/tasks`, `defineTasks`, `runTask`, `beignet task run`, `beignet make task`, `server/tasks.ts`, `features/<feature>/tasks/`, `paths.tasks`), and standardize context binding: context-free declarations stay top-level (`defineEvent`), while context-bound definitions come from per-capability factories (`createListeners`, `createJobs`, `createSchedules`, `createNotifications`, `createTasks`) called once in `lib/`. Top-level context-generic `defineListener`, `defineJob`, `defineSchedule`, and `defineNotification` are removed.
|
|
138
|
+
- 905da0a: Audit ports can be wrapped with `createAmbientAuditLog` to fill actor, tenant,
|
|
139
|
+
and correlation ids from the ambient request context at record time — including
|
|
140
|
+
inside per-transaction port rebuilds — and `requireSession`, `requireUser`,
|
|
141
|
+
`requireUserId`, `requireTenant`, and `requireTenantId` are now exported from
|
|
142
|
+
`@beignet/core/ports`, throwing framework-owned 401/403 errors.
|
|
143
|
+
- 192c6ad: Typed clients now attach idempotency keys automatically from contract metadata (override with `idempotencyKey`), React Query mutations keep the key stable across retry attempts, and the shared client error helpers `contractErrorMessage` and `rootFormError` are now exported by @beignet/core/client and @beignet/react-hook-form.
|
|
144
|
+
- 192c6ad: Rename `defineFactory` to `createFactory` and `defineEnv` to `createEnvLoader` to match the naming convention: define declares things you register, create returns runtime objects you call.
|
|
145
|
+
- 192c6ad: beforeSend hooks now run for native web Responses with a headers-only view (`native: true`), so CORS, request-id, and trace headers reach streamed responses; idempotency reservations are released for streamed responses instead of compensating in afterSend.
|
|
146
|
+
- 192c6ad: Routes can bind a contract directly to a use case with `{ contract, useCase }` — status is inferred from a sole 2xx response, input defaults to merged path/query/body parts, and validated inputs are not re-parsed when the use case reuses the contract schema by reference. Full `handle` routes remain the escape hatch for headers, streaming, and multi-status responses.
|
|
147
|
+
- 255527d: Add `createTestContext` for testing jobs, listeners, schedules, notifications, and tasks; make `createTestPorts` overrides accept typed partial ports without casts; default the test audit port to ambient enrichment; add `transaction.outbox` to flush buffered domain events on commit; add `defineServerContext` so apps can share one context blueprint between the server and tests.
|
|
148
|
+
- ac78cdf: Enforce contract `meta.idempotency` at the HTTP boundary with the new
|
|
149
|
+
`createIdempotencyHooks(...)` server hook. The hook reserves the client key
|
|
150
|
+
after request parsing, replays completed matching responses with an
|
|
151
|
+
`idempotency-replayed: true` header, and rejects in-progress and conflicting
|
|
152
|
+
keys. The server now maps uncaught `IdempotencyConflictError` and
|
|
153
|
+
`IdempotencyInProgressError` primitives to framework-owned `409` responses
|
|
154
|
+
using the new `httpErrors.IdempotencyConflict` and
|
|
155
|
+
`httpErrors.IdempotencyInProgress` catalog entries, so apps no longer need to
|
|
156
|
+
re-map idempotency primitives to app-local catalog errors.
|
|
157
|
+
`runIdempotently(...)` remains the workflow-level primitive for non-HTTP work.
|
|
158
|
+
`beignet doctor` recognizes the new `httpErrors` catalog entries.
|
|
159
|
+
|
|
160
|
+
## 0.0.3
|
|
161
|
+
|
|
162
|
+
### Patch Changes
|
|
163
|
+
|
|
164
|
+
- 3160184: Add `beignet db generate|migrate|seed|reset`, scaffold standard seed/reset database entrypoints, and expose a factory reset helper for test data workflows.
|
|
165
|
+
- 254ef6d: Add scoped route hooks for route and route-group policy, update auth hooks to expose public/optional/required route-hook factories, and teach CLI route inspection about curried route groups.
|
|
166
|
+
- 4cb1784: Add first-class upload router primitives, a typed browser upload client, a
|
|
167
|
+
React upload adapter, Next.js upload route helper, S3-compatible direct upload
|
|
168
|
+
signing, devtools upload watcher support, an upload generator, and a
|
|
169
|
+
first-class `beignet make feature` command with optional policy, event, job,
|
|
170
|
+
and upload artifacts for the standard vertical slice. Add first-class job retry
|
|
171
|
+
helpers, outbox retry policy integration, and job retry/dead-letter devtools
|
|
172
|
+
events. Add a Next.js outbox drain route helper and doctor warnings for
|
|
173
|
+
serverless background-work footguns.
|
|
174
|
+
- 8bd9085: Add `@beignet/web` as a framework-neutral Web Fetch adapter, include a `@beignet/web/testing` route test harness, and have `@beignet/next` reuse the Web adapter for standard Request/Response handling.
|
|
175
|
+
|
|
3
176
|
## 0.0.2
|
|
4
177
|
|
|
5
178
|
### Patch Changes
|