@fuzdev/fuz_app 0.150.0 → 0.152.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/README.md +1 -1
- package/dist/actions/CLAUDE.md +324 -299
- package/dist/actions/action_bridge.d.ts +5 -86
- package/dist/actions/action_bridge.d.ts.map +1 -1
- package/dist/actions/action_bridge.js +4 -84
- package/dist/actions/action_codegen.d.ts +8 -166
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +19 -95
- package/dist/actions/action_dispatcher.d.ts +10 -0
- package/dist/actions/action_dispatcher.d.ts.map +1 -1
- package/dist/actions/action_dispatcher.js +9 -6
- package/dist/actions/action_event.d.ts +1 -2
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_event.js +7 -13
- package/dist/actions/action_event_helpers.d.ts +1 -40
- package/dist/actions/action_event_helpers.d.ts.map +1 -1
- package/dist/actions/action_event_helpers.js +1 -25
- package/dist/actions/action_rpc.d.ts +10 -215
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +56 -111
- package/dist/actions/action_spec.d.ts +2 -2
- package/dist/actions/action_spec.js +2 -2
- package/dist/actions/action_types.d.ts +229 -8
- package/dist/actions/action_types.d.ts.map +1 -1
- package/dist/actions/action_types.js +56 -5
- package/dist/actions/broadcast_api.d.ts +22 -17
- package/dist/actions/broadcast_api.d.ts.map +1 -1
- package/dist/actions/broadcast_api.js +16 -27
- package/dist/actions/cancel.d.ts +4 -13
- package/dist/actions/cancel.d.ts.map +1 -1
- package/dist/actions/cancel.js +5 -17
- package/dist/actions/compile_action_registry.d.ts +1 -2
- package/dist/actions/compile_action_registry.d.ts.map +1 -1
- package/dist/actions/connection_closer.d.ts +120 -50
- package/dist/actions/connection_closer.d.ts.map +1 -1
- package/dist/actions/connection_closer.js +139 -31
- package/dist/actions/{transports_ws_backend.d.ts → connection_registry.d.ts} +120 -132
- package/dist/actions/connection_registry.d.ts.map +1 -0
- package/dist/actions/{transports_ws_backend.js → connection_registry.js} +149 -152
- package/dist/actions/frontend_rpc_client.d.ts +52 -2
- package/dist/actions/frontend_rpc_client.d.ts.map +1 -1
- package/dist/actions/frontend_rpc_client.js +42 -4
- package/dist/actions/peer_ping.d.ts +7 -9
- package/dist/actions/peer_ping.d.ts.map +1 -1
- package/dist/actions/peer_ping.js +6 -8
- package/dist/actions/peer_request.d.ts +6 -5
- package/dist/actions/peer_request.d.ts.map +1 -1
- package/dist/actions/peer_request.js +6 -5
- package/dist/actions/perform_action.d.ts +36 -28
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +60 -34
- package/dist/actions/protocol.d.ts +14 -0
- package/dist/actions/protocol.d.ts.map +1 -1
- package/dist/actions/protocol.js +18 -0
- package/dist/actions/register_action_ws.d.ts +137 -298
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +155 -923
- package/dist/actions/socket.svelte.d.ts +9 -0
- package/dist/actions/socket.svelte.d.ts.map +1 -1
- package/dist/actions/socket.svelte.js +16 -5
- package/dist/actions/transports.d.ts +88 -34
- package/dist/actions/transports.d.ts.map +1 -1
- package/dist/actions/transports.js +76 -76
- package/dist/actions/transports_http.d.ts +48 -12
- package/dist/actions/transports_http.d.ts.map +1 -1
- package/dist/actions/transports_http.js +75 -44
- package/dist/actions/transports_ws.d.ts +29 -0
- package/dist/actions/transports_ws.d.ts.map +1 -1
- package/dist/actions/transports_ws.js +34 -8
- package/dist/actions/ws_endpoint_spec.d.ts +52 -75
- package/dist/actions/ws_endpoint_spec.d.ts.map +1 -1
- package/dist/actions/ws_endpoint_spec.js +27 -10
- package/dist/actions/ws_outbound_writer.d.ts +3 -3
- package/dist/actions/ws_outbound_writer.js +3 -3
- package/dist/actions/ws_socket_session.d.ts +321 -0
- package/dist/actions/ws_socket_session.d.ts.map +1 -0
- package/dist/actions/ws_socket_session.js +783 -0
- package/dist/auth/CLAUDE.md +70 -44
- package/dist/auth/account_action_specs.d.ts +2 -0
- package/dist/auth/account_action_specs.d.ts.map +1 -1
- package/dist/auth/account_actions.d.ts +1 -1
- package/dist/auth/account_actions.d.ts.map +1 -1
- package/dist/auth/account_actions.js +9 -3
- 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 +27 -17
- package/dist/auth/account_routes.d.ts +2 -1
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +14 -17
- package/dist/auth/account_schema.d.ts +5 -5
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +5 -2
- package/dist/auth/actor_lookup_actions.d.ts +1 -1
- package/dist/auth/actor_lookup_actions.d.ts.map +1 -1
- package/dist/auth/actor_lookup_actions.js +1 -1
- package/dist/auth/actor_search_action_specs.d.ts.map +1 -1
- package/dist/auth/actor_search_action_specs.js +2 -1
- package/dist/auth/actor_search_actions.d.ts +1 -1
- package/dist/auth/actor_search_actions.d.ts.map +1 -1
- package/dist/auth/actor_search_actions.js +1 -1
- package/dist/auth/actor_search_queries.d.ts +5 -5
- package/dist/auth/actor_search_queries.d.ts.map +1 -1
- package/dist/auth/actor_search_queries.js +7 -7
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +3 -1
- package/dist/auth/admin_actions.d.ts +1 -1
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +12 -42
- package/dist/auth/all_cell_actions.d.ts +6 -4
- package/dist/auth/all_cell_actions.d.ts.map +1 -1
- package/dist/auth/all_cell_actions.js +1 -1
- package/dist/auth/api_token_queries.d.ts +1 -0
- package/dist/auth/api_token_queries.d.ts.map +1 -1
- package/dist/auth/api_token_queries.js +1 -0
- package/dist/auth/audit_emitter.d.ts +3 -3
- package/dist/auth/audit_emitter.js +2 -2
- package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_route_schema.js +3 -2
- package/dist/auth/audit_log_routes.d.ts +20 -11
- package/dist/auth/audit_log_routes.d.ts.map +1 -1
- package/dist/auth/audit_log_routes.js +49 -29
- package/dist/auth/audit_log_schema.d.ts +13 -21
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +10 -18
- package/dist/auth/bearer_auth.d.ts +7 -4
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +21 -15
- package/dist/auth/cell_action_helpers.d.ts +89 -0
- package/dist/auth/cell_action_helpers.d.ts.map +1 -0
- package/dist/auth/cell_action_helpers.js +113 -0
- package/dist/auth/cell_actions.d.ts +22 -13
- package/dist/auth/cell_actions.d.ts.map +1 -1
- package/dist/auth/cell_actions.js +105 -167
- package/dist/auth/cell_audit_actions.d.ts +1 -1
- package/dist/auth/cell_audit_actions.d.ts.map +1 -1
- package/dist/auth/cell_audit_actions.js +3 -12
- package/dist/auth/cell_audit_metadata.d.ts +1 -1
- package/dist/auth/cell_audit_metadata.js +1 -1
- package/dist/auth/cell_field_actions.d.ts +1 -1
- package/dist/auth/cell_field_actions.d.ts.map +1 -1
- package/dist/auth/cell_field_actions.js +16 -66
- package/dist/auth/cell_grant_action_specs.d.ts +2 -2
- package/dist/auth/cell_grant_action_specs.js +3 -3
- package/dist/auth/cell_grant_actions.d.ts +73 -11
- package/dist/auth/cell_grant_actions.d.ts.map +1 -1
- package/dist/auth/cell_grant_actions.js +63 -55
- package/dist/auth/cell_grant_audit_metadata.d.ts +6 -3
- package/dist/auth/cell_grant_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_grant_audit_metadata.js +7 -4
- package/dist/auth/cell_item_actions.d.ts +1 -1
- package/dist/auth/cell_item_actions.d.ts.map +1 -1
- package/dist/auth/cell_item_actions.js +21 -82
- package/dist/auth/cleanup.d.ts +1 -1
- package/dist/auth/cleanup.d.ts.map +1 -1
- package/dist/auth/cleanup.js +6 -3
- package/dist/auth/credential_deadline.d.ts +3 -3
- package/dist/auth/credential_deadline.js +3 -3
- package/dist/auth/credential_type_schema.d.ts +5 -5
- package/dist/auth/credential_type_schema.js +5 -5
- package/dist/auth/daemon_token_middleware.d.ts +12 -6
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +28 -17
- package/dist/auth/deps.d.ts +4 -4
- package/dist/auth/fail_floor.d.ts +55 -0
- package/dist/auth/fail_floor.d.ts.map +1 -0
- package/dist/auth/fail_floor.js +63 -0
- package/dist/auth/invite_queries.d.ts +3 -15
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_queries.js +3 -21
- package/dist/auth/middleware.d.ts +12 -7
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +42 -29
- package/dist/auth/migrations.d.ts +5 -33
- package/dist/auth/migrations.d.ts.map +1 -1
- package/dist/auth/migrations.js +9 -16
- package/dist/auth/request_context.d.ts +101 -71
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +137 -140
- package/dist/auth/resolved_auth.d.ts +122 -36
- package/dist/auth/resolved_auth.d.ts.map +1 -1
- package/dist/auth/resolved_auth.js +89 -38
- package/dist/auth/role_grant_offer_action_specs.d.ts +99 -14
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_action_specs.js +26 -13
- package/dist/auth/role_grant_offer_actions.d.ts +13 -7
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +14 -12
- package/dist/auth/role_grant_offer_notifications.d.ts +3 -3
- package/dist/auth/role_grant_offer_notifications.js +1 -1
- package/dist/auth/role_grant_offer_queries.d.ts +0 -5
- package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_queries.js +9 -41
- package/dist/auth/role_grant_queries.d.ts +17 -67
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.js +34 -106
- package/dist/auth/role_grant_sql.d.ts +42 -0
- package/dist/auth/role_grant_sql.d.ts.map +1 -0
- package/dist/auth/role_grant_sql.js +54 -0
- package/dist/auth/scope_kind_schema.d.ts +1 -1
- package/dist/auth/scope_kind_schema.js +1 -1
- package/dist/auth/self_service_role_actions.d.ts +1 -1
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +1 -1
- package/dist/auth/session_queries.d.ts +2 -1
- package/dist/auth/session_queries.d.ts.map +1 -1
- package/dist/auth/session_queries.js +2 -1
- package/dist/auth/signup_routes.d.ts +2 -1
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +14 -13
- package/dist/auth/standard_rpc_actions.d.ts +1 -1
- package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
- package/dist/auth/token_scope.d.ts +19 -46
- package/dist/auth/token_scope.d.ts.map +1 -1
- package/dist/auth/token_scope.js +23 -41
- package/dist/db/CLAUDE.md +9 -4
- package/dist/db/cell_ddl.d.ts +5 -142
- package/dist/db/cell_ddl.d.ts.map +1 -1
- package/dist/db/cell_ddl.js +17 -16
- package/dist/db/cell_field_queries.d.ts +0 -13
- package/dist/db/cell_field_queries.d.ts.map +1 -1
- package/dist/db/cell_field_queries.js +0 -16
- package/dist/db/cell_grant_queries.d.ts +10 -5
- package/dist/db/cell_grant_queries.d.ts.map +1 -1
- package/dist/db/cell_grant_queries.js +13 -7
- package/dist/db/cell_item_queries.d.ts +0 -7
- package/dist/db/cell_item_queries.d.ts.map +1 -1
- package/dist/db/cell_item_queries.js +0 -10
- package/dist/db/cell_queries.d.ts +12 -48
- package/dist/db/cell_queries.d.ts.map +1 -1
- package/dist/db/cell_queries.js +24 -55
- package/dist/db/cell_view_sql.d.ts +1 -6
- package/dist/db/cell_view_sql.d.ts.map +1 -1
- package/dist/db/cell_view_sql.js +1 -2
- package/dist/db/fact_ddl.d.ts +5 -30
- package/dist/db/fact_ddl.d.ts.map +1 -1
- package/dist/db/fact_ddl.js +14 -13
- package/dist/db/fact_store.d.ts +11 -0
- package/dist/db/fact_store.d.ts.map +1 -1
- package/dist/db/fact_store.js +4 -1
- package/dist/db/migrate.d.ts +44 -6
- package/dist/db/migrate.d.ts.map +1 -1
- package/dist/db/migrate.js +63 -4
- package/dist/dev/setup.d.ts +18 -14
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +42 -39
- package/dist/env/dotenv.d.ts +2 -2
- package/dist/env/dotenv.js +2 -2
- package/dist/env/update_env_variable.d.ts +33 -21
- package/dist/env/update_env_variable.d.ts.map +1 -1
- package/dist/env/update_env_variable.js +54 -35
- package/dist/hono_context.d.ts +15 -90
- package/dist/hono_context.d.ts.map +1 -1
- package/dist/hono_context.js +9 -56
- package/dist/http/CLAUDE.md +35 -20
- package/dist/http/auth_shape.d.ts +1 -8
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/auth_shape.js +6 -12
- package/dist/http/common_routes.d.ts.map +1 -1
- package/dist/http/common_routes.js +3 -2
- package/dist/http/db_routes.d.ts +3 -3
- package/dist/http/db_routes.js +3 -3
- package/dist/http/error_schemas.d.ts +1 -2
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +1 -2
- package/dist/http/health_schema.d.ts +16 -0
- package/dist/http/health_schema.d.ts.map +1 -0
- package/dist/http/health_schema.js +12 -0
- package/dist/http/jsonrpc_errors.d.ts +22 -2
- package/dist/http/jsonrpc_errors.d.ts.map +1 -1
- package/dist/http/jsonrpc_errors.js +41 -3
- package/dist/http/jsonrpc_helpers.d.ts +60 -17
- package/dist/http/jsonrpc_helpers.d.ts.map +1 -1
- package/dist/http/jsonrpc_helpers.js +67 -25
- package/dist/http/origin.d.ts +30 -1
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +46 -9
- package/dist/http/origin_wildcard.d.ts +97 -0
- package/dist/http/origin_wildcard.d.ts.map +1 -0
- package/dist/http/origin_wildcard.js +142 -0
- package/dist/http/pending_effects.d.ts +28 -0
- package/dist/http/pending_effects.d.ts.map +1 -1
- package/dist/http/pending_effects.js +32 -1
- package/dist/http/route_spec.d.ts +4 -3
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +54 -45
- package/dist/http/surface.d.ts +1 -1
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface_query.d.ts +9 -50
- package/dist/http/surface_query.d.ts.map +1 -1
- package/dist/http/surface_query.js +48 -94
- package/dist/realtime/audit_log_sse.d.ts +180 -0
- package/dist/realtime/audit_log_sse.d.ts.map +1 -0
- package/dist/realtime/audit_log_sse.js +154 -0
- package/dist/realtime/sse.d.ts +21 -6
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +33 -10
- package/dist/realtime/sse_constants.d.ts +29 -2
- package/dist/realtime/sse_constants.d.ts.map +1 -1
- package/dist/realtime/sse_constants.js +35 -2
- package/dist/realtime/{subscriber_registry.d.ts → sse_registry.d.ts} +12 -12
- package/dist/realtime/sse_registry.d.ts.map +1 -0
- package/dist/realtime/{subscriber_registry.js → sse_registry.js} +4 -4
- package/dist/schema_meta.d.ts +30 -10
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/schema_meta.js +85 -21
- package/dist/sensitivity.d.ts +9 -3
- package/dist/sensitivity.d.ts.map +1 -1
- package/dist/sensitivity.js +3 -2
- package/dist/server/app_backend.d.ts +8 -5
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_backend.js +6 -12
- package/dist/server/app_server.d.ts +62 -51
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +84 -71
- package/dist/server/app_server_context.d.ts +1 -1
- package/dist/server/app_server_context.d.ts.map +1 -1
- package/dist/server/env.d.ts +24 -20
- package/dist/server/env.d.ts.map +1 -1
- package/dist/server/env.js +24 -34
- package/dist/server/serve_fact_route.d.ts +12 -16
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +59 -34
- package/dist/server/static.d.ts.map +1 -1
- package/dist/server/static.js +2 -2
- package/dist/testing/CLAUDE.md +179 -158
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +10 -19
- package/dist/testing/adversarial_headers.d.ts.map +1 -1
- package/dist/testing/adversarial_headers.js +8 -0
- package/dist/testing/app_server.d.ts +9 -77
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +31 -112
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/attack_surface.js +3 -4
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +4 -5
- package/dist/testing/auth_apps.d.ts +3 -3
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +9 -6
- package/dist/testing/connection_closer_helpers.d.ts +8 -16
- package/dist/testing/connection_closer_helpers.d.ts.map +1 -1
- package/dist/testing/connection_closer_helpers.js +7 -20
- package/dist/testing/cross_backend/action_manifest.d.ts +15 -4
- package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest.js +13 -3
- package/dist/testing/cross_backend/action_manifest_parity.d.ts +15 -7
- package/dist/testing/cross_backend/action_manifest_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest_parity.js +8 -1
- package/dist/testing/cross_backend/body_size.d.ts.map +1 -1
- package/dist/testing/cross_backend/body_size.js +25 -22
- package/dist/testing/cross_backend/build_test_backend_paths.d.ts +22 -3
- package/dist/testing/cross_backend/build_test_backend_paths.d.ts.map +1 -1
- package/dist/testing/cross_backend/build_test_backend_paths.js +34 -11
- package/dist/testing/cross_backend/capabilities.d.ts +13 -7
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_grant_role.js +2 -2
- package/dist/testing/cross_backend/cell_grant_steward.d.ts +4 -0
- package/dist/testing/cross_backend/cell_grant_steward.d.ts.map +1 -0
- package/dist/testing/cross_backend/cell_grant_steward.js +120 -0
- package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_relations.js +21 -0
- package/dist/testing/cross_backend/conformance_table.d.ts +1 -1
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.d.ts +18 -4
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +29 -9
- package/dist/testing/cross_backend/default_spine_surface.d.ts +7 -7
- package/dist/testing/cross_backend/default_spine_surface.js +2 -2
- package/dist/testing/cross_backend/fact_serving.d.ts.map +1 -1
- package/dist/testing/cross_backend/fact_serving.js +48 -0
- package/dist/testing/cross_backend/full_spine_mount.d.ts +3 -4
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +9 -2
- package/dist/testing/cross_backend/origin_scope.d.ts.map +1 -1
- package/dist/testing/cross_backend/origin_scope.js +5 -13
- package/dist/testing/cross_backend/peer_ping_ws.d.ts.map +1 -1
- package/dist/testing/cross_backend/peer_ping_ws.js +29 -4
- package/dist/testing/cross_backend/postgres_database.d.ts +32 -0
- package/dist/testing/cross_backend/postgres_database.d.ts.map +1 -1
- package/dist/testing/cross_backend/postgres_database.js +56 -1
- package/dist/testing/cross_backend/query_shape.d.ts.map +1 -1
- package/dist/testing/cross_backend/query_shape.js +18 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +23 -1
- package/dist/testing/cross_backend/rpc_success_fixtures.js +2 -2
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts +17 -5
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.js +5 -4
- package/dist/testing/cross_backend/session_cap.d.ts +8 -0
- package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/session_cap.js +66 -2
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +5 -4
- package/dist/testing/cross_backend/spine_suites.d.ts +4 -1
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +21 -0
- package/dist/testing/cross_backend/spine_surface_constants.d.ts +22 -7
- package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.js +22 -7
- package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/sse_round_trip.js +4 -3
- package/dist/testing/cross_backend/standard.d.ts +6 -12
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/test_cell_grant_steward_revoke_authorize.d.ts +8 -0
- package/dist/testing/cross_backend/test_cell_grant_steward_revoke_authorize.d.ts.map +1 -0
- package/dist/testing/cross_backend/test_cell_grant_steward_revoke_authorize.js +22 -0
- package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_backdoor.js +4 -6
- package/dist/testing/cross_backend/testing_origin_check.d.ts +1 -1
- package/dist/testing/cross_backend/testing_origin_check.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_origin_check.js +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +10 -5
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +7 -6
- package/dist/testing/cross_backend/testing_server_bun.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_bun.js +5 -4
- package/dist/testing/cross_backend/testing_server_core.d.ts +6 -7
- package/dist/testing/cross_backend/testing_server_core.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_core.js +1 -1
- package/dist/testing/cross_backend/testing_server_node.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_node.js +13 -2
- package/dist/testing/cross_backend/token_lifetime.d.ts.map +1 -1
- package/dist/testing/cross_backend/token_lifetime.js +68 -0
- package/dist/testing/cross_backend/transport_composition.d.ts +1 -1
- package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
- package/dist/testing/cross_backend/transport_composition.js +45 -3
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts +16 -2
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +11 -8
- package/dist/testing/cross_backend/ws_action_rate_limit.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_action_rate_limit.js +30 -12
- package/dist/testing/cross_backend/ws_connection_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_connection_cap.js +5 -7
- package/dist/testing/cross_backend/ws_endpoint.d.ts +2 -3
- package/dist/testing/cross_backend/ws_endpoint.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_envelope.d.ts +17 -0
- package/dist/testing/cross_backend/ws_envelope.d.ts.map +1 -0
- package/dist/testing/cross_backend/ws_envelope.js +172 -0
- package/dist/testing/cross_backend/ws_inbound_dispatch.d.ts +16 -0
- package/dist/testing/cross_backend/ws_inbound_dispatch.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_inbound_dispatch.js +8 -4
- package/dist/testing/cross_backend/ws_outbound_overflow.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_outbound_overflow.js +5 -8
- package/dist/testing/cross_backend/ws_role_gated.js +2 -2
- package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_round_trip.js +6 -4
- package/dist/{cli/daemon.d.ts → testing/daemon_info.d.ts} +15 -47
- package/dist/testing/daemon_info.d.ts.map +1 -0
- package/dist/testing/daemon_info.js +108 -0
- package/dist/testing/daemon_token_rotation.js +1 -1
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +3 -4
- package/dist/testing/db.js +2 -2
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +35 -65
- package/dist/testing/integration_helpers.d.ts +0 -15
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +2 -42
- package/dist/testing/middleware.d.ts +20 -12
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +49 -40
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +13 -22
- package/dist/testing/resolved_auth.d.ts +30 -0
- package/dist/testing/resolved_auth.d.ts.map +1 -0
- package/dist/testing/resolved_auth.js +41 -0
- package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
- package/dist/testing/rpc_envelope_cases.js +3 -0
- package/dist/testing/rpc_helpers.d.ts +1 -1
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +2 -1
- package/dist/testing/sse_round_trip.d.ts +5 -4
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +2 -2
- package/dist/testing/stubs.d.ts +2 -2
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +24 -21
- package/dist/testing/test_origin.d.ts +25 -0
- package/dist/testing/test_origin.d.ts.map +1 -0
- package/dist/testing/test_origin.js +28 -0
- package/dist/testing/transports/raw_http.d.ts +54 -0
- package/dist/testing/transports/raw_http.d.ts.map +1 -1
- package/dist/testing/transports/raw_http.js +58 -0
- package/dist/testing/transports/ws_raw_client.d.ts +8 -0
- package/dist/testing/transports/ws_raw_client.d.ts.map +1 -1
- package/dist/testing/transports/ws_raw_client.js +13 -0
- package/dist/testing/transports/ws_transport.d.ts +15 -2
- package/dist/testing/transports/ws_transport.d.ts.map +1 -1
- package/dist/testing/transports/ws_transport.js +4 -2
- package/dist/testing/ws_round_trip.d.ts +27 -25
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +34 -26
- package/dist/ui/AccountSessions.svelte +48 -19
- package/dist/ui/AccountSessions.svelte.d.ts +2 -17
- package/dist/ui/AccountSessions.svelte.d.ts.map +1 -1
- package/dist/ui/AdminAccounts.svelte +6 -1
- package/dist/ui/AdminAuditLog.svelte +61 -22
- package/dist/ui/AdminAuditLog.svelte.d.ts.map +1 -1
- package/dist/ui/AdminInvites.svelte +1 -1
- package/dist/ui/AdminOverview.svelte +76 -37
- package/dist/ui/AdminOverview.svelte.d.ts.map +1 -1
- package/dist/ui/AdminRoleGrantHistory.svelte +6 -1
- package/dist/ui/AdminSessions.svelte +1 -1
- package/dist/ui/AppShell.svelte +3 -2
- package/dist/ui/AppShell.svelte.d.ts +3 -2
- package/dist/ui/AppShell.svelte.d.ts.map +1 -1
- package/dist/ui/CLAUDE.md +121 -35
- package/dist/ui/Datatable.svelte +33 -18
- package/dist/ui/Datatable.svelte.d.ts +2 -14
- package/dist/ui/Datatable.svelte.d.ts.map +1 -1
- package/dist/ui/OpenSignupToggle.svelte +10 -1
- package/dist/ui/OpenSignupToggle.svelte.d.ts.map +1 -1
- package/dist/ui/PopoverButton.svelte +13 -8
- package/dist/ui/PopoverButton.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferForm.svelte +3 -2
- package/dist/ui/RoleGrantOfferForm.svelte.d.ts +3 -2
- package/dist/ui/RoleGrantOfferForm.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferHistory.svelte +3 -3
- package/dist/ui/RoleGrantOfferInbox.svelte +19 -15
- package/dist/ui/RoleGrantOfferInbox.svelte.d.ts.map +1 -1
- package/dist/ui/SurfaceExplorer.svelte +66 -27
- package/dist/ui/SurfaceExplorer.svelte.d.ts.map +1 -1
- package/dist/ui/account_sessions_state.svelte.d.ts +7 -14
- package/dist/ui/account_sessions_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.d.ts +14 -9
- package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.js +6 -4
- package/dist/ui/admin_invites_state.svelte.d.ts +2 -2
- package/dist/ui/admin_invites_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_rpc_adapters.d.ts +9 -9
- package/dist/ui/admin_rpc_adapters.d.ts.map +1 -1
- package/dist/ui/admin_rpc_adapters.js +9 -9
- package/dist/ui/app_settings_state.svelte.d.ts +2 -2
- package/dist/ui/app_settings_state.svelte.d.ts.map +1 -1
- package/dist/ui/audit_log_state.svelte.d.ts +70 -13
- package/dist/ui/audit_log_state.svelte.d.ts.map +1 -1
- package/dist/ui/audit_log_state.svelte.js +239 -47
- package/dist/ui/backend_probe.svelte.d.ts +93 -0
- package/dist/ui/backend_probe.svelte.d.ts.map +1 -0
- package/dist/ui/backend_probe.svelte.js +140 -0
- package/dist/ui/format_scope.d.ts +7 -7
- package/dist/ui/format_scope.d.ts.map +1 -1
- package/dist/ui/format_scope.js +4 -4
- package/dist/ui/keyed_async_slot.svelte.d.ts +2 -2
- package/dist/ui/keyed_async_slot.svelte.js +2 -2
- package/dist/ui/popover.svelte.d.ts +18 -19
- package/dist/ui/popover.svelte.d.ts.map +1 -1
- package/dist/ui/popover.svelte.js +103 -16
- package/dist/ui/role_grant_offers_state.svelte.d.ts +41 -46
- package/dist/ui/role_grant_offers_state.svelte.d.ts.map +1 -1
- package/dist/ui/role_grant_offers_state.svelte.js +37 -19
- package/dist/ui/ui_format.d.ts +17 -0
- package/dist/ui/ui_format.d.ts.map +1 -1
- package/dist/ui/ui_format.js +20 -0
- package/package.json +9 -8
- package/dist/actions/register_ws_endpoint.d.ts +0 -79
- package/dist/actions/register_ws_endpoint.d.ts.map +0 -1
- package/dist/actions/register_ws_endpoint.js +0 -109
- package/dist/actions/transports_ws_auth_guard.d.ts +0 -96
- package/dist/actions/transports_ws_auth_guard.d.ts.map +0 -1
- package/dist/actions/transports_ws_auth_guard.js +0 -141
- package/dist/actions/transports_ws_backend.d.ts.map +0 -1
- package/dist/cli/args.d.ts +0 -55
- package/dist/cli/args.d.ts.map +0 -1
- package/dist/cli/args.js +0 -100
- package/dist/cli/config.d.ts +0 -47
- package/dist/cli/config.d.ts.map +0 -1
- package/dist/cli/config.js +0 -77
- package/dist/cli/daemon.d.ts.map +0 -1
- package/dist/cli/daemon.js +0 -181
- package/dist/cli/help.d.ts +0 -124
- package/dist/cli/help.d.ts.map +0 -1
- package/dist/cli/help.js +0 -215
- package/dist/cli/logger.d.ts +0 -46
- package/dist/cli/logger.d.ts.map +0 -1
- package/dist/cli/logger.js +0 -48
- package/dist/cli/util.d.ts +0 -36
- package/dist/cli/util.d.ts.map +0 -1
- package/dist/cli/util.js +0 -50
- package/dist/realtime/sse_auth_guard.d.ts +0 -197
- package/dist/realtime/sse_auth_guard.d.ts.map +0 -1
- package/dist/realtime/sse_auth_guard.js +0 -239
- package/dist/realtime/subscriber_registry.d.ts.map +0 -1
- package/dist/testing/bootstrap_success.d.ts +0 -29
- package/dist/testing/bootstrap_success.d.ts.map +0 -1
- package/dist/testing/bootstrap_success.js +0 -144
- package/dist/testing/mock_fs.d.ts +0 -20
- package/dist/testing/mock_fs.d.ts.map +0 -1
- package/dist/testing/mock_fs.js +0 -28
- package/dist/testing/standard.d.ts +0 -122
- package/dist/testing/standard.d.ts.map +0 -1
- package/dist/testing/standard.js +0 -73
- package/dist/testing/testing_rate_limiter.d.ts +0 -65
- package/dist/testing/testing_rate_limiter.d.ts.map +0 -1
- package/dist/testing/testing_rate_limiter.js +0 -80
package/dist/ui/CLAUDE.md
CHANGED
|
@@ -140,7 +140,10 @@ pattern rather than reintroducing prop-drilling.
|
|
|
140
140
|
(dialog `cancel`, `popover="auto"`) stay intact, and it bails while a
|
|
141
141
|
modal is open (`document.querySelector(':modal')` matches). An open
|
|
142
142
|
`popover="auto"` isn't `:modal`, so one Escape closes it and the overlay
|
|
143
|
-
together.
|
|
143
|
+
together. A visible `Popover` (`popover.svelte.ts`) is different: its
|
|
144
|
+
Escape listener sits on `document`, ahead of `window`, and prevents the
|
|
145
|
+
default, which the overlay's listener skips — so the first Escape closes
|
|
146
|
+
only the popover. Closing is `flushSync`ed so the content leaves `inert` before
|
|
144
147
|
focus returns. When focus was inside the sidebar or had fallen to `body`
|
|
145
148
|
(opening from the content makes it `inert`, which drops focus there), it
|
|
146
149
|
goes back to the opener if still connected and focusable, else to the
|
|
@@ -283,9 +286,11 @@ return;`), since Enter and clicks still reach it.
|
|
|
283
286
|
|
|
284
287
|
- `AccountSessions.svelte` — self-serve session list for the logged-in
|
|
285
288
|
account. Instantiates `AccountSessionsState`, renders a `Datatable`
|
|
286
|
-
with per-row `revoke` and
|
|
287
|
-
|
|
288
|
-
|
|
289
|
+
with per-row `revoke` and a `ConfirmButton` `revoke all`. The row the
|
|
290
|
+
server marks `is_current` is this browser's session: it reads
|
|
291
|
+
`current` and offers `log out` (`auth_state.logout`, the logout
|
|
292
|
+
request) in place of revoke, and a `revoke all` that succeeded logs
|
|
293
|
+
out the same way, so the UI falls back to the login page.
|
|
289
294
|
|
|
290
295
|
## Admin
|
|
291
296
|
|
|
@@ -304,18 +309,27 @@ destructive actions.
|
|
|
304
309
|
per-row error displays inline next to the failing button (no
|
|
305
310
|
top-level rollup).
|
|
306
311
|
- `AdminAuditLog.svelte` — audit event stream. Consumes
|
|
307
|
-
`audit_log_rpc_context`. Filter by `event_type
|
|
308
|
-
toggle SSE streaming (via `EventSource` — not RPC)
|
|
312
|
+
`audit_log_rpc_context`. Filter by `event_type` (the stream reopens with
|
|
313
|
+
it), manual refresh, toggle SSE streaming (via `EventSource` — not RPC);
|
|
314
|
+
a closed stream shows a retry in place of the stream toggle (a filter
|
|
315
|
+
change leaves it closed), and a
|
|
316
|
+
failed or truncated gap fill says events may be missing.
|
|
309
317
|
- `AdminInvites.svelte` — invite CRUD + embeds `OpenSignupToggle`.
|
|
310
318
|
Consumes `admin_invites_rpc_context`. Per-row delete reads
|
|
311
319
|
`state.remove.loading(invite_id)` / `state.remove.error(invite_id)`
|
|
312
320
|
with inline per-row error display.
|
|
313
321
|
- `AdminOverview.svelte` — dashboard panels (accounts / sessions /
|
|
314
|
-
invites / recent activity / security / system). Consumes
|
|
322
|
+
invites / recent activity / security / system). Consumes the admin
|
|
315
323
|
RPC contexts plus `auth_state_context`; fetches in parallel on mount.
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
324
|
+
Recent activity is the newest audit slice; the security counts come from
|
|
325
|
+
their own queries — failed logins from `audit_log_list` filtered to
|
|
326
|
+
`login` + `failure`, role grant changes from `audit_log_role_grant_history`
|
|
327
|
+
— each fetched up to `AUDIT_LOG_LIST_LIMIT_MAX` rows and counted over the
|
|
328
|
+
last 24 hours (`count_in_window`), `N+` when the cap may cut the window off.
|
|
329
|
+
The public-signup chip renders only once settings load, labeled
|
|
330
|
+
`open` / `invite-only` in both the Invites and System panels.
|
|
331
|
+
`role_counts` is display-only and scope-blind — an account counts under
|
|
332
|
+
each role it holds at any scope.
|
|
319
333
|
- `AdminRoleGrantHistory.svelte` — role-grant-create/revoke history table.
|
|
320
334
|
Consumes `audit_log_rpc_context`, calls
|
|
321
335
|
`audit_log.fetch_role_grant_history()` once on mount.
|
|
@@ -333,8 +347,11 @@ destructive actions.
|
|
|
333
347
|
`AppSettingsState.settings.open_signup`. Consumes
|
|
334
348
|
`app_settings_rpc_context`.
|
|
335
349
|
- `SurfaceExplorer.svelte` — reads-only `AppSurface` renderer. Props:
|
|
336
|
-
`surface: AppSurface`. Filter routes by auth type; expand a row
|
|
337
|
-
|
|
350
|
+
`surface: AppSurface`. Filter routes by auth type; expand a row with the
|
|
351
|
+
disclosure `<button aria-expanded>` in its first cell to dump
|
|
352
|
+
`params`/`query`/`input`/`output`/`errors` schemas as JSON. One
|
|
353
|
+
classification gives each auth chip its label and color (`none`,
|
|
354
|
+
`keeper`, `role:…`, `credential:…`, `authenticated`).
|
|
338
355
|
Also tables middleware, env, events, and diagnostics.
|
|
339
356
|
|
|
340
357
|
## Role grant offers
|
|
@@ -344,6 +361,8 @@ destructive actions.
|
|
|
344
361
|
`format_role?` — consumers plug in display names for actor/scope ids.
|
|
345
362
|
Accept is a `PendingButton`; decline is a `ConfirmButton` whose
|
|
346
363
|
popover contains a textarea (max `ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX`).
|
|
364
|
+
Each row reads its own pending state and error from the keyed `accept` /
|
|
365
|
+
`decline` slots, so one row's failure never shows on another.
|
|
347
366
|
- `RoleGrantOfferForm.svelte` — grantor-side create form. Props:
|
|
348
367
|
`to_account_id`, `to_actor_id = null` (optional — narrows the offer
|
|
349
368
|
to a specific actor on the recipient account; default account-grain),
|
|
@@ -371,14 +390,17 @@ destructive actions.
|
|
|
371
390
|
`role_grant_offers_state_context`. Options: `rpc: RoleGrantOffersRpc`,
|
|
372
391
|
`account_id: () => string | null`, `actor_id: () => string | null`.
|
|
373
392
|
The narrow `RoleGrantOffersRpc` interface has six methods: `list`,
|
|
374
|
-
`history`, `create`, `accept`, `decline`, `retract`.
|
|
375
|
-
`AsyncSlot
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
393
|
+
`history`, `create`, `accept`, `decline`, `retract`. Slots:
|
|
394
|
+
`AsyncSlot<void>` for `list` / `list_history`, one
|
|
395
|
+
`AsyncSlot<RoleGrantOfferJson>` (`create`) that owns the created offer
|
|
396
|
+
so `submit_create` returns it via the slot's supersession-safe `data`
|
|
397
|
+
path, and `KeyedAsyncSlot<string>` keyed by offer id for the per-row
|
|
398
|
+
`accept` / `decline` / `retract` (per-row pending + error;
|
|
399
|
+
`RoleGrantOfferInbox` binds each row to its own). The `$state.raw` Map
|
|
400
|
+
cache keyed by offer id stays on the class (multiple ops + WS
|
|
401
|
+
notifications merge into it; a pending copy never replaces a terminal
|
|
402
|
+
one). Each verb stamps the terminal offer its RPC answers into the
|
|
403
|
+
cache, so `history` shows it without waiting on the WS notification. Methods use the `submit_*` prefix to avoid slot-name
|
|
382
404
|
collisions (`submit_create` / `submit_accept` / `submit_decline` /
|
|
383
405
|
`submit_retract`); the fetch slot is named `list_history` so the
|
|
384
406
|
derived view stays natural as `history`. `$derived.by` views:
|
|
@@ -466,7 +488,14 @@ All state classes hold per-op `AsyncSlot`s for the fetch + singular
|
|
|
466
488
|
write verbs, and `KeyedAsyncSlot`s for per-row write verbs (the
|
|
467
489
|
`SvelteSet<id>` pattern is retired — per-row tracking lives on the
|
|
468
490
|
keyed slot's `loading(key)` / `error(key)` accessors). Method names use
|
|
469
|
-
the `submit_*` prefix where the verb collides with a slot name.
|
|
491
|
+
the `submit_*` prefix where the verb collides with a slot name. Every
|
|
492
|
+
narrow `*Rpc` adapter method takes its action's input as one params object
|
|
493
|
+
and returns its output, both typed from the action specs — `params?` where
|
|
494
|
+
the input defaults to `{}`, nothing where the action takes no input — so an
|
|
495
|
+
adapter over the typed throwing client is a one-line pass-through per
|
|
496
|
+
method. `AdminAccountsRpc.delete_account` narrows its params: its input
|
|
497
|
+
defaults too, but the empty input deletes the caller, so the adapter type
|
|
498
|
+
requires `account_id` as a `Uuid` (`{}` and a `null` id don't typecheck).
|
|
470
499
|
|
|
471
500
|
- `account_sessions_state.svelte.ts` — `AccountSessionsState` +
|
|
472
501
|
`account_sessions_rpc_context` + narrow `AccountSessionsRpc`
|
|
@@ -476,17 +505,38 @@ the `submit_*` prefix where the verb collides with a slot name.
|
|
|
476
505
|
`submit_revoke(id)`, `submit_revoke_all`. Derived `active_count`.
|
|
477
506
|
- `audit_log_state.svelte.ts` — `AuditLogState` +
|
|
478
507
|
`audit_log_rpc_context` + narrow `AuditLogRpc` (`list` +
|
|
479
|
-
`role_grant_history`). Slots: `list`, `role_grant_history
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
508
|
+
`role_grant_history`). Slots: `list`, `role_grant_history`, `gap_fill`
|
|
509
|
+
(the catch-up fetch each stream open runs; its `error` surfaces a failed
|
|
510
|
+
fill). Fields: `events`, `role_grant_history_events`, `stream_status`
|
|
511
|
+
(`AuditLogStreamStatus`: `'off' | 'connecting' | 'open' | 'closed'` —
|
|
512
|
+
`'closed'` once `EventSource` stops retrying, e.g. after a revocation's
|
|
513
|
+
reconnect is refused; `subscribe` again to retry), `gap_truncated` (a gap
|
|
514
|
+
fill returned a full `AUDIT_LOG_LIST_LIMIT_MAX` page, so events may be
|
|
515
|
+
missing). Internal `#last_seq` anchors the gap fill (`fetch` sets it from
|
|
516
|
+
its result, `0` for an empty first page), and `#fill_since` keeps the start
|
|
517
|
+
a fill still owes — one a reopen, retry or failure cut short, or an open
|
|
518
|
+
deferred to a newest-page `fetch` that failed — so the next fill starts
|
|
519
|
+
there rather than past the live rows that arrived meanwhile. Methods:
|
|
520
|
+
`fetch(options?)` (RPC; clears `gap_truncated` and a failed `gap_fill`,
|
|
521
|
+
and a newest-page fetch aborts an in-flight fill; mid-stream it keeps
|
|
522
|
+
live events newer than the page that match its filter),
|
|
523
|
+
`fetch_role_grant_history`,
|
|
524
|
+
`subscribe(filter?: AuditLogFilter)` (opens `EventSource` at
|
|
525
|
+
`#stream_url`, default `/api/admin/audit/stream`; keeps live events that
|
|
526
|
+
pass the filter and gap-fills via `since_seq` with the same filter — only
|
|
527
|
+
while `events` was fetched with that filter: an open the list doesn't
|
|
528
|
+
match, or one during a newest-page `fetch`, defers its fill to the `fetch`
|
|
529
|
+
with the stream's filter, which fills from its page; a fill merges only
|
|
530
|
+
while the list keeps its filter; and live events under another filter
|
|
531
|
+
merge only when they match the list's, without advancing the anchor),
|
|
532
|
+
`disconnect()` (also aborts an in-flight gap fill). Live and
|
|
533
|
+
gap rows merge by `seq`, deduplicated by `id`, so `events` stays
|
|
534
|
+
newest-first. `audit_log_filter_matches(event, filter)` is the client-side
|
|
535
|
+
twin of the list query's filter. SSE stays on `EventSource` — streaming is
|
|
536
|
+
not an RPC concern.
|
|
487
537
|
- `admin_accounts_state.svelte.ts` — `AdminAccountsState` +
|
|
488
538
|
`admin_accounts_rpc_context` + narrow `AdminAccountsRpc` (nine
|
|
489
|
-
methods: `list_accounts` (`include_deleted
|
|
539
|
+
methods: `list_accounts` (`{include_deleted?, …}`), `delete_account`,
|
|
490
540
|
`undelete_account`, `list_sessions`, `create_role_grant`,
|
|
491
541
|
`revoke_role_grant`, `retract_offer`, `session_revoke_all`,
|
|
492
542
|
`token_revoke_all` — `delete_account`/`undelete_account` back
|
|
@@ -558,7 +608,7 @@ interface. See "Key patterns" above for the provisioner pattern.
|
|
|
558
608
|
getters), so there's no separate `role_grant_offers_rpc_context`.
|
|
559
609
|
- `format_scope_context` — `() => FormatScope` (getter shape, matching
|
|
560
610
|
the RPC contexts above). `FormatScope = ({scope_id, role}) => string |
|
|
561
|
-
null`; default returns `null` so callers fall back to the
|
|
611
|
+
null`; default returns `null` so callers fall back to the truncated uuid.
|
|
562
612
|
Provisioned by `provide_admin_rpc_contexts(adapters, {format_scope})`.
|
|
563
613
|
Consumed by `AdminAccounts`, `AdminRoleGrantHistory`, `RoleGrantOfferInbox`,
|
|
564
614
|
`RoleGrantOfferHistory` via the `resolve_scope_label(scope_id, role,
|
|
@@ -577,8 +627,17 @@ format_scope, global_label)` helper — `global_label = null` renders no
|
|
|
577
627
|
`align`, `offset`, `popover_class`, `disable_outside_click` as
|
|
578
628
|
`$state.raw`. Three `Attachment` factories: `container`,
|
|
579
629
|
`trigger(params?)`, `content(params?)`. `show()` / `hide()` /
|
|
580
|
-
`toggle()`, plus `update(params)` to swap config. ARIA
|
|
581
|
-
|
|
630
|
+
`toggle()`, plus `update(params)` to swap config. ARIA wired
|
|
631
|
+
automatically: the content gets `role="dialog"` (unless it sets a role)
|
|
632
|
+
and `aria-labelledby` the trigger (unless it carries its own name); the
|
|
633
|
+
trigger gets `aria-expanded`, and `aria-controls` only while visible with
|
|
634
|
+
content mounted (cleared on hide). While visible, a `document` `keydown`
|
|
635
|
+
listener hides on Escape — preventing the default so enclosing layers
|
|
636
|
+
(`AppShell`'s overlay) leave it alone, skipping an Escape already
|
|
637
|
+
prevented, and returning focus to the trigger when it was in the content.
|
|
638
|
+
Only the newest visible popover handles Escape (a module-level stack), so
|
|
639
|
+
nested ones close innermost first, and while a `:modal` is open a popover
|
|
640
|
+
outside it leaves Escape to the modal's close request.
|
|
582
641
|
- `position_helpers.ts` — `Position` / `Alignment` / `CardinalPosition`
|
|
583
642
|
types; `generate_position_styles(position, align, offset)` returns
|
|
584
643
|
CSS styles record for absolute positioning (left/right/top/bottom/
|
|
@@ -597,8 +656,12 @@ format_scope, global_label)` helper — `global_label = null` renders no
|
|
|
597
656
|
|
|
598
657
|
## Data
|
|
599
658
|
|
|
600
|
-
- `Datatable.svelte` — generic
|
|
601
|
-
|
|
659
|
+
- `Datatable.svelte` — generic table (`<script generics="T">`), exposed
|
|
660
|
+
as ARIA `table` / `row` / `columnheader` / `cell` (no `grid` — it has no
|
|
661
|
+
grid keyboard model); the empty state is a full-width row.
|
|
662
|
+
Props: `columns`, `rows`, `row_key: (row: T) => PropertyKey` (required —
|
|
663
|
+
the keyed-each key, so per-row state follows its row; a `null`/`undefined`
|
|
664
|
+
key throws in DEV, no index fallback), `height?`, optional
|
|
602
665
|
`header` / `cell` / `empty` snippets. Sticky header, CSS-subgrid
|
|
603
666
|
layout, pointer-based column resize (writes deltas to a keyed
|
|
604
667
|
record). Default cell renders `column.format(value, row)` or
|
|
@@ -609,6 +672,26 @@ format_scope, global_label)` helper — `global_label = null` renders no
|
|
|
609
672
|
|
|
610
673
|
## Fetch + format
|
|
611
674
|
|
|
675
|
+
- `backend_probe.svelte.ts` — `probe_backend({fetch_health?, timeout_ms?, signal?}?)`
|
|
676
|
+
→ `BackendProbeResult` (`{ok: true}` or `{ok: false, error}`): live only when
|
|
677
|
+
`HEALTH_PATH` answers `2xx` with a body whose `status` is `'ok'` (read
|
|
678
|
+
loosely, so an added field never reads as down; the route spec's own schema
|
|
679
|
+
stays strict), so a static SPA fallback's `200` HTML, a non-`2xx`, a
|
|
680
|
+
network error (a dropped body included), and no reply within
|
|
681
|
+
`BACKEND_PROBE_TIMEOUT_MS` (10 s, applied to the default fetch's reply and
|
|
682
|
+
body; a supplied fetch keeps its own signal) are all down
|
|
683
|
+
(`BACKEND_PROBE_NOT_HEALTH` names a `2xx` whose body isn't the health reply
|
|
684
|
+
or isn't JSON). A timeout's error names the ms only for the default fetch; a
|
|
685
|
+
supplied fetch's `TimeoutError` reads `timed out`. `signal` cancels the
|
|
686
|
+
default fetch alongside its timeout, and a probe it aborted reports
|
|
687
|
+
`BACKEND_PROBE_ABORTED`; a supplied fetch ignores it.
|
|
688
|
+
`BackendProbe` wraps it for a login gate — `AuthState.check_session` can't
|
|
689
|
+
tell a down backend from a logged-out caller: `probing`, `reachable`
|
|
690
|
+
(`null` until a probe settles, through SSR and prerender too), `error`, and
|
|
691
|
+
`probe()`, where a later probe supersedes one in flight.
|
|
692
|
+
`probe_backend` takes `BackendProbeOptions` (`fetch_health?`, `timeout_ms?`,
|
|
693
|
+
`signal?`); `BackendProbe` takes all but `signal`, since a reusable state's
|
|
694
|
+
one signal, once aborted, would fail every later probe.
|
|
612
695
|
- `ui_fetch.ts` — `ui_fetch(input, init?)` wraps `fetch` with
|
|
613
696
|
`credentials: 'include'` for cookie-based session auth;
|
|
614
697
|
`parse_response_error(response, fallback?)` safely extracts
|
|
@@ -622,6 +705,9 @@ format_scope, global_label)` helper — `global_label = null` renders no
|
|
|
622
705
|
- `truncate_uuid(uuid)` — 12-char middle-truncation.
|
|
623
706
|
- `format_datetime_local(timestamp)` — absolute UTC string for
|
|
624
707
|
`title` attributes.
|
|
708
|
+
- `count_in_window(rows, window_start, cap)` — count of newest-first
|
|
709
|
+
rows created since `window_start`, labeled `N+` when a full capped
|
|
710
|
+
list's oldest row is still inside the window.
|
|
625
711
|
- `format_value(value)` — table-cell stringifier (NULL / undefined /
|
|
626
712
|
JSON / primitive).
|
|
627
713
|
- `format_audit_metadata(event_type, metadata)` — event-type-
|
package/dist/ui/Datatable.svelte
CHANGED
|
@@ -6,9 +6,18 @@
|
|
|
6
6
|
* present, else `format_value`. Resize deltas are kept in component-local
|
|
7
7
|
* state, keyed by `column.key` — they don't outlive the component.
|
|
8
8
|
*
|
|
9
|
+
* Rows are keyed by the required `row_key` accessor, so per-row state
|
|
10
|
+
* (popovers, pending buttons) follows its row across deletes and refetches.
|
|
11
|
+
* A row whose key is `null` or `undefined` throws in DEV.
|
|
12
|
+
*
|
|
13
|
+
* Exposed as an ARIA `table` (not `grid` — there's no grid keyboard model):
|
|
14
|
+
* `row` / `columnheader` / `cell` roles, with the empty state a full-width
|
|
15
|
+
* row of its own.
|
|
16
|
+
*
|
|
9
17
|
* @module
|
|
10
18
|
*/
|
|
11
19
|
|
|
20
|
+
import { DEV } from 'esm-env';
|
|
12
21
|
import type { Snippet } from 'svelte';
|
|
13
22
|
import type { SvelteHTMLElements } from 'svelte/elements';
|
|
14
23
|
|
|
@@ -22,7 +31,7 @@
|
|
|
22
31
|
const {
|
|
23
32
|
columns,
|
|
24
33
|
rows,
|
|
25
|
-
row_key
|
|
34
|
+
row_key,
|
|
26
35
|
height,
|
|
27
36
|
header,
|
|
28
37
|
cell,
|
|
@@ -31,11 +40,8 @@
|
|
|
31
40
|
}: SvelteHTMLElements['div'] & {
|
|
32
41
|
columns: Array<DatatableColumn<T>>;
|
|
33
42
|
rows: Array<T>;
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
* @default 'id'
|
|
37
|
-
*/
|
|
38
|
-
row_key?: string & keyof T; // eslint-disable-line @typescript-eslint/no-duplicate-type-constituents
|
|
43
|
+
/** The row's stable identity, used as the keyed-each key — e.g. `(row) => row.id`. */
|
|
44
|
+
row_key: (row: T) => PropertyKey;
|
|
39
45
|
/** CSS height for the scrollable region (e.g. `'400px'`). Omit to size to content. */
|
|
40
46
|
height?: string;
|
|
41
47
|
/** Override default header-cell rendering. Receives the column. */
|
|
@@ -46,6 +52,14 @@
|
|
|
46
52
|
empty?: Snippet;
|
|
47
53
|
} = $props();
|
|
48
54
|
|
|
55
|
+
const key_of = (row: T): PropertyKey => {
|
|
56
|
+
const key = row_key(row);
|
|
57
|
+
if (DEV && key == null) {
|
|
58
|
+
throw Error(`Datatable row_key returned ${String(key)} — every row needs a stable key`);
|
|
59
|
+
}
|
|
60
|
+
return key;
|
|
61
|
+
};
|
|
62
|
+
|
|
49
63
|
// column widths — base from column defs, resize deltas layered on top
|
|
50
64
|
const resize_deltas: Record<string, number> = $state({});
|
|
51
65
|
|
|
@@ -92,11 +106,10 @@
|
|
|
92
106
|
class="datatable {rest.class}"
|
|
93
107
|
style:height
|
|
94
108
|
style:grid-template-columns={grid_template_columns}
|
|
95
|
-
role="
|
|
96
|
-
aria-rowcount={rows.length + 1}
|
|
109
|
+
role="table"
|
|
97
110
|
>
|
|
98
111
|
<!-- sticky header -->
|
|
99
|
-
<div class="datatable-header" role="row"
|
|
112
|
+
<div class="datatable-header" role="row">
|
|
100
113
|
{#each columns as column, i (column.key)}
|
|
101
114
|
<div class="datatable-header-cell" role="columnheader">
|
|
102
115
|
{#if header}
|
|
@@ -116,18 +129,20 @@
|
|
|
116
129
|
</div>
|
|
117
130
|
|
|
118
131
|
{#if rows.length === 0}
|
|
119
|
-
<div class="datatable-empty">
|
|
120
|
-
{
|
|
121
|
-
{
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
132
|
+
<div class="datatable-empty" role="row">
|
|
133
|
+
<div role="cell" aria-colspan={columns.length}>
|
|
134
|
+
{#if empty}
|
|
135
|
+
{@render empty()}
|
|
136
|
+
{:else}
|
|
137
|
+
<span class="text_50">no data</span>
|
|
138
|
+
{/if}
|
|
139
|
+
</div>
|
|
125
140
|
</div>
|
|
126
141
|
{:else}
|
|
127
|
-
{#each rows as row
|
|
128
|
-
<div class="datatable-row" role="row"
|
|
142
|
+
{#each rows as row (key_of(row))}
|
|
143
|
+
<div class="datatable-row" role="row">
|
|
129
144
|
{#each columns as column (column.key)}
|
|
130
|
-
<div class="datatable-cell" role="
|
|
145
|
+
<div class="datatable-cell" role="cell">
|
|
131
146
|
{#if cell}
|
|
132
147
|
{@render cell(column, row, row[column.key])}
|
|
133
148
|
{:else if column.format}
|
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generic CSS-subgrid datatable. Sticky header, pointer-driven column
|
|
3
|
-
* resize, and optional `header` / `cell` / `empty` snippets for custom
|
|
4
|
-
* rendering. Default cell rendering uses `column.format(value, row)` if
|
|
5
|
-
* present, else `format_value`. Resize deltas are kept in component-local
|
|
6
|
-
* state, keyed by `column.key` — they don't outlive the component.
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
*/
|
|
10
1
|
import type { Snippet } from 'svelte';
|
|
11
2
|
import { type DatatableColumn } from './datatable.js';
|
|
12
3
|
declare function $$render<T extends Record<string, any> = Record<string, any>>(): {
|
|
13
4
|
props: import("svelte/elements").HTMLAttributes<HTMLDivElement> & {
|
|
14
5
|
columns: Array<DatatableColumn<T>>;
|
|
15
6
|
rows: Array<T>;
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
* @default 'id'
|
|
19
|
-
*/
|
|
20
|
-
row_key?: string & keyof T;
|
|
7
|
+
/** The row's stable identity, used as the keyed-each key — e.g. `(row) => row.id`. */
|
|
8
|
+
row_key: (row: T) => PropertyKey;
|
|
21
9
|
/** CSS height for the scrollable region (e.g. `'400px'`). Omit to size to content. */
|
|
22
10
|
height?: string;
|
|
23
11
|
/** Override default header-cell rendering. Receives the column. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Datatable.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/Datatable.svelte"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Datatable.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/Datatable.svelte"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGtC,OAAO,EAGL,KAAK,eAAe,EACpB,MAAM,gBAAgB,CAAC;AAEzB,iBAAS,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;iBAU1D,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;cAC5B,KAAK,CAAC,CAAC,CAAC;QACd,sFAAsF;iBAC7E,CAAC,GAAG,EAAE,CAAC,KAAK,WAAW;QAChC,sFAAsF;iBAC7E,MAAM;QACf,mEAAmE;iBAC1D,OAAO,CAAC,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9C,iFAAiF;eAC1E,OAAO,CAAC,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACvE,mEAAmE;gBAC3D,OAAO;;;;;;EA8GwG;AACzH,cAAM,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACvE,KAAK,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAChD,MAAM,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAClD,KAAK,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAChD,QAAQ;IACR,OAAO;CACV;AAED,UAAU,qBAAqB;IAC3B,KAAK,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;KAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9a,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC7K,YAAY,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;CACjE;AACD,QAAA,MAAM,SAAS,EAAE,qBAAmC,CAAC;AACnC,KAAK,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1G,eAAe,SAAS,CAAC"}
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
* `app_settings_rpc_context`; the toggle calls `app_settings_update` RPC
|
|
5
5
|
* via `AppSettingsState.update_open_signup`.
|
|
6
6
|
*
|
|
7
|
+
* The browser flips the box before the write lands, so once the write
|
|
8
|
+
* settles the box is re-synced to `settings` — after a failure it shows the
|
|
9
|
+
* server's state again, not the refused one.
|
|
10
|
+
*
|
|
7
11
|
* @module
|
|
8
12
|
*/
|
|
9
13
|
|
|
@@ -13,6 +17,11 @@
|
|
|
13
17
|
const app_settings = new AppSettingsState({ get_rpc });
|
|
14
18
|
|
|
15
19
|
void app_settings.fetch();
|
|
20
|
+
|
|
21
|
+
const toggle = async (input: HTMLInputElement): Promise<void> => {
|
|
22
|
+
await app_settings.update_open_signup(input.checked);
|
|
23
|
+
if (app_settings.settings) input.checked = app_settings.settings.open_signup;
|
|
24
|
+
};
|
|
16
25
|
</script>
|
|
17
26
|
|
|
18
27
|
<div class="open-signup-toggle">
|
|
@@ -25,7 +34,7 @@
|
|
|
25
34
|
class="mr_lg"
|
|
26
35
|
checked={app_settings.settings.open_signup}
|
|
27
36
|
disabled={app_settings.update.loading}
|
|
28
|
-
onchange={() =>
|
|
37
|
+
onchange={(e) => toggle(e.currentTarget)}
|
|
29
38
|
/>
|
|
30
39
|
<div>
|
|
31
40
|
<div>open signup</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenSignupToggle.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/OpenSignupToggle.svelte"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OpenSignupToggle.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/OpenSignupToggle.svelte"],"names":[],"mappings":"AAuDA,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,gBAAgB;;kBAA+E,CAAC;AACpF,KAAK,gBAAgB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAChE,eAAe,gBAAgB,CAAC"}
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
import type { SvelteHTMLElements } from 'svelte/elements';
|
|
47
47
|
import type { Snippet } from 'svelte';
|
|
48
48
|
import { scale } from 'svelte/transition';
|
|
49
|
+
import { DEV } from 'esm-env';
|
|
49
50
|
import type { OmitStrict } from '@fuzdev/fuz_util/types.ts';
|
|
50
51
|
|
|
51
52
|
import { Popover } from './popover.svelte.js';
|
|
@@ -75,14 +76,18 @@
|
|
|
75
76
|
} = $props();
|
|
76
77
|
|
|
77
78
|
// TODO @many type union instead of this pattern?
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
79
|
+
if (DEV) {
|
|
80
|
+
$effect(() => {
|
|
81
|
+
if (children && button) {
|
|
82
|
+
console.error(
|
|
83
|
+
'PopoverButton has both children and button defined - button takes precedence'
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
if (!children && !button) {
|
|
87
|
+
console.error('PopoverButton requires either children or a button snippet prop');
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
86
91
|
|
|
87
92
|
// Create a popover instance
|
|
88
93
|
const popover = new Popover();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverButton.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/PopoverButton.svelte"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CI;AACJ,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"PopoverButton.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/PopoverButton.svelte"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CI;AACJ,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEhE,KAAK,gBAAgB,GAAI,UAAU,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,GAAG;IAC/E,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAChC,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC9B,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5C,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,aAAa,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;IACtD,eAAe,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAC7C,uBAAuB,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;IAChE,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;CACnD,CAAC;AAgFH,QAAA,MAAM,aAAa,sDAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import PendingButton from '@fuzdev/fuz_ui/PendingButton.svelte';
|
|
18
18
|
|
|
19
|
+
import type { Uuid } from '../primitive_schemas.js';
|
|
19
20
|
import {
|
|
20
21
|
role_grant_offers_state_context,
|
|
21
22
|
type RoleGrantOfferScope
|
|
@@ -44,13 +45,13 @@
|
|
|
44
45
|
format_role = (role: string) => role,
|
|
45
46
|
...scope
|
|
46
47
|
}: {
|
|
47
|
-
to_account_id:
|
|
48
|
+
to_account_id: Uuid;
|
|
48
49
|
/**
|
|
49
50
|
* Narrow the offer to a specific actor on `to_account_id`. Omit
|
|
50
51
|
* (or `null`, the default) for the account-grain default — any
|
|
51
52
|
* actor on the recipient account may accept.
|
|
52
53
|
*/
|
|
53
|
-
to_actor_id?:
|
|
54
|
+
to_actor_id?: Uuid | null;
|
|
54
55
|
/** Roles the caller may offer — caller filters upstream (default: admin-grant-path). */
|
|
55
56
|
roles: Array<string>;
|
|
56
57
|
on_created?: (offer: RoleGrantOfferJson) => void;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import type { Uuid } from '../primitive_schemas.js';
|
|
1
2
|
import { type RoleGrantOfferScope } from './role_grant_offers_state.svelte.js';
|
|
2
3
|
import { type RoleGrantOfferJson } from '../auth/role_grant_offer_schema.js';
|
|
3
4
|
type $$ComponentProps = {
|
|
4
|
-
to_account_id:
|
|
5
|
+
to_account_id: Uuid;
|
|
5
6
|
/**
|
|
6
7
|
* Narrow the offer to a specific actor on `to_account_id`. Omit
|
|
7
8
|
* (or `null`, the default) for the account-grain default — any
|
|
8
9
|
* actor on the recipient account may accept.
|
|
9
10
|
*/
|
|
10
|
-
to_actor_id?:
|
|
11
|
+
to_actor_id?: Uuid | null;
|
|
11
12
|
/** Roles the caller may offer — caller filters upstream (default: admin-grant-path). */
|
|
12
13
|
roles: Array<string>;
|
|
13
14
|
on_created?: (offer: RoleGrantOfferJson) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoleGrantOfferForm.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/RoleGrantOfferForm.svelte"],"names":[],"mappings":"AAmBA,OAAO,EAEL,KAAK,mBAAmB,EACxB,MAAM,qCAAqC,CAAC;AAE9C,OAAO,EAEL,KAAK,kBAAkB,EACvB,MAAM,oCAAoC,CAAC;AAU5C,KAAK,gBAAgB,GAAI;IACxB,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"RoleGrantOfferForm.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/RoleGrantOfferForm.svelte"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAEL,KAAK,mBAAmB,EACxB,MAAM,qCAAqC,CAAC;AAE9C,OAAO,EAEL,KAAK,kBAAkB,EACvB,MAAM,oCAAoC,CAAC;AAU5C,KAAK,gBAAgB,GAAI;IACxB,aAAa,EAAE,IAAI,CAAC;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,wFAAwF;IACxF,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACjD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACvC,GAAG,mBAAmB,CAAC;AAmHzB,QAAA,MAAM,kBAAkB,sDAAwC,CAAC;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,eAAe,kBAAkB,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Shows every offer involving the current account — recipient or grantor
|
|
6
6
|
* — including terminal rows (accepted, declined, retracted, superseded,
|
|
7
|
-
* expired). Backed by `role_grant_offer_history`
|
|
7
|
+
* expired). Backed by the `role_grant_offer_history` RPC action; seeded
|
|
8
8
|
* via `RoleGrantOffersState.fetch_history()`.
|
|
9
9
|
*
|
|
10
10
|
* Consumers plug in optional `format_actor` / `format_scope` callbacks
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
const get_format_scope = format_scope_context.get();
|
|
42
42
|
const format_scope_from_context = $derived(get_format_scope());
|
|
43
43
|
|
|
44
|
-
const now =
|
|
44
|
+
const now = Date.now();
|
|
45
45
|
|
|
46
46
|
const status_of = (offer: RoleGrantOfferJson): string => {
|
|
47
47
|
if (offer.accepted_at) return 'accepted';
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
{:else if role_grant_offers.list_history.error}
|
|
90
90
|
<p class="color_c_50">{role_grant_offers.list_history.error}</p>
|
|
91
91
|
{:else}
|
|
92
|
-
<Datatable {columns} rows={role_grant_offers.history} height="400px"
|
|
92
|
+
<Datatable {columns} rows={role_grant_offers.history} row_key={(row) => row.id} height="400px">
|
|
93
93
|
{#snippet cell(column, row)}
|
|
94
94
|
{#if column.key === 'from_actor_id'}
|
|
95
95
|
{#if current_actor_id && row.from_actor_id === current_actor_id}
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
* Recipient-side pending offer inbox.
|
|
4
4
|
*
|
|
5
5
|
* Renders `RoleGrantOffersState.incoming` (pending, soonest-expiry first)
|
|
6
|
-
* with accept + decline-with-reason controls
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* with per-row accept + decline-with-reason controls, each row showing its
|
|
7
|
+
* own pending state and error. Grantor and scope rendering are delegated
|
|
8
|
+
* via optional callback props — consumers plug in display names once they
|
|
9
|
+
* know what a `from_actor_id` / `scope_id` represents in their domain
|
|
10
|
+
* (usernames, classroom names, etc.).
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
import PendingButton from '@fuzdev/fuz_ui/PendingButton.svelte';
|
|
@@ -48,15 +49,8 @@
|
|
|
48
49
|
<section class="role-grant-offer-inbox">
|
|
49
50
|
<h2>Pending Offers</h2>
|
|
50
51
|
|
|
51
|
-
{#if role_grant_offers.list.error
|
|
52
|
-
role_grant_offers.
|
|
53
|
-
role_grant_offers.decline.error
|
|
54
|
-
}
|
|
55
|
-
<p class="color_c_50">
|
|
56
|
-
{role_grant_offers.list.error ??
|
|
57
|
-
role_grant_offers.accept.error ??
|
|
58
|
-
role_grant_offers.decline.error}
|
|
59
|
-
</p>
|
|
52
|
+
{#if role_grant_offers.list.error}
|
|
53
|
+
<p class="color_c_50">{role_grant_offers.list.error}</p>
|
|
60
54
|
{/if}
|
|
61
55
|
|
|
62
56
|
{#if role_grant_offers.incoming.length === 0}
|
|
@@ -64,6 +58,10 @@
|
|
|
64
58
|
{:else}
|
|
65
59
|
<ul class="column gap_md">
|
|
66
60
|
{#each role_grant_offers.incoming as offer (offer.id)}
|
|
61
|
+
{@const accepting = role_grant_offers.accept.loading(offer.id)}
|
|
62
|
+
{@const declining = role_grant_offers.decline.loading(offer.id)}
|
|
63
|
+
{@const row_error =
|
|
64
|
+
role_grant_offers.accept.error(offer.id) ?? role_grant_offers.decline.error(offer.id)}
|
|
67
65
|
<li class="box p_md column gap_sm">
|
|
68
66
|
<div class="row gap_sm">
|
|
69
67
|
<span class="chip palette_a">{format_role(offer.role)}</span>
|
|
@@ -83,8 +81,8 @@
|
|
|
83
81
|
|
|
84
82
|
<div class="row gap_sm">
|
|
85
83
|
<PendingButton
|
|
86
|
-
pending={
|
|
87
|
-
disabled={
|
|
84
|
+
pending={accepting}
|
|
85
|
+
disabled={accepting || declining}
|
|
88
86
|
onclick={() => role_grant_offers.submit_accept(offer.id)}
|
|
89
87
|
class="palette_b"
|
|
90
88
|
>
|
|
@@ -94,6 +92,8 @@
|
|
|
94
92
|
<ConfirmButton
|
|
95
93
|
title="decline offer"
|
|
96
94
|
position="bottom"
|
|
95
|
+
pending={declining}
|
|
96
|
+
disabled={accepting || declining}
|
|
97
97
|
onconfirm={() => {
|
|
98
98
|
const reason = decline_reasons.get(offer.id) ?? '';
|
|
99
99
|
void role_grant_offers.submit_decline(offer.id, reason || null);
|
|
@@ -130,6 +130,10 @@
|
|
|
130
130
|
{/snippet}
|
|
131
131
|
</ConfirmButton>
|
|
132
132
|
</div>
|
|
133
|
+
|
|
134
|
+
{#if row_error}
|
|
135
|
+
<p class="color_c_50 mb_0">{row_error}</p>
|
|
136
|
+
{/if}
|
|
133
137
|
</li>
|
|
134
138
|
{/each}
|
|
135
139
|
</ul>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoleGrantOfferInbox.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/RoleGrantOfferInbox.svelte"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RoleGrantOfferInbox.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/RoleGrantOfferInbox.svelte"],"names":[],"mappings":"AAoBA,OAAO,EAA6C,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE/F,KAAK,gBAAgB,GAAI;IACxB,uEAAuE;IACvE,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD;;;;OAIG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,+DAA+D;IAC/D,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACvC,CAAC;AAmGH,QAAA,MAAM,mBAAmB,sDAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
|