@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
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import '../assert_dev_env.js';
|
|
2
|
+
/**
|
|
3
|
+
* The request target conformance table: how both spines decode what a matched
|
|
4
|
+
* route reads of the request target — the query string and the path params —
|
|
5
|
+
* and what a request carrying a given target observably answers, the routing
|
|
6
|
+
* of its method and path included.
|
|
7
|
+
*
|
|
8
|
+
* `request_target_conformance.json` (beside this module) has three sections:
|
|
9
|
+
*
|
|
10
|
+
* - **query** — `{name, query, read}`: the raw query string (the text after
|
|
11
|
+
* `?`, or `null` for a target with none) and what the strict query reader
|
|
12
|
+
* (`http/request_target.ts`, the Rust `fuz_http::request_target`) reads of
|
|
13
|
+
* it — `{"pairs": [[name, value], …]}`, every pair in order, or
|
|
14
|
+
* `{"refused": reason}` (`PercentDecodeError`).
|
|
15
|
+
* - **param** — `{name, segment, read}`: one raw path segment and what the
|
|
16
|
+
* strict segment reader reads of it — `{"value": text}` or
|
|
17
|
+
* `{"refused": reason}`.
|
|
18
|
+
* - **wire** — `{name, method, target, as, origin?, host?, headers?,
|
|
19
|
+
* upgrade?, requires?, expect, expect_where_dot_segments_resolved?, note?}`:
|
|
20
|
+
* a request sent over a raw socket with its method and target written as
|
|
21
|
+
* is, by the principal `as` names (`"keeper_session"`, `"none"`, or
|
|
22
|
+
* `"invalid_session"` — the session cookie's name with a value that doesn't
|
|
23
|
+
* verify), with `origin` as its one `Origin` line, `host` as its `Host` in
|
|
24
|
+
* place of the backend's, and each of `headers` as a line of its own, as a
|
|
25
|
+
* WebSocket upgrade when `upgrade` is set, and only to a backend declaring
|
|
26
|
+
* every capability `requires` names. `expect`
|
|
27
|
+
* pins the answer's `status`, the REST `error` code, and on a JSON-RPC
|
|
28
|
+
* answer the envelope's `id` — which pins the decoding of an echoed value —
|
|
29
|
+
* with its error `code` and `data.reason`; and where the row routes, the
|
|
30
|
+
* `Allow` methods as a set (`[]` for none), a plain-text body byte for
|
|
31
|
+
* byte (`text`), the `Content-Type`'s kind of a bodiless `HEAD` answer
|
|
32
|
+
* (`media`), and whether the session cookie is cleared (`clears_session`).
|
|
33
|
+
* Never a whole JSON body, and never the DEV-only `issues`. A dot-segment
|
|
34
|
+
* row's `expect` is the answer where the router reads the raw path, and
|
|
35
|
+
* `expect_where_dot_segments_resolved` the answer where the runtime
|
|
36
|
+
* resolves dot segments first (`BackendCapabilities.runtime_resolves_dot_segments`).
|
|
37
|
+
*
|
|
38
|
+
* Wire targets name the backend's paths with `{placeholders}`
|
|
39
|
+
* (`REQUEST_TARGET_CONFORMANCE_PLACEHOLDERS`), filled per backend.
|
|
40
|
+
*
|
|
41
|
+
* The legs: the TS unit test over the readers (`src/test/http/`), the Rust
|
|
42
|
+
* unit test beside `fuz_http::request_target` over a byte-identical copy of
|
|
43
|
+
* the file, and `request_target_conformance_wire.ts`, sending each wire row to
|
|
44
|
+
* a live backend. Edited by hand, never generated.
|
|
45
|
+
*
|
|
46
|
+
* @module
|
|
47
|
+
*/
|
|
48
|
+
import { readFileSync } from 'node:fs';
|
|
49
|
+
import { array, boolean, integer, literal, max_length, min_length, nullable, number, object, one_of, optional, parse_or_throw, pipe, string, union } from '@fuzdev/fuz_schema/schema.ts';
|
|
50
|
+
import { PERCENT_DECODE_ERRORS } from '../../http/request_target.js';
|
|
51
|
+
/** A refusal in the table: the reader's `PercentDecodeError`. */
|
|
52
|
+
export const RequestTargetConformanceRefused = object({ refused: one_of(PERCENT_DECODE_ERRORS) });
|
|
53
|
+
/** One row of the `query` section. */
|
|
54
|
+
export const RequestTargetConformanceQueryRow = object({
|
|
55
|
+
name: string,
|
|
56
|
+
query: nullable(string),
|
|
57
|
+
read: union([
|
|
58
|
+
object({ pairs: array(pipe(array(string), min_length(2), max_length(2))) }),
|
|
59
|
+
RequestTargetConformanceRefused
|
|
60
|
+
])
|
|
61
|
+
});
|
|
62
|
+
/** One row of the `param` section. */
|
|
63
|
+
export const RequestTargetConformanceParamRow = object({
|
|
64
|
+
name: string,
|
|
65
|
+
segment: string,
|
|
66
|
+
read: union([object({ value: string }), RequestTargetConformanceRefused])
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* Who sends a wire row: the keeper's session cookie, no credential, or the
|
|
70
|
+
* session cookie's name with a value that doesn't verify — the cookie the
|
|
71
|
+
* session middleware clears under the auth scope.
|
|
72
|
+
*/
|
|
73
|
+
export const REQUEST_TARGET_CONFORMANCE_PRINCIPALS = [
|
|
74
|
+
'keeper_session',
|
|
75
|
+
'none',
|
|
76
|
+
'invalid_session'
|
|
77
|
+
];
|
|
78
|
+
/** The backend capabilities a wire row may require. */
|
|
79
|
+
export const REQUEST_TARGET_CONFORMANCE_REQUIREMENTS = [
|
|
80
|
+
'ws',
|
|
81
|
+
'sse',
|
|
82
|
+
'account_status',
|
|
83
|
+
'fact_serving',
|
|
84
|
+
'fact_serving_admin_hash',
|
|
85
|
+
'spine_fallback'
|
|
86
|
+
];
|
|
87
|
+
/** The media types a wire row may pin on a bodiless answer: JSON, or plain text. */
|
|
88
|
+
export const REQUEST_TARGET_CONFORMANCE_MEDIA = ['json', 'text'];
|
|
89
|
+
/** What a wire row's answer must carry. */
|
|
90
|
+
export const RequestTargetConformanceExpect = object({
|
|
91
|
+
status: pipe(number, integer),
|
|
92
|
+
/** The REST error body's `error` code. */
|
|
93
|
+
error: optional(string),
|
|
94
|
+
/** The JSON-RPC envelope: its `id`, and on an error its `code` and `data.reason`. */
|
|
95
|
+
jsonrpc: optional(object({
|
|
96
|
+
id: union([string, number, literal(null)]),
|
|
97
|
+
code: optional(pipe(number, integer)),
|
|
98
|
+
reason: optional(string)
|
|
99
|
+
})),
|
|
100
|
+
/**
|
|
101
|
+
* The `Allow` header's methods, compared as a set (a router orders them its
|
|
102
|
+
* own way); `[]` is an answer with no `Allow`.
|
|
103
|
+
*/
|
|
104
|
+
allow: optional(array(string)),
|
|
105
|
+
/** The body byte for byte, under a `text/plain` `Content-Type`. */
|
|
106
|
+
text: optional(string),
|
|
107
|
+
/** The `Content-Type`'s kind, for an answer with no body to read — a `HEAD`'s. */
|
|
108
|
+
media: optional(one_of(REQUEST_TARGET_CONFORMANCE_MEDIA)),
|
|
109
|
+
/** Whether the answer clears the session cookie (`true`) or leaves it alone (`false`). */
|
|
110
|
+
clears_session: optional(boolean)
|
|
111
|
+
});
|
|
112
|
+
/** One row of the `wire` section. */
|
|
113
|
+
export const RequestTargetConformanceWireRow = object({
|
|
114
|
+
name: string,
|
|
115
|
+
method: string,
|
|
116
|
+
target: string,
|
|
117
|
+
as: one_of(REQUEST_TARGET_CONFORMANCE_PRINCIPALS),
|
|
118
|
+
/** An `Origin` line to send; none when absent. */
|
|
119
|
+
origin: optional(string),
|
|
120
|
+
/** The `Host` to send in place of the backend's own. */
|
|
121
|
+
host: optional(string),
|
|
122
|
+
/**
|
|
123
|
+
* Header lines to send as written (`name: value`) — a `POST`'s
|
|
124
|
+
* `Content-Type`, so a row reaches the router and not a content-type gate.
|
|
125
|
+
*/
|
|
126
|
+
headers: optional(array(string)),
|
|
127
|
+
upgrade: optional(boolean),
|
|
128
|
+
/** The capabilities a backend must declare, every one, to be sent the row. */
|
|
129
|
+
requires: optional(pipe(array(one_of(REQUEST_TARGET_CONFORMANCE_REQUIREMENTS)), min_length(1))),
|
|
130
|
+
expect: RequestTargetConformanceExpect,
|
|
131
|
+
/**
|
|
132
|
+
* The answer on a backend whose runtime resolves dot segments before the
|
|
133
|
+
* app sees the request (`BackendCapabilities.runtime_resolves_dot_segments`);
|
|
134
|
+
* `expect` is then the answer where the path reaches the router raw.
|
|
135
|
+
*/
|
|
136
|
+
expect_where_dot_segments_resolved: optional(RequestTargetConformanceExpect),
|
|
137
|
+
note: optional(string)
|
|
138
|
+
});
|
|
139
|
+
/** The table, a `@fuzdev/fuz_schema` `object`. */
|
|
140
|
+
export const RequestTargetConformance = object({
|
|
141
|
+
query: pipe(array(RequestTargetConformanceQueryRow), min_length(1)),
|
|
142
|
+
param: pipe(array(RequestTargetConformanceParamRow), min_length(1)),
|
|
143
|
+
wire: pipe(array(RequestTargetConformanceWireRow), min_length(1))
|
|
144
|
+
});
|
|
145
|
+
/** The placeholder names a wire target may use, each written `{name}` in the table. */
|
|
146
|
+
export const REQUEST_TARGET_CONFORMANCE_PLACEHOLDERS = [
|
|
147
|
+
'rpc_path',
|
|
148
|
+
'ws_path',
|
|
149
|
+
'account_status_path',
|
|
150
|
+
'account_login_path',
|
|
151
|
+
'sse_path',
|
|
152
|
+
'health_path'
|
|
153
|
+
];
|
|
154
|
+
/** The committed table, resolved relative to this module. */
|
|
155
|
+
export const REQUEST_TARGET_CONFORMANCE_URL = new URL('./request_target_conformance.json', import.meta.url);
|
|
156
|
+
/**
|
|
157
|
+
* Read and parse the committed table, and check every row name is unique
|
|
158
|
+
* within its section.
|
|
159
|
+
*
|
|
160
|
+
* @throws Error when the file is off the schema, or a section repeats a name
|
|
161
|
+
*/
|
|
162
|
+
export const load_request_target_conformance = () => {
|
|
163
|
+
const table = parse_or_throw(RequestTargetConformance, JSON.parse(readFileSync(REQUEST_TARGET_CONFORMANCE_URL, 'utf8')));
|
|
164
|
+
for (const [section, rows] of Object.entries(table)) {
|
|
165
|
+
const names = new Set();
|
|
166
|
+
for (const row of rows) {
|
|
167
|
+
if (names.has(row.name)) {
|
|
168
|
+
throw new Error(`request target conformance: '${row.name}' twice in \`${section}\``);
|
|
169
|
+
}
|
|
170
|
+
names.add(row.name);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return table;
|
|
174
|
+
};
|
|
175
|
+
const PLACEHOLDER_REGEX = /\{([a-z_]+)\}/g;
|
|
176
|
+
/**
|
|
177
|
+
* Fill a wire target's `{placeholders}`.
|
|
178
|
+
*
|
|
179
|
+
* @throws Error on a placeholder this backend has no value for
|
|
180
|
+
*/
|
|
181
|
+
export const fill_request_target_conformance_placeholders = (target, placeholders) => target.replace(PLACEHOLDER_REGEX, (_match, name) => {
|
|
182
|
+
if (!Object.hasOwn(placeholders, name)) {
|
|
183
|
+
throw new Error(`unknown request target conformance placeholder {${name}}`);
|
|
184
|
+
}
|
|
185
|
+
return placeholders[name];
|
|
186
|
+
});
|