@fuzdev/fuz_app 0.183.0 → 0.185.0
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/dist/actions/CLAUDE.md +538 -1223
- package/dist/actions/action_codegen.d.ts +1 -1
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +3 -2
- package/dist/actions/connection_closer.d.ts +11 -9
- package/dist/actions/connection_closer.d.ts.map +1 -1
- package/dist/actions/connection_closer.js +11 -9
- package/dist/actions/frontend_rpc_client.d.ts +1 -1
- package/dist/actions/register_action_ws.d.ts +21 -1
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +2 -1
- package/dist/actions/ws_socket_session.d.ts +25 -4
- package/dist/actions/ws_socket_session.d.ts.map +1 -1
- package/dist/actions/ws_socket_session.js +81 -25
- package/dist/auth/CLAUDE.md +433 -1048
- package/dist/auth/account_queries.d.ts +1 -1
- package/dist/auth/account_queries.js +1 -1
- package/dist/auth/account_routes.d.ts +4 -5
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +8 -10
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +10 -11
- package/dist/auth/api_token.d.ts +20 -3
- package/dist/auth/api_token.d.ts.map +1 -1
- package/dist/auth/api_token.js +28 -9
- package/dist/auth/api_token_queries.d.ts +2 -2
- package/dist/auth/api_token_queries.js +2 -2
- package/dist/auth/audit_log_routes.d.ts +1 -1
- package/dist/auth/audit_log_routes.d.ts.map +1 -1
- package/dist/auth/audit_log_routes.js +3 -2
- package/dist/auth/audit_log_schema.d.ts +15 -9
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +1 -2
- package/dist/auth/auth_guard_resolver.d.ts +1 -1
- package/dist/auth/auth_guard_resolver.js +1 -1
- package/dist/auth/bearer_auth.d.ts +2 -5
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +4 -13
- package/dist/auth/bootstrap_account.d.ts +13 -15
- package/dist/auth/bootstrap_account.d.ts.map +1 -1
- package/dist/auth/bootstrap_account.js +9 -11
- package/dist/auth/bootstrap_routes.d.ts +20 -21
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/bootstrap_routes.js +21 -19
- package/dist/auth/bootstrap_token_store.d.ts +3 -4
- package/dist/auth/bootstrap_token_store.d.ts.map +1 -1
- package/dist/auth/bootstrap_token_store.js +1 -1
- package/dist/auth/cleanup.d.ts +34 -3
- package/dist/auth/cleanup.d.ts.map +1 -1
- package/dist/auth/cleanup.js +11 -3
- package/dist/auth/daemon_token.d.ts +5 -1
- package/dist/auth/daemon_token.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.d.ts +12 -8
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +15 -21
- package/dist/auth/deps.d.ts +11 -0
- package/dist/auth/deps.d.ts.map +1 -1
- package/dist/auth/invite_queries.d.ts +51 -3
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_queries.js +81 -6
- package/dist/auth/invite_schema.d.ts +2 -1
- package/dist/auth/invite_schema.d.ts.map +1 -1
- package/dist/auth/middleware.d.ts +2 -3
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +3 -3
- package/dist/auth/request_context.d.ts +3 -3
- package/dist/auth/request_context.js +3 -3
- package/dist/auth/role_grant_offer_actions.d.ts +2 -2
- package/dist/auth/role_grant_offer_actions.js +2 -2
- package/dist/auth/session_cookie.d.ts +82 -174
- package/dist/auth/session_cookie.d.ts.map +1 -1
- package/dist/auth/session_cookie.js +80 -130
- package/dist/auth/session_middleware.d.ts +8 -17
- package/dist/auth/session_middleware.d.ts.map +1 -1
- package/dist/auth/session_middleware.js +14 -23
- package/dist/auth/session_queries.d.ts +9 -14
- package/dist/auth/session_queries.d.ts.map +1 -1
- package/dist/auth/session_queries.js +8 -9
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +4 -6
- package/dist/db/CLAUDE.md +5 -3
- package/dist/dev/setup.d.ts +3 -1
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +3 -1
- package/dist/http/CLAUDE.md +315 -768
- package/dist/http/db_routes.d.ts +1 -1
- package/dist/http/db_routes.js +1 -1
- package/dist/http/origin.d.ts +7 -8
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +7 -8
- package/dist/http/pending_effects.d.ts +82 -4
- package/dist/http/pending_effects.d.ts.map +1 -1
- package/dist/http/pending_effects.js +82 -4
- package/dist/http/route_result.d.ts +1 -1
- package/dist/http/route_spec.d.ts +17 -14
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/realtime/audit_log_sse.d.ts +1 -1
- package/dist/realtime/sse.d.ts +6 -25
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +4 -25
- package/dist/realtime/sse_constants.d.ts +1 -1
- package/dist/realtime/sse_constants.js +1 -1
- package/dist/server/app_backend.d.ts +4 -5
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_backend.js +3 -1
- package/dist/server/app_server.d.ts +87 -76
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +111 -91
- package/dist/server/app_server_context.d.ts +1 -2
- package/dist/server/app_server_context.d.ts.map +1 -1
- package/dist/server/env.js +2 -2
- package/dist/server/shutdown_drain.d.ts +69 -0
- package/dist/server/shutdown_drain.d.ts.map +1 -0
- package/dist/server/shutdown_drain.js +77 -0
- package/dist/testing/CLAUDE.md +89 -57
- package/dist/testing/admin_integration.d.ts +4 -5
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +39 -23
- package/dist/testing/app_server.d.ts +3 -8
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +10 -9
- package/dist/testing/attack_surface.d.ts +1 -1
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/audit_completeness.d.ts +2 -3
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +1 -1
- package/dist/testing/cross_backend/bootstrap_backend.d.ts +3 -1
- package/dist/testing/cross_backend/bootstrap_backend.d.ts.map +1 -1
- package/dist/testing/cross_backend/bootstrap_backend.js +5 -1
- package/dist/testing/cross_backend/capability_mounts.d.ts.map +1 -1
- package/dist/testing/cross_backend/capability_mounts.js +16 -11
- package/dist/testing/cross_backend/conformance_table.d.ts +5 -6
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +4 -4
- package/dist/testing/cross_backend/cookie_attributes.js +1 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts +10 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.js +33 -7
- package/dist/testing/cross_backend/default_backend_configs.d.ts +3 -3
- package/dist/testing/cross_backend/default_spine_surface.d.ts +0 -6
- package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_spine_surface.js +4 -9
- package/dist/testing/cross_backend/differential.d.ts +2 -3
- package/dist/testing/cross_backend/differential.d.ts.map +1 -1
- package/dist/testing/cross_backend/differential.js +1 -1
- package/dist/testing/cross_backend/full_spine_mount.d.ts +1 -42
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +45 -4
- package/dist/testing/cross_backend/in_process_setup.d.ts +7 -8
- package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/in_process_setup.js +10 -13
- package/dist/testing/cross_backend/rpc_success_fixtures.d.ts.map +1 -1
- package/dist/testing/cross_backend/rpc_success_fixtures.js +2 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +3 -4
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.js +2 -2
- package/dist/testing/cross_backend/setup.d.ts +1 -1
- package/dist/testing/cross_backend/spawn_backend.d.ts +14 -0
- package/dist/testing/cross_backend/spawn_backend.d.ts.map +1 -1
- package/dist/testing/cross_backend/spawn_backend.js +56 -8
- package/dist/testing/cross_backend/spine_suites.d.ts +18 -16
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +38 -18
- package/dist/testing/cross_backend/standard.d.ts +19 -84
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/standard.js +8 -23
- package/dist/testing/cross_backend/standard_auth.d.ts +74 -0
- package/dist/testing/cross_backend/standard_auth.d.ts.map +1 -0
- package/dist/testing/cross_backend/standard_auth.js +28 -0
- package/dist/testing/cross_backend/standard_bundle.d.ts +48 -0
- package/dist/testing/cross_backend/standard_bundle.d.ts.map +1 -0
- package/dist/testing/cross_backend/standard_bundle.js +43 -0
- package/dist/testing/cross_backend/testing_credential_read.d.ts +10 -11
- package/dist/testing/cross_backend/testing_credential_read.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_credential_read.js +12 -12
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +46 -30
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +52 -31
- package/dist/testing/cross_backend/testing_server_bun.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_bun.js +5 -4
- package/dist/testing/cross_backend/testing_server_core.d.ts +16 -3
- package/dist/testing/cross_backend/testing_server_core.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_core.js +22 -7
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts +6 -2
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +7 -3
- package/dist/testing/daemon_token_rotation.d.ts.map +1 -1
- package/dist/testing/daemon_token_rotation.js +2 -3
- package/dist/testing/error_coverage.d.ts +5 -0
- package/dist/testing/error_coverage.d.ts.map +1 -1
- package/dist/testing/error_coverage.js +2 -1
- package/dist/testing/integration.d.ts +6 -23
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +53 -83
- package/dist/testing/integration_helpers.d.ts +16 -0
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +29 -1
- package/dist/testing/middleware_gate_probes.d.ts +55 -1
- package/dist/testing/middleware_gate_probes.d.ts.map +1 -1
- package/dist/testing/middleware_gate_probes.js +69 -3
- package/dist/testing/rate_limiting.d.ts +2 -3
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +3 -3
- package/dist/testing/rpc_helpers.d.ts +1 -2
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +3 -3
- package/dist/testing/rpc_round_trip.d.ts +2 -3
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.js +1 -1
- package/dist/testing/sse_round_trip.d.ts +2 -3
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +2 -2
- package/dist/testing/stubs.d.ts +5 -6
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +10 -8
- package/dist/testing/test_app.d.ts +8 -5
- package/dist/testing/test_app.d.ts.map +1 -1
- package/dist/testing/test_app.js +7 -7
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +3 -0
- package/dist/ui/ui_format.d.ts.map +1 -1
- package/dist/ui/ui_format.js +1 -2
- package/package.json +1 -1
package/dist/http/db_routes.d.ts
CHANGED
|
@@ -79,7 +79,7 @@ export declare const NON_BROWSABLE_TABLES: ReadonlyArray<string>;
|
|
|
79
79
|
* (`create_revocation_guard`) closes live connections by listening to audit
|
|
80
80
|
* events, so a raw row delete here is invisible to it.
|
|
81
81
|
* - `bootstrap_lock` — deleting the singleton closes bootstrap for good:
|
|
82
|
-
* `
|
|
82
|
+
* `is_bootstrap_available` reads a missing row as unavailable (logged as an
|
|
83
83
|
* error), so a database that has not bootstrapped never can until the row
|
|
84
84
|
* is restored.
|
|
85
85
|
* - `app_settings` — deleting the singleton makes every settings read throw.
|
package/dist/http/db_routes.js
CHANGED
|
@@ -84,7 +84,7 @@ export const NON_BROWSABLE_TABLES = Object.freeze([
|
|
|
84
84
|
* (`create_revocation_guard`) closes live connections by listening to audit
|
|
85
85
|
* events, so a raw row delete here is invisible to it.
|
|
86
86
|
* - `bootstrap_lock` — deleting the singleton closes bootstrap for good:
|
|
87
|
-
* `
|
|
87
|
+
* `is_bootstrap_available` reads a missing row as unavailable (logged as an
|
|
88
88
|
* error), so a database that has not bootstrapped never can until the row
|
|
89
89
|
* is restored.
|
|
90
90
|
* - `app_settings` — deleting the singleton makes every settings read throw.
|
package/dist/http/origin.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Request source verification middleware for API protection.
|
|
3
3
|
*
|
|
4
|
-
* Verifies requests carry an `Origin` the server allows, or none.
|
|
5
|
-
* CSRF
|
|
6
|
-
* (
|
|
7
|
-
* (`http/simple_request.ts`)
|
|
8
|
-
* include every other port on the same host
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* the WebSocket upgrade, which is never preflighted.
|
|
4
|
+
* Verifies requests carry an `Origin` the server allows, or none. The origin
|
|
5
|
+
* check is one of three CSRF layers, beside `SameSite: strict` session
|
|
6
|
+
* cookies (`auth/session_middleware.ts`) and the JSON-only `POST` refusal
|
|
7
|
+
* (`http/simple_request.ts`): `SameSite` alone admits same-site pages, which
|
|
8
|
+
* include every other port on the same host, and the origin check refuses an
|
|
9
|
+
* untrusted page's request before any handler runs. It is the only one of the
|
|
10
|
+
* three that guards the WebSocket upgrade, which is never preflighted.
|
|
12
11
|
*
|
|
13
12
|
* The allowlist grammar is shared with the Rust spine entry for entry:
|
|
14
13
|
* `parse_allowed_origins` accepts and refuses the same entries, naming each
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"origin.d.ts","sourceRoot":"","sources":["../../src/lib/http/origin.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"origin.d.ts","sourceRoot":"","sources":["../../src/lib/http/origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAU,KAAK,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAIlE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAI/D;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,mWAiBjC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,uBAAuB,iXAAwD,CAAC;AAC7F,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE5E,wDAAwD;AACxD,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,MAAM,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAwB5F,CAAC;AAEF,0DAA0D;AAC1D,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAC;IACvC,qEAAqE;IACrE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,oEAAoE;IACpE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACxB;AAKD;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,GAAI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
|
/**
|
|
2
2
|
* Request source verification middleware for API protection.
|
|
3
3
|
*
|
|
4
|
-
* Verifies requests carry an `Origin` the server allows, or none.
|
|
5
|
-
* CSRF
|
|
6
|
-
* (
|
|
7
|
-
* (`http/simple_request.ts`)
|
|
8
|
-
* include every other port on the same host
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* the WebSocket upgrade, which is never preflighted.
|
|
4
|
+
* Verifies requests carry an `Origin` the server allows, or none. The origin
|
|
5
|
+
* check is one of three CSRF layers, beside `SameSite: strict` session
|
|
6
|
+
* cookies (`auth/session_middleware.ts`) and the JSON-only `POST` refusal
|
|
7
|
+
* (`http/simple_request.ts`): `SameSite` alone admits same-site pages, which
|
|
8
|
+
* include every other port on the same host, and the origin check refuses an
|
|
9
|
+
* untrusted page's request before any handler runs. It is the only one of the
|
|
10
|
+
* three that guards the WebSocket upgrade, which is never preflighted.
|
|
12
11
|
*
|
|
13
12
|
* The allowlist grammar is shared with the Rust spine entry for entry:
|
|
14
13
|
* `parse_allowed_origins` accepts and refuses the same entries, naming each
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* by their timing contract:
|
|
6
6
|
*
|
|
7
7
|
* - `pending_effects: Array<Promise<void>>` — eager. Producers push pool
|
|
8
|
-
* writes that are already in flight (failure audit rows,
|
|
9
|
-
*
|
|
8
|
+
* writes that are already in flight (failure audit rows, api-token usage
|
|
9
|
+
* tracking). The pool write is rollback-resilient by
|
|
10
10
|
* virtue of running outside the request transaction; pushing the
|
|
11
11
|
* in-flight handle lets test mode (`await_pending_effects: true`) await
|
|
12
12
|
* it.
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* Producers go through `emit_after_commit(ctx, fn)`; the flush
|
|
15
15
|
* middleware is the only site that ever invokes the thunk, and it does
|
|
16
16
|
* so after the request handler (and its wrapping `db.transaction`)
|
|
17
|
-
* returns. Used for WS sends
|
|
17
|
+
* returns. Used for WS sends, a revocation's connection closes, a success
|
|
18
|
+
* audit row's listener fan-out, and any work that must observe a committed
|
|
18
19
|
* transaction.
|
|
19
20
|
*
|
|
20
21
|
* **Discard on rollback.** A `post_commit_effects` thunk is discarded if the
|
|
@@ -184,7 +185,9 @@ export declare const flush_post_commit_effects: (effects: ReadonlyArray<() => vo
|
|
|
184
185
|
* that needs a write awaits it itself. Eager rejections are logged and passed
|
|
185
186
|
* to `on_rejection` (the server's `on_effect_error`). The caller picks whether
|
|
186
187
|
* to await the returned promise — HTTP awaits it in test mode only, WS awaits
|
|
187
|
-
* it per frame after the reply is sent
|
|
188
|
+
* it per frame after the reply is sent — and hands it to its request's
|
|
189
|
+
* `AcceptedRequest.finish` either way, so `AppServer.close` waits for it.
|
|
190
|
+
* Never rejects.
|
|
188
191
|
*
|
|
189
192
|
* @param pending_effects - the eager queue of in-flight pool writes
|
|
190
193
|
* @param post_commit_effects - the deferred thunks queued by `emit_after_commit`
|
|
@@ -192,4 +195,79 @@ export declare const flush_post_commit_effects: (effects: ReadonlyArray<() => vo
|
|
|
192
195
|
* @param on_rejection - optional fan-out for each eager rejection
|
|
193
196
|
*/
|
|
194
197
|
export declare const flush_request_effects: (pending_effects: ReadonlyArray<Promise<void>>, post_commit_effects: ReadonlyArray<() => void | Promise<void>>, log: Logger, on_rejection?: (reason: unknown) => void) => Promise<void>;
|
|
198
|
+
/**
|
|
199
|
+
* Every request the server accepted — an HTTP request, a WS message accepted
|
|
200
|
+
* for dispatch — held from acceptance until its handler has returned and its
|
|
201
|
+
* effect flush has settled, so `AppServer.close` can wait for both before the
|
|
202
|
+
* database closes. A WebSocket's open is held the same way, with no flush:
|
|
203
|
+
* from before its pending registration until its admission re-read,
|
|
204
|
+
* `on_socket_open`, and the start of its queued frames' dispatch are done
|
|
205
|
+
* (`actions/ws_socket_session.ts`). One tracker per backend
|
|
206
|
+
* (`AppDeps.request_tracker`), shared by every transport, so a request is
|
|
207
|
+
* held the same way whichever transport accepted it. Its `drain_inflight` /
|
|
208
|
+
* `inflight_count` match `AuditEmitter`'s, the other set the shutdown drain
|
|
209
|
+
* waits on.
|
|
210
|
+
*
|
|
211
|
+
* The flushes are held apart as well, for a drain that must not wait on a
|
|
212
|
+
* running handler — `_testing_drain_effects`, whose own request is one: a
|
|
213
|
+
* flush is tracked only once its handler has returned, so a drain waiting on
|
|
214
|
+
* flushes never waits on itself.
|
|
215
|
+
*/
|
|
216
|
+
export interface RequestTracker {
|
|
217
|
+
/**
|
|
218
|
+
* Hold a request from the moment it is accepted, before its handler runs.
|
|
219
|
+
* Call before any work that can throw, and end it with
|
|
220
|
+
* `AcceptedRequest.finish` on every path. Answers `null` once the tracker
|
|
221
|
+
* is closed: the request is refused, never run.
|
|
222
|
+
*
|
|
223
|
+
* @mutates the tracker - adds the request, removed once it finishes and its flush settles
|
|
224
|
+
*/
|
|
225
|
+
accept: () => AcceptedRequest | null;
|
|
226
|
+
/**
|
|
227
|
+
* Refuse every later `accept`, so nothing new starts against a database
|
|
228
|
+
* about to close. Requests already held are kept and still drained.
|
|
229
|
+
* Idempotent.
|
|
230
|
+
*/
|
|
231
|
+
close: () => void;
|
|
232
|
+
/**
|
|
233
|
+
* Wait until no request is held — handler or flush — not for a snapshot:
|
|
234
|
+
* a request accepted while waiting is awaited too. Never rejects.
|
|
235
|
+
*
|
|
236
|
+
* Never call it from inside a request: the caller is held, so it waits on
|
|
237
|
+
* itself forever. A request awaits `drain_flushes` instead.
|
|
238
|
+
*/
|
|
239
|
+
drain_inflight: () => Promise<void>;
|
|
240
|
+
/** How many requests are held: a handler still running, or a flush. */
|
|
241
|
+
inflight_count: () => number;
|
|
242
|
+
/**
|
|
243
|
+
* Wait until no flush is running — not for a snapshot, and never for a
|
|
244
|
+
* handler still running. Never rejects. The one drain a request may await:
|
|
245
|
+
* its own flush starts only after its handler returns.
|
|
246
|
+
*/
|
|
247
|
+
drain_flushes: () => Promise<void>;
|
|
248
|
+
/** How many flushes are running — of requests whose handler has returned. */
|
|
249
|
+
flush_count: () => number;
|
|
250
|
+
}
|
|
251
|
+
/** A request `RequestTracker.accept` holds. */
|
|
252
|
+
export interface AcceptedRequest {
|
|
253
|
+
/**
|
|
254
|
+
* End the request once its handler has returned: it is released when
|
|
255
|
+
* `flush` settles, at once with no flush. `flush` must never reject —
|
|
256
|
+
* `flush_request_effects` doesn't. A second call does nothing.
|
|
257
|
+
*/
|
|
258
|
+
finish: (flush: Promise<void> | null) => void;
|
|
259
|
+
}
|
|
260
|
+
/** Create an empty, open `RequestTracker`. */
|
|
261
|
+
export declare const create_request_tracker: () => RequestTracker;
|
|
262
|
+
/**
|
|
263
|
+
* A view of `parent` with its own `close`: `accept` refuses once the view is
|
|
264
|
+
* closed and otherwise holds the request on `parent`; the drains and counts
|
|
265
|
+
* are `parent`'s, so they cover every server on the backend, not only the
|
|
266
|
+
* requests this view accepted. One server's admission over its backend's tracker —
|
|
267
|
+
* `AppServer.close` closes its view, so the backend's tracker stays open for
|
|
268
|
+
* a server assembled on it later.
|
|
269
|
+
*
|
|
270
|
+
* @param parent - the tracker requests are held on
|
|
271
|
+
*/
|
|
272
|
+
export declare const create_request_tracker_view: (parent: RequestTracker) => RequestTracker;
|
|
195
273
|
//# sourceMappingURL=pending_effects.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pending_effects.d.ts","sourceRoot":"","sources":["../../src/lib/http/pending_effects.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pending_effects.d.ts","sourceRoot":"","sources":["../../src/lib/http/pending_effects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,sDAAsD;IACtD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,0EAA0E;IA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contract:
|
|
6
6
|
*
|
|
7
7
|
* - `pending_effects: Array<Promise<void>>` — eager. Producers push pool
|
|
8
|
-
* writes that are already in flight (failure audit rows,
|
|
9
|
-
*
|
|
8
|
+
* writes that are already in flight (failure audit rows, api-token usage
|
|
9
|
+
* tracking). The pool write is rollback-resilient by
|
|
10
10
|
* virtue of running outside the request transaction; pushing the
|
|
11
11
|
* in-flight handle lets test mode (`await_pending_effects: true`) await
|
|
12
12
|
* it.
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* Producers go through `emit_after_commit(ctx, fn)`; the flush
|
|
15
15
|
* middleware is the only site that ever invokes the thunk, and it does
|
|
16
16
|
* so after the request handler (and its wrapping `db.transaction`)
|
|
17
|
-
* returns. Used for WS sends
|
|
17
|
+
* returns. Used for WS sends, a revocation's connection closes, a success
|
|
18
|
+
* audit row's listener fan-out, and any work that must observe a committed
|
|
18
19
|
* transaction.
|
|
19
20
|
*
|
|
20
21
|
* **Discard on rollback.** A `post_commit_effects` thunk is discarded if the
|
|
@@ -203,7 +204,9 @@ export const flush_post_commit_effects = async (effects, log) => {
|
|
|
203
204
|
* that needs a write awaits it itself. Eager rejections are logged and passed
|
|
204
205
|
* to `on_rejection` (the server's `on_effect_error`). The caller picks whether
|
|
205
206
|
* to await the returned promise — HTTP awaits it in test mode only, WS awaits
|
|
206
|
-
* it per frame after the reply is sent
|
|
207
|
+
* it per frame after the reply is sent — and hands it to its request's
|
|
208
|
+
* `AcceptedRequest.finish` either way, so `AppServer.close` waits for it.
|
|
209
|
+
* Never rejects.
|
|
207
210
|
*
|
|
208
211
|
* @param pending_effects - the eager queue of in-flight pool writes
|
|
209
212
|
* @param post_commit_effects - the deferred thunks queued by `emit_after_commit`
|
|
@@ -216,3 +219,78 @@ export const flush_request_effects = async (pending_effects, post_commit_effects
|
|
|
216
219
|
await flush_pending_effects(pending_effects, log, on_rejection);
|
|
217
220
|
await deferred;
|
|
218
221
|
};
|
|
222
|
+
/** Create an empty, open `RequestTracker`. */
|
|
223
|
+
export const create_request_tracker = () => {
|
|
224
|
+
const requests = new Set();
|
|
225
|
+
const flushes = new Set();
|
|
226
|
+
// removed on either outcome, so a flush that rejects despite the contract
|
|
227
|
+
// can't wedge shutdown or surface as an unhandled rejection
|
|
228
|
+
const hold = (set, promise) => {
|
|
229
|
+
set.add(promise);
|
|
230
|
+
const remove = () => {
|
|
231
|
+
set.delete(promise);
|
|
232
|
+
};
|
|
233
|
+
void promise.then(remove, remove);
|
|
234
|
+
};
|
|
235
|
+
// the removal reaction is registered first, so a settled promise is gone
|
|
236
|
+
// from its set by the time a pass resumes
|
|
237
|
+
const drain = async (set) => {
|
|
238
|
+
while (set.size > 0)
|
|
239
|
+
await Promise.allSettled(set);
|
|
240
|
+
};
|
|
241
|
+
let closed = false;
|
|
242
|
+
return {
|
|
243
|
+
accept: () => {
|
|
244
|
+
if (closed)
|
|
245
|
+
return null;
|
|
246
|
+
let release;
|
|
247
|
+
hold(requests, new Promise((resolve) => {
|
|
248
|
+
release = resolve;
|
|
249
|
+
}));
|
|
250
|
+
let finished = false;
|
|
251
|
+
return {
|
|
252
|
+
finish: (flush) => {
|
|
253
|
+
if (finished)
|
|
254
|
+
return;
|
|
255
|
+
finished = true;
|
|
256
|
+
if (!flush) {
|
|
257
|
+
release();
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
hold(flushes, flush);
|
|
261
|
+
void flush.then(release, release);
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
},
|
|
265
|
+
close: () => {
|
|
266
|
+
closed = true;
|
|
267
|
+
},
|
|
268
|
+
drain_inflight: () => drain(requests),
|
|
269
|
+
inflight_count: () => requests.size,
|
|
270
|
+
drain_flushes: () => drain(flushes),
|
|
271
|
+
flush_count: () => flushes.size
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
/**
|
|
275
|
+
* A view of `parent` with its own `close`: `accept` refuses once the view is
|
|
276
|
+
* closed and otherwise holds the request on `parent`; the drains and counts
|
|
277
|
+
* are `parent`'s, so they cover every server on the backend, not only the
|
|
278
|
+
* requests this view accepted. One server's admission over its backend's tracker —
|
|
279
|
+
* `AppServer.close` closes its view, so the backend's tracker stays open for
|
|
280
|
+
* a server assembled on it later.
|
|
281
|
+
*
|
|
282
|
+
* @param parent - the tracker requests are held on
|
|
283
|
+
*/
|
|
284
|
+
export const create_request_tracker_view = (parent) => {
|
|
285
|
+
let closed = false;
|
|
286
|
+
return {
|
|
287
|
+
accept: () => (closed ? null : parent.accept()),
|
|
288
|
+
close: () => {
|
|
289
|
+
closed = true;
|
|
290
|
+
},
|
|
291
|
+
drain_inflight: () => parent.drain_inflight(),
|
|
292
|
+
inflight_count: () => parent.inflight_count(),
|
|
293
|
+
drain_flushes: () => parent.drain_flushes(),
|
|
294
|
+
flush_count: () => parent.flush_count()
|
|
295
|
+
};
|
|
296
|
+
};
|
|
@@ -36,7 +36,7 @@ export interface RouteOkOptions {
|
|
|
36
36
|
* `Set-Cookie` header values, written in order after every `Set-Cookie`
|
|
37
37
|
* line the middleware put on the context — the session middleware's clear
|
|
38
38
|
* of a stale cookie first. Formatted by the caller
|
|
39
|
-
* (`
|
|
39
|
+
* (`sign_session_cookie`, `format_session_clear_cookie`); the framework
|
|
40
40
|
* treats them as opaque lines.
|
|
41
41
|
*/
|
|
42
42
|
readonly set_cookie?: ReadonlyArray<string>;
|
|
@@ -24,7 +24,7 @@ import { type RestErrorDef, type REST_AUTHENTICATION_REQUIRED, type REST_CREDENT
|
|
|
24
24
|
import type { RateLimitKey } from '../rate_limiter.js';
|
|
25
25
|
import type { MiddlewareSpec } from './middleware_spec.js';
|
|
26
26
|
import { type ReadonlyJson, type RouteFailOf, type RouteOk, type RouteRaw, type RouteRawBody, type RouteResult, type RouteSse } from './route_result.js';
|
|
27
|
-
import type { OpenedSseStream,
|
|
27
|
+
import type { OpenedSseStream, SseStreamOptions, SseStream } from '../realtime/sse.js';
|
|
28
28
|
import { type RouteAuth } from './auth_shape.js';
|
|
29
29
|
import { type JsonBodyResult } from './json_text.js';
|
|
30
30
|
import { type QueryPairsRead } from './request_target.js';
|
|
@@ -33,11 +33,12 @@ import type { ResolvedAuth } from '../auth/resolved_auth.js';
|
|
|
33
33
|
/**
|
|
34
34
|
* Two-phase auth guard set returned by `AuthGuardResolver`.
|
|
35
35
|
*
|
|
36
|
-
* `pre_authorization` runs before the authorization phase — the 401 check
|
|
37
|
-
* and the rule-3 token-scope refusal live here,
|
|
38
|
-
*
|
|
36
|
+
* `pre_authorization` runs before the authorization phase — the 401 check,
|
|
37
|
+
* the credential-type gate and the rule-3 token-scope refusal live here, each
|
|
38
|
+
* reading only what the auth middleware set, so a caller they turn away never
|
|
39
|
+
* reaches the actor resolution or the route's body.
|
|
39
40
|
* `post_authorization` runs after the authorization phase has populated
|
|
40
|
-
* `RequestContext` —
|
|
41
|
+
* `RequestContext` — the role check lives here because it reads
|
|
41
42
|
* `c.var.request_context.role_grants`.
|
|
42
43
|
*
|
|
43
44
|
* Both phases run ahead of body validation, which is why neither is named
|
|
@@ -89,13 +90,15 @@ export type RouteMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
|
89
90
|
* either.
|
|
90
91
|
*
|
|
91
92
|
* Audit writes run through `AppDeps.audit.emit(route, input)` (see
|
|
92
|
-
* `auth/audit_emitter.ts`).
|
|
93
|
-
*
|
|
94
|
-
*
|
|
93
|
+
* `auth/audit_emitter.ts`). A success row is written in the transaction of
|
|
94
|
+
* the change it reports — a refused INSERT fails the change, and with no
|
|
95
|
+
* transaction open `emit` throws — and a failure row on the pool it closes
|
|
96
|
+
* over, so a refused attempt's row survives the rollback.
|
|
95
97
|
*
|
|
96
|
-
* Routes whose body
|
|
97
|
-
* declare `transaction: false`
|
|
98
|
-
*
|
|
98
|
+
* Routes whose body opens its own transaction around just its writes
|
|
99
|
+
* (`/login`, `/password`, signup, bootstrap) declare `transaction: false`
|
|
100
|
+
* on the spec, which makes `route.db` the pool, and run that transaction
|
|
101
|
+
* through `transaction_with_post_commit_rollback`.
|
|
99
102
|
*
|
|
100
103
|
* @typeParam TAuth - `auth`, narrowed per route by `RequestContextForAuth`
|
|
101
104
|
* @typeParam TInput - the validated body
|
|
@@ -201,7 +204,7 @@ export interface RouteContext<TAuth extends RequestContext | null = RequestConte
|
|
|
201
204
|
db: Db;
|
|
202
205
|
/**
|
|
203
206
|
* Eager fire-and-forget queue — push the in-flight `Promise<void>` for
|
|
204
|
-
* pool writes already running (audit
|
|
207
|
+
* pool writes already running (failure audit rows, api-token usage
|
|
205
208
|
* tracking). The flush middleware drains via
|
|
206
209
|
* `flush_pending_effects` after the handler returns.
|
|
207
210
|
*/
|
|
@@ -217,7 +220,7 @@ export interface RouteContext<TAuth extends RequestContext | null = RequestConte
|
|
|
217
220
|
post_commit_effects: Array<() => void | Promise<void>>;
|
|
218
221
|
}
|
|
219
222
|
/** Options for `RouteContext.open_sse`. */
|
|
220
|
-
export interface RouteOpenSseOptions extends
|
|
223
|
+
export interface RouteOpenSseOptions extends SseStreamOptions {
|
|
221
224
|
/**
|
|
222
225
|
* Logger for the stream's serialization and `on_close` listener errors and
|
|
223
226
|
* its outbound-overflow warning. Default: the `log` given `apply_route_specs`.
|
|
@@ -230,7 +233,7 @@ export interface RouteOpenSseOptions extends SseResponseOptions {
|
|
|
230
233
|
* which `create_app_server` passes. Injected, so this module stays free of
|
|
231
234
|
* `hono/streaming`.
|
|
232
235
|
*/
|
|
233
|
-
export type RouteSseOpener = <T>(c: Context, log: Logger, options?:
|
|
236
|
+
export type RouteSseOpener = <T>(c: Context, log: Logger, options?: SseStreamOptions) => OpenedSseStream<T>;
|
|
234
237
|
/**
|
|
235
238
|
* Route handler function — receives the `RouteContext` and returns a result
|
|
236
239
|
* (`route_ok`, `route_fail`, `route_raw`, `route_sse` in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route_spec.d.ts","sourceRoot":"","sources":["../../src/lib/http/route_spec.ts"],"names":[],"mappings":"AAAA;;;;;;;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it_log_sse: (options: {
|
|
|
170
170
|
*/
|
|
171
171
|
max_per_scope?: number | null;
|
|
172
172
|
/**
|
|
173
|
-
* Each stream's keep-alive interval (`
|
|
173
|
+
* Each stream's keep-alive interval (`SseStreamOptions.keep_alive_ms`), in
|
|
174
174
|
* ms; `null` turns keep-alives off. A test server shortens it.
|
|
175
175
|
*
|
|
176
176
|
* @default SSE_KEEP_ALIVE_INTERVAL_MS
|
package/dist/realtime/sse.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SSE (Server-Sent Events) streaming utilities for Hono.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* `create_sse_stream` opens a stream on a request — what a route spec's
|
|
5
|
+
* `RouteContext.open_sse` gives it, answered by `route_sse` — and
|
|
6
|
+
* `SseNotification` is the notification shape, aligned with JSON-RPC 2.0.
|
|
6
7
|
*
|
|
7
8
|
* ## Outbound bound
|
|
8
9
|
*
|
|
@@ -66,8 +67,8 @@ export interface SseNotification {
|
|
|
66
67
|
/** Method-specific payload. */
|
|
67
68
|
params: unknown;
|
|
68
69
|
}
|
|
69
|
-
/** Options for `create_sse_stream
|
|
70
|
-
export interface
|
|
70
|
+
/** Options for `create_sse_stream`. */
|
|
71
|
+
export interface SseStreamOptions {
|
|
71
72
|
/**
|
|
72
73
|
* The account the stream belongs to, named in the warning logged when the
|
|
73
74
|
* stream ends on its outbound budget.
|
|
@@ -123,27 +124,7 @@ export interface OpenedSseStream<T> {
|
|
|
123
124
|
* @throws Error when `options.keep_alive_ms` is out of range
|
|
124
125
|
* (`validate_sse_keep_alive_ms`)
|
|
125
126
|
*/
|
|
126
|
-
export declare const create_sse_stream: <T = unknown>(c: Context, log: Logger, options?:
|
|
127
|
-
/**
|
|
128
|
-
* Create an SSE response for a Hono context: `create_sse_stream`, answered at
|
|
129
|
-
* once through the context with `SSE_RESPONSE_HEADERS` — the response
|
|
130
|
-
* Hono's `streamSSE` builds, so it carries the headers the middleware put on
|
|
131
|
-
* the context. For a handler outside the route-spec system; a route spec opens
|
|
132
|
-
* its stream through `RouteContext.open_sse` instead, which builds the
|
|
133
|
-
* response only when the route answers with it.
|
|
134
|
-
*
|
|
135
|
-
* @param log - logger for serialization and `on_close` listener errors, and
|
|
136
|
-
* for the warning when the stream ends on its outbound budget
|
|
137
|
-
* @param options - what the overflow warning names, and the keep-alive interval
|
|
138
|
-
* @returns object with the streaming `Response` and an `SseStream` controller
|
|
139
|
-
* @throws Error when `options.keep_alive_ms` is out of range
|
|
140
|
-
* (`validate_sse_keep_alive_ms`)
|
|
141
|
-
* @mutates `c` - writes `SSE_RESPONSE_HEADERS` on the context's headers
|
|
142
|
-
*/
|
|
143
|
-
export declare const create_sse_response: <T = unknown>(c: Context, log: Logger, options?: SseResponseOptions) => {
|
|
144
|
-
response: Response;
|
|
145
|
-
stream: SseStream<T>;
|
|
146
|
-
};
|
|
127
|
+
export declare const create_sse_stream: <T = unknown>(c: Context, log: Logger, options?: SseStreamOptions) => OpenedSseStream<T>;
|
|
147
128
|
/** Spec for a push event — declares params schema, description, and channel. */
|
|
148
129
|
export interface EventSpec {
|
|
149
130
|
/** Event method name, used as the JSON-RPC notification `method`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../src/lib/realtime/sse.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../src/lib/realtime/sse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAYrE;;;;GAIG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC,GA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,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,IAAI,CAAA;CAAE,EAC9D,aAAa,KAAK,CAAC,SAAS,CAAC,EAC7B,KAAK,MAAM,KACT;IAAE,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,IAAI,CAAA;CAmBjD,CAAC"}
|
package/dist/realtime/sse.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SSE (Server-Sent Events) streaming utilities for Hono.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* `create_sse_stream` opens a stream on a request — what a route spec's
|
|
5
|
+
* `RouteContext.open_sse` gives it, answered by `route_sse` — and
|
|
6
|
+
* `SseNotification` is the notification shape, aligned with JSON-RPC 2.0.
|
|
6
7
|
*
|
|
7
8
|
* ## Outbound bound
|
|
8
9
|
*
|
|
@@ -35,7 +36,7 @@ import { DEV } from 'esm-env';
|
|
|
35
36
|
import { parse } from '@fuzdev/fuz_schema/schema.ts';
|
|
36
37
|
import { utf8_length } from '../actions/transports.js';
|
|
37
38
|
import { OutboundBudget } from './outbound_budget.js';
|
|
38
|
-
import { SSE_CONNECTED_COMMENT, SSE_KEEP_ALIVE_COMMENT, SSE_KEEP_ALIVE_INTERVAL_MS, SSE_OUTBOUND_QUEUE_BYTES,
|
|
39
|
+
import { SSE_CONNECTED_COMMENT, SSE_KEEP_ALIVE_COMMENT, SSE_KEEP_ALIVE_INTERVAL_MS, SSE_OUTBOUND_QUEUE_BYTES, validate_sse_keep_alive_ms } from './sse_constants.js';
|
|
39
40
|
const is_node_connection_stream = (value) => {
|
|
40
41
|
if (typeof value !== 'object' || value === null)
|
|
41
42
|
return false;
|
|
@@ -226,28 +227,6 @@ export const create_sse_stream = (c, log, options) => {
|
|
|
226
227
|
watch_client_disconnect(c, do_close);
|
|
227
228
|
return { stream, body: hono_stream.responseReadable };
|
|
228
229
|
};
|
|
229
|
-
/**
|
|
230
|
-
* Create an SSE response for a Hono context: `create_sse_stream`, answered at
|
|
231
|
-
* once through the context with `SSE_RESPONSE_HEADERS` — the response
|
|
232
|
-
* Hono's `streamSSE` builds, so it carries the headers the middleware put on
|
|
233
|
-
* the context. For a handler outside the route-spec system; a route spec opens
|
|
234
|
-
* its stream through `RouteContext.open_sse` instead, which builds the
|
|
235
|
-
* response only when the route answers with it.
|
|
236
|
-
*
|
|
237
|
-
* @param log - logger for serialization and `on_close` listener errors, and
|
|
238
|
-
* for the warning when the stream ends on its outbound budget
|
|
239
|
-
* @param options - what the overflow warning names, and the keep-alive interval
|
|
240
|
-
* @returns object with the streaming `Response` and an `SseStream` controller
|
|
241
|
-
* @throws Error when `options.keep_alive_ms` is out of range
|
|
242
|
-
* (`validate_sse_keep_alive_ms`)
|
|
243
|
-
* @mutates `c` - writes `SSE_RESPONSE_HEADERS` on the context's headers
|
|
244
|
-
*/
|
|
245
|
-
export const create_sse_response = (c, log, options) => {
|
|
246
|
-
const { stream, body } = create_sse_stream(c, log, options);
|
|
247
|
-
for (const [name, value] of Object.entries(SSE_RESPONSE_HEADERS))
|
|
248
|
-
c.header(name, value);
|
|
249
|
-
return { response: c.newResponse(body), stream };
|
|
250
|
-
};
|
|
251
230
|
/**
|
|
252
231
|
* Create a broadcaster that validates events in DEV mode.
|
|
253
232
|
*
|
|
@@ -37,7 +37,7 @@ export declare const SSE_KEEP_ALIVE_INTERVAL_MS = 15000;
|
|
|
37
37
|
export declare const SSE_KEEP_ALIVE_INTERVAL_MS_MAX = 2147483647;
|
|
38
38
|
/**
|
|
39
39
|
* Throw unless `keep_alive_ms` is a valid keep-alive interval
|
|
40
|
-
* (`
|
|
40
|
+
* (`SseStreamOptions.keep_alive_ms`):
|
|
41
41
|
* `undefined` (the default), `null` (off), or a positive number of ms up to
|
|
42
42
|
* `SSE_KEEP_ALIVE_INTERVAL_MS_MAX`. Timers read anything else — zero, a
|
|
43
43
|
* negative, `NaN`, `Infinity`, or past the max — as an interval of about
|
|
@@ -42,7 +42,7 @@ export const SSE_KEEP_ALIVE_INTERVAL_MS = 15_000;
|
|
|
42
42
|
export const SSE_KEEP_ALIVE_INTERVAL_MS_MAX = 2_147_483_647;
|
|
43
43
|
/**
|
|
44
44
|
* Throw unless `keep_alive_ms` is a valid keep-alive interval
|
|
45
|
-
* (`
|
|
45
|
+
* (`SseStreamOptions.keep_alive_ms`):
|
|
46
46
|
* `undefined` (the default), `null` (off), or a positive number of ms up to
|
|
47
47
|
* `SSE_KEEP_ALIVE_INTERVAL_MS_MAX`. Timers read anything else — zero, a
|
|
48
48
|
* negative, `NaN`, `Infinity`, or past the max — as an interval of about
|
|
@@ -141,9 +141,8 @@ export interface CreateAppBackendOptions {
|
|
|
141
141
|
/**
|
|
142
142
|
* Bound on the pool checkouts a request makes, in ms — the server env's
|
|
143
143
|
* `FUZ_DB_CHECKOUT_TIMEOUT_MS`. Default `DEFAULT_DB_CHECKOUT_TIMEOUT_MS`
|
|
144
|
-
* (5 s). A failed checkout answers 503 on every surface. Audit writes
|
|
145
|
-
* `db_audit_checkout_timeout_ms` instead
|
|
146
|
-
* waits on included. A checkout that waits and then connects can take about
|
|
144
|
+
* (5 s). A failed checkout answers 503 on every surface. Audit pool writes (failure
|
|
145
|
+
* rows) use `db_audit_checkout_timeout_ms` instead. A checkout that waits and then connects can take about
|
|
147
146
|
* twice the bound (`db/db_pg.ts`, "Checkout timeout"). Postgres only:
|
|
148
147
|
* PGlite and pglet have no pool, and a value passed with one is warned of
|
|
149
148
|
* at boot. Twin of the Rust `BaseServerEnv::db_checkout_timeout`.
|
|
@@ -152,8 +151,8 @@ export interface CreateAppBackendOptions {
|
|
|
152
151
|
/**
|
|
153
152
|
* Bound on the checkout behind each audit pool write, in ms — the server
|
|
154
153
|
* env's `FUZ_DB_AUDIT_CHECKOUT_TIMEOUT_MS`. Default
|
|
155
|
-
* `DEFAULT_DB_AUDIT_CHECKOUT_TIMEOUT_MS` (30 s).
|
|
156
|
-
*
|
|
154
|
+
* `DEFAULT_DB_AUDIT_CHECKOUT_TIMEOUT_MS` (30 s). No response waits on
|
|
155
|
+
* a pool write; `AppServer.close` drains them within its own bound. Postgres only, like
|
|
157
156
|
* `db_checkout_timeout_ms`. Twin of the Rust
|
|
158
157
|
* `BaseServerEnv::db_audit_checkout_timeout`.
|
|
159
158
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app_backend.d.ts","sourceRoot":"","sources":["../../src/lib/server/app_backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAE9F,OAAO,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAkB,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"app_backend.d.ts","sourceRoot":"","sources":["../../src/lib/server/app_backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAE9F,OAAO,KAAK,EAAE,MAAM,EAAE,EAAE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