@fuzdev/fuz_app 0.51.0 → 0.53.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 +43 -10
- package/dist/actions/action_bridge.d.ts +3 -1
- package/dist/actions/action_bridge.d.ts.map +1 -1
- package/dist/actions/action_bridge.js +3 -1
- package/dist/actions/action_codegen.d.ts +28 -43
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +31 -50
- package/dist/actions/action_event.d.ts +44 -1
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_event.js +44 -1
- package/dist/actions/action_event_helpers.d.ts +26 -0
- package/dist/actions/action_event_helpers.d.ts.map +1 -1
- package/dist/actions/action_event_helpers.js +26 -1
- package/dist/actions/action_peer.d.ts +17 -0
- package/dist/actions/action_peer.d.ts.map +1 -1
- package/dist/actions/action_peer.js +8 -9
- package/dist/actions/action_registry.d.ts +1 -5
- package/dist/actions/action_registry.d.ts.map +1 -1
- package/dist/actions/action_registry.js +5 -11
- package/dist/actions/action_rpc.d.ts +20 -0
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +45 -20
- package/dist/actions/action_spec.d.ts +75 -6
- package/dist/actions/action_spec.d.ts.map +1 -1
- package/dist/actions/action_spec.js +36 -6
- package/dist/actions/frontend_rpc_client.d.ts +1 -9
- package/dist/actions/frontend_rpc_client.d.ts.map +1 -1
- package/dist/actions/frontend_rpc_client.js +1 -9
- package/dist/actions/register_action_ws.d.ts +19 -0
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +44 -1
- package/dist/actions/register_ws_endpoint.d.ts +3 -0
- package/dist/actions/register_ws_endpoint.d.ts.map +1 -1
- package/dist/actions/register_ws_endpoint.js +3 -0
- package/dist/actions/request_tracker.svelte.d.ts +24 -16
- package/dist/actions/request_tracker.svelte.d.ts.map +1 -1
- package/dist/actions/request_tracker.svelte.js +24 -16
- package/dist/actions/rpc_client.d.ts +0 -1
- package/dist/actions/rpc_client.d.ts.map +1 -1
- package/dist/actions/rpc_client.js +3 -17
- package/dist/actions/socket.svelte.d.ts +35 -16
- package/dist/actions/socket.svelte.d.ts.map +1 -1
- package/dist/actions/socket.svelte.js +33 -14
- package/dist/actions/transports.d.ts +15 -5
- package/dist/actions/transports.d.ts.map +1 -1
- package/dist/actions/transports.js +15 -15
- package/dist/actions/transports_http.d.ts +7 -0
- package/dist/actions/transports_http.d.ts.map +1 -1
- package/dist/actions/transports_http.js +7 -0
- package/dist/actions/transports_ws.d.ts +13 -0
- package/dist/actions/transports_ws.d.ts.map +1 -1
- package/dist/actions/transports_ws.js +13 -0
- package/dist/actions/transports_ws_auth_guard.d.ts +6 -4
- package/dist/actions/transports_ws_auth_guard.d.ts.map +1 -1
- package/dist/actions/transports_ws_auth_guard.js +6 -4
- package/dist/actions/transports_ws_backend.d.ts +14 -1
- package/dist/actions/transports_ws_backend.d.ts.map +1 -1
- package/dist/actions/transports_ws_backend.js +14 -10
- package/dist/auth/CLAUDE.md +64 -18
- package/dist/auth/account_queries.d.ts +7 -0
- package/dist/auth/account_queries.d.ts.map +1 -1
- package/dist/auth/account_queries.js +7 -0
- package/dist/auth/admin_action_specs.d.ts +5 -0
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +5 -0
- package/dist/auth/admin_actions.d.ts +1 -0
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +1 -0
- package/dist/auth/api_token_queries.d.ts +6 -0
- package/dist/auth/api_token_queries.d.ts.map +1 -1
- package/dist/auth/api_token_queries.js +6 -0
- package/dist/auth/app_settings_queries.d.ts +4 -0
- package/dist/auth/app_settings_queries.d.ts.map +1 -1
- package/dist/auth/app_settings_queries.js +4 -0
- package/dist/auth/audit_log_queries.d.ts +5 -0
- package/dist/auth/audit_log_queries.d.ts.map +1 -1
- package/dist/auth/audit_log_queries.js +5 -0
- package/dist/auth/audit_log_routes.d.ts +2 -2
- package/dist/auth/audit_log_routes.js +2 -2
- package/dist/auth/audit_log_schema.d.ts +2 -0
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +134 -55
- package/dist/auth/bearer_auth.d.ts +2 -0
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +2 -0
- package/dist/auth/bootstrap_account.d.ts +3 -0
- package/dist/auth/bootstrap_account.d.ts.map +1 -1
- package/dist/auth/bootstrap_account.js +3 -0
- package/dist/auth/cleanup.d.ts +6 -0
- package/dist/auth/cleanup.d.ts.map +1 -1
- package/dist/auth/cleanup.js +6 -0
- package/dist/auth/daemon_token_middleware.d.ts +4 -0
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +4 -0
- package/dist/auth/invite_queries.d.ts +3 -0
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_queries.js +3 -0
- package/dist/auth/permit_offer_action_specs.d.ts +6 -0
- package/dist/auth/permit_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/permit_offer_action_specs.js +11 -0
- package/dist/auth/permit_offer_queries.d.ts +18 -0
- package/dist/auth/permit_offer_queries.d.ts.map +1 -1
- package/dist/auth/permit_offer_queries.js +18 -0
- package/dist/auth/permit_queries.d.ts +7 -0
- package/dist/auth/permit_queries.d.ts.map +1 -1
- package/dist/auth/permit_queries.js +7 -0
- package/dist/auth/request_context.d.ts +1 -0
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +1 -0
- package/dist/auth/role_schema.d.ts +2 -0
- package/dist/auth/role_schema.d.ts.map +1 -1
- package/dist/auth/role_schema.js +2 -0
- package/dist/auth/self_service_role_actions.d.ts +1 -0
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +1 -0
- package/dist/auth/session_lifecycle.d.ts +2 -0
- package/dist/auth/session_lifecycle.d.ts.map +1 -1
- package/dist/auth/session_lifecycle.js +2 -0
- package/dist/auth/session_middleware.d.ts +1 -0
- package/dist/auth/session_middleware.d.ts.map +1 -1
- package/dist/auth/session_middleware.js +1 -0
- package/dist/auth/session_queries.d.ts +9 -0
- package/dist/auth/session_queries.d.ts.map +1 -1
- package/dist/auth/session_queries.js +9 -0
- package/dist/cli/config.d.ts +1 -2
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +1 -2
- package/dist/cli/daemon.d.ts +6 -1
- package/dist/cli/daemon.d.ts.map +1 -1
- package/dist/cli/daemon.js +6 -1
- package/dist/db/assert_row.d.ts +2 -1
- package/dist/db/assert_row.d.ts.map +1 -1
- package/dist/db/assert_row.js +2 -1
- package/dist/db/create_db.d.ts +3 -1
- package/dist/db/create_db.d.ts.map +1 -1
- package/dist/db/create_db.js +3 -1
- package/dist/db/db.d.ts +15 -4
- package/dist/db/db.d.ts.map +1 -1
- package/dist/db/db.js +14 -3
- package/dist/db/db_pg.d.ts +4 -3
- package/dist/db/db_pg.d.ts.map +1 -1
- package/dist/db/db_pg.js +7 -5
- package/dist/db/db_pglite.d.ts +4 -4
- package/dist/db/db_pglite.js +4 -4
- package/dist/db/migrate.d.ts +7 -4
- package/dist/db/migrate.d.ts.map +1 -1
- package/dist/db/migrate.js +5 -2
- package/dist/db/sql_identifier.d.ts +2 -1
- package/dist/db/sql_identifier.d.ts.map +1 -1
- package/dist/db/sql_identifier.js +2 -1
- package/dist/db/status.d.ts +4 -1
- package/dist/db/status.d.ts.map +1 -1
- package/dist/db/status.js +5 -2
- package/dist/dev/setup.d.ts +15 -2
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +15 -2
- package/dist/env/dotenv.d.ts +2 -1
- package/dist/env/dotenv.d.ts.map +1 -1
- package/dist/env/dotenv.js +2 -1
- package/dist/env/load.d.ts +1 -3
- package/dist/env/load.d.ts.map +1 -1
- package/dist/env/load.js +1 -3
- package/dist/env/resolve.d.ts +1 -1
- package/dist/env/resolve.js +1 -1
- package/dist/env/update_env_variable.d.ts +2 -0
- package/dist/env/update_env_variable.d.ts.map +1 -1
- package/dist/env/update_env_variable.js +2 -0
- package/dist/hono_context.d.ts +2 -5
- package/dist/hono_context.d.ts.map +1 -1
- package/dist/hono_context.js +2 -5
- package/dist/http/common_routes.d.ts +0 -8
- package/dist/http/common_routes.d.ts.map +1 -1
- package/dist/http/common_routes.js +0 -8
- package/dist/http/db_routes.d.ts +0 -3
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +0 -3
- package/dist/http/error_schemas.d.ts +12 -11
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +11 -7
- package/dist/http/jsonrpc_errors.d.ts +0 -6
- package/dist/http/jsonrpc_errors.d.ts.map +1 -1
- package/dist/http/jsonrpc_errors.js +0 -6
- package/dist/http/origin.d.ts +6 -13
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +7 -14
- package/dist/http/pending_effects.d.ts +4 -0
- package/dist/http/pending_effects.d.ts.map +1 -1
- package/dist/http/pending_effects.js +4 -0
- package/dist/http/proxy.d.ts +3 -6
- package/dist/http/proxy.d.ts.map +1 -1
- package/dist/http/proxy.js +3 -6
- package/dist/http/route_spec.d.ts +14 -35
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +17 -22
- package/dist/http/schema_helpers.d.ts +0 -4
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +0 -4
- package/dist/http/surface.d.ts +2 -12
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +1 -12
- package/dist/rate_limiter.d.ts +30 -1
- package/dist/rate_limiter.d.ts.map +1 -1
- package/dist/rate_limiter.js +40 -1
- package/dist/realtime/sse.d.ts +7 -2
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +3 -2
- package/dist/realtime/sse_auth_guard.d.ts +21 -21
- package/dist/realtime/sse_auth_guard.d.ts.map +1 -1
- package/dist/realtime/sse_auth_guard.js +24 -24
- package/dist/realtime/subscriber_registry.d.ts +4 -5
- package/dist/realtime/subscriber_registry.d.ts.map +1 -1
- package/dist/realtime/subscriber_registry.js +4 -5
- package/dist/runtime/fs.d.ts +5 -3
- package/dist/runtime/fs.d.ts.map +1 -1
- package/dist/runtime/fs.js +5 -3
- package/dist/runtime/mock.d.ts +6 -3
- package/dist/runtime/mock.d.ts.map +1 -1
- package/dist/runtime/mock.js +6 -3
- package/dist/server/app_backend.d.ts +1 -0
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_backend.js +1 -0
- package/dist/server/app_server.d.ts +31 -5
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +23 -7
- package/dist/server/startup.d.ts +0 -2
- package/dist/server/startup.d.ts.map +1 -1
- package/dist/server/startup.js +0 -2
- package/dist/server/static.d.ts +0 -1
- package/dist/server/static.d.ts.map +1 -1
- package/dist/server/static.js +0 -1
- package/dist/server/validate_nginx.d.ts +3 -3
- package/dist/server/validate_nginx.d.ts.map +1 -1
- package/dist/server/validate_nginx.js +0 -3
- package/dist/testing/CLAUDE.md +1 -1
- package/dist/testing/admin_integration.d.ts +5 -1
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +8 -6
- package/dist/testing/adversarial_404.d.ts +0 -2
- package/dist/testing/adversarial_404.d.ts.map +1 -1
- package/dist/testing/adversarial_404.js +0 -2
- package/dist/testing/adversarial_headers.d.ts +5 -4
- package/dist/testing/adversarial_headers.d.ts.map +1 -1
- package/dist/testing/adversarial_headers.js +5 -4
- package/dist/testing/adversarial_input.d.ts +4 -2
- package/dist/testing/adversarial_input.d.ts.map +1 -1
- package/dist/testing/adversarial_input.js +4 -2
- package/dist/testing/app_server.d.ts +25 -0
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +11 -2
- package/dist/testing/assertions.d.ts +23 -11
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/assertions.js +23 -11
- package/dist/testing/attack_surface.d.ts +0 -4
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/attack_surface.js +0 -4
- package/dist/testing/audit_completeness.d.ts +4 -1
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +4 -1
- package/dist/testing/auth_apps.d.ts +5 -10
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +5 -10
- package/dist/testing/data_exposure.d.ts +0 -11
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +0 -11
- package/dist/testing/db.d.ts +9 -7
- package/dist/testing/db.d.ts.map +1 -1
- package/dist/testing/db.js +9 -7
- package/dist/testing/error_coverage.d.ts +9 -14
- package/dist/testing/error_coverage.d.ts.map +1 -1
- package/dist/testing/error_coverage.js +9 -14
- package/dist/testing/integration.d.ts +4 -1
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +4 -1
- package/dist/testing/integration_helpers.d.ts +5 -34
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +5 -41
- package/dist/testing/middleware.d.ts +5 -10
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +5 -10
- package/dist/testing/mock_fs.d.ts +0 -2
- package/dist/testing/mock_fs.d.ts.map +1 -1
- package/dist/testing/mock_fs.js +0 -2
- package/dist/testing/rate_limiting.d.ts +3 -1
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +3 -1
- package/dist/testing/round_trip.d.ts +0 -2
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/round_trip.js +0 -2
- package/dist/testing/rpc_attack_surface.d.ts +0 -2
- package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
- package/dist/testing/rpc_attack_surface.js +0 -2
- package/dist/testing/rpc_helpers.d.ts +21 -14
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +21 -14
- package/dist/testing/rpc_round_trip.d.ts +0 -2
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.js +0 -2
- package/dist/testing/schema_generators.d.ts +5 -3
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +22 -3
- package/dist/testing/sse_round_trip.d.ts +3 -1
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +3 -1
- package/dist/testing/standard.d.ts +0 -2
- package/dist/testing/standard.d.ts.map +1 -1
- package/dist/testing/standard.js +0 -2
- package/dist/testing/stubs.d.ts +8 -3
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +10 -3
- package/dist/testing/surface_invariants.d.ts +14 -3
- package/dist/testing/surface_invariants.d.ts.map +1 -1
- package/dist/testing/surface_invariants.js +14 -3
- package/dist/testing/ws_round_trip.d.ts +13 -1
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/ui/AccountSessions.svelte +9 -0
- package/dist/ui/AccountSessions.svelte.d.ts.map +1 -1
- package/dist/ui/AdminAccounts.svelte +10 -0
- package/dist/ui/AdminAccounts.svelte.d.ts.map +1 -1
- package/dist/ui/AdminAuditLog.svelte +10 -0
- package/dist/ui/AdminAuditLog.svelte.d.ts.map +1 -1
- package/dist/ui/AdminInvites.svelte +9 -0
- package/dist/ui/AdminInvites.svelte.d.ts.map +1 -1
- package/dist/ui/AdminOverview.svelte +10 -0
- package/dist/ui/AdminOverview.svelte.d.ts.map +1 -1
- package/dist/ui/AdminPermitHistory.svelte +9 -0
- package/dist/ui/AdminPermitHistory.svelte.d.ts.map +1 -1
- package/dist/ui/AdminSessions.svelte +10 -0
- package/dist/ui/AdminSessions.svelte.d.ts.map +1 -1
- package/dist/ui/AdminSettings.svelte +9 -0
- package/dist/ui/AdminSettings.svelte.d.ts.map +1 -1
- package/dist/ui/AdminSurface.svelte +9 -0
- package/dist/ui/AdminSurface.svelte.d.ts.map +1 -1
- package/dist/ui/AppShell.svelte +24 -0
- package/dist/ui/AppShell.svelte.d.ts +23 -0
- package/dist/ui/AppShell.svelte.d.ts.map +1 -1
- package/dist/ui/BootstrapForm.svelte +17 -0
- package/dist/ui/BootstrapForm.svelte.d.ts +4 -0
- package/dist/ui/BootstrapForm.svelte.d.ts.map +1 -1
- package/dist/ui/CLAUDE.md +1 -1
- package/dist/ui/ColumnLayout.svelte +11 -0
- package/dist/ui/ColumnLayout.svelte.d.ts +10 -0
- package/dist/ui/ColumnLayout.svelte.d.ts.map +1 -1
- package/dist/ui/Datatable.svelte +18 -0
- package/dist/ui/Datatable.svelte.d.ts +17 -0
- package/dist/ui/Datatable.svelte.d.ts.map +1 -1
- package/dist/ui/LoginForm.svelte +18 -0
- package/dist/ui/LoginForm.svelte.d.ts +9 -0
- package/dist/ui/LoginForm.svelte.d.ts.map +1 -1
- package/dist/ui/LogoutButton.svelte +9 -0
- package/dist/ui/LogoutButton.svelte.d.ts +8 -0
- package/dist/ui/LogoutButton.svelte.d.ts.map +1 -1
- package/dist/ui/MenuLink.svelte +10 -0
- package/dist/ui/MenuLink.svelte.d.ts +9 -0
- package/dist/ui/MenuLink.svelte.d.ts.map +1 -1
- package/dist/ui/OpenSignupToggle.svelte +9 -0
- package/dist/ui/OpenSignupToggle.svelte.d.ts.map +1 -1
- package/dist/ui/SignupForm.svelte +16 -0
- package/dist/ui/SignupForm.svelte.d.ts +4 -0
- package/dist/ui/SignupForm.svelte.d.ts.map +1 -1
- package/dist/ui/SurfaceExplorer.svelte +9 -0
- package/dist/ui/SurfaceExplorer.svelte.d.ts.map +1 -1
- package/dist/ui/audit_log_state.svelte.d.ts +6 -1
- package/dist/ui/audit_log_state.svelte.d.ts.map +1 -1
- package/dist/ui/audit_log_state.svelte.js +7 -2
- package/dist/ui/auth_state.svelte.d.ts +16 -4
- package/dist/ui/auth_state.svelte.d.ts.map +1 -1
- package/dist/ui/auth_state.svelte.js +16 -4
- package/dist/ui/form_state.svelte.d.ts +9 -0
- package/dist/ui/form_state.svelte.d.ts.map +1 -1
- package/dist/ui/form_state.svelte.js +9 -0
- package/dist/ui/loadable.svelte.d.ts +6 -1
- package/dist/ui/loadable.svelte.d.ts.map +1 -1
- package/dist/ui/loadable.svelte.js +6 -1
- package/dist/ui/permit_offers_state.svelte.d.ts +2 -0
- package/dist/ui/permit_offers_state.svelte.d.ts.map +1 -1
- package/dist/ui/permit_offers_state.svelte.js +2 -0
- package/dist/ui/popover.svelte.d.ts +17 -4
- package/dist/ui/popover.svelte.d.ts.map +1 -1
- package/dist/ui/popover.svelte.js +17 -4
- package/dist/ui/position_helpers.d.ts +1 -3
- package/dist/ui/position_helpers.d.ts.map +1 -1
- package/dist/ui/position_helpers.js +1 -3
- package/dist/ui/sidebar_state.svelte.d.ts +21 -9
- package/dist/ui/sidebar_state.svelte.d.ts.map +1 -1
- package/dist/ui/sidebar_state.svelte.js +16 -2
- package/dist/ui/table_state.svelte.d.ts +14 -0
- package/dist/ui/table_state.svelte.d.ts.map +1 -1
- package/dist/ui/table_state.svelte.js +14 -0
- package/dist/ui/ui_fetch.d.ts +1 -7
- package/dist/ui/ui_fetch.d.ts.map +1 -1
- package/dist/ui/ui_fetch.js +1 -7
- package/dist/ui/ui_format.d.ts +2 -14
- package/dist/ui/ui_format.d.ts.map +1 -1
- package/dist/ui/ui_format.js +2 -14
- package/package.json +2 -2
|
@@ -63,8 +63,10 @@ export interface BearerAuthMocks {
|
|
|
63
63
|
* `query_account_by_id`, `query_actor_by_account`, and `query_permit_find_active_for_actor`
|
|
64
64
|
* so each test case controls return values independently.
|
|
65
65
|
*
|
|
66
|
-
* @param tc - the test config providing mock return values
|
|
67
66
|
* @returns mocks bundle with spy references
|
|
67
|
+
* @mutates module-level `vi.mock` registrations for `api_token_queries`,
|
|
68
|
+
* `account_queries`, and `permit_queries` — each call resets and re-binds
|
|
69
|
+
* the four spies, so cases run in sequence without bleeding state.
|
|
68
70
|
*/
|
|
69
71
|
export declare const create_bearer_auth_mocks: (tc: BearerAuthTestOptions) => BearerAuthMocks;
|
|
70
72
|
/** Default client IP set by the proxy stub in test apps. */
|
|
@@ -74,10 +76,6 @@ export declare const TEST_CLIENT_IP = "127.0.0.1";
|
|
|
74
76
|
*
|
|
75
77
|
* The route handler at `/api/test` returns the resolved context in the response body,
|
|
76
78
|
* enabling assertions on `REQUEST_CONTEXT_KEY` and `CREDENTIAL_TYPE_KEY`.
|
|
77
|
-
*
|
|
78
|
-
* @param tc - the test config providing mock behavior
|
|
79
|
-
* @param ip_rate_limiter - optional rate limiter (null to disable)
|
|
80
|
-
* @returns the app and mocks bundle
|
|
81
79
|
*/
|
|
82
80
|
export declare const create_bearer_auth_test_app: (tc: BearerAuthTestOptions, ip_rate_limiter?: RateLimiter | null) => {
|
|
83
81
|
app: Hono;
|
|
@@ -87,10 +85,6 @@ export declare const create_bearer_auth_test_app: (tc: BearerAuthTestOptions, ip
|
|
|
87
85
|
* Run a table of bearer auth middleware test cases.
|
|
88
86
|
*
|
|
89
87
|
* Generates one `test()` per case inside a `describe()` block.
|
|
90
|
-
*
|
|
91
|
-
* @param suite_name - the describe block name
|
|
92
|
-
* @param cases - the test case table
|
|
93
|
-
* @param ip_rate_limiter - optional rate limiter shared across cases
|
|
94
88
|
*/
|
|
95
89
|
export declare const describe_bearer_auth_cases: (suite_name: string, cases: Array<BearerAuthTestCase>, ip_rate_limiter?: RateLimiter | null) => void;
|
|
96
90
|
/** Path used by the echo route in `create_test_middleware_stack_app`. */
|
|
@@ -120,8 +114,9 @@ export interface TestMiddlewareStackApp {
|
|
|
120
114
|
* All DB queries return undefined (no real database needed).
|
|
121
115
|
* The echo route at `TEST_MIDDLEWARE_PATH` returns `{ok, client_ip, has_context}`.
|
|
122
116
|
*
|
|
123
|
-
* @param options - middleware stack configuration
|
|
124
117
|
* @returns the app and mock spies (reconfigure via `mockImplementation` for valid-token paths)
|
|
118
|
+
* @mutates module-level `vi.mock` registrations for the four bearer-auth query
|
|
119
|
+
* modules — each call resets the spies before wiring the stack.
|
|
125
120
|
*/
|
|
126
121
|
export declare const create_test_middleware_stack_app: (options?: TestMiddlewareStackOptions) => TestMiddlewareStackApp;
|
|
127
122
|
//# sourceMappingURL=middleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;;GAQG;AAEH,OAAO,EAAC,EAAE,EAAyB,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAC1B,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAU3B,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAsB,KAAK,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAqBpF,gEAAgE;AAChE,MAAM,WAAW,qBAAqB;IACrC,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,oEAAoE;IACpE,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,iDAAiD;IACjD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,4CAA4C;IAC5C,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,+CAA+C;IAC/C,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,2DAA2D;IAC3D,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,gFAAgF;IAChF,eAAe,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+GAA+G;IAC/G,qBAAqB,CA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0B,KAClC,sBAiDF,CAAC"}
|
|
@@ -41,8 +41,10 @@ const STUB_DEPS = { db: {} };
|
|
|
41
41
|
* `query_account_by_id`, `query_actor_by_account`, and `query_permit_find_active_for_actor`
|
|
42
42
|
* so each test case controls return values independently.
|
|
43
43
|
*
|
|
44
|
-
* @param tc - the test config providing mock return values
|
|
45
44
|
* @returns mocks bundle with spy references
|
|
45
|
+
* @mutates module-level `vi.mock` registrations for `api_token_queries`,
|
|
46
|
+
* `account_queries`, and `permit_queries` — each call resets and re-binds
|
|
47
|
+
* the four spies, so cases run in sequence without bleeding state.
|
|
46
48
|
*/
|
|
47
49
|
export const create_bearer_auth_mocks = (tc) => {
|
|
48
50
|
const mock_validate = vi.mocked(query_validate_api_token);
|
|
@@ -70,10 +72,6 @@ export const TEST_CLIENT_IP = '127.0.0.1';
|
|
|
70
72
|
*
|
|
71
73
|
* The route handler at `/api/test` returns the resolved context in the response body,
|
|
72
74
|
* enabling assertions on `REQUEST_CONTEXT_KEY` and `CREDENTIAL_TYPE_KEY`.
|
|
73
|
-
*
|
|
74
|
-
* @param tc - the test config providing mock behavior
|
|
75
|
-
* @param ip_rate_limiter - optional rate limiter (null to disable)
|
|
76
|
-
* @returns the app and mocks bundle
|
|
77
75
|
*/
|
|
78
76
|
export const create_bearer_auth_test_app = (tc, ip_rate_limiter = null) => {
|
|
79
77
|
const mocks = create_bearer_auth_mocks(tc);
|
|
@@ -115,10 +113,6 @@ export const create_bearer_auth_test_app = (tc, ip_rate_limiter = null) => {
|
|
|
115
113
|
* Run a table of bearer auth middleware test cases.
|
|
116
114
|
*
|
|
117
115
|
* Generates one `test()` per case inside a `describe()` block.
|
|
118
|
-
*
|
|
119
|
-
* @param suite_name - the describe block name
|
|
120
|
-
* @param cases - the test case table
|
|
121
|
-
* @param ip_rate_limiter - optional rate limiter shared across cases
|
|
122
116
|
*/
|
|
123
117
|
export const describe_bearer_auth_cases = (suite_name, cases, ip_rate_limiter = null) => {
|
|
124
118
|
describe(suite_name, () => {
|
|
@@ -174,8 +168,9 @@ export const TEST_MIDDLEWARE_PATH = '/api/test';
|
|
|
174
168
|
* All DB queries return undefined (no real database needed).
|
|
175
169
|
* The echo route at `TEST_MIDDLEWARE_PATH` returns `{ok, client_ip, has_context}`.
|
|
176
170
|
*
|
|
177
|
-
* @param options - middleware stack configuration
|
|
178
171
|
* @returns the app and mock spies (reconfigure via `mockImplementation` for valid-token paths)
|
|
172
|
+
* @mutates module-level `vi.mock` registrations for the four bearer-auth query
|
|
173
|
+
* modules — each call resets the spies before wiring the stack.
|
|
179
174
|
*/
|
|
180
175
|
export const create_test_middleware_stack_app = (options) => {
|
|
181
176
|
const trusted_proxies = options?.trusted_proxies ?? ['10.0.0.1'];
|
|
@@ -14,8 +14,6 @@ export interface MockFs {
|
|
|
14
14
|
*
|
|
15
15
|
* `read_file` throws an `ENOENT`-tagged error for missing paths so callers
|
|
16
16
|
* can exercise the same "file doesn't exist" code path as `node:fs`.
|
|
17
|
-
*
|
|
18
|
-
* @param initial_files - starting contents keyed by absolute path
|
|
19
17
|
*/
|
|
20
18
|
export declare const create_mock_fs: (initial_files?: Record<string, string>) => MockFs;
|
|
21
19
|
//# sourceMappingURL=mock_fs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock_fs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/mock_fs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,MAAM;IACtB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/D,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/E,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CAC/C;AAED
|
|
1
|
+
{"version":3,"file":"mock_fs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/mock_fs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,MAAM;IACtB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/D,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/E,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CAC/C;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,gBAAe,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,KAAG,MAuB3E,CAAC"}
|
package/dist/testing/mock_fs.js
CHANGED
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*
|
|
10
10
|
* `read_file` throws an `ENOENT`-tagged error for missing paths so callers
|
|
11
11
|
* can exercise the same "file doesn't exist" code path as `node:fs`.
|
|
12
|
-
*
|
|
13
|
-
* @param initial_files - starting contents keyed by absolute path
|
|
14
12
|
*/
|
|
15
13
|
export const create_mock_fs = (initial_files = {}) => {
|
|
16
14
|
const files = { ...initial_files };
|
|
@@ -53,7 +53,9 @@ export interface RateLimitingTestOptions {
|
|
|
53
53
|
* Each test group asserts that required routes exist, failing with a descriptive
|
|
54
54
|
* message if the consumer's route specs are misconfigured.
|
|
55
55
|
*
|
|
56
|
-
* @
|
|
56
|
+
* @throws Error at setup time when `options.rpc_endpoints` is empty — the
|
|
57
|
+
* bearer-auth rate-limit test probes via the `account_verify` RPC action,
|
|
58
|
+
* so the suite hard-fails via `require_rpc_endpoint_path`.
|
|
57
59
|
*/
|
|
58
60
|
export declare const describe_rate_limiting_tests: (options: RateLimitingTestOptions) => void;
|
|
59
61
|
//# sourceMappingURL=rate_limiting.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate_limiting.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/rate_limiting.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAiB7B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAIrD,OAAO,EAAkB,KAAK,eAAe,EAAC,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAIN,KAAK,SAAS,EACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EAIN,KAAK,uBAAuB,EAC5B,MAAM,kBAAkB,CAAC;AAK1B;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,4CAA4C;IAC5C,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,wDAAwD;IACxD,kBAAkB,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE,iDAAiD;IACjD,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAChC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;;;;;;;OAYG;IACH,aAAa,EAAE,uBAAuB,CAAC;CACvC;AAED
|
|
1
|
+
{"version":3,"file":"rate_limiting.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/rate_limiting.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAiB7B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAIrD,OAAO,EAAkB,KAAK,eAAe,EAAC,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAIN,KAAK,SAAS,EACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EAIN,KAAK,uBAAuB,EAC5B,MAAM,kBAAkB,CAAC;AAK1B;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,4CAA4C;IAC5C,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,wDAAwD;IACxD,kBAAkB,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE,iDAAiD;IACjD,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAChC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;;;;;;;OAYG;IACH,aAAa,EAAE,uBAAuB,CAAC;CACvC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,4BAA4B,GAAI,SAAS,uBAAuB,KAAG,IA8P/E,CAAC"}
|
|
@@ -35,7 +35,9 @@ import { account_verify_action_spec } from '../auth/account_action_specs.js';
|
|
|
35
35
|
* Each test group asserts that required routes exist, failing with a descriptive
|
|
36
36
|
* message if the consumer's route specs are misconfigured.
|
|
37
37
|
*
|
|
38
|
-
* @
|
|
38
|
+
* @throws Error at setup time when `options.rpc_endpoints` is empty — the
|
|
39
|
+
* bearer-auth rate-limit test probes via the `account_verify` RPC action,
|
|
40
|
+
* so the suite hard-fails via `require_rpc_endpoint_path`.
|
|
39
41
|
*/
|
|
40
42
|
export const describe_rate_limiting_tests = (options) => {
|
|
41
43
|
const max_attempts = options.max_attempts ?? 2;
|
|
@@ -30,8 +30,6 @@ export interface RoundTripTestOptions {
|
|
|
30
30
|
* SSE routes are skipped (Content-Type `text/event-stream`).
|
|
31
31
|
* Routes returning non-2xx with valid input are still validated against
|
|
32
32
|
* their declared error schemas.
|
|
33
|
-
*
|
|
34
|
-
* @param options - round-trip test configuration
|
|
35
33
|
*/
|
|
36
34
|
export declare const describe_round_trip_validation: (options: RoundTripTestOptions) => void;
|
|
37
35
|
//# sourceMappingURL=round_trip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"round_trip.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/round_trip.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAc7B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAC,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAChF,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAG9D,OAAO,EAAwB,KAAK,SAAS,EAAC,MAAM,SAAS,CAAC;AAQ9D,oDAAoD;AACpD,MAAM,WAAW,oBAAoB;IACpC,4CAA4C;IAC5C,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,wDAAwD;IACxD,kBAAkB,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CACpB,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,iBAAiB,GAAG,oBAAoB,CAAC,CAC5E,CAAC;IACF,qEAAqE;IACrE,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAChC,kDAAkD;IAClD,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B,+EAA+E;IAC/E,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvD;AAED
|
|
1
|
+
{"version":3,"file":"round_trip.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/round_trip.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAc7B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAC,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAChF,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAG9D,OAAO,EAAwB,KAAK,SAAS,EAAC,MAAM,SAAS,CAAC;AAQ9D,oDAAoD;AACpD,MAAM,WAAW,oBAAoB;IACpC,4CAA4C;IAC5C,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,wDAAwD;IACxD,kBAAkB,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CACpB,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,iBAAiB,GAAG,oBAAoB,CAAC,CAC5E,CAAC;IACF,qEAAqE;IACrE,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAChC,kDAAkD;IAClD,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B,+EAA+E;IAC/E,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvD;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,8BAA8B,GAAI,SAAS,oBAAoB,KAAG,IA6F9E,CAAC"}
|
|
@@ -29,8 +29,6 @@ import { create_stub_app_server_context } from './stubs.js';
|
|
|
29
29
|
* SSE routes are skipped (Content-Type `text/event-stream`).
|
|
30
30
|
* Routes returning non-2xx with valid input are still validated against
|
|
31
31
|
* their declared error schemas.
|
|
32
|
-
*
|
|
33
|
-
* @param options - round-trip test configuration
|
|
34
32
|
*/
|
|
35
33
|
export const describe_round_trip_validation = (options) => {
|
|
36
34
|
const skip_set = new Set(options.skip_routes);
|
|
@@ -16,8 +16,6 @@ export interface RpcAttackSurfaceOptions {
|
|
|
16
16
|
* 3. Adversarial params — schema-invalid params per method
|
|
17
17
|
*
|
|
18
18
|
* Skips silently when `surface.rpc_endpoints` is empty.
|
|
19
|
-
*
|
|
20
|
-
* @param options - the test configuration
|
|
21
19
|
*/
|
|
22
20
|
export declare const describe_rpc_attack_surface_tests: (options: RpcAttackSurfaceOptions) => void;
|
|
23
21
|
//# sourceMappingURL=rpc_attack_surface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc_attack_surface.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/rpc_attack_surface.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAkB7B,OAAO,KAAK,EAA6C,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAoBnG,uDAAuD;AACvD,MAAM,WAAW,uBAAuB;IACvC,+FAA+F;IAC/F,KAAK,EAAE,MAAM,cAAc,CAAC;IAC5B,yDAAyD;IACzD,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACrB;AAodD
|
|
1
|
+
{"version":3,"file":"rpc_attack_surface.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/rpc_attack_surface.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAkB7B,OAAO,KAAK,EAA6C,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAoBnG,uDAAuD;AACvD,MAAM,WAAW,uBAAuB;IACvC,+FAA+F;IAC/F,KAAK,EAAE,MAAM,cAAc,CAAC;IAC5B,yDAAyD;IACzD,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACrB;AAodD;;;;;;;;;GASG;AACH,eAAO,MAAM,iCAAiC,GAAI,SAAS,uBAAuB,KAAG,IAOpF,CAAC"}
|
|
@@ -383,8 +383,6 @@ const format_auth = (auth) => {
|
|
|
383
383
|
* 3. Adversarial params — schema-invalid params per method
|
|
384
384
|
*
|
|
385
385
|
* Skips silently when `surface.rpc_endpoints` is empty.
|
|
386
|
-
*
|
|
387
|
-
* @param options - the test configuration
|
|
388
386
|
*/
|
|
389
387
|
export const describe_rpc_attack_surface_tests = (options) => {
|
|
390
388
|
const { surface } = options.build();
|
|
@@ -34,12 +34,14 @@ export type RpcEndpointsSuiteOption = Array<RpcEndpointSpec> | ((ctx: AppServerC
|
|
|
34
34
|
* etc.) are. Factories that return a different `path` based on `ctx` will
|
|
35
35
|
* produce a setup/runtime mismatch; the path-purity assert below surfaces
|
|
36
36
|
* that as a clear `gro check` error rather than a silent test/runtime drift.
|
|
37
|
+
*
|
|
38
|
+
* @throws Error if the factory's two stub-ctx invocations produce different
|
|
39
|
+
* `(path, method-list)` shapes — surfaces non-pure factories at setup time.
|
|
37
40
|
*/
|
|
38
41
|
export declare const resolve_rpc_endpoints_for_setup: (rpc_endpoints: RpcEndpointsSuiteOption, session_options: SessionOptions<string>) => Array<RpcEndpointSpec>;
|
|
39
42
|
/**
|
|
40
43
|
* Create a `RequestInit` for a JSON-RPC POST request.
|
|
41
44
|
*
|
|
42
|
-
* @param method - JSON-RPC method name
|
|
43
45
|
* @param params - params (omit for parameterless methods; `null` is also
|
|
44
46
|
* stripped for ergonomic call sites — JSON-RPC 2.0 §4.2
|
|
45
47
|
* forbids `"params": null` on the wire, and `create_rpc_endpoint`
|
|
@@ -48,17 +50,14 @@ export declare const resolve_rpc_endpoints_for_setup: (rpc_endpoints: RpcEndpoin
|
|
|
48
50
|
* envelope (e.g. asserting envelope-level rejection) should
|
|
49
51
|
* build the body inline rather than route through this helper.
|
|
50
52
|
* @param id - request id (default `'test'`)
|
|
51
|
-
* @returns a `RequestInit` with the JSON-RPC envelope as body
|
|
52
53
|
*/
|
|
53
54
|
export declare const create_rpc_post_init: (method: string, params?: unknown, id?: string | number) => RequestInit;
|
|
54
55
|
/**
|
|
55
56
|
* Build a GET URL with JSON-RPC query parameters.
|
|
56
57
|
*
|
|
57
58
|
* @param endpoint_path - the RPC endpoint path (e.g., `/api/rpc`)
|
|
58
|
-
* @param method - JSON-RPC method name
|
|
59
59
|
* @param params - params (omit for parameterless methods)
|
|
60
60
|
* @param id - request id (default `'test'`)
|
|
61
|
-
* @returns the full URL with query string
|
|
62
61
|
*/
|
|
63
62
|
export declare const create_rpc_get_url: (endpoint_path: string, method: string, params?: unknown, id?: string | number) => string;
|
|
64
63
|
/**
|
|
@@ -67,7 +66,6 @@ export declare const create_rpc_get_url: (endpoint_path: string, method: string,
|
|
|
67
66
|
* Validates the structure matches `JsonrpcErrorResponse` and optionally
|
|
68
67
|
* checks the error code.
|
|
69
68
|
*
|
|
70
|
-
* @param body - parsed response body
|
|
71
69
|
* @param expected_code - optional error code to assert
|
|
72
70
|
*/
|
|
73
71
|
export declare const assert_jsonrpc_error_response: (body: unknown, expected_code?: JsonrpcErrorCode) => void;
|
|
@@ -78,7 +76,6 @@ export declare const assert_jsonrpc_error_response: (body: unknown, expected_cod
|
|
|
78
76
|
* is provided, also validates the `result` field against the declared
|
|
79
77
|
* output schema — matching the REST round-trip's `assert_response_matches_spec`.
|
|
80
78
|
*
|
|
81
|
-
* @param body - parsed response body
|
|
82
79
|
* @param output_schema - optional Zod schema to validate the `result` field against
|
|
83
80
|
*/
|
|
84
81
|
export declare const assert_jsonrpc_success_response: (body: unknown, output_schema?: z.ZodType) => void;
|
|
@@ -144,11 +141,10 @@ export interface RpcCallArgs {
|
|
|
144
141
|
* caller-provided headers, fires POST (default) or GET, parses the envelope,
|
|
145
142
|
* and returns a discriminated result.
|
|
146
143
|
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
* `error.data.reason`.
|
|
144
|
+
* @throws Error if the response body is neither a valid `JsonrpcResponse`
|
|
145
|
+
* nor `JsonrpcErrorResponse` envelope — protocol-level failures the caller
|
|
146
|
+
* should never tolerate. All JSON-RPC errors come back via `{ok: false, error}`
|
|
147
|
+
* so assertions can focus on `error.code` / `error.data.reason`.
|
|
152
148
|
*/
|
|
153
149
|
export declare const rpc_call: (args: RpcCallArgs) => Promise<RpcCallResult>;
|
|
154
150
|
/**
|
|
@@ -196,6 +192,9 @@ export type RpcCallForSpecArgs<TSpec extends RequestResponseActionSpec> = Omit<R
|
|
|
196
192
|
* happy-path + denial-path assertions where the error `data.reason` shape
|
|
197
193
|
* is still asserted manually. For adversarial input tests that send
|
|
198
194
|
* malformed params, use the untyped `rpc_call`.
|
|
195
|
+
*
|
|
196
|
+
* @throws Error if the success `result` does not parse against `spec.output`,
|
|
197
|
+
* or if `rpc_call` itself throws on an envelope violation.
|
|
199
198
|
*/
|
|
200
199
|
export declare const rpc_call_for_spec: <TSpec extends RequestResponseActionSpec>(args: RpcCallForSpecArgs<TSpec>) => Promise<RpcCallResultForSpec<TSpec>>;
|
|
201
200
|
/**
|
|
@@ -203,6 +202,9 @@ export declare const rpc_call_for_spec: <TSpec extends RequestResponseActionSpec
|
|
|
203
202
|
* output schema and returns typed data. Envelope-level failures or error
|
|
204
203
|
* responses throw — use the untyped `rpc_call` for tests that need to
|
|
205
204
|
* assert on specific error shapes.
|
|
205
|
+
*
|
|
206
|
+
* @throws Error if the response is a JSON-RPC error, if `rpc_call` throws
|
|
207
|
+
* on an envelope violation, or if the result fails `output_schema.safeParse`.
|
|
206
208
|
*/
|
|
207
209
|
export declare const rpc_call_typed: <T>(args: RpcCallArgs, output_schema: z.ZodType<T>) => Promise<T>;
|
|
208
210
|
/**
|
|
@@ -225,12 +227,17 @@ export declare const find_rpc_method: (rpc_endpoints: ReadonlyArray<AppSurfaceRp
|
|
|
225
227
|
} | undefined;
|
|
226
228
|
/**
|
|
227
229
|
* Resolve a single RPC endpoint path — the common case where a consumer
|
|
228
|
-
* mounts exactly one `create_rpc_endpoint`.
|
|
229
|
-
*
|
|
230
|
-
*
|
|
230
|
+
* mounts exactly one `create_rpc_endpoint`.
|
|
231
|
+
*
|
|
232
|
+
* Used at suite setup time to hard-fail integration suites (admin / audit /
|
|
233
|
+
* SSE / rate-limiting) when the consumer omitted `rpc_endpoints` rather
|
|
234
|
+
* than letting tests fail mid-run with confusing errors.
|
|
231
235
|
*
|
|
232
236
|
* Callers that need multi-endpoint support should iterate `rpc_endpoints`
|
|
233
237
|
* directly.
|
|
238
|
+
*
|
|
239
|
+
* @throws Error if `rpc_endpoints` is empty (hard-fail; see the suite options
|
|
240
|
+
* docs) or has more than one entry (ambiguous).
|
|
234
241
|
*/
|
|
235
242
|
export declare const require_rpc_endpoint_path: (rpc_endpoints: ReadonlyArray<RpcEndpointSpec>) => string;
|
|
236
243
|
//# sourceMappingURL=rpc_helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/rpc_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAa7B,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAIN,KAAK,gBAAgB,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,2BAA2B,CAAC;AACzE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAC,qBAAqB,EAAE,mBAAmB,EAAE,eAAe,EAAC,MAAM,oBAAoB,CAAC;AACpG,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAG9D;;;;;;;;GAQG;AACH,MAAM,MAAM,uBAAuB,GAChC,KAAK,CAAC,eAAe,CAAC,GACtB,CAAC,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;AAEvD
|
|
1
|
+
{"version":3,"file":"rpc_helpers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OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAarC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,GAAU,CAAC,EACrC,MAAM,WAAW,EACjB,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KACzB,OAAO,CAAC,CAAC,CAcX,CAAC;AAIF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC3B,eAAe,aAAa,CAAC,eAAe,CAAC,EAC7C,QAAQ,MAAM,KACZ;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAC,GAAG,SAOtC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC3B,eAAe,aAAa,CAAC,qBAAqB,CAAC,EACnD,QAAQ,MAAM,KACZ;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,mBAAmB,CAAA;CAAC,GAAG,SAOrD,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,yBAAyB,GACrC,eAAe,aAAa,CAAC,eAAe,CAAC,KAC3C,MAYF,CAAC"}
|
|
@@ -30,6 +30,9 @@ import { create_stub_app_server_context } from './stubs.js';
|
|
|
30
30
|
* etc.) are. Factories that return a different `path` based on `ctx` will
|
|
31
31
|
* produce a setup/runtime mismatch; the path-purity assert below surfaces
|
|
32
32
|
* that as a clear `gro check` error rather than a silent test/runtime drift.
|
|
33
|
+
*
|
|
34
|
+
* @throws Error if the factory's two stub-ctx invocations produce different
|
|
35
|
+
* `(path, method-list)` shapes — surfaces non-pure factories at setup time.
|
|
33
36
|
*/
|
|
34
37
|
export const resolve_rpc_endpoints_for_setup = (rpc_endpoints, session_options) => {
|
|
35
38
|
if (typeof rpc_endpoints !== 'function')
|
|
@@ -54,7 +57,6 @@ export const resolve_rpc_endpoints_for_setup = (rpc_endpoints, session_options)
|
|
|
54
57
|
/**
|
|
55
58
|
* Create a `RequestInit` for a JSON-RPC POST request.
|
|
56
59
|
*
|
|
57
|
-
* @param method - JSON-RPC method name
|
|
58
60
|
* @param params - params (omit for parameterless methods; `null` is also
|
|
59
61
|
* stripped for ergonomic call sites — JSON-RPC 2.0 §4.2
|
|
60
62
|
* forbids `"params": null` on the wire, and `create_rpc_endpoint`
|
|
@@ -63,7 +65,6 @@ export const resolve_rpc_endpoints_for_setup = (rpc_endpoints, session_options)
|
|
|
63
65
|
* envelope (e.g. asserting envelope-level rejection) should
|
|
64
66
|
* build the body inline rather than route through this helper.
|
|
65
67
|
* @param id - request id (default `'test'`)
|
|
66
|
-
* @returns a `RequestInit` with the JSON-RPC envelope as body
|
|
67
68
|
*/
|
|
68
69
|
export const create_rpc_post_init = (method, params, id = 'test') => {
|
|
69
70
|
const envelope = { jsonrpc: JSONRPC_VERSION, method, id };
|
|
@@ -79,10 +80,8 @@ export const create_rpc_post_init = (method, params, id = 'test') => {
|
|
|
79
80
|
* Build a GET URL with JSON-RPC query parameters.
|
|
80
81
|
*
|
|
81
82
|
* @param endpoint_path - the RPC endpoint path (e.g., `/api/rpc`)
|
|
82
|
-
* @param method - JSON-RPC method name
|
|
83
83
|
* @param params - params (omit for parameterless methods)
|
|
84
84
|
* @param id - request id (default `'test'`)
|
|
85
|
-
* @returns the full URL with query string
|
|
86
85
|
*/
|
|
87
86
|
export const create_rpc_get_url = (endpoint_path, method, params, id = 'test') => {
|
|
88
87
|
const search = new URLSearchParams({ method, id: String(id) });
|
|
@@ -97,7 +96,6 @@ export const create_rpc_get_url = (endpoint_path, method, params, id = 'test') =
|
|
|
97
96
|
* Validates the structure matches `JsonrpcErrorResponse` and optionally
|
|
98
97
|
* checks the error code.
|
|
99
98
|
*
|
|
100
|
-
* @param body - parsed response body
|
|
101
99
|
* @param expected_code - optional error code to assert
|
|
102
100
|
*/
|
|
103
101
|
export const assert_jsonrpc_error_response = (body, expected_code) => {
|
|
@@ -114,7 +112,6 @@ export const assert_jsonrpc_error_response = (body, expected_code) => {
|
|
|
114
112
|
* is provided, also validates the `result` field against the declared
|
|
115
113
|
* output schema — matching the REST round-trip's `assert_response_matches_spec`.
|
|
116
114
|
*
|
|
117
|
-
* @param body - parsed response body
|
|
118
115
|
* @param output_schema - optional Zod schema to validate the `result` field against
|
|
119
116
|
*/
|
|
120
117
|
export const assert_jsonrpc_success_response = (body, output_schema) => {
|
|
@@ -144,11 +141,10 @@ const RPC_CALL_DEFAULT_HEADERS = {
|
|
|
144
141
|
* caller-provided headers, fires POST (default) or GET, parses the envelope,
|
|
145
142
|
* and returns a discriminated result.
|
|
146
143
|
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
* `error.data.reason`.
|
|
144
|
+
* @throws Error if the response body is neither a valid `JsonrpcResponse`
|
|
145
|
+
* nor `JsonrpcErrorResponse` envelope — protocol-level failures the caller
|
|
146
|
+
* should never tolerate. All JSON-RPC errors come back via `{ok: false, error}`
|
|
147
|
+
* so assertions can focus on `error.code` / `error.data.reason`.
|
|
152
148
|
*/
|
|
153
149
|
export const rpc_call = async (args) => {
|
|
154
150
|
const { app, path, method, params, headers, id = 'test', verb = 'POST', suppress_default_origin, } = args;
|
|
@@ -214,6 +210,9 @@ export const rpc_call_non_browser = (args) => rpc_call({ ...args, suppress_defau
|
|
|
214
210
|
* happy-path + denial-path assertions where the error `data.reason` shape
|
|
215
211
|
* is still asserted manually. For adversarial input tests that send
|
|
216
212
|
* malformed params, use the untyped `rpc_call`.
|
|
213
|
+
*
|
|
214
|
+
* @throws Error if the success `result` does not parse against `spec.output`,
|
|
215
|
+
* or if `rpc_call` itself throws on an envelope violation.
|
|
217
216
|
*/
|
|
218
217
|
export const rpc_call_for_spec = async (args) => {
|
|
219
218
|
const { spec, params, ...rest } = args;
|
|
@@ -232,6 +231,9 @@ export const rpc_call_for_spec = async (args) => {
|
|
|
232
231
|
* output schema and returns typed data. Envelope-level failures or error
|
|
233
232
|
* responses throw — use the untyped `rpc_call` for tests that need to
|
|
234
233
|
* assert on specific error shapes.
|
|
234
|
+
*
|
|
235
|
+
* @throws Error if the response is a JSON-RPC error, if `rpc_call` throws
|
|
236
|
+
* on an envelope violation, or if the result fails `output_schema.safeParse`.
|
|
235
237
|
*/
|
|
236
238
|
export const rpc_call_typed = async (args, output_schema) => {
|
|
237
239
|
const res = await rpc_call(args);
|
|
@@ -275,12 +277,17 @@ export const find_rpc_method = (rpc_endpoints, method) => {
|
|
|
275
277
|
};
|
|
276
278
|
/**
|
|
277
279
|
* Resolve a single RPC endpoint path — the common case where a consumer
|
|
278
|
-
* mounts exactly one `create_rpc_endpoint`.
|
|
279
|
-
*
|
|
280
|
-
*
|
|
280
|
+
* mounts exactly one `create_rpc_endpoint`.
|
|
281
|
+
*
|
|
282
|
+
* Used at suite setup time to hard-fail integration suites (admin / audit /
|
|
283
|
+
* SSE / rate-limiting) when the consumer omitted `rpc_endpoints` rather
|
|
284
|
+
* than letting tests fail mid-run with confusing errors.
|
|
281
285
|
*
|
|
282
286
|
* Callers that need multi-endpoint support should iterate `rpc_endpoints`
|
|
283
287
|
* directly.
|
|
288
|
+
*
|
|
289
|
+
* @throws Error if `rpc_endpoints` is empty (hard-fail; see the suite options
|
|
290
|
+
* docs) or has more than one entry (ambiguous).
|
|
284
291
|
*/
|
|
285
292
|
export const require_rpc_endpoint_path = (rpc_endpoints) => {
|
|
286
293
|
if (rpc_endpoints.length === 0) {
|
|
@@ -45,8 +45,6 @@ export interface RpcRoundTripTestOptions {
|
|
|
45
45
|
* Error responses (from missing DB state, etc.) are expected and validated
|
|
46
46
|
* as well-formed JSON-RPC errors. Successful responses are validated against
|
|
47
47
|
* `action.spec.output`.
|
|
48
|
-
*
|
|
49
|
-
* @param options - round-trip test configuration
|
|
50
48
|
*/
|
|
51
49
|
export declare const describe_rpc_round_trip_tests: (options: RpcRoundTripTestOptions) => void;
|
|
52
50
|
//# sourceMappingURL=rpc_round_trip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc_round_trip.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/rpc_round_trip.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAe7B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAEN,KAAK,eAAe,EAGpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAwB,KAAK,SAAS,EAAC,MAAM,SAAS,CAAC;AAM9D,OAAO,EAMN,KAAK,uBAAuB,EAC5B,MAAM,kBAAkB,CAAC;AAE1B,mDAAmD;AACnD,MAAM,WAAW,uBAAuB;IACvC,4CAA4C;IAC5C,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,wDAAwD;IACxD,kBAAkB,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE;;;;;;;;;;OAUG;IACH,aAAa,EAAE,uBAAuB,CAAC;IACvC,iDAAiD;IACjD,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,qEAAqE;IACrE,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAChC,oDAAoD;IACpD,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,6EAA6E;IAC7E,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvD;AA2BD
|
|
1
|
+
{"version":3,"file":"rpc_round_trip.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/rpc_round_trip.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAe7B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAEN,KAAK,eAAe,EAGpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAwB,KAAK,SAAS,EAAC,MAAM,SAAS,CAAC;AAM9D,OAAO,EAMN,KAAK,uBAAuB,EAC5B,MAAM,kBAAkB,CAAC;AAE1B,mDAAmD;AACnD,MAAM,WAAW,uBAAuB;IACvC,4CAA4C;IAC5C,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,wDAAwD;IACxD,kBAAkB,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE;;;;;;;;;;OAUG;IACH,aAAa,EAAE,uBAAuB,CAAC;IACvC,iDAAiD;IACjD,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,qEAAqE;IACrE,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAChC,oDAAoD;IACpD,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,6EAA6E;IAC7E,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvD;AA2BD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,6BAA6B,GAAI,SAAS,uBAAuB,KAAG,IA8IhF,CAAC"}
|
|
@@ -49,8 +49,6 @@ const pick_rpc_auth_headers = (method, test_app, authed_account, admin_account)
|
|
|
49
49
|
* Error responses (from missing DB state, etc.) are expected and validated
|
|
50
50
|
* as well-formed JSON-RPC errors. Successful responses are validated against
|
|
51
51
|
* `action.spec.output`.
|
|
52
|
-
*
|
|
53
|
-
* @param options - round-trip test configuration
|
|
54
52
|
*/
|
|
55
53
|
export const describe_rpc_round_trip_tests = (options) => {
|
|
56
54
|
const skip_set = new Set(options.skip_methods);
|
|
@@ -25,9 +25,11 @@ export declare const resolve_valid_path: (path: string, params_schema?: z.ZodObj
|
|
|
25
25
|
/**
|
|
26
26
|
* Generate a valid request body for a route's input schema.
|
|
27
27
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
28
|
+
* @returns a generated body that passes `safeParse`, or `undefined` for null /
|
|
29
|
+
* non-object schemas
|
|
30
|
+
* @throws Error if the generated body fails `input_schema.safeParse` — catches
|
|
31
|
+
* broken `generate_valid_value` logic early with a descriptive Zod-issues
|
|
32
|
+
* summary instead of a confusing 400 in downstream tests.
|
|
31
33
|
*/
|
|
32
34
|
export declare const generate_valid_body: (input_schema: z.ZodType) => Record<string, unknown> | undefined;
|
|
33
35
|
//# sourceMappingURL=schema_generators.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema_generators.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/schema_generators.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;;GAQG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,EAKN,KAAK,YAAY,EACjB,MAAM,yBAAyB,CAAC;AAIjC;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,cAAc,CAAC,CAAC,OAAO,KAAG,MAAM,GAAG,IAShE,CAAC;AA+FF,qEAAqE;AACrE,eAAO,MAAM,oBAAoB,GAAI,OAAO,YAAY,EAAE,cAAc,CAAC,CAAC,OAAO,KAAG,
|
|
1
|
+
{"version":3,"file":"schema_generators.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/schema_generators.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;;GAQG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,EAKN,KAAK,YAAY,EACjB,MAAM,yBAAyB,CAAC;AAIjC;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,cAAc,CAAC,CAAC,OAAO,KAAG,MAAM,GAAG,IAShE,CAAC;AA+FF,qEAAqE;AACrE,eAAO,MAAM,oBAAoB,GAAI,OAAO,YAAY,EAAE,cAAc,CAAC,CAAC,OAAO,KAAG,OAmEnF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,EAAE,gBAAgB,CAAC,CAAC,SAAS,KAAG,MAa9E,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,GAC/B,cAAc,CAAC,CAAC,OAAO,KACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAkB5B,CAAC"}
|
|
@@ -165,6 +165,23 @@ export const generate_valid_value = (field, field_schema) => {
|
|
|
165
165
|
}
|
|
166
166
|
case 'null':
|
|
167
167
|
return null;
|
|
168
|
+
case 'union': {
|
|
169
|
+
// Pick the first variant and recurse. Works for both `z.union` and
|
|
170
|
+
// `z.discriminatedUnion` — Zod 4 represents both as `def.type ===
|
|
171
|
+
// 'union'` with a `def.options` array. Picking `options[0]` is a
|
|
172
|
+
// pragmatic default; consumers needing a specific branch can pass
|
|
173
|
+
// an override via the relevant test helper.
|
|
174
|
+
const def = zod_unwrap_def(field_schema);
|
|
175
|
+
const first = def.options?.[0];
|
|
176
|
+
if (first) {
|
|
177
|
+
const inner_field = {
|
|
178
|
+
...field,
|
|
179
|
+
base_type: zod_get_base_type(first),
|
|
180
|
+
};
|
|
181
|
+
return generate_valid_value(inner_field, first);
|
|
182
|
+
}
|
|
183
|
+
return 'test_value';
|
|
184
|
+
}
|
|
168
185
|
case 'enum': {
|
|
169
186
|
const enum_def = zod_unwrap_def(field_schema);
|
|
170
187
|
if ('entries' in enum_def) {
|
|
@@ -206,9 +223,11 @@ export const resolve_valid_path = (path, params_schema) => {
|
|
|
206
223
|
/**
|
|
207
224
|
* Generate a valid request body for a route's input schema.
|
|
208
225
|
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
226
|
+
* @returns a generated body that passes `safeParse`, or `undefined` for null /
|
|
227
|
+
* non-object schemas
|
|
228
|
+
* @throws Error if the generated body fails `input_schema.safeParse` — catches
|
|
229
|
+
* broken `generate_valid_value` logic early with a descriptive Zod-issues
|
|
230
|
+
* summary instead of a confusing 400 in downstream tests.
|
|
212
231
|
*/
|
|
213
232
|
export const generate_valid_body = (input_schema) => {
|
|
214
233
|
if (is_null_schema(input_schema))
|
|
@@ -74,7 +74,9 @@ export interface SseRouteTestOptions {
|
|
|
74
74
|
* connected comment, fires the trigger, validates the resulting payload,
|
|
75
75
|
* then asserts close-on-revoke (unless opted out).
|
|
76
76
|
*
|
|
77
|
-
* @
|
|
77
|
+
* @throws Error at setup time when `options.rpc_endpoints` is empty — the
|
|
78
|
+
* close-on-revoke assertion dispatches `account_session_revoke_all` via
|
|
79
|
+
* RPC. Hard-fails via `require_rpc_endpoint_path`.
|
|
78
80
|
*/
|
|
79
81
|
export declare const describe_sse_route_tests: (options: SseRouteTestOptions) => void;
|
|
80
82
|
//# sourceMappingURL=sse_round_trip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse_round_trip.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/sse_round_trip.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAmB7B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAwB,KAAK,SAAS,EAAuB,MAAM,oBAAoB,CAAC;AAE/F,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,MAAM,iB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OAaG;IACH,aAAa,EAAE,uBAAuB,CAAC;IACvC,8BAA8B;IAC9B,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CAChC;AAyHD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,wBAAwB,GAAI,SAAS,mBAAmB,KAAG,IA2HvE,CAAC"}
|
|
@@ -126,7 +126,9 @@ const parse_and_validate_sse_payload = (frame, event_specs, route_path) => {
|
|
|
126
126
|
* connected comment, fires the trigger, validates the resulting payload,
|
|
127
127
|
* then asserts close-on-revoke (unless opted out).
|
|
128
128
|
*
|
|
129
|
-
* @
|
|
129
|
+
* @throws Error at setup time when `options.rpc_endpoints` is empty — the
|
|
130
|
+
* close-on-revoke assertion dispatches `account_session_revoke_all` via
|
|
131
|
+
* RPC. Hard-fails via `require_rpc_endpoint_path`.
|
|
130
132
|
*/
|
|
131
133
|
export const describe_sse_route_tests = (options) => {
|
|
132
134
|
// Hard-fail early so consumers see a clear setup error instead of a
|
|
@@ -55,8 +55,6 @@ export interface StandardTestOptions {
|
|
|
55
55
|
* Run both standard integration and admin integration test suites.
|
|
56
56
|
*
|
|
57
57
|
* Admin tests are only included when `roles` is provided.
|
|
58
|
-
*
|
|
59
|
-
* @param options - session config, route factory, RPC endpoints, and optional role schema
|
|
60
58
|
*/
|
|
61
59
|
export declare const describe_standard_tests: (options: StandardTestOptions) => void;
|
|
62
60
|
//# sourceMappingURL=standard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/standard.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAC,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAChF,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC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,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,4CAA4C;IAC5C,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,wDAAwD;IACxD,kBAAkB,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CACpB,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,iBAAiB,GAAG,oBAAoB,CAAC,CAC5E,CAAC;IACF;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAChC;;;OAGG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB;;;;;;;;;;OAUG;IACH,aAAa,EAAE,uBAAuB,CAAC;IACvC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,mBAAmB,KAAG,IAStE,CAAC"}
|
package/dist/testing/standard.js
CHANGED
|
@@ -5,8 +5,6 @@ import { describe_standard_admin_integration_tests } from './admin_integration.j
|
|
|
5
5
|
* Run both standard integration and admin integration test suites.
|
|
6
6
|
*
|
|
7
7
|
* Admin tests are only included when `roles` is provided.
|
|
8
|
-
*
|
|
9
|
-
* @param options - session config, route factory, RPC endpoints, and optional role schema
|
|
10
8
|
*/
|
|
11
9
|
export const describe_standard_tests = (options) => {
|
|
12
10
|
describe_standard_integration_tests(options);
|