@fuzdev/fuz_app 0.180.0 → 0.182.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 +38 -20
- package/dist/actions/action_rpc.d.ts +25 -6
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +56 -48
- package/dist/actions/action_types.d.ts +31 -13
- package/dist/actions/action_types.d.ts.map +1 -1
- package/dist/actions/action_types.js +1 -1
- package/dist/actions/notification_sender.d.ts +83 -0
- package/dist/actions/notification_sender.d.ts.map +1 -0
- package/dist/actions/notification_sender.js +85 -0
- package/dist/actions/perform_action.d.ts +13 -4
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +27 -18
- package/dist/actions/register_action_ws.d.ts +20 -2
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +17 -5
- package/dist/actions/ws_socket_session.d.ts +3 -0
- package/dist/actions/ws_socket_session.d.ts.map +1 -1
- package/dist/actions/ws_socket_session.js +3 -2
- package/dist/auth/CLAUDE.md +84 -59
- package/dist/auth/account_actions.d.ts.map +1 -1
- package/dist/auth/account_actions.js +30 -3
- package/dist/auth/account_queries.d.ts +213 -2
- package/dist/auth/account_queries.d.ts.map +1 -1
- package/dist/auth/account_queries.js +255 -2
- package/dist/auth/account_route_schema.d.ts +26 -16
- package/dist/auth/account_route_schema.d.ts.map +1 -1
- package/dist/auth/account_route_schema.js +10 -24
- package/dist/auth/account_routes.d.ts +5 -7
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +110 -89
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +117 -25
- package/dist/auth/api_token_queries.d.ts +29 -12
- package/dist/auth/api_token_queries.d.ts.map +1 -1
- package/dist/auth/api_token_queries.js +42 -27
- package/dist/auth/audit_log_route_schema.d.ts +1 -1
- package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
- 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 +10 -12
- package/dist/auth/audit_log_schema.js +4 -4
- package/dist/auth/bearer_auth.d.ts +4 -3
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +37 -32
- package/dist/auth/bootstrap_account.d.ts +65 -37
- package/dist/auth/bootstrap_account.d.ts.map +1 -1
- package/dist/auth/bootstrap_account.js +115 -66
- package/dist/auth/bootstrap_route_schema.d.ts +6 -2
- package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
- package/dist/auth/bootstrap_route_schema.js +7 -2
- package/dist/auth/bootstrap_routes.d.ts +50 -33
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/bootstrap_routes.js +109 -87
- package/dist/auth/bootstrap_token_store.d.ts +60 -0
- package/dist/auth/bootstrap_token_store.d.ts.map +1 -0
- package/dist/auth/bootstrap_token_store.js +39 -0
- package/dist/auth/credential_headers.d.ts +71 -0
- package/dist/auth/credential_headers.d.ts.map +1 -0
- package/dist/auth/credential_headers.js +100 -0
- package/dist/auth/daemon_token.d.ts +13 -1
- package/dist/auth/daemon_token.d.ts.map +1 -1
- package/dist/auth/daemon_token.js +14 -2
- package/dist/auth/daemon_token_middleware.d.ts +10 -11
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +39 -30
- package/dist/auth/deps.d.ts +10 -11
- package/dist/auth/deps.d.ts.map +1 -1
- package/dist/auth/invite_queries.d.ts +18 -0
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_queries.js +24 -0
- package/dist/auth/request_context.d.ts +97 -76
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +93 -104
- package/dist/auth/resolved_auth.d.ts +10 -5
- package/dist/auth/resolved_auth.d.ts.map +1 -1
- package/dist/auth/resolved_auth.js +2 -2
- package/dist/auth/role_grant_offer_action_specs.d.ts +2 -2
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_action_specs.js +5 -3
- package/dist/auth/role_grant_offer_actions.d.ts +7 -11
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +97 -106
- package/dist/auth/role_grant_offer_ddl.d.ts +7 -1
- package/dist/auth/role_grant_offer_ddl.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_ddl.js +9 -2
- package/dist/auth/role_grant_offer_notifications.d.ts +87 -38
- package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_notifications.js +75 -22
- package/dist/auth/role_grant_offer_queries.d.ts +143 -9
- package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_queries.js +266 -66
- package/dist/auth/role_grant_offer_schema.js +1 -1
- package/dist/auth/role_grant_queries.d.ts +57 -10
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.js +81 -22
- package/dist/auth/role_grant_sql.d.ts +21 -0
- package/dist/auth/role_grant_sql.d.ts.map +1 -1
- package/dist/auth/role_grant_sql.js +21 -0
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +9 -2
- package/dist/auth/session_cookie.d.ts +105 -25
- package/dist/auth/session_cookie.d.ts.map +1 -1
- package/dist/auth/session_cookie.js +124 -15
- package/dist/auth/session_middleware.d.ts +83 -54
- package/dist/auth/session_middleware.d.ts.map +1 -1
- package/dist/auth/session_middleware.js +92 -66
- package/dist/auth/session_queries.d.ts +95 -14
- package/dist/auth/session_queries.d.ts.map +1 -1
- package/dist/auth/session_queries.js +98 -19
- package/dist/auth/signup_route_schema.d.ts +5 -5
- package/dist/auth/signup_route_schema.d.ts.map +1 -1
- package/dist/auth/signup_route_schema.js +4 -4
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +17 -14
- package/dist/auth/standard_rpc_actions.d.ts +6 -19
- package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
- package/dist/auth/standard_rpc_actions.js +5 -6
- package/dist/auth/token_scope.d.ts +6 -8
- package/dist/auth/token_scope.d.ts.map +1 -1
- package/dist/auth/token_scope.js +6 -9
- package/dist/dev/setup.d.ts +6 -1
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +42 -34
- package/dist/hono_context.d.ts +21 -0
- package/dist/hono_context.d.ts.map +1 -1
- package/dist/hono_context.js +17 -0
- package/dist/http/CLAUDE.md +156 -48
- package/dist/http/auth_shape.d.ts +4 -4
- package/dist/http/common_routes.js +1 -1
- package/dist/http/db_routes.d.ts +4 -3
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +14 -14
- package/dist/http/dev_route_error_check.d.ts +6 -3
- package/dist/http/dev_route_error_check.d.ts.map +1 -1
- package/dist/http/dev_route_error_check.js +6 -3
- package/dist/http/dev_set_cookie_check.d.ts +53 -0
- package/dist/http/dev_set_cookie_check.d.ts.map +1 -0
- package/dist/http/dev_set_cookie_check.js +80 -0
- package/dist/http/error_schemas.d.ts +45 -22
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +53 -26
- package/dist/http/header_lines.d.ts +42 -0
- package/dist/http/header_lines.d.ts.map +1 -0
- package/dist/http/header_lines.js +80 -0
- package/dist/http/host.d.ts +12 -9
- package/dist/http/host.d.ts.map +1 -1
- package/dist/http/host.js +25 -20
- package/dist/http/origin.d.ts +7 -22
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +11 -25
- package/dist/http/proxy.d.ts +1 -0
- package/dist/http/proxy.d.ts.map +1 -1
- package/dist/http/proxy.js +3 -0
- package/dist/http/request_headers.d.ts +95 -0
- package/dist/http/request_headers.d.ts.map +1 -0
- package/dist/http/request_headers.js +110 -0
- package/dist/http/request_target.d.ts +134 -0
- package/dist/http/request_target.d.ts.map +1 -0
- package/dist/http/request_target.js +193 -0
- package/dist/http/route_error_check.d.ts +4 -11
- package/dist/http/route_error_check.d.ts.map +1 -1
- package/dist/http/route_error_check.js +4 -21
- package/dist/http/route_result.d.ts +127 -23
- package/dist/http/route_result.d.ts.map +1 -1
- package/dist/http/route_result.js +97 -19
- package/dist/http/route_spec.d.ts +299 -83
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +548 -71
- package/dist/http/simple_request.d.ts +19 -14
- package/dist/http/simple_request.d.ts.map +1 -1
- package/dist/http/simple_request.js +17 -29
- package/dist/http/surface.d.ts +2 -0
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +4 -1
- package/dist/realtime/outbound_budget.d.ts +1 -2
- package/dist/realtime/outbound_budget.d.ts.map +1 -1
- package/dist/realtime/outbound_budget.js +1 -2
- package/dist/realtime/sse.d.ts +47 -17
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +115 -93
- package/dist/realtime/sse_constants.d.ts +7 -1
- package/dist/realtime/sse_constants.d.ts.map +1 -1
- package/dist/realtime/sse_constants.js +12 -1
- package/dist/realtime/sse_registry.d.ts +3 -3
- package/dist/realtime/sse_registry.js +3 -3
- package/dist/runtime/deps.d.ts +20 -4
- package/dist/runtime/deps.d.ts.map +1 -1
- package/dist/runtime/mock.d.ts +7 -1
- package/dist/runtime/mock.d.ts.map +1 -1
- package/dist/runtime/mock.js +33 -3
- package/dist/runtime/node.d.ts.map +1 -1
- package/dist/runtime/node.js +2 -1
- package/dist/runtime/secure_file.d.ts +71 -10
- package/dist/runtime/secure_file.d.ts.map +1 -1
- package/dist/runtime/secure_file.js +91 -11
- package/dist/server/app_backend.d.ts +0 -8
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_backend.js +4 -4
- package/dist/server/app_server.d.ts +54 -33
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +69 -41
- package/dist/server/serve_fact_route.d.ts +3 -3
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +59 -55
- package/dist/server/static.d.ts +20 -0
- package/dist/server/static.d.ts.map +1 -1
- package/dist/server/static.js +56 -8
- package/dist/server/unmatched_route.d.ts +42 -0
- package/dist/server/unmatched_route.d.ts.map +1 -0
- package/dist/server/unmatched_route.js +64 -0
- package/dist/testing/CLAUDE.md +406 -1202
- package/dist/testing/app_server.d.ts +3 -1
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +5 -9
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +3 -2
- package/dist/testing/cross_backend/account_lifecycle.d.ts +11 -4
- package/dist/testing/cross_backend/account_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/account_lifecycle.js +320 -6
- package/dist/testing/cross_backend/build_test_backend_paths.d.ts +4 -1
- package/dist/testing/cross_backend/build_test_backend_paths.d.ts.map +1 -1
- package/dist/testing/cross_backend/build_test_backend_paths.js +1 -1
- package/dist/testing/cross_backend/capabilities.d.ts +68 -5
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/capabilities.js +20 -4
- package/dist/testing/cross_backend/cell_gated_create.js +1 -1
- package/dist/testing/cross_backend/conformance_case.d.ts +63 -21
- package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.d.ts +54 -12
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +179 -23
- package/dist/testing/cross_backend/cookie_attributes.js +1 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts +7 -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 +3 -3
- package/dist/testing/cross_backend/credential_conformance.d.ts +196 -0
- package/dist/testing/cross_backend/credential_conformance.d.ts.map +1 -0
- package/dist/testing/cross_backend/credential_conformance.js +296 -0
- package/dist/testing/cross_backend/credential_conformance.json +1284 -0
- package/dist/testing/cross_backend/credential_conformance_wire.d.ts +40 -0
- package/dist/testing/cross_backend/credential_conformance_wire.d.ts.map +1 -0
- package/dist/testing/cross_backend/credential_conformance_wire.js +293 -0
- package/dist/testing/cross_backend/credential_header_robustness.d.ts +1 -3
- package/dist/testing/cross_backend/credential_header_robustness.d.ts.map +1 -1
- package/dist/testing/cross_backend/credential_header_robustness.js +24 -55
- package/dist/testing/cross_backend/credential_wire.d.ts +112 -0
- package/dist/testing/cross_backend/credential_wire.d.ts.map +1 -0
- package/dist/testing/cross_backend/credential_wire.js +188 -0
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +22 -2
- package/dist/testing/cross_backend/default_spine_surface.d.ts +1 -26
- package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_spine_surface.js +3 -7
- package/dist/testing/cross_backend/differential.d.ts +1 -1
- package/dist/testing/cross_backend/differential.d.ts.map +1 -1
- package/dist/testing/cross_backend/differential.js +3 -2
- package/dist/testing/cross_backend/differential_normalize.d.ts +23 -6
- package/dist/testing/cross_backend/differential_normalize.d.ts.map +1 -1
- package/dist/testing/cross_backend/differential_normalize.js +11 -5
- package/dist/testing/cross_backend/full_spine_mount.d.ts +4 -10
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +11 -4
- package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/identity_parity.js +4 -0
- package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/in_process_setup.js +78 -4
- package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
- package/dist/testing/cross_backend/login_security.js +13 -10
- package/dist/testing/cross_backend/peer_ping_ws.d.ts +1 -1
- package/dist/testing/cross_backend/peer_ping_ws.js +2 -2
- package/dist/testing/cross_backend/request_header_conformance.d.ts +174 -0
- package/dist/testing/cross_backend/request_header_conformance.d.ts.map +1 -0
- package/dist/testing/cross_backend/request_header_conformance.js +196 -0
- package/dist/testing/cross_backend/request_header_conformance.json +1158 -0
- package/dist/testing/cross_backend/request_header_conformance_wire.d.ts +39 -0
- package/dist/testing/cross_backend/request_header_conformance_wire.d.ts.map +1 -0
- package/dist/testing/cross_backend/request_header_conformance_wire.js +284 -0
- package/dist/testing/cross_backend/request_target_conformance.d.ts +298 -0
- package/dist/testing/cross_backend/request_target_conformance.d.ts.map +1 -0
- package/dist/testing/cross_backend/request_target_conformance.js +186 -0
- package/dist/testing/cross_backend/request_target_conformance.json +3765 -0
- package/dist/testing/cross_backend/request_target_conformance_wire.d.ts +32 -0
- package/dist/testing/cross_backend/request_target_conformance_wire.d.ts.map +1 -0
- package/dist/testing/cross_backend/request_target_conformance_wire.js +278 -0
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +173 -1
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts +5 -4
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.js +185 -31
- package/dist/testing/cross_backend/rpc_adversarial.d.ts +6 -4
- package/dist/testing/cross_backend/rpc_adversarial.d.ts.map +1 -1
- package/dist/testing/cross_backend/rpc_adversarial.js +5 -2
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +6 -7
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.js +4 -5
- package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/session_cap.js +82 -34
- package/dist/testing/cross_backend/session_cookie_effect.d.ts +43 -0
- package/dist/testing/cross_backend/session_cookie_effect.d.ts.map +1 -0
- package/dist/testing/cross_backend/session_cookie_effect.js +103 -0
- package/dist/testing/cross_backend/session_login.d.ts +24 -0
- package/dist/testing/cross_backend/session_login.d.ts.map +1 -0
- package/dist/testing/cross_backend/session_login.js +31 -0
- package/dist/testing/cross_backend/setup.d.ts +117 -0
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +193 -9
- package/dist/testing/cross_backend/simple_request.d.ts.map +1 -1
- package/dist/testing/cross_backend/simple_request.js +5 -0
- package/dist/testing/cross_backend/spine_suites.d.ts +9 -1
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +88 -5
- package/dist/testing/cross_backend/spine_surface_constants.d.ts +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.js +1 -0
- package/dist/testing/cross_backend/sse_round_trip.d.ts +8 -5
- package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/sse_round_trip.js +205 -64
- package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_backdoor.js +5 -2
- package/dist/testing/cross_backend/testing_credential_read.d.ts +165 -0
- package/dist/testing/cross_backend/testing_credential_read.d.ts.map +1 -0
- package/dist/testing/cross_backend/testing_credential_read.js +175 -0
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +19 -0
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +22 -6
- package/dist/testing/cross_backend/token_lifetime.d.ts.map +1 -1
- package/dist/testing/cross_backend/token_lifetime.js +58 -2
- package/dist/testing/cross_backend/transport_composition.d.ts +2 -4
- package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
- package/dist/testing/cross_backend/transport_composition.js +13 -10
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +5 -3
- package/dist/testing/cross_backend/ws_endpoint.d.ts +11 -1
- package/dist/testing/cross_backend/ws_endpoint.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_endpoint.js +19 -2
- package/dist/testing/cross_backend/ws_role_gated.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_role_gated.js +2 -3
- package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_round_trip.js +28 -12
- package/dist/testing/cross_backend/xfail.d.ts +44 -11
- package/dist/testing/cross_backend/xfail.d.ts.map +1 -1
- package/dist/testing/cross_backend/xfail.js +68 -23
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +4 -3
- package/dist/testing/integration.d.ts +1 -2
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +14 -8
- package/dist/testing/integration_helpers.d.ts +50 -3
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +87 -9
- package/dist/testing/middleware.d.ts +3 -1
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +14 -7
- package/dist/testing/resolved_auth.d.ts +3 -1
- package/dist/testing/resolved_auth.d.ts.map +1 -1
- package/dist/testing/resolved_auth.js +4 -4
- package/dist/testing/round_trip.d.ts +6 -2
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/round_trip.js +17 -6
- package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
- package/dist/testing/rpc_envelope_cases.js +7 -0
- package/dist/testing/rpc_helpers.d.ts +4 -2
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +6 -1
- package/dist/testing/rpc_round_trip.d.ts +13 -2
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.js +25 -6
- package/dist/testing/schema_generators.d.ts +2 -2
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +4 -4
- package/dist/testing/stubs.d.ts +2 -2
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +13 -10
- package/dist/testing/transports/fetch_transport.d.ts +6 -3
- package/dist/testing/transports/fetch_transport.d.ts.map +1 -1
- package/dist/testing/transports/fetch_transport.js +31 -19
- package/dist/testing/transports/raw_http.d.ts +61 -1
- package/dist/testing/transports/raw_http.d.ts.map +1 -1
- package/dist/testing/transports/raw_http.js +61 -1
- package/dist/testing/transports/ws_raw_client.d.ts +20 -0
- package/dist/testing/transports/ws_raw_client.d.ts.map +1 -1
- package/dist/testing/transports/ws_raw_client.js +10 -4
- package/dist/testing/transports/ws_transport.d.ts +21 -1
- package/dist/testing/transports/ws_transport.d.ts.map +1 -1
- package/dist/testing/transports/ws_transport.js +58 -20
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +8 -4
- package/package.json +1 -1
|
@@ -23,8 +23,13 @@ import type { Db } from '../db/db.js';
|
|
|
23
23
|
import { type RestErrorDef, type REST_AUTHENTICATION_REQUIRED, type REST_CREDENTIAL_TYPE_REQUIRED, type REST_INSUFFICIENT_PERMISSIONS, type REST_INTERNAL_ERROR, type REST_RATE_LIMIT_EXCEEDED, type REST_SERVICE_UNAVAILABLE, type REST_TOKEN_SCOPE_REQUIRED } from './error_schemas.js';
|
|
24
24
|
import type { RateLimitKey } from '../rate_limiter.js';
|
|
25
25
|
import type { MiddlewareSpec } from './middleware_spec.js';
|
|
26
|
-
import type
|
|
26
|
+
import { type ReadonlyJson, type RouteFailOf, type RouteOk, type RouteRaw, type RouteRawBody, type RouteResult, type RouteSse } from './route_result.js';
|
|
27
|
+
import type { OpenedSseStream, SseResponseOptions, SseStream } from '../realtime/sse.js';
|
|
27
28
|
import { type RouteAuth } from './auth_shape.js';
|
|
29
|
+
import { type JsonBodyResult } from './json_text.js';
|
|
30
|
+
import { type QueryPairsRead } from './request_target.js';
|
|
31
|
+
import type { RequestContext, RequestContextForAuth } from '../auth/request_context.js';
|
|
32
|
+
import type { ResolvedAuth } from '../auth/resolved_auth.js';
|
|
28
33
|
/**
|
|
29
34
|
* Two-phase auth guard set returned by `AuthGuardResolver`.
|
|
30
35
|
*
|
|
@@ -71,9 +76,19 @@ export type AuthorizationHandler = (c: Context, spec: RouteSpec) => Promise<Resp
|
|
|
71
76
|
/** HTTP methods supported by route specs. */
|
|
72
77
|
export type RouteMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
73
78
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
79
|
+
* Everything a route handler receives: the request as the pipeline resolved
|
|
80
|
+
* and validated it, the per-request deps, and the few effects a handler may
|
|
81
|
+
* ask of the response. A handler takes nothing else — never the Hono
|
|
82
|
+
* context — and returns a result (`http/route_result.ts`), so nothing it does
|
|
83
|
+
* can write on the response the spine builds after the commit.
|
|
84
|
+
*
|
|
85
|
+
* The fields it shares with `ActionContext` (`auth`, `client_ip`, `signal`,
|
|
86
|
+
* `db`, `pending_effects`, `post_commit_effects`) carry the same names and
|
|
87
|
+
* types there, so a helper typed against one of the narrow slices
|
|
88
|
+
* (`QueryDeps`, `EmitAfterCommitContext`, `AuditEmitterContext`) takes
|
|
89
|
+
* either.
|
|
90
|
+
*
|
|
91
|
+
* Audit writes run through `AppDeps.audit.emit(route, input)` (see
|
|
77
92
|
* `auth/audit_emitter.ts`). It writes a success row in the route's
|
|
78
93
|
* transaction when one is open and a failure row on the pool it closes over,
|
|
79
94
|
* so a refused attempt's row survives the rollback.
|
|
@@ -81,8 +96,104 @@ export type RouteMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
|
81
96
|
* Routes whose body manages its own transaction (signup, bootstrap)
|
|
82
97
|
* declare `transaction: false` on the spec, which makes `route.db` the
|
|
83
98
|
* pool — they reach for it directly.
|
|
99
|
+
*
|
|
100
|
+
* @typeParam TAuth - `auth`, narrowed per route by `RequestContextForAuth`
|
|
101
|
+
* @typeParam TInput - the validated body
|
|
102
|
+
* @typeParam TParams - the validated path params, `undefined` without a `params` schema
|
|
103
|
+
* @typeParam TQuery - the validated query, `undefined` without a `query` schema
|
|
84
104
|
*/
|
|
85
|
-
export interface RouteContext {
|
|
105
|
+
export interface RouteContext<TAuth extends RequestContext | null = RequestContext | null, TInput = unknown, TParams = unknown, TQuery = unknown> {
|
|
106
|
+
/**
|
|
107
|
+
* The request context the authorization phase built: the account, the
|
|
108
|
+
* acting actor, and its role grants; `null` on a route whose auth reads
|
|
109
|
+
* none. A handler of a route that requires an account or an actor gets
|
|
110
|
+
* it non-null by type (`RequestContextForAuth`), and the spec's handler
|
|
111
|
+
* throws rather than run without it (`define_route`).
|
|
112
|
+
*/
|
|
113
|
+
auth: TAuth;
|
|
114
|
+
/**
|
|
115
|
+
* The credential the auth middleware resolved, `null` for an anonymous
|
|
116
|
+
* caller. A `reads_credential` route — one that answers anonymous callers
|
|
117
|
+
* itself — reads the account it may act on through
|
|
118
|
+
* `get_public_account(route)` (`auth/request_context.ts`), never from
|
|
119
|
+
* here: a scope-narrowed API token is the anonymous caller there, and only
|
|
120
|
+
* that function applies the rule.
|
|
121
|
+
*/
|
|
122
|
+
credential: ResolvedAuth | null;
|
|
123
|
+
/** The client IP the trusted-proxy middleware resolved, `'unknown'` without one. */
|
|
124
|
+
client_ip: string;
|
|
125
|
+
/**
|
|
126
|
+
* The connection's peer address as the trusted-proxy middleware read it
|
|
127
|
+
* (`ProxyOptions.get_connection_ip`) — the socket's, never a forwarded
|
|
128
|
+
* one — `null` when the middleware is not mounted or the runtime gave
|
|
129
|
+
* none. For a route that admits loopback callers only. As the runtime
|
|
130
|
+
* spells it, not normalized — an IPv4-mapped `::ffff:127.0.0.1` stays
|
|
131
|
+
* that — unlike `client_ip`.
|
|
132
|
+
*/
|
|
133
|
+
connection_ip: string | null;
|
|
134
|
+
/** Aborts when the client disconnects. */
|
|
135
|
+
signal: AbortSignal;
|
|
136
|
+
/** The validated body — `null` for a route with a `null` input (every `GET`). */
|
|
137
|
+
input: TInput;
|
|
138
|
+
/** The validated path params, `undefined` for a route without a `params` schema. */
|
|
139
|
+
params: TParams;
|
|
140
|
+
/** The validated query, `undefined` for a route without a `query` schema. */
|
|
141
|
+
query: TQuery;
|
|
142
|
+
/**
|
|
143
|
+
* Whether a test harness pre-built the request context — what
|
|
144
|
+
* `has_test_context_preset` reads of the Hono context: `auth` then has no
|
|
145
|
+
* rows behind it, so a handler that re-reads them skips the re-read.
|
|
146
|
+
* Never set in production.
|
|
147
|
+
*/
|
|
148
|
+
has_test_context_preset: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* The raw request, for what the pipeline neither validates nor reads: a
|
|
151
|
+
* `raw_body` route's body stream, the undecoded URL. Its body can be read
|
|
152
|
+
* once: the pipeline already read it on a route with a JSON input, and
|
|
153
|
+
* `read_json_body` reads it, so a handler that reads it there finds it
|
|
154
|
+
* used. Its `headers.get(name)` answers `null` for an absent header, where
|
|
155
|
+
* `header_lines(name)` answers an empty list.
|
|
156
|
+
*/
|
|
157
|
+
request: Request;
|
|
158
|
+
/**
|
|
159
|
+
* The query string decoded strictly (`read_query_pairs`,
|
|
160
|
+
* `http/request_target.ts`) — every pair in order, or the refusal when
|
|
161
|
+
* any escape in it doesn't decode — for a route reading a parameter its
|
|
162
|
+
* `query` schema does not declare. Read a key with `query_first`; on a
|
|
163
|
+
* refusal answer `REST_INVALID_QUERY_PARAMS` (or the transport's own
|
|
164
|
+
* refusal), at the point the route reads the query, as the Rust spine's
|
|
165
|
+
* `read_query_pairs` callers do.
|
|
166
|
+
*/
|
|
167
|
+
query_pairs: QueryPairsRead;
|
|
168
|
+
/**
|
|
169
|
+
* The body read as JSON text (`read_json_body`, `http/json_text.ts`), the
|
|
170
|
+
* one read the authorization phase and input validation share — for a
|
|
171
|
+
* route that parses its own body.
|
|
172
|
+
*/
|
|
173
|
+
read_json_body: () => Promise<JsonBodyResult>;
|
|
174
|
+
/** A request header as the lines the client sent (`get_header_lines`). */
|
|
175
|
+
header_lines: (name: string) => Array<string>;
|
|
176
|
+
/**
|
|
177
|
+
* Answer with `Connection: close`, whatever the result — the error catch's
|
|
178
|
+
* answer included — so the runtime drops the connection rather than read
|
|
179
|
+
* a request body nothing will read (an upload refused before its end).
|
|
180
|
+
* A raw result may not carry the header itself.
|
|
181
|
+
*/
|
|
182
|
+
close_connection: () => void;
|
|
183
|
+
/**
|
|
184
|
+
* Open the SSE stream this request answers with (`route_sse(stream)`).
|
|
185
|
+
* The stream exists — `send`, `close`, and `on_close` work — from the
|
|
186
|
+
* moment this returns, so the handler can register it before it answers.
|
|
187
|
+
* Nothing is written on the context: the response is built only when the
|
|
188
|
+
* route answers with the stream, after any commit, through the context
|
|
189
|
+
* (so it carries what the middleware put there) and with
|
|
190
|
+
* `SSE_RESPONSE_HEADERS`. A stream the handler opens and does not answer
|
|
191
|
+
* with — it answers something else, or throws — is closed and its body
|
|
192
|
+
* cancelled, and the answer carries none of the stream's headers.
|
|
193
|
+
*
|
|
194
|
+
* @throws Error when `apply_route_specs` was given no `open_sse`
|
|
195
|
+
*/
|
|
196
|
+
open_sse: <T = unknown>(options?: RouteOpenSseOptions) => SseStream<T>;
|
|
86
197
|
/**
|
|
87
198
|
* Transaction-scoped when `RouteSpec.transaction` is true (the default
|
|
88
199
|
* for non-GET); pool-level otherwise.
|
|
@@ -105,20 +216,31 @@ export interface RouteContext {
|
|
|
105
216
|
*/
|
|
106
217
|
post_commit_effects: Array<() => void | Promise<void>>;
|
|
107
218
|
}
|
|
219
|
+
/** Options for `RouteContext.open_sse`. */
|
|
220
|
+
export interface RouteOpenSseOptions extends SseResponseOptions {
|
|
221
|
+
/**
|
|
222
|
+
* Logger for the stream's serialization and `on_close` listener errors and
|
|
223
|
+
* its outbound-overflow warning. Default: the `log` given `apply_route_specs`.
|
|
224
|
+
*/
|
|
225
|
+
log?: Logger;
|
|
226
|
+
}
|
|
108
227
|
/**
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* `
|
|
228
|
+
* What opens an SSE stream on a request without building its response: the
|
|
229
|
+
* stream and its body, the shape of `create_sse_stream` (`realtime/sse.ts`),
|
|
230
|
+
* which `create_app_server` passes. Injected, so this module stays free of
|
|
231
|
+
* `hono/streaming`.
|
|
232
|
+
*/
|
|
233
|
+
export type RouteSseOpener = <T>(c: Context, log: Logger, options?: SseResponseOptions) => OpenedSseStream<T>;
|
|
234
|
+
/**
|
|
235
|
+
* Route handler function — receives the `RouteContext` and returns a result
|
|
236
|
+
* (`route_ok`, `route_fail`, `route_raw`, `route_sse` in
|
|
237
|
+
* `http/route_result.ts`) that `apply_route_specs` turns into the response.
|
|
113
238
|
*
|
|
114
239
|
* The type a `RouteSpec` stores, any result: `define_route` and
|
|
115
240
|
* `attach_route_handler` check a handler against its route
|
|
116
241
|
* (`TypedRouteHandler`) before it is stored.
|
|
117
|
-
*
|
|
118
|
-
* TypeScript allows fewer params, so handlers that don't need `route`
|
|
119
|
-
* can use `(c) => ...` without changes.
|
|
120
242
|
*/
|
|
121
|
-
export type RouteHandler = (
|
|
243
|
+
export type RouteHandler = (route: RouteContext) => RouteResult | Promise<RouteResult>;
|
|
122
244
|
/** Marks a `RouteSpec` made by `define_route` or `attach_route_handler`; no runtime property. */
|
|
123
245
|
declare const ROUTE_SPEC_BRAND: unique symbol;
|
|
124
246
|
/**
|
|
@@ -126,8 +248,9 @@ declare const ROUTE_SPEC_BRAND: unique symbol;
|
|
|
126
248
|
*
|
|
127
249
|
* `input` and `output` schemas align with SAES `ActionSpec` naming. Every
|
|
128
250
|
* schema field takes a `@fuzdev/fuz_schema` schema, validated through
|
|
129
|
-
* `parse`. Use `literal(null)` for routes with no request body (
|
|
130
|
-
* without
|
|
251
|
+
* `parse`. Use `literal(null)` for routes with no request body (a DELETE
|
|
252
|
+
* without one). A `GET` carries none, so its `input` must be `literal(null)`
|
|
253
|
+
* — `apply_route_specs` refuses any other — and its fields go on `query`.
|
|
131
254
|
*/
|
|
132
255
|
export interface RouteSpec {
|
|
133
256
|
method: RouteMethod;
|
|
@@ -205,7 +328,7 @@ export interface RouteSpec {
|
|
|
205
328
|
* The handler owns the token-scope rule a gate would otherwise apply: a
|
|
206
329
|
* scope-narrowed API token reaches no non-RPC surface that reads account
|
|
207
330
|
* data, and `auth.required_scope` is refused on a route that admits
|
|
208
|
-
* anonymous callers. Read the credential through `
|
|
331
|
+
* anonymous callers. Read the credential through `get_public_account`
|
|
209
332
|
* (`auth/request_context.ts`), not `get_resolved_auth`, so a narrowed token is
|
|
210
333
|
* answered as the anonymous caller. The RPC endpoint is the exception — its
|
|
211
334
|
* dispatcher gates each method against the scope.
|
|
@@ -231,6 +354,23 @@ export interface RouteSpec {
|
|
|
231
354
|
* a status another layer declares adds a branch there and replaces nothing.
|
|
232
355
|
*/
|
|
233
356
|
errors?: ReadonlyArray<RestErrorDef>;
|
|
357
|
+
/**
|
|
358
|
+
* Headers every answer of the route carries, once a request reaches it:
|
|
359
|
+
* its own validation and gate refusals, the handler's result of any kind,
|
|
360
|
+
* and the error catch's 500 or 503 (a refusal by middleware ahead of the
|
|
361
|
+
* route, such as the origin check, carries none). For a header true of
|
|
362
|
+
* every answer — `Cache-Control: no-store` on a per-caller read — not one
|
|
363
|
+
* of a success alone, which the result carries.
|
|
364
|
+
*
|
|
365
|
+
* One value per name, a name once in any case, a value a `Headers`
|
|
366
|
+
* accepts and not empty; none of `ROUTE_RAW_REFUSED_HEADERS`, and neither
|
|
367
|
+
* `Content-Type` nor `Content-Length`, which belong to a body. A result
|
|
368
|
+
* whose own headers name one of these is refused when it is prepared —
|
|
369
|
+
* the declared value is the route's for every answer, so a second one is
|
|
370
|
+
* a conflict, not an override. `apply_route_specs` throws naming the
|
|
371
|
+
* route on a record off these rules.
|
|
372
|
+
*/
|
|
373
|
+
response_headers?: Readonly<Record<string, string>>;
|
|
234
374
|
/**
|
|
235
375
|
* Whether to wrap the handler in a database transaction.
|
|
236
376
|
*
|
|
@@ -260,23 +400,34 @@ export type RouteAlwaysErrors = typeof REST_INTERNAL_ERROR | typeof REST_SERVICE
|
|
|
260
400
|
export type RouteHandlerDerivedErrors<TAuth extends RouteAuth, TRateLimit> = (TAuth['account'] extends 'required' ? typeof REST_AUTHENTICATION_REQUIRED : TAuth['actor'] extends 'required' ? typeof REST_AUTHENTICATION_REQUIRED : never) | (TAuth['required_scope'] extends string ? typeof REST_TOKEN_SCOPE_REQUIRED : never) | (TAuth['credential_types'] extends ReadonlyArray<string> ? typeof REST_CREDENTIAL_TYPE_REQUIRED : never) | (TAuth['roles'] extends ReadonlyArray<string> ? typeof REST_INSUFFICIENT_PERMISSIONS : never) | (TRateLimit extends RateLimitKey ? typeof REST_RATE_LIMIT_EXCEEDED : never);
|
|
261
401
|
/**
|
|
262
402
|
* What a handler of a route may return: a success typed by the input side of
|
|
263
|
-
* its `output`, a raw
|
|
264
|
-
* allows — its `errors`, the derived ones a handler may give
|
|
403
|
+
* its `output`, a raw answer, an SSE stream, or a failure of a definition the
|
|
404
|
+
* route allows — its `errors`, the derived ones a handler may give
|
|
265
405
|
* (`RouteHandlerDerivedErrors`), and the catch layers' (`RouteAlwaysErrors`).
|
|
266
406
|
*/
|
|
267
|
-
export type RouteHandlerResult<TErrors extends ReadonlyArray<RestErrorDef>, TOutput extends AnySchema, TAuth extends RouteAuth, TRateLimit> = RouteOk<ReadonlyJson<InferInput<TOutput>>> | RouteRaw | RouteFailOf<TErrors[number] | RouteAlwaysErrors | RouteHandlerDerivedErrors<TAuth, TRateLimit>>;
|
|
268
|
-
/** A
|
|
269
|
-
export type
|
|
407
|
+
export type RouteHandlerResult<TErrors extends ReadonlyArray<RestErrorDef>, TOutput extends AnySchema, TAuth extends RouteAuth, TRateLimit> = RouteOk<ReadonlyJson<InferInput<TOutput>>> | RouteRaw | RouteSse | RouteFailOf<TErrors[number] | RouteAlwaysErrors | RouteHandlerDerivedErrors<TAuth, TRateLimit>>;
|
|
408
|
+
/** A `params` or `query` slot's validated value: `undefined` when the route declares no schema. */
|
|
409
|
+
export type RouteSlotValue<TSchema extends AnySchema | undefined> = TSchema extends AnySchema ? Infer<TSchema> : undefined;
|
|
410
|
+
/**
|
|
411
|
+
* The `RouteContext` a route's handler receives, typed from its spec: `auth`
|
|
412
|
+
* narrowed by `RequestContextForAuth`, and the validated `input`, `params`,
|
|
413
|
+
* and `query` by their schemas.
|
|
414
|
+
*/
|
|
415
|
+
export type TypedRouteContext<TAuth extends RouteAuth, TInput extends AnySchema, TParams extends AnySchema | undefined, TQuery extends AnySchema | undefined> = RouteContext<RequestContextForAuth<TAuth>, Infer<TInput>, RouteSlotValue<TParams>, RouteSlotValue<TQuery>>;
|
|
416
|
+
/** A route handler checked against its route; see `RouteHandlerResult` and `TypedRouteContext`. */
|
|
417
|
+
export type TypedRouteHandler<TErrors extends ReadonlyArray<RestErrorDef>, TOutput extends AnySchema, TAuth extends RouteAuth, TRateLimit, TInput extends AnySchema = AnySchema, TParams extends AnySchema | undefined = undefined, TQuery extends AnySchema | undefined = undefined> = (route: TypedRouteContext<TAuth, TInput, TParams, TQuery>) => RouteHandlerResult<TErrors, TOutput, TAuth, TRateLimit> | Promise<RouteHandlerResult<TErrors, TOutput, TAuth, TRateLimit>>;
|
|
270
418
|
/** The fields of a route that carry no type parameter. */
|
|
271
|
-
type RouteShapePlain = Omit<RouteSpec, 'handler' | 'errors' | 'output' | 'auth' | 'rate_limit' | typeof ROUTE_SPEC_BRAND>;
|
|
419
|
+
type RouteShapePlain = Omit<RouteSpec, 'handler' | 'errors' | 'output' | 'auth' | 'rate_limit' | 'input' | 'params' | 'query' | typeof ROUTE_SPEC_BRAND>;
|
|
272
420
|
/**
|
|
273
421
|
* A route minus its handler, with the types its handler is checked against
|
|
274
422
|
* kept: what `define_route_shape` returns and `attach_route_handler` takes,
|
|
275
423
|
* the hono-free half of a route a cross-process suite builds its surface from.
|
|
276
424
|
*/
|
|
277
|
-
export type RouteShape<TErrors extends ReadonlyArray<RestErrorDef> = ReadonlyArray<RestErrorDef>, TOutput extends AnySchema = AnySchema, TAuth extends RouteAuth = RouteAuth, TRateLimit extends RateLimitKey | undefined = RateLimitKey | undefined> = RouteShapePlain & {
|
|
425
|
+
export type RouteShape<TErrors extends ReadonlyArray<RestErrorDef> = ReadonlyArray<RestErrorDef>, TOutput extends AnySchema = AnySchema, TAuth extends RouteAuth = RouteAuth, TRateLimit extends RateLimitKey | undefined = RateLimitKey | undefined, TInput extends AnySchema = AnySchema, TParams extends AnySchema | undefined = AnySchema | undefined, TQuery extends AnySchema | undefined = AnySchema | undefined> = RouteShapePlain & {
|
|
278
426
|
auth: TAuth;
|
|
279
427
|
output: TOutput;
|
|
428
|
+
input: TInput;
|
|
429
|
+
params?: TParams;
|
|
430
|
+
query?: TQuery;
|
|
280
431
|
errors?: TErrors;
|
|
281
432
|
rate_limit?: TRateLimit;
|
|
282
433
|
};
|
|
@@ -293,12 +444,19 @@ export type KnownRouteErrors<TErrors extends ReadonlyArray<RestErrorDef>> = stri
|
|
|
293
444
|
* A literal `errors` list is read as given; a list typed
|
|
294
445
|
* `Array<RestErrorDef>` is refused (`KnownRouteErrors`).
|
|
295
446
|
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
447
|
+
* The handler's `route` is typed from the spec (`TypedRouteContext`). Where
|
|
448
|
+
* that types `route.auth` non-null — the route requires an account or an
|
|
449
|
+
* actor — the stored handler checks it before it runs and throws when it is
|
|
450
|
+
* missing anyway (a spread of the spec whose `auth` was rewritten, a harness
|
|
451
|
+
* that skipped the gate), which the error catch answers 500: a handler never
|
|
452
|
+
* runs on a request context its type promised and the request lacks.
|
|
453
|
+
*
|
|
454
|
+
* @param spec - the route, its handler returning `route_ok`, `route_fail`, `route_raw`, or `route_sse`
|
|
455
|
+
* @returns `spec`, its handler behind that check where the route requires one
|
|
298
456
|
*/
|
|
299
|
-
export declare const define_route: <const TErrors extends ReadonlyArray<RestErrorDef> = [], TOutput extends AnySchema = AnySchema, const TAuth extends RouteAuth = RouteAuth, TRateLimit extends RateLimitKey | undefined = undefined>(spec: RouteShape<TErrors, TOutput, TAuth, TRateLimit> & {
|
|
457
|
+
export declare const define_route: <const TErrors extends ReadonlyArray<RestErrorDef> = [], TOutput extends AnySchema = AnySchema, const TAuth extends RouteAuth = RouteAuth, TRateLimit extends RateLimitKey | undefined = undefined, TInput extends AnySchema = AnySchema, TParams extends AnySchema | undefined = undefined, TQuery extends AnySchema | undefined = undefined>(spec: RouteShape<TErrors, TOutput, TAuth, TRateLimit, TInput, TParams, TQuery> & {
|
|
300
458
|
errors?: KnownRouteErrors<TErrors>;
|
|
301
|
-
handler: TypedRouteHandler<TErrors, TOutput, TAuth, TRateLimit>;
|
|
459
|
+
handler: TypedRouteHandler<TErrors, TOutput, TAuth, TRateLimit, TInput, TParams, TQuery>;
|
|
302
460
|
}) => RouteSpec;
|
|
303
461
|
/**
|
|
304
462
|
* Define a route minus its handler, keeping the types `attach_route_handler`
|
|
@@ -307,68 +465,109 @@ export declare const define_route: <const TErrors extends ReadonlyArray<RestErro
|
|
|
307
465
|
* @param shape - the route without `handler`
|
|
308
466
|
* @returns `shape`
|
|
309
467
|
*/
|
|
310
|
-
export declare const define_route_shape: <const TErrors extends ReadonlyArray<RestErrorDef> = [], TOutput extends AnySchema = AnySchema, const TAuth extends RouteAuth = RouteAuth, TRateLimit extends RateLimitKey | undefined = undefined>(shape: RouteShape<TErrors, TOutput, TAuth, TRateLimit> & {
|
|
468
|
+
export declare const define_route_shape: <const TErrors extends ReadonlyArray<RestErrorDef> = [], TOutput extends AnySchema = AnySchema, const TAuth extends RouteAuth = RouteAuth, TRateLimit extends RateLimitKey | undefined = undefined, TInput extends AnySchema = AnySchema, TParams extends AnySchema | undefined = undefined, TQuery extends AnySchema | undefined = undefined>(shape: RouteShape<TErrors, TOutput, TAuth, TRateLimit, TInput, TParams, TQuery> & {
|
|
311
469
|
errors?: KnownRouteErrors<TErrors>;
|
|
312
|
-
}) => RouteShape<TErrors, TOutput, TAuth, TRateLimit>;
|
|
470
|
+
}) => RouteShape<TErrors, TOutput, TAuth, TRateLimit, TInput, TParams, TQuery>;
|
|
313
471
|
/**
|
|
314
|
-
* Attach a handler to a route shape (`define_route_shape`), checked
|
|
315
|
-
* `define_route` checks one.
|
|
472
|
+
* Attach a handler to a route shape (`define_route_shape`), checked and
|
|
473
|
+
* guarded as `define_route` checks and guards one.
|
|
316
474
|
*
|
|
317
475
|
* @param shape - the route without `handler`
|
|
318
|
-
* @param handler - the handler, returning `route_ok`, `route_fail`, or `
|
|
476
|
+
* @param handler - the handler, returning `route_ok`, `route_fail`, `route_raw`, or `route_sse`
|
|
319
477
|
* @returns a new spec, `shape` with `handler`
|
|
320
478
|
*/
|
|
321
|
-
export declare const attach_route_handler: <TErrors extends ReadonlyArray<RestErrorDef>, TOutput extends AnySchema, TAuth extends RouteAuth, TRateLimit extends RateLimitKey | undefined>(shape: RouteShape<TErrors, TOutput, TAuth, TRateLimit> & {
|
|
479
|
+
export declare const attach_route_handler: <TErrors extends ReadonlyArray<RestErrorDef>, TOutput extends AnySchema, TAuth extends RouteAuth, TRateLimit extends RateLimitKey | undefined, TInput extends AnySchema, TParams extends AnySchema | undefined, TQuery extends AnySchema | undefined>(shape: RouteShape<TErrors, TOutput, TAuth, TRateLimit, TInput, TParams, TQuery> & {
|
|
322
480
|
errors?: KnownRouteErrors<TErrors>;
|
|
323
|
-
}, handler: TypedRouteHandler<TErrors, TOutput, TAuth, TRateLimit>) => RouteSpec;
|
|
481
|
+
}, handler: TypedRouteHandler<TErrors, TOutput, TAuth, TRateLimit, TInput, TParams, TQuery>) => RouteSpec;
|
|
324
482
|
/**
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
* definition derives (`Retry-After`), a raw result as it is. Headers and
|
|
328
|
-
* cookies set on `c` before carry over, as Hono builds the response from `c`.
|
|
329
|
-
*
|
|
330
|
-
* @param c - the Hono context
|
|
331
|
-
* @param result - the handler's result
|
|
332
|
-
* @throws TypeError when `result` is not a result `route_ok`, `route_fail`, or `route_raw` made: a `Response`, a success without a value or with a function or symbol for one, a failure without its status or definition, a raw result without a response, `undefined` or `null`
|
|
483
|
+
* A handler's result made ready to answer, by `prepare_route_response`: what
|
|
484
|
+
* `emit_route_response` builds the response from.
|
|
333
485
|
*/
|
|
334
|
-
export
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
* ```ts
|
|
349
|
-
* const input = get_route_input<MyInput>(c);
|
|
350
|
-
* ```
|
|
351
|
-
*/
|
|
352
|
-
export declare function get_route_input<S extends AnySchema>(c: Context, schema: S): Infer<S>;
|
|
353
|
-
export declare function get_route_input<T = unknown>(c: Context): T;
|
|
486
|
+
export type PreparedRouteResponse = {
|
|
487
|
+
readonly kind: 'body';
|
|
488
|
+
/** `undefined` for a success, which answers the context's status (200), as `c.json` does. */
|
|
489
|
+
readonly status: number | undefined;
|
|
490
|
+
readonly body: RouteRawBody;
|
|
491
|
+
/** Absent for a raw answer with no headers. */
|
|
492
|
+
readonly headers: Record<string, string | Array<string>> | undefined;
|
|
493
|
+
/** A success's `Set-Cookie` lines, `[]` for any other result. */
|
|
494
|
+
readonly set_cookie: ReadonlyArray<string>;
|
|
495
|
+
} | {
|
|
496
|
+
readonly kind: 'sse';
|
|
497
|
+
readonly stream: SseStream<never>;
|
|
498
|
+
readonly body: ReadableStream<Uint8Array>;
|
|
499
|
+
};
|
|
354
500
|
/**
|
|
355
|
-
*
|
|
501
|
+
* Prepare the response for a handler's result, checking everything it can see
|
|
502
|
+
* that would keep it from being built or framed as declared, so
|
|
503
|
+
* `emit_route_response` fails only on a stream disturbed past what a check
|
|
504
|
+
* can see (`route_raw`). Runs inside
|
|
505
|
+
* the route's transaction: a result it refuses throws, the transaction rolls
|
|
506
|
+
* back, and the post-commit effects are discarded. Serializes a success's or
|
|
507
|
+
* a failure's JSON body here for the same reason. Writes nothing.
|
|
508
|
+
*
|
|
509
|
+
* - a success — `value` as JSON, its `set_cookie` lines kept for the emit
|
|
510
|
+
* - a failure — its body as JSON at its status, with the headers its
|
|
511
|
+
* definition derives (`Retry-After`); a failure carrying `set_cookie` is
|
|
512
|
+
* refused, since a refusal never sets a cookie
|
|
513
|
+
* - a raw answer — checked by the rules `route_raw` lists
|
|
514
|
+
* - an SSE answer — its stream must be one `RouteContext.open_sse` opened for
|
|
515
|
+
* this request (`opened_sse`), and the route may not have asked to close the
|
|
516
|
+
* connection (`SSE_RESPONSE_HEADERS` keep it alive)
|
|
517
|
+
*
|
|
518
|
+
* A raw or failure result whose headers name one of the route's
|
|
519
|
+
* `response_headers`, or an SSE answer on a route declaring one of
|
|
520
|
+
* `SSE_RESPONSE_HEADERS`, is refused: the declared header is the route's on
|
|
521
|
+
* every answer.
|
|
356
522
|
*
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
*
|
|
523
|
+
* @param result - the handler's result
|
|
524
|
+
* @param options - the request's label for refusals, the streams it opened, and what the route declared or asked of the response
|
|
525
|
+
* @returns the prepared response
|
|
526
|
+
* @throws TypeError when `result` is not a result the factories made — a `Response`, a success without a JSON value, a failure without its status or definition, a raw answer its rules refuse, a stream this request did not open, `undefined` or `null` — or conflicts with the route's `response_headers` or its `close_connection`
|
|
360
527
|
*/
|
|
361
|
-
export declare
|
|
362
|
-
|
|
528
|
+
export declare const prepare_route_response: (result: RouteResult, options: {
|
|
529
|
+
/** Names the request in a refusal, `METHOD path`. */
|
|
530
|
+
label: string;
|
|
531
|
+
/** The streams `open_sse` opened for this request, each with its response. */
|
|
532
|
+
opened_sse: ReadonlyMap<SseStream<never>, ReadableStream<Uint8Array>>;
|
|
533
|
+
/** The route's `response_headers` names, lowercase. Default none. */
|
|
534
|
+
response_header_names?: ReadonlySet<string>;
|
|
535
|
+
/** Whether the handler called `close_connection`. Default `false`. */
|
|
536
|
+
close_requested?: boolean;
|
|
537
|
+
}) => PreparedRouteResponse;
|
|
363
538
|
/**
|
|
364
|
-
*
|
|
539
|
+
* Build the response `prepare_route_response` prepared — the one place a route
|
|
540
|
+
* result becomes a `Response`, and only once the route's transaction has
|
|
541
|
+
* committed, so nothing a handler returned reaches the wire for writes that
|
|
542
|
+
* rolled back. Built through the Hono context (`c.body`), so the headers the
|
|
543
|
+
* middleware put on the context — the session middleware's clear of a stale
|
|
544
|
+
* cookie — lead, and a success's `Set-Cookie` lines follow them in order.
|
|
545
|
+
* A success is written as `c.json` writes it, a failure as
|
|
546
|
+
* `c.json(body, status, headers)` does, and an SSE stream with
|
|
547
|
+
* `SSE_RESPONSE_HEADERS`.
|
|
548
|
+
*
|
|
549
|
+
* The prepare checked everything it can see. What it can't — a stream body
|
|
550
|
+
* read and released, unlocked yet disturbed — makes the `Response` constructor
|
|
551
|
+
* throw here, after the commit; `apply_route_specs` rethrows that as an error
|
|
552
|
+
* naming the route and the commit, which the error catch logs and answers 500.
|
|
553
|
+
*
|
|
554
|
+
* A `HEAD` request — which Hono answers by running the `GET` route and
|
|
555
|
+
* dropping the body unread, never cancelling it — gets a stream's status and
|
|
556
|
+
* headers alone, and the stream released here: an SSE stream is closed, so
|
|
557
|
+
* its `on_close` listeners run and a registry drops it, and a raw stream body
|
|
558
|
+
* is cancelled, which releases its source (`route_raw`). An SSE answer to a
|
|
559
|
+
* `HEAD` leaves out `SSE_RESPONSE_HEADERS`' `Connection: keep-alive`, which
|
|
560
|
+
* keeps a stream's connection open and would hold one with no stream on it
|
|
561
|
+
* past a client's `Connection: close` (`@hono/node-server` honors it). Text and bytes are
|
|
562
|
+
* built as for a `GET` — Hono drops them, and an outer layer that reads the
|
|
563
|
+
* answer (the DEV error check) still sees its body.
|
|
365
564
|
*
|
|
366
|
-
*
|
|
367
|
-
*
|
|
368
|
-
*
|
|
565
|
+
* @param c - the Hono context
|
|
566
|
+
* @param prepared - what `prepare_route_response` returned
|
|
567
|
+
* @returns the response
|
|
568
|
+
* @throws TypeError when the runtime refuses to build a response from a prepared body
|
|
369
569
|
*/
|
|
370
|
-
export declare
|
|
371
|
-
export declare function get_route_query<T = unknown>(c: Context): T;
|
|
570
|
+
export declare const emit_route_response: (c: Context, prepared: PreparedRouteResponse) => Response;
|
|
372
571
|
/**
|
|
373
572
|
* Apply named middleware specs to a Hono app.
|
|
374
573
|
*
|
|
@@ -383,7 +582,8 @@ export declare const apply_middleware_specs: (app: Hono, specs: Array<Middleware
|
|
|
383
582
|
* runs the optional authorization phase to resolve the acting actor + build
|
|
384
583
|
* the request context, wraps handler with DEV-only output
|
|
385
584
|
* validation, builds each response from its handler's result
|
|
386
|
-
* (`
|
|
585
|
+
* (`prepare_route_response` inside the transaction, `emit_route_response`
|
|
586
|
+
* after it), wraps with error catch layer (a thrown JSON-RPC error,
|
|
387
587
|
* recognized via `to_thrown_jsonrpc_error`, maps to its status; any other
|
|
388
588
|
* throw to a 500), and registers the route.
|
|
389
589
|
*
|
|
@@ -400,10 +600,14 @@ export declare const apply_middleware_specs: (app: Hono, specs: Array<Middleware
|
|
|
400
600
|
* route rather than carry its payload, and the authorization phase reads
|
|
401
601
|
* `acting` off the query on GETs).
|
|
402
602
|
*
|
|
403
|
-
* Each handler receives a `RouteContext`
|
|
404
|
-
*
|
|
405
|
-
* - `
|
|
406
|
-
*
|
|
603
|
+
* Each handler receives a `RouteContext` and nothing else: built from the
|
|
604
|
+
* Hono context once every stage before the handler has run, with `db`
|
|
605
|
+
* transaction-scoped when `RouteSpec.transaction` is true and the pool
|
|
606
|
+
* otherwise, and `open_sse` opening through `options.open_sse`.
|
|
607
|
+
*
|
|
608
|
+
* A route's `response_headers` are written on the context by its first
|
|
609
|
+
* stage, ahead of the content-type check, so every answer the route gives
|
|
610
|
+
* carries them; a record off their rules throws at registration.
|
|
407
611
|
*
|
|
408
612
|
* Also enforces the auth shape's registry-time invariants: the cross-axis
|
|
409
613
|
* invariants 1, 3, and 4 (`assert_route_auth_invariants`), and invariant 2:
|
|
@@ -418,19 +622,31 @@ export declare const apply_middleware_specs: (app: Hono, specs: Array<Middleware
|
|
|
418
622
|
* `errors` entry an error definition (`rest_error`): anything else throws
|
|
419
623
|
* naming the route and the slot. A `params` or `query`
|
|
420
624
|
* must be an object schema (`get_schema_entries`), as the path params and
|
|
421
|
-
* query string are an object: one that isn't throws naming the route.
|
|
625
|
+
* query string are an object: one that isn't throws naming the route. A
|
|
626
|
+
* `GET` carries no body, so its `input` must be a null schema
|
|
627
|
+
* (`is_null_schema`): any other throws naming the route.
|
|
422
628
|
*
|
|
423
629
|
* In DEV each handler's 2xx JSON responses are checked against its `output`.
|
|
424
630
|
* Error responses are checked by the DEV error check
|
|
425
631
|
* (`create_dev_route_error_check`), which `create_app_server` mounts outermost.
|
|
426
632
|
*
|
|
427
633
|
* @param resolve_auth_guards - maps `RouteAuth` to middleware — use `fuz_auth_guard_resolver` from `auth/auth_guard_resolver.ts`
|
|
428
|
-
* @param authorize - optional authorization phase; runs after the pre-authorization guards and before the post-authorization guards
|
|
429
634
|
* @param db - used for transaction wrapping and `RouteContext`
|
|
635
|
+
* @param options - the authorization phase and the SSE opener
|
|
430
636
|
* @mutates `app`
|
|
431
|
-
* @throws Error if two specs share the same `method` + `path` (each combination must be unique), if a schema slot holds a value that is no schema or an `errors` entry is not a definition, if any spec violates a cross-axis auth invariant or the actor-acting biconditional,
|
|
637
|
+
* @throws Error if two specs share the same `method` + `path` (each combination must be unique), if a schema slot holds a value that is no schema or an `errors` entry is not a definition, if a `GET` declares an `input` other than `literal(null)`, if any spec violates a cross-axis auth invariant or the actor-acting biconditional, if a `params` or `query` is not an object schema, or if `response_headers` is off its rules
|
|
432
638
|
*/
|
|
433
|
-
export declare const apply_route_specs: (app: Hono, specs: Array<RouteSpec>, resolve_auth_guards: AuthGuardResolver, log: Logger, db: Db,
|
|
639
|
+
export declare const apply_route_specs: (app: Hono, specs: Array<RouteSpec>, resolve_auth_guards: AuthGuardResolver, log: Logger, db: Db, options?: ApplyRouteSpecsOptions) => void;
|
|
640
|
+
/** Options for `apply_route_specs`. */
|
|
641
|
+
export interface ApplyRouteSpecsOptions {
|
|
642
|
+
/** The authorization phase; runs after the pre-authorization guards and before the post-authorization guards. */
|
|
643
|
+
authorize?: AuthorizationHandler;
|
|
644
|
+
/**
|
|
645
|
+
* What `RouteContext.open_sse` opens a stream with — `create_sse_stream`
|
|
646
|
+
* (`realtime/sse.ts`). Without it a route opening a stream throws.
|
|
647
|
+
*/
|
|
648
|
+
open_sse?: RouteSseOpener;
|
|
649
|
+
}
|
|
434
650
|
/**
|
|
435
651
|
* Prepend a prefix to all route spec paths.
|
|
436
652
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route_spec.d.ts","sourceRoot":"","sources":["../../src/lib/http/route_spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAW,IAAI,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"route_spec.d.ts","sourceRoot":"","sources":["../../src/lib/http/route_spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAW,IAAI,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAEtE,OAAO,EAEN,KAAK,SAAS,EAEd,KAAK,UAAU,EACf,KAAK,KAAK,EACV,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAGtC,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,y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