@fuzdev/fuz_app 0.50.0 → 0.52.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 +16 -3
- 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 +44 -13
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +58 -20
- 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 -0
- package/dist/actions/action_registry.d.ts +2 -2
- package/dist/actions/action_registry.js +2 -2
- package/dist/actions/action_rpc.d.ts +4 -0
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +4 -0
- package/dist/actions/action_spec.d.ts +23 -3
- package/dist/actions/action_spec.d.ts.map +1 -1
- package/dist/actions/action_spec.js +17 -3
- package/dist/actions/action_types.d.ts +2 -2
- package/dist/actions/action_types.js +2 -2
- package/dist/actions/cancel.d.ts +2 -2
- package/dist/actions/cancel.js +2 -2
- package/dist/actions/heartbeat.d.ts +2 -2
- package/dist/actions/heartbeat.js +2 -2
- package/dist/actions/protocol.d.ts +1 -1
- package/dist/actions/protocol.js +1 -1
- package/dist/actions/register_action_ws.d.ts +4 -1
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +4 -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 +14 -1
- package/dist/actions/request_tracker.svelte.d.ts.map +1 -1
- package/dist/actions/request_tracker.svelte.js +14 -1
- package/dist/actions/socket.svelte.d.ts +35 -15
- package/dist/actions/socket.svelte.d.ts.map +1 -1
- package/dist/actions/socket.svelte.js +33 -13
- package/dist/actions/transports.d.ts +12 -3
- package/dist/actions/transports.d.ts.map +1 -1
- package/dist/actions/transports.js +16 -7
- 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 -2
- package/dist/actions/transports_ws_auth_guard.d.ts.map +1 -1
- package/dist/actions/transports_ws_auth_guard.js +6 -2
- 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 -1
- package/dist/auth/CLAUDE.md +40 -4
- package/dist/auth/account_queries.d.ts +10 -0
- package/dist/auth/account_queries.d.ts.map +1 -1
- package/dist/auth/account_queries.js +10 -0
- package/dist/auth/account_routes.d.ts +3 -3
- package/dist/auth/account_routes.js +3 -3
- package/dist/auth/account_schema.d.ts +1 -1
- package/dist/auth/account_schema.js +1 -1
- 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.d.ts +1 -1
- package/dist/auth/api_token.js +1 -1
- package/dist/auth/api_token_queries.d.ts +7 -0
- package/dist/auth/api_token_queries.d.ts.map +1 -1
- package/dist/auth/api_token_queries.js +7 -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 +6 -0
- package/dist/auth/audit_log_queries.d.ts.map +1 -1
- package/dist/auth/audit_log_queries.js +6 -0
- package/dist/auth/audit_log_routes.d.ts +1 -1
- package/dist/auth/audit_log_routes.js +1 -1
- package/dist/auth/audit_log_schema.d.ts +3 -1
- 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.d.ts +1 -1
- package/dist/auth/daemon_token.js +1 -1
- package/dist/auth/daemon_token_middleware.d.ts +5 -1
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +5 -1
- package/dist/auth/ddl.d.ts +1 -1
- package/dist/auth/ddl.js +1 -1
- package/dist/auth/invite_queries.d.ts +4 -0
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_queries.js +4 -0
- package/dist/auth/password.d.ts +1 -1
- package/dist/auth/password.js +1 -1
- package/dist/auth/permit_offer_action_specs.d.ts +5 -0
- package/dist/auth/permit_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/permit_offer_action_specs.js +10 -0
- package/dist/auth/permit_offer_queries.d.ts +19 -0
- package/dist/auth/permit_offer_queries.d.ts.map +1 -1
- package/dist/auth/permit_offer_queries.js +19 -0
- package/dist/auth/permit_queries.d.ts +8 -0
- package/dist/auth/permit_queries.d.ts.map +1 -1
- package/dist/auth/permit_queries.js +8 -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/route_guards.d.ts +1 -1
- package/dist/auth/route_guards.js +1 -1
- package/dist/auth/self_service_role_action_specs.d.ts +1 -1
- package/dist/auth/self_service_role_action_specs.js +1 -1
- package/dist/auth/self_service_role_actions.d.ts +2 -1
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +2 -1
- package/dist/auth/session_lifecycle.d.ts +3 -0
- package/dist/auth/session_lifecycle.d.ts.map +1 -1
- package/dist/auth/session_lifecycle.js +3 -0
- package/dist/auth/session_middleware.d.ts +5 -0
- package/dist/auth/session_middleware.d.ts.map +1 -1
- package/dist/auth/session_middleware.js +5 -0
- package/dist/auth/session_queries.d.ts +10 -1
- package/dist/auth/session_queries.d.ts.map +1 -1
- package/dist/auth/session_queries.js +10 -1
- package/dist/auth/signup_routes.d.ts +1 -1
- package/dist/auth/signup_routes.js +1 -1
- package/dist/cli/config.d.ts +2 -0
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +2 -0
- 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/cli/util.d.ts +1 -1
- package/dist/cli/util.js +1 -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 +5 -2
- package/dist/db/create_db.d.ts.map +1 -1
- package/dist/db/create_db.js +5 -2
- package/dist/db/db.d.ts +22 -7
- package/dist/db/db.d.ts.map +1 -1
- package/dist/db/db.js +21 -6
- package/dist/db/db_pg.d.ts +2 -1
- package/dist/db/db_pg.d.ts.map +1 -1
- package/dist/db/db_pg.js +5 -3
- package/dist/db/db_pglite.d.ts +3 -2
- package/dist/db/db_pglite.d.ts.map +1 -1
- package/dist/db/db_pglite.js +3 -2
- package/dist/db/migrate.d.ts +8 -4
- package/dist/db/migrate.d.ts.map +1 -1
- package/dist/db/migrate.js +6 -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 +18 -2
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +18 -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 -1
- package/dist/env/load.js +1 -1
- 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 +1 -1
- package/dist/hono_context.js +1 -1
- package/dist/http/jsonrpc_errors.d.ts +2 -2
- package/dist/http/jsonrpc_errors.js +2 -2
- package/dist/http/jsonrpc_helpers.d.ts +2 -2
- package/dist/http/jsonrpc_helpers.js +2 -2
- package/dist/http/middleware_spec.d.ts +1 -1
- package/dist/http/middleware_spec.js +1 -1
- package/dist/http/origin.d.ts +1 -1
- package/dist/http/origin.js +1 -1
- 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 -0
- package/dist/http/proxy.d.ts.map +1 -1
- package/dist/http/proxy.js +3 -0
- package/dist/http/route_spec.d.ts +1 -0
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +7 -0
- package/dist/http/schema_helpers.d.ts +1 -1
- package/dist/http/schema_helpers.js +1 -1
- package/dist/http/surface.d.ts +1 -1
- package/dist/http/surface.js +1 -1
- package/dist/rate_limiter.d.ts +14 -1
- package/dist/rate_limiter.d.ts.map +1 -1
- package/dist/rate_limiter.js +14 -1
- package/dist/realtime/sse.d.ts +7 -1
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +3 -1
- 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 -2
- package/dist/realtime/subscriber_registry.d.ts.map +1 -1
- package/dist/realtime/subscriber_registry.js +4 -2
- package/dist/runtime/deno.d.ts +1 -1
- package/dist/runtime/deno.js +1 -1
- package/dist/runtime/fs.d.ts +5 -0
- package/dist/runtime/fs.d.ts.map +1 -1
- package/dist/runtime/fs.js +5 -0
- package/dist/runtime/mock.d.ts +6 -0
- package/dist/runtime/mock.d.ts.map +1 -1
- package/dist/runtime/mock.js +6 -0
- package/dist/runtime/node.d.ts +1 -1
- package/dist/runtime/node.js +1 -1
- 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 +4 -0
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +4 -0
- package/dist/server/validate_nginx.d.ts +3 -0
- package/dist/server/validate_nginx.d.ts.map +1 -1
- package/dist/testing/admin_integration.d.ts +5 -0
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +5 -0
- package/dist/testing/adversarial_headers.d.ts +5 -3
- package/dist/testing/adversarial_headers.d.ts.map +1 -1
- package/dist/testing/adversarial_headers.js +5 -3
- package/dist/testing/adversarial_input.d.ts +4 -0
- package/dist/testing/adversarial_input.d.ts.map +1 -1
- package/dist/testing/adversarial_input.js +4 -0
- package/dist/testing/app_server.d.ts +3 -0
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +11 -0
- package/dist/testing/assertions.d.ts +23 -7
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/assertions.js +23 -7
- package/dist/testing/audit_completeness.d.ts +4 -0
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +4 -0
- package/dist/testing/auth_apps.d.ts +3 -0
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +3 -0
- package/dist/testing/db.d.ts +9 -1
- package/dist/testing/db.d.ts.map +1 -1
- package/dist/testing/db.js +9 -1
- package/dist/testing/error_coverage.d.ts +9 -0
- package/dist/testing/error_coverage.d.ts.map +1 -1
- package/dist/testing/error_coverage.js +9 -0
- package/dist/testing/integration.d.ts +4 -0
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +4 -0
- package/dist/testing/integration_helpers.d.ts +10 -4
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +10 -4
- package/dist/testing/middleware.d.ts +5 -0
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +5 -0
- package/dist/testing/rate_limiting.d.ts +3 -0
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +3 -0
- package/dist/testing/rpc_attack_surface.js +1 -1
- package/dist/testing/rpc_helpers.d.ts +21 -8
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +22 -9
- package/dist/testing/schema_generators.d.ts +7 -2
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +7 -2
- package/dist/testing/sse_round_trip.d.ts +3 -0
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +3 -0
- package/dist/testing/stubs.d.ts +7 -0
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +7 -0
- package/dist/testing/surface_invariants.d.ts +14 -0
- package/dist/testing/surface_invariants.d.ts.map +1 -1
- package/dist/testing/surface_invariants.js +14 -0
- package/dist/testing/ws_round_trip.d.ts +13 -1
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +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/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/account_sessions_state.svelte.d.ts +2 -2
- package/dist/ui/account_sessions_state.svelte.js +1 -1
- package/dist/ui/admin_rpc_adapters.d.ts +1 -1
- package/dist/ui/admin_rpc_adapters.js +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 +6 -1
- 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 -0
- package/dist/ui/position_helpers.d.ts.map +1 -1
- package/dist/ui/position_helpers.js +1 -0
- package/dist/ui/sidebar_state.svelte.d.ts +22 -9
- package/dist/ui/sidebar_state.svelte.d.ts.map +1 -1
- package/dist/ui/sidebar_state.svelte.js +17 -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/package.json +1 -1
|
@@ -43,6 +43,9 @@ const STUB_DEPS = { db: {} };
|
|
|
43
43
|
*
|
|
44
44
|
* @param tc - the test config providing mock return values
|
|
45
45
|
* @returns mocks bundle with spy references
|
|
46
|
+
* @mutates module-level `vi.mock` registrations for `api_token_queries`,
|
|
47
|
+
* `account_queries`, and `permit_queries` — each call resets and re-binds
|
|
48
|
+
* the four spies, so cases run in sequence without bleeding state.
|
|
46
49
|
*/
|
|
47
50
|
export const create_bearer_auth_mocks = (tc) => {
|
|
48
51
|
const mock_validate = vi.mocked(query_validate_api_token);
|
|
@@ -176,6 +179,8 @@ export const TEST_MIDDLEWARE_PATH = '/api/test';
|
|
|
176
179
|
*
|
|
177
180
|
* @param options - middleware stack configuration
|
|
178
181
|
* @returns the app and mock spies (reconfigure via `mockImplementation` for valid-token paths)
|
|
182
|
+
* @mutates module-level `vi.mock` registrations for the four bearer-auth query
|
|
183
|
+
* modules — each call resets the spies before wiring the stack.
|
|
179
184
|
*/
|
|
180
185
|
export const create_test_middleware_stack_app = (options) => {
|
|
181
186
|
const trusted_proxies = options?.trusted_proxies ?? ['10.0.0.1'];
|
|
@@ -54,6 +54,9 @@ export interface RateLimitingTestOptions {
|
|
|
54
54
|
* message if the consumer's route specs are misconfigured.
|
|
55
55
|
*
|
|
56
56
|
* @param options - session config and route factory
|
|
57
|
+
* @throws Error at setup time when `options.rpc_endpoints` is empty — the
|
|
58
|
+
* bearer-auth rate-limit test probes via the `account_verify` RPC action,
|
|
59
|
+
* so the suite hard-fails via `require_rpc_endpoint_path`.
|
|
57
60
|
*/
|
|
58
61
|
export declare const describe_rate_limiting_tests: (options: RateLimitingTestOptions) => void;
|
|
59
62
|
//# 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;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,4BAA4B,GAAI,SAAS,uBAAuB,KAAG,IA8P/E,CAAC"}
|
|
@@ -36,6 +36,9 @@ import { account_verify_action_spec } from '../auth/account_action_specs.js';
|
|
|
36
36
|
* message if the consumer's route specs are misconfigured.
|
|
37
37
|
*
|
|
38
38
|
* @param options - session config and route factory
|
|
39
|
+
* @throws Error at setup time when `options.rpc_endpoints` is empty — the
|
|
40
|
+
* bearer-auth rate-limit test probes via the `account_verify` RPC action,
|
|
41
|
+
* so the suite hard-fails via `require_rpc_endpoint_path`.
|
|
39
42
|
*/
|
|
40
43
|
export const describe_rate_limiting_tests = (options) => {
|
|
41
44
|
const max_attempts = options.max_attempts ?? 2;
|
|
@@ -306,7 +306,7 @@ const describe_rpc_adversarial_envelopes = (options) => {
|
|
|
306
306
|
* For each method with a non-null input schema, generates test cases
|
|
307
307
|
* from the schema (wrong types, missing fields, format violations)
|
|
308
308
|
* and wraps them in valid JSON-RPC envelopes. Reuses
|
|
309
|
-
* `generate_input_test_cases` from `adversarial_input.ts`.
|
|
309
|
+
* `generate_input_test_cases` from `testing/adversarial_input.ts`.
|
|
310
310
|
*/
|
|
311
311
|
const describe_rpc_adversarial_params = (options) => {
|
|
312
312
|
const { build, roles } = options;
|
|
@@ -34,6 +34,9 @@ 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
|
/**
|
|
@@ -144,11 +147,10 @@ export interface RpcCallArgs {
|
|
|
144
147
|
* caller-provided headers, fires POST (default) or GET, parses the envelope,
|
|
145
148
|
* and returns a discriminated result.
|
|
146
149
|
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
* `error.data.reason`.
|
|
150
|
+
* @throws Error if the response body is neither a valid `JsonrpcResponse`
|
|
151
|
+
* nor `JsonrpcErrorResponse` envelope — protocol-level failures the caller
|
|
152
|
+
* should never tolerate. All JSON-RPC errors come back via `{ok: false, error}`
|
|
153
|
+
* so assertions can focus on `error.code` / `error.data.reason`.
|
|
152
154
|
*/
|
|
153
155
|
export declare const rpc_call: (args: RpcCallArgs) => Promise<RpcCallResult>;
|
|
154
156
|
/**
|
|
@@ -196,6 +198,9 @@ export type RpcCallForSpecArgs<TSpec extends RequestResponseActionSpec> = Omit<R
|
|
|
196
198
|
* happy-path + denial-path assertions where the error `data.reason` shape
|
|
197
199
|
* is still asserted manually. For adversarial input tests that send
|
|
198
200
|
* malformed params, use the untyped `rpc_call`.
|
|
201
|
+
*
|
|
202
|
+
* @throws Error if the success `result` does not parse against `spec.output`,
|
|
203
|
+
* or if `rpc_call` itself throws on an envelope violation.
|
|
199
204
|
*/
|
|
200
205
|
export declare const rpc_call_for_spec: <TSpec extends RequestResponseActionSpec>(args: RpcCallForSpecArgs<TSpec>) => Promise<RpcCallResultForSpec<TSpec>>;
|
|
201
206
|
/**
|
|
@@ -203,6 +208,9 @@ export declare const rpc_call_for_spec: <TSpec extends RequestResponseActionSpec
|
|
|
203
208
|
* output schema and returns typed data. Envelope-level failures or error
|
|
204
209
|
* responses throw — use the untyped `rpc_call` for tests that need to
|
|
205
210
|
* assert on specific error shapes.
|
|
211
|
+
*
|
|
212
|
+
* @throws Error if the response is a JSON-RPC error, if `rpc_call` throws
|
|
213
|
+
* on an envelope violation, or if the result fails `output_schema.safeParse`.
|
|
206
214
|
*/
|
|
207
215
|
export declare const rpc_call_typed: <T>(args: RpcCallArgs, output_schema: z.ZodType<T>) => Promise<T>;
|
|
208
216
|
/**
|
|
@@ -225,12 +233,17 @@ export declare const find_rpc_method: (rpc_endpoints: ReadonlyArray<AppSurfaceRp
|
|
|
225
233
|
} | undefined;
|
|
226
234
|
/**
|
|
227
235
|
* Resolve a single RPC endpoint path — the common case where a consumer
|
|
228
|
-
* mounts exactly one `create_rpc_endpoint`.
|
|
229
|
-
*
|
|
230
|
-
*
|
|
236
|
+
* mounts exactly one `create_rpc_endpoint`.
|
|
237
|
+
*
|
|
238
|
+
* Used at suite setup time to hard-fail integration suites (admin / audit /
|
|
239
|
+
* SSE / rate-limiting) when the consumer omitted `rpc_endpoints` rather
|
|
240
|
+
* than letting tests fail mid-run with confusing errors.
|
|
231
241
|
*
|
|
232
242
|
* Callers that need multi-endpoint support should iterate `rpc_endpoints`
|
|
233
243
|
* directly.
|
|
244
|
+
*
|
|
245
|
+
* @throws Error if `rpc_endpoints` is empty (hard-fail; see the suite options
|
|
246
|
+
* docs) or has more than one entry (ambiguous).
|
|
234
247
|
*/
|
|
235
248
|
export declare const require_rpc_endpoint_path: (rpc_endpoints: ReadonlyArray<RpcEndpointSpec>) => string;
|
|
236
249
|
//# 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.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,EA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AAC,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"}
|
|
@@ -3,7 +3,7 @@ import './assert_dev_env.js';
|
|
|
3
3
|
* JSON-RPC test helpers — request construction, response assertion, and
|
|
4
4
|
* one-shot call ergonomics.
|
|
5
5
|
*
|
|
6
|
-
* Shared by `rpc_attack_surface.ts`, `rpc_round_trip.ts`, and
|
|
6
|
+
* Shared by `testing/rpc_attack_surface.ts`, `testing/rpc_round_trip.ts`, and
|
|
7
7
|
* consumer-facing admin/audit suites that exercise RPC methods directly.
|
|
8
8
|
*
|
|
9
9
|
* @module
|
|
@@ -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')
|
|
@@ -144,11 +147,10 @@ const RPC_CALL_DEFAULT_HEADERS = {
|
|
|
144
147
|
* caller-provided headers, fires POST (default) or GET, parses the envelope,
|
|
145
148
|
* and returns a discriminated result.
|
|
146
149
|
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
* `error.data.reason`.
|
|
150
|
+
* @throws Error if the response body is neither a valid `JsonrpcResponse`
|
|
151
|
+
* nor `JsonrpcErrorResponse` envelope — protocol-level failures the caller
|
|
152
|
+
* should never tolerate. All JSON-RPC errors come back via `{ok: false, error}`
|
|
153
|
+
* so assertions can focus on `error.code` / `error.data.reason`.
|
|
152
154
|
*/
|
|
153
155
|
export const rpc_call = async (args) => {
|
|
154
156
|
const { app, path, method, params, headers, id = 'test', verb = 'POST', suppress_default_origin, } = args;
|
|
@@ -214,6 +216,9 @@ export const rpc_call_non_browser = (args) => rpc_call({ ...args, suppress_defau
|
|
|
214
216
|
* happy-path + denial-path assertions where the error `data.reason` shape
|
|
215
217
|
* is still asserted manually. For adversarial input tests that send
|
|
216
218
|
* malformed params, use the untyped `rpc_call`.
|
|
219
|
+
*
|
|
220
|
+
* @throws Error if the success `result` does not parse against `spec.output`,
|
|
221
|
+
* or if `rpc_call` itself throws on an envelope violation.
|
|
217
222
|
*/
|
|
218
223
|
export const rpc_call_for_spec = async (args) => {
|
|
219
224
|
const { spec, params, ...rest } = args;
|
|
@@ -232,6 +237,9 @@ export const rpc_call_for_spec = async (args) => {
|
|
|
232
237
|
* output schema and returns typed data. Envelope-level failures or error
|
|
233
238
|
* responses throw — use the untyped `rpc_call` for tests that need to
|
|
234
239
|
* assert on specific error shapes.
|
|
240
|
+
*
|
|
241
|
+
* @throws Error if the response is a JSON-RPC error, if `rpc_call` throws
|
|
242
|
+
* on an envelope violation, or if the result fails `output_schema.safeParse`.
|
|
235
243
|
*/
|
|
236
244
|
export const rpc_call_typed = async (args, output_schema) => {
|
|
237
245
|
const res = await rpc_call(args);
|
|
@@ -275,12 +283,17 @@ export const find_rpc_method = (rpc_endpoints, method) => {
|
|
|
275
283
|
};
|
|
276
284
|
/**
|
|
277
285
|
* Resolve a single RPC endpoint path — the common case where a consumer
|
|
278
|
-
* mounts exactly one `create_rpc_endpoint`.
|
|
279
|
-
*
|
|
280
|
-
*
|
|
286
|
+
* mounts exactly one `create_rpc_endpoint`.
|
|
287
|
+
*
|
|
288
|
+
* Used at suite setup time to hard-fail integration suites (admin / audit /
|
|
289
|
+
* SSE / rate-limiting) when the consumer omitted `rpc_endpoints` rather
|
|
290
|
+
* than letting tests fail mid-run with confusing errors.
|
|
281
291
|
*
|
|
282
292
|
* Callers that need multi-endpoint support should iterate `rpc_endpoints`
|
|
283
293
|
* directly.
|
|
294
|
+
*
|
|
295
|
+
* @throws Error if `rpc_endpoints` is empty (hard-fail; see the suite options
|
|
296
|
+
* docs) or has more than one entry (ambiguous).
|
|
284
297
|
*/
|
|
285
298
|
export const require_rpc_endpoint_path = (rpc_endpoints) => {
|
|
286
299
|
if (rpc_endpoints.length === 0) {
|
|
@@ -26,8 +26,13 @@ export declare const resolve_valid_path: (path: string, params_schema?: z.ZodObj
|
|
|
26
26
|
* Generate a valid request body for a route's input schema.
|
|
27
27
|
*
|
|
28
28
|
* Returns `undefined` for null schemas or schemas that can't be unwrapped to objects.
|
|
29
|
-
*
|
|
30
|
-
*
|
|
29
|
+
*
|
|
30
|
+
* @param input_schema - the route's input Zod schema
|
|
31
|
+
* @returns a generated body that passes `safeParse`, or `undefined` for null /
|
|
32
|
+
* non-object schemas
|
|
33
|
+
* @throws Error if the generated body fails `input_schema.safeParse` — catches
|
|
34
|
+
* broken `generate_valid_value` logic early with a descriptive Zod-issues
|
|
35
|
+
* summary instead of a confusing 400 in downstream tests.
|
|
31
36
|
*/
|
|
32
37
|
export declare const generate_valid_body: (input_schema: z.ZodType) => Record<string, unknown> | undefined;
|
|
33
38
|
//# 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,OAkDnF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,EAAE,gBAAgB,CAAC,CAAC,SAAS,KAAG,MAa9E,CAAC;AAEF
|
|
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,OAkDnF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,EAAE,gBAAgB,CAAC,CAAC,SAAS,KAAG,MAa9E,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,GAC/B,cAAc,CAAC,CAAC,OAAO,KACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAkB5B,CAAC"}
|
|
@@ -207,8 +207,13 @@ export const resolve_valid_path = (path, params_schema) => {
|
|
|
207
207
|
* Generate a valid request body for a route's input schema.
|
|
208
208
|
*
|
|
209
209
|
* Returns `undefined` for null schemas or schemas that can't be unwrapped to objects.
|
|
210
|
-
*
|
|
211
|
-
*
|
|
210
|
+
*
|
|
211
|
+
* @param input_schema - the route's input Zod schema
|
|
212
|
+
* @returns a generated body that passes `safeParse`, or `undefined` for null /
|
|
213
|
+
* non-object schemas
|
|
214
|
+
* @throws Error if the generated body fails `input_schema.safeParse` — catches
|
|
215
|
+
* broken `generate_valid_value` logic early with a descriptive Zod-issues
|
|
216
|
+
* summary instead of a confusing 400 in downstream tests.
|
|
212
217
|
*/
|
|
213
218
|
export const generate_valid_body = (input_schema) => {
|
|
214
219
|
if (is_null_schema(input_schema))
|
|
@@ -75,6 +75,9 @@ export interface SseRouteTestOptions {
|
|
|
75
75
|
* then asserts close-on-revoke (unless opted out).
|
|
76
76
|
*
|
|
77
77
|
* @param options - SSE test configuration
|
|
78
|
+
* @throws Error at setup time when `options.rpc_endpoints` is empty — the
|
|
79
|
+
* close-on-revoke assertion dispatches `account_session_revoke_all` via
|
|
80
|
+
* RPC. Hard-fails via `require_rpc_endpoint_path`.
|
|
78
81
|
*/
|
|
79
82
|
export declare const describe_sse_route_tests: (options: SseRouteTestOptions) => void;
|
|
80
83
|
//# 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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KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE,iDAAiD;IACjD,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,qEAAqE;IACrE,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAChC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAChD;;;;;;;;;;;;;OAaG;IACH,aAAa,EAAE,uBAAuB,CAAC;IACvC,8BAA8B;IAC9B,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CAChC;AAyHD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,GAAI,SAAS,mBAAmB,KAAG,IA2HvE,CAAC"}
|
|
@@ -127,6 +127,9 @@ const parse_and_validate_sse_payload = (frame, event_specs, route_path) => {
|
|
|
127
127
|
* then asserts close-on-revoke (unless opted out).
|
|
128
128
|
*
|
|
129
129
|
* @param options - SSE test configuration
|
|
130
|
+
* @throws Error at setup time when `options.rpc_endpoints` is empty — the
|
|
131
|
+
* close-on-revoke assertion dispatches `account_session_revoke_all` via
|
|
132
|
+
* RPC. Hard-fails via `require_rpc_endpoint_path`.
|
|
130
133
|
*/
|
|
131
134
|
export const describe_sse_route_tests = (options) => {
|
|
132
135
|
// Hard-fail early so consumers see a clear setup error instead of a
|
package/dist/testing/stubs.d.ts
CHANGED
|
@@ -15,7 +15,14 @@ import type { EventSpec } from '../realtime/sse.js';
|
|
|
15
15
|
* calls through to a throwing stub, the error message identifies exactly which stub
|
|
16
16
|
* was hit, catching test bugs that would silently pass with `{} as any`.
|
|
17
17
|
*
|
|
18
|
+
* JS-internal probes (`Symbol`, `then`, `constructor`, `$$typeof`) return
|
|
19
|
+
* `undefined` so the proxy doesn't crash framework-level identity checks;
|
|
20
|
+
* `toJSON` returns `"[throwing_stub:label]"` so accidental serialization
|
|
21
|
+
* surfaces the stub's identity in console output rather than silent `"{}"`.
|
|
22
|
+
*
|
|
18
23
|
* @param label - descriptive name for error messages (e.g. `'keyring'`, `'db'`)
|
|
24
|
+
* @throws Error on any non-internal property access (`get` trap), labeled with
|
|
25
|
+
* the stub name and the offending property.
|
|
19
26
|
*/
|
|
20
27
|
export declare const create_throwing_stub: <T = any>(label: string) => T;
|
|
21
28
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stubs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/stubs.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAa7B,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAE3B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAE/D,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,EAAE,EAAC,MAAM,aAAa,CAAC;AAC/B,OAAO,EAAqB,KAAK,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAGzE,OAAO,EAEN,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAKlD
|
|
1
|
+
{"version":3,"file":"stubs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/stubs.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAa7B,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAE3B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAE/D,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAA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kDAAkD;AAClD,MAAM,WAAW,+BAA+B;IAC/C,6DAA6D;IAC7D,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,qFAAqF;IACrF,kBAAkB,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE,oEAAoE;IACpE,UAAU,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC;IACzB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC/B;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;IAC7F,iFAAiF;IACjF,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,KAAK,CAAC,cAAc,CAAC,CAAC;IAC/E,0DAA0D;IAC1D,sBAAsB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,GACxC,SAAS,+BAA+B,KACtC,cA2CF,CAAC"}
|
package/dist/testing/stubs.js
CHANGED
|
@@ -23,7 +23,14 @@ import { BaseServerEnv } from '../server/env.js';
|
|
|
23
23
|
* calls through to a throwing stub, the error message identifies exactly which stub
|
|
24
24
|
* was hit, catching test bugs that would silently pass with `{} as any`.
|
|
25
25
|
*
|
|
26
|
+
* JS-internal probes (`Symbol`, `then`, `constructor`, `$$typeof`) return
|
|
27
|
+
* `undefined` so the proxy doesn't crash framework-level identity checks;
|
|
28
|
+
* `toJSON` returns `"[throwing_stub:label]"` so accidental serialization
|
|
29
|
+
* surfaces the stub's identity in console output rather than silent `"{}"`.
|
|
30
|
+
*
|
|
26
31
|
* @param label - descriptive name for error messages (e.g. `'keyring'`, `'db'`)
|
|
32
|
+
* @throws Error on any non-internal property access (`get` trap), labeled with
|
|
33
|
+
* the stub name and the offending property.
|
|
27
34
|
*/
|
|
28
35
|
export const create_throwing_stub = (label) => new Proxy({}, {
|
|
29
36
|
get: (_target, prop) => {
|
|
@@ -201,10 +201,21 @@ export declare const DEFAULT_ERROR_SCHEMA_TIGHTNESS: ErrorSchemaTightnessOptions
|
|
|
201
201
|
*
|
|
202
202
|
* @param surface - the app surface to check
|
|
203
203
|
* @param options - threshold and exclusion configuration
|
|
204
|
+
* @throws AssertionError listing every route × status combination whose error
|
|
205
|
+
* schema specificity is below `min_specificity` (default `'enum'`) and is
|
|
206
|
+
* not in `allowlist` or `ignore_statuses`.
|
|
204
207
|
*/
|
|
205
208
|
export declare const assert_error_schema_tightness: (surface: AppSurface, options?: ErrorSchemaTightnessOptions) => void;
|
|
206
209
|
/**
|
|
207
210
|
* Run all structural invariants. Options-free — applies universally.
|
|
211
|
+
*
|
|
212
|
+
* Catches schema/surface generation bugs: missing 401/403/400 declarations,
|
|
213
|
+
* empty descriptions, duplicate routes, middleware-injected error codes
|
|
214
|
+
* unpropagated to routes, structurally invalid error schemas, error codes
|
|
215
|
+
* appearing at multiple statuses, and generic 404 schemas on param routes.
|
|
216
|
+
*
|
|
217
|
+
* @throws AssertionError on the first invariant violation; the message names
|
|
218
|
+
* the offending route and the missing/inconsistent field.
|
|
208
219
|
*/
|
|
209
220
|
export declare const assert_surface_invariants: (surface: AppSurface) => void;
|
|
210
221
|
/**
|
|
@@ -215,6 +226,9 @@ export declare const assert_surface_invariants: (surface: AppSurface) => void;
|
|
|
215
226
|
* - No unexpected public mutation routes
|
|
216
227
|
* - Input schemas use mutation methods (not GET)
|
|
217
228
|
* - Keeper routes under expected prefixes
|
|
229
|
+
*
|
|
230
|
+
* @throws AssertionError on the first policy violation; the message names
|
|
231
|
+
* the offending route.
|
|
218
232
|
*/
|
|
219
233
|
export declare const assert_surface_security_policy: (surface: AppSurface, options?: SurfaceSecurityPolicyOptions) => void;
|
|
220
234
|
//# sourceMappingURL=surface_invariants.d.ts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sBAAsB,CAAC;IACzC,mEAAmE;IACnE,eAAe,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,kDAAkD;IAClD,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,uCAAuC,EAAE,aAAa,CAAC,MAAM,CAAM,CAAC;AAEjF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,8BAA8B,EAAE,2BAG5C,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,6BAA6B,GACzC,SAAS,UAAU,EACnB,UAAU,2BAA2B,KACnC,IAsBF,CAAC;AAIF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,UAAU,KAAG,IAY/D,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,8BAA8B,GAC1C,SAAS,UAAU,EACnB,UAAS,4BAAiC,KACxC,IAKF,CAAC"}
|
|
@@ -425,6 +425,9 @@ export const DEFAULT_ERROR_SCHEMA_TIGHTNESS = {
|
|
|
425
425
|
*
|
|
426
426
|
* @param surface - the app surface to check
|
|
427
427
|
* @param options - threshold and exclusion configuration
|
|
428
|
+
* @throws AssertionError listing every route × status combination whose error
|
|
429
|
+
* schema specificity is below `min_specificity` (default `'enum'`) and is
|
|
430
|
+
* not in `allowlist` or `ignore_statuses`.
|
|
428
431
|
*/
|
|
429
432
|
export const assert_error_schema_tightness = (surface, options) => {
|
|
430
433
|
const min_specificity = options?.min_specificity ?? 'enum';
|
|
@@ -448,6 +451,14 @@ export const assert_error_schema_tightness = (surface, options) => {
|
|
|
448
451
|
// --- Aggregate runners ---
|
|
449
452
|
/**
|
|
450
453
|
* Run all structural invariants. Options-free — applies universally.
|
|
454
|
+
*
|
|
455
|
+
* Catches schema/surface generation bugs: missing 401/403/400 declarations,
|
|
456
|
+
* empty descriptions, duplicate routes, middleware-injected error codes
|
|
457
|
+
* unpropagated to routes, structurally invalid error schemas, error codes
|
|
458
|
+
* appearing at multiple statuses, and generic 404 schemas on param routes.
|
|
459
|
+
*
|
|
460
|
+
* @throws AssertionError on the first invariant violation; the message names
|
|
461
|
+
* the offending route and the missing/inconsistent field.
|
|
451
462
|
*/
|
|
452
463
|
export const assert_surface_invariants = (surface) => {
|
|
453
464
|
assert_protected_routes_declare_401(surface);
|
|
@@ -470,6 +481,9 @@ export const assert_surface_invariants = (surface) => {
|
|
|
470
481
|
* - No unexpected public mutation routes
|
|
471
482
|
* - Input schemas use mutation methods (not GET)
|
|
472
483
|
* - Keeper routes under expected prefixes
|
|
484
|
+
*
|
|
485
|
+
* @throws AssertionError on the first policy violation; the message names
|
|
486
|
+
* the offending route.
|
|
473
487
|
*/
|
|
474
488
|
export const assert_surface_security_policy = (surface, options = {}) => {
|
|
475
489
|
assert_sensitive_routes_rate_limited(surface, options.sensitive_route_patterns);
|
|
@@ -129,7 +129,12 @@ export interface WsConnectIdentity {
|
|
|
129
129
|
}
|
|
130
130
|
/** A mock WS client: send requests, inspect/await incoming messages. */
|
|
131
131
|
export interface MockWsClient {
|
|
132
|
-
/**
|
|
132
|
+
/**
|
|
133
|
+
* Send a JSON-RPC message (request or notification) to the server.
|
|
134
|
+
*
|
|
135
|
+
* @throws Error if called after `close()` resolves — the harness rejects
|
|
136
|
+
* sends on a closed socket so post-close test bugs surface immediately.
|
|
137
|
+
*/
|
|
133
138
|
send: (message: unknown) => Promise<void>;
|
|
134
139
|
/**
|
|
135
140
|
* Send a JSON-RPC request and await its response. Resolves with the
|
|
@@ -139,6 +144,9 @@ export interface MockWsClient {
|
|
|
139
144
|
* `Cannot read property 'foo' of undefined`, which hides the real
|
|
140
145
|
* cause. Use `send` + `wait_for(is_response_for(id))` directly when
|
|
141
146
|
* you need to assert on the error frame itself.
|
|
147
|
+
*
|
|
148
|
+
* @throws Error if the server returns a JSON-RPC error frame for `id`,
|
|
149
|
+
* or if `wait_for` times out before a matching response arrives.
|
|
142
150
|
*/
|
|
143
151
|
request: <R = unknown>(id: number | string, method: string, params: unknown, timeout_ms?: number) => Promise<R>;
|
|
144
152
|
/**
|
|
@@ -157,6 +165,10 @@ export interface MockWsClient {
|
|
|
157
165
|
* When `predicate` is a type guard (e.g. `is_notification_with<P>`),
|
|
158
166
|
* the result is narrowed automatically and callers don't need to
|
|
159
167
|
* spell `<JsonrpcNotificationFrame<P>>` on the call site.
|
|
168
|
+
*
|
|
169
|
+
* @throws Error if `timeout_ms` elapses before a matching message
|
|
170
|
+
* arrives — the pending waiter is dropped from the internal list so
|
|
171
|
+
* later messages don't keep iterating it.
|
|
160
172
|
*/
|
|
161
173
|
wait_for: {
|
|
162
174
|
<T>(predicate: (msg: unknown) => msg is T, timeout_ms?: number): Promise<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws_round_trip.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/ws_round_trip.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAO,MAAM,MAAM,CAAC;AACxC,OAAO,EACN,SAAS,EAET,KAAK,gBAAgB,EAErB,KAAK,QAAQ,EACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAc,KAAK,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAE9D,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,4BAA4B,CAAC;AAEvD,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,kCAAkC,CAAC;AAE7E,OAAO,EAEN,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,yBAAyB,EAAC,MAAM,qCAAqC,CAAC;AAC9E,OA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KAAG,IAIH,CAAC"}
|
|
@@ -203,7 +203,7 @@ const build_multi_role_request_context = (account_id, roles) => {
|
|
|
203
203
|
/**
|
|
204
204
|
* Stub `RequestContext` for single-role or public fakes. Hardcoded
|
|
205
205
|
* ids (`acc_1` / `act_1`) mirror `create_test_request_context` in
|
|
206
|
-
* `auth_apps.ts`.
|
|
206
|
+
* `testing/auth_apps.ts`.
|
|
207
207
|
*/
|
|
208
208
|
const build_simple_request_context = (role) => ({
|
|
209
209
|
account: create_test_account({ id: 'acc_1', username: 'testuser' }),
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Self-serve session list for the logged-in account. Instantiates an
|
|
4
|
+
* `AccountSessionsState` against `account_sessions_rpc_context` and renders
|
|
5
|
+
* a `Datatable` with per-row revoke and an optional revoke-all. Calling
|
|
6
|
+
* `revoke_all` clears `auth_state.verified` so the UI falls back to login.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
2
11
|
import {auth_state_context} from './auth_state.svelte.js';
|
|
3
12
|
import {
|
|
4
13
|
AccountSessionsState,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountSessions.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/AccountSessions.svelte"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AccountSessions.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/AccountSessions.svelte"],"names":[],"mappings":"AAsGA,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IACtG,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,eAAe;;kBAA+E,CAAC;AACnF,KAAK,eAAe,GAAG,YAAY,CAAC,OAAO,eAAe,CAAC,CAAC;AAC9D,eAAe,eAAe,CAAC"}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Admin accounts table — users with their permits and pending offers.
|
|
4
|
+
* Consumes `admin_accounts_rpc_context` (read via `AdminAccountsState`)
|
|
5
|
+
* and `format_scope_context` for label rendering. Per-row actions:
|
|
6
|
+
* grant role (`permit_offer_create`), revoke permit (`permit_revoke`,
|
|
7
|
+
* keyed by `actor_id`), retract pending offer (`permit_offer_retract`).
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
|
|
2
12
|
import {AdminAccountsState, admin_accounts_rpc_context} from './admin_accounts_state.svelte.js';
|
|
3
13
|
import ConfirmButton from './ConfirmButton.svelte';
|
|
4
14
|
import Datatable from './Datatable.svelte';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminAccounts.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/AdminAccounts.svelte"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AdminAccounts.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/AdminAccounts.svelte"],"names":[],"mappings":"AA+JA,QAAA,MAAM,aAAa,2DAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Admin audit log viewer. Consumes `audit_log_rpc_context`; uses
|
|
4
|
+
* `audit_log_list` RPC for fetches and a separate `EventSource` against
|
|
5
|
+
* the SSE stream URL for live tailing (toggle via the stream button).
|
|
6
|
+
* Filter by `event_type`, manual refresh, and live-stream connection
|
|
7
|
+
* status are surfaced in the header.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
|
|
2
12
|
import {onDestroy} from 'svelte';
|
|
3
13
|
|
|
4
14
|
import {AuditLogState, audit_log_rpc_context} from './audit_log_state.svelte.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminAuditLog.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/AdminAuditLog.svelte"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AdminAuditLog.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/AdminAuditLog.svelte"],"names":[],"mappings":"AAgKA,QAAA,MAAM,aAAa,2DAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Admin invites manager — list, create (`invite_create`), and delete
|
|
4
|
+
* (`invite_delete`) RPC actions through `admin_invites_rpc_context`.
|
|
5
|
+
* Embeds `OpenSignupToggle` so the same surface controls both the
|
|
6
|
+
* invite-only and open-signup flows.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
2
11
|
import PendingButton from '@fuzdev/fuz_ui/PendingButton.svelte';
|
|
3
12
|
|
|
4
13
|
import {AdminInvitesState, admin_invites_rpc_context} from './admin_invites_state.svelte.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminInvites.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/AdminInvites.svelte"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AdminInvites.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/AdminInvites.svelte"],"names":[],"mappings":"AAqJA,QAAA,MAAM,YAAY,2DAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Admin dashboard — six summary panels (accounts, sessions, invites,
|
|
4
|
+
* recent activity, security, system) fed by parallel `fetch()` calls
|
|
5
|
+
* on mount. Consumes all four admin RPC contexts plus `auth_state_context`;
|
|
6
|
+
* derives `role_counts`, `failed_logins`, and `permit_changes` from the
|
|
7
|
+
* audit log slice.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
|
|
2
12
|
import {onMount} from 'svelte';
|
|
3
13
|
import {resolve} from '$app/paths';
|
|
4
14
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminOverview.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/AdminOverview.svelte"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AdminOverview.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/AdminOverview.svelte"],"names":[],"mappings":"AA0UA,QAAA,MAAM,aAAa,2DAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Permit grant/revoke history table. Consumes `audit_log_rpc_context`,
|
|
4
|
+
* calls `audit_log.fetch_permit_history()` once on mount (the
|
|
5
|
+
* `audit_log_permit_history` RPC). Uses `format_scope_context` to render
|
|
6
|
+
* scope ids as human labels.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
2
11
|
import {AuditLogState, audit_log_rpc_context} from './audit_log_state.svelte.js';
|
|
3
12
|
import {format_relative_time, format_datetime_local, truncate_uuid} from './ui_format.js';
|
|
4
13
|
import Datatable from './Datatable.svelte';
|