@fuzdev/fuz_app 0.104.0 → 0.106.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 +2 -2
- package/dist/actions/action_bridge.d.ts.map +1 -1
- package/dist/actions/action_bridge.js +2 -2
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +3 -3
- package/dist/actions/action_dispatcher.d.ts.map +1 -1
- package/dist/actions/action_dispatcher.js +3 -3
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_event.js +11 -11
- package/dist/actions/action_event_data.d.ts.map +1 -1
- package/dist/actions/action_event_data.js +2 -2
- package/dist/actions/action_event_helpers.d.ts.map +1 -1
- package/dist/actions/action_event_helpers.js +2 -2
- package/dist/actions/action_event_types.d.ts.map +1 -1
- package/dist/actions/action_event_types.js +4 -4
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +14 -13
- package/dist/actions/action_spec.d.ts.map +1 -1
- package/dist/actions/action_spec.js +6 -6
- package/dist/actions/action_types.d.ts.map +1 -1
- package/dist/actions/broadcast_api.d.ts.map +1 -1
- package/dist/actions/broadcast_api.js +1 -1
- package/dist/actions/cancel.d.ts.map +1 -1
- package/dist/actions/cancel.js +3 -3
- package/dist/actions/compile_action_registry.d.ts.map +1 -1
- package/dist/actions/frontend_rpc_client.d.ts.map +1 -1
- package/dist/actions/frontend_rpc_client.js +3 -3
- package/dist/actions/heartbeat.d.ts.map +1 -1
- package/dist/actions/heartbeat.js +2 -2
- package/dist/actions/peer_ping.d.ts.map +1 -1
- package/dist/actions/peer_ping.js +6 -6
- package/dist/actions/peer_request.d.ts.map +1 -1
- package/dist/actions/perform_action.d.ts +8 -0
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +41 -23
- package/dist/actions/protocol.d.ts.map +1 -1
- package/dist/actions/protocol.js +1 -1
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +39 -12
- package/dist/actions/register_ws_endpoint.d.ts.map +1 -1
- package/dist/actions/register_ws_endpoint.js +3 -3
- package/dist/actions/request_tracker.svelte.d.ts.map +1 -1
- package/dist/actions/request_tracker.svelte.js +2 -2
- package/dist/actions/rpc_client.d.ts.map +1 -1
- package/dist/actions/rpc_client.js +7 -7
- package/dist/actions/socket.svelte.d.ts.map +1 -1
- package/dist/actions/socket.svelte.js +4 -3
- package/dist/actions/transports.d.ts.map +1 -1
- package/dist/actions/transports_http.d.ts.map +1 -1
- package/dist/actions/transports_http.js +7 -7
- package/dist/actions/transports_ws.d.ts.map +1 -1
- package/dist/actions/transports_ws.js +3 -3
- package/dist/actions/transports_ws_auth_guard.d.ts +4 -4
- package/dist/actions/transports_ws_auth_guard.d.ts.map +1 -1
- package/dist/actions/transports_ws_auth_guard.js +5 -5
- package/dist/actions/transports_ws_backend.d.ts.map +1 -1
- package/dist/actions/transports_ws_backend.js +2 -2
- package/dist/actions/ws_endpoint_spec.d.ts +2 -2
- package/dist/actions/ws_endpoint_spec.d.ts.map +1 -1
- package/dist/auth/CLAUDE.md +11 -7
- package/dist/auth/account_action_specs.d.ts +32 -9
- package/dist/auth/account_action_specs.d.ts.map +1 -1
- package/dist/auth/account_action_specs.js +35 -23
- package/dist/auth/account_actions.d.ts +3 -3
- package/dist/auth/account_actions.d.ts.map +1 -1
- package/dist/auth/account_actions.js +25 -12
- package/dist/auth/account_queries.d.ts.map +1 -1
- package/dist/auth/account_queries.js +6 -6
- package/dist/auth/account_route_schema.d.ts.map +1 -1
- package/dist/auth/account_route_schema.js +19 -19
- package/dist/auth/account_routes.d.ts +2 -2
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +27 -27
- package/dist/auth/account_schema.d.ts +26 -2
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +28 -10
- package/dist/auth/actor_lookup_action_specs.d.ts.map +1 -1
- package/dist/auth/actor_lookup_action_specs.js +5 -5
- package/dist/auth/actor_lookup_actions.d.ts +4 -2
- package/dist/auth/actor_lookup_actions.d.ts.map +1 -1
- package/dist/auth/actor_lookup_actions.js +3 -3
- package/dist/auth/actor_lookup_queries.d.ts.map +1 -1
- package/dist/auth/actor_search_action_specs.d.ts.map +1 -1
- package/dist/auth/actor_search_action_specs.js +6 -6
- package/dist/auth/actor_search_actions.d.ts +4 -2
- package/dist/auth/actor_search_actions.d.ts.map +1 -1
- package/dist/auth/actor_search_actions.js +5 -5
- package/dist/auth/actor_search_queries.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.d.ts +2 -2
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +55 -55
- package/dist/auth/admin_actions.d.ts +5 -5
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +45 -44
- package/dist/auth/all_action_spec_registries.d.ts.map +1 -1
- package/dist/auth/all_action_spec_registries.js +1 -1
- 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.d.ts.map +1 -1
- package/dist/auth/api_token_queries.d.ts +9 -3
- package/dist/auth/api_token_queries.d.ts.map +1 -1
- package/dist/auth/api_token_queries.js +29 -8
- package/dist/auth/app_settings_queries.d.ts.map +1 -1
- package/dist/auth/app_settings_schema.d.ts.map +1 -1
- package/dist/auth/app_settings_schema.js +3 -3
- package/dist/auth/audit_emitter.d.ts +28 -20
- package/dist/auth/audit_emitter.d.ts.map +1 -1
- package/dist/auth/audit_emitter.js +37 -19
- package/dist/auth/audit_log_ddl.js +1 -1
- package/dist/auth/audit_log_queries.d.ts.map +1 -1
- package/dist/auth/audit_log_queries.js +2 -2
- package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_route_schema.js +1 -1
- package/dist/auth/audit_log_routes.d.ts.map +1 -1
- package/dist/auth/audit_log_routes.js +12 -4
- package/dist/auth/audit_log_schema.d.ts +2 -2
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +69 -68
- package/dist/auth/auth_ddl.js +3 -3
- package/dist/auth/auth_guard_resolver.d.ts.map +1 -1
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +6 -1
- package/dist/auth/bootstrap_account.d.ts.map +1 -1
- package/dist/auth/bootstrap_account.js +5 -5
- package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
- package/dist/auth/bootstrap_route_schema.js +6 -6
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/bootstrap_routes.js +7 -7
- package/dist/auth/cell_action_specs.d.ts +1 -1
- package/dist/auth/cell_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_action_specs.js +47 -47
- package/dist/auth/cell_actions.d.ts +2 -2
- package/dist/auth/cell_actions.d.ts.map +1 -1
- package/dist/auth/cell_actions.js +37 -37
- package/dist/auth/cell_audit_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_audit_action_specs.js +4 -4
- package/dist/auth/cell_audit_actions.d.ts.map +1 -1
- package/dist/auth/cell_audit_actions.js +3 -3
- package/dist/auth/cell_audit_events.d.ts.map +1 -1
- package/dist/auth/cell_audit_events.js +5 -5
- package/dist/auth/cell_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_audit_metadata.js +3 -3
- package/dist/auth/cell_authorize.d.ts.map +1 -1
- package/dist/auth/cell_data_schema.d.ts.map +1 -1
- package/dist/auth/cell_data_schema.js +1 -1
- package/dist/auth/cell_field_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_field_action_specs.js +16 -16
- package/dist/auth/cell_field_actions.d.ts +2 -2
- package/dist/auth/cell_field_actions.d.ts.map +1 -1
- package/dist/auth/cell_field_actions.js +11 -11
- package/dist/auth/cell_field_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_field_audit_metadata.js +2 -2
- package/dist/auth/cell_grant_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_grant_action_specs.js +15 -15
- package/dist/auth/cell_grant_actions.d.ts +2 -2
- package/dist/auth/cell_grant_actions.d.ts.map +1 -1
- package/dist/auth/cell_grant_actions.js +12 -12
- package/dist/auth/cell_grant_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_grant_audit_metadata.js +3 -3
- package/dist/auth/cell_item_action_specs.d.ts +6 -2
- package/dist/auth/cell_item_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_item_action_specs.js +25 -21
- package/dist/auth/cell_item_actions.d.ts +2 -2
- package/dist/auth/cell_item_actions.d.ts.map +1 -1
- package/dist/auth/cell_item_actions.js +14 -14
- package/dist/auth/cell_item_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_item_audit_metadata.js +3 -3
- package/dist/auth/cell_relation_visibility.d.ts.map +1 -1
- package/dist/auth/cleanup.d.ts.map +1 -1
- package/dist/auth/cleanup.js +2 -2
- package/dist/auth/credential_type_schema.d.ts.map +1 -1
- package/dist/auth/credential_type_schema.js +5 -5
- package/dist/auth/daemon_token.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +7 -3
- package/dist/auth/deps.d.ts +20 -5
- package/dist/auth/deps.d.ts.map +1 -1
- package/dist/auth/grant_path_schema.d.ts.map +1 -1
- package/dist/auth/grant_path_schema.js +8 -8
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_schema.d.ts.map +1 -1
- package/dist/auth/invite_schema.js +2 -2
- package/dist/auth/keyring.d.ts.map +1 -1
- package/dist/auth/keyring.js +1 -1
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +7 -7
- package/dist/auth/migrations.d.ts.map +1 -1
- package/dist/auth/migrations.js +54 -19
- package/dist/auth/password.d.ts.map +1 -1
- package/dist/auth/password_argon2.d.ts.map +1 -1
- package/dist/auth/password_argon2.js +2 -2
- package/dist/auth/request_context.d.ts +18 -0
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +33 -7
- package/dist/auth/role_grant_offer_action_specs.d.ts +12 -0
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_action_specs.js +47 -36
- package/dist/auth/role_grant_offer_actions.d.ts +7 -4
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +43 -43
- package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_notifications.js +13 -13
- package/dist/auth/role_grant_offer_queries.d.ts +1 -1
- package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_queries.js +11 -11
- package/dist/auth/role_grant_offer_schema.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_schema.js +7 -7
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.js +3 -3
- package/dist/auth/role_schema.d.ts.map +1 -1
- package/dist/auth/role_schema.js +7 -7
- package/dist/auth/scope_kind_schema.d.ts.map +1 -1
- package/dist/auth/self_service_role_action_specs.d.ts +7 -0
- package/dist/auth/self_service_role_action_specs.d.ts.map +1 -1
- package/dist/auth/self_service_role_action_specs.js +12 -6
- package/dist/auth/self_service_role_actions.d.ts +3 -3
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +9 -9
- package/dist/auth/session_cookie.d.ts.map +1 -1
- package/dist/auth/session_cookie.js +3 -3
- package/dist/auth/session_middleware.d.ts.map +1 -1
- package/dist/auth/session_middleware.js +4 -4
- package/dist/auth/session_queries.d.ts +14 -4
- package/dist/auth/session_queries.d.ts.map +1 -1
- package/dist/auth/session_queries.js +13 -3
- package/dist/auth/signup_route_schema.d.ts.map +1 -1
- package/dist/auth/signup_route_schema.js +6 -6
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +11 -11
- package/dist/auth/standard_action_specs.d.ts.map +1 -1
- package/dist/auth/standard_action_specs.js +1 -1
- package/dist/auth/standard_rpc_actions.d.ts +4 -4
- package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
- package/dist/auth/standard_rpc_actions.js +3 -3
- package/dist/auth/token_scope.d.ts +155 -0
- package/dist/auth/token_scope.d.ts.map +1 -0
- package/dist/auth/token_scope.js +190 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/daemon.d.ts.map +1 -1
- package/dist/cli/daemon.js +3 -3
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +1 -1
- package/dist/cli/logger.d.ts.map +1 -1
- package/dist/cli/logger.js +1 -1
- package/dist/cli/util.d.ts.map +1 -1
- package/dist/cli/util.js +1 -1
- package/dist/db/CLAUDE.md +1 -1
- package/dist/db/cell_audit_queries.d.ts.map +1 -1
- package/dist/db/cell_audit_queries.js +1 -1
- package/dist/db/cell_ddl.d.ts.map +1 -1
- package/dist/db/cell_ddl.js +7 -7
- package/dist/db/cell_field_queries.d.ts.map +1 -1
- package/dist/db/cell_grant_queries.d.ts.map +1 -1
- package/dist/db/cell_grant_queries.js +1 -1
- package/dist/db/cell_history_ddl.d.ts.map +1 -1
- package/dist/db/cell_history_ddl.js +4 -4
- package/dist/db/cell_item_queries.d.ts.map +1 -1
- package/dist/db/cell_queries.d.ts +1 -1
- package/dist/db/cell_queries.d.ts.map +1 -1
- package/dist/db/cell_queries.js +3 -3
- package/dist/db/create_db.d.ts.map +1 -1
- package/dist/db/create_db.js +1 -1
- package/dist/db/db.d.ts.map +1 -1
- package/dist/db/db_pg.d.ts.map +1 -1
- package/dist/db/db_pg.js +1 -1
- package/dist/db/db_pglite.d.ts.map +1 -1
- package/dist/db/db_pglite.js +1 -1
- package/dist/db/fact_ddl.d.ts.map +1 -1
- package/dist/db/fact_ddl.js +3 -3
- package/dist/db/fact_disk_storage.d.ts +1 -1
- package/dist/db/fact_disk_storage.d.ts.map +1 -1
- package/dist/db/fact_disk_storage.js +6 -6
- package/dist/db/fact_queries.d.ts +1 -1
- package/dist/db/fact_queries.d.ts.map +1 -1
- package/dist/db/fact_queries.js +2 -2
- package/dist/db/fact_store.d.ts +1 -1
- package/dist/db/fact_store.d.ts.map +1 -1
- package/dist/db/fact_store.js +9 -9
- package/dist/db/fact_store_errors.d.ts.map +1 -1
- package/dist/db/file_fact_url.d.ts +1 -1
- package/dist/db/file_fact_url.d.ts.map +1 -1
- package/dist/db/file_fact_url.js +1 -1
- package/dist/db/migrate.d.ts.map +1 -1
- package/dist/db/pg_error.d.ts.map +1 -1
- package/dist/db/query_deps.d.ts.map +1 -1
- package/dist/db/schema_ready.d.ts.map +1 -1
- package/dist/db/schema_ready.js +2 -2
- package/dist/db/status.d.ts.map +1 -1
- package/dist/db/status.js +6 -6
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +6 -6
- package/dist/env/dotenv.d.ts.map +1 -1
- package/dist/env/load.d.ts.map +1 -1
- package/dist/env/resolve.d.ts.map +1 -1
- package/dist/hono_context.d.ts +23 -0
- package/dist/hono_context.d.ts.map +1 -1
- package/dist/hono_context.js +16 -2
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/auth_shape.js +6 -6
- package/dist/http/client_ip.d.ts.map +1 -1
- package/dist/http/common_routes.d.ts.map +1 -1
- package/dist/http/common_routes.js +8 -8
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +27 -23
- package/dist/http/error_schemas.d.ts +13 -1
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +25 -13
- package/dist/http/jsonrpc.d.ts.map +1 -1
- package/dist/http/jsonrpc.js +9 -9
- package/dist/http/jsonrpc_errors.d.ts.map +1 -1
- package/dist/http/jsonrpc_errors.js +21 -21
- package/dist/http/jsonrpc_helpers.d.ts.map +1 -1
- package/dist/http/jsonrpc_helpers.js +7 -7
- package/dist/http/middleware_spec.d.ts.map +1 -1
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/pending_effects.d.ts.map +1 -1
- package/dist/http/proxy.d.ts.map +1 -1
- package/dist/http/proxy.js +1 -1
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +6 -6
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +1 -1
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +11 -11
- package/dist/http/surface_query.d.ts.map +1 -1
- package/dist/http/surface_query.js +1 -1
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas.js +1 -1
- package/dist/rate_limiter.d.ts.map +1 -1
- package/dist/rate_limiter.js +4 -4
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +2 -2
- package/dist/realtime/sse_auth_guard.d.ts +4 -4
- package/dist/realtime/sse_auth_guard.d.ts.map +1 -1
- package/dist/realtime/sse_auth_guard.js +8 -8
- package/dist/realtime/subscriber_registry.d.ts.map +1 -1
- package/dist/runtime/deno.d.ts.map +1 -1
- package/dist/runtime/deno.js +7 -7
- package/dist/runtime/deps.d.ts.map +1 -1
- package/dist/runtime/fs.d.ts.map +1 -1
- package/dist/runtime/mock.d.ts.map +1 -1
- package/dist/runtime/mock.js +3 -3
- package/dist/runtime/node.d.ts.map +1 -1
- package/dist/runtime/node.js +7 -7
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/server/app_backend.d.ts +3 -3
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_backend.js +3 -3
- package/dist/server/app_server.d.ts +6 -6
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +32 -32
- package/dist/server/app_server_context.d.ts.map +1 -1
- package/dist/server/env.d.ts.map +1 -1
- package/dist/server/env.js +9 -9
- package/dist/server/file_fact_fetcher.d.ts.map +1 -1
- package/dist/server/file_fact_fetcher.js +1 -1
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +23 -13
- package/dist/server/startup.d.ts.map +1 -1
- package/dist/server/static.d.ts.map +1 -1
- package/dist/server/x_accel.d.ts +2 -4
- package/dist/server/x_accel.d.ts.map +1 -1
- package/dist/server/x_accel.js +3 -5
- package/dist/testing/CLAUDE.md +2 -2
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +64 -64
- package/dist/testing/adversarial_404.d.ts.map +1 -1
- package/dist/testing/adversarial_404.js +1 -1
- package/dist/testing/adversarial_headers.d.ts.map +1 -1
- package/dist/testing/adversarial_headers.js +15 -15
- package/dist/testing/adversarial_input.d.ts.map +1 -1
- package/dist/testing/adversarial_input.js +22 -22
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +34 -33
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/attack_surface.js +12 -12
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +42 -42
- package/dist/testing/audit_drift_guard.d.ts +3 -1
- package/dist/testing/audit_drift_guard.d.ts.map +1 -1
- package/dist/testing/audit_drift_guard.js +12 -6
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +4 -4
- package/dist/testing/bootstrap_success.d.ts.map +1 -1
- package/dist/testing/bootstrap_success.js +11 -11
- package/dist/testing/connection_closer_helpers.d.ts.map +1 -1
- package/dist/testing/connection_closer_helpers.js +1 -1
- package/dist/testing/cross_backend/account_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/account_lifecycle.js +1 -1
- package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest.js +4 -4
- package/dist/testing/cross_backend/action_manifest_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/actor_lookup.d.ts.map +1 -1
- package/dist/testing/cross_backend/actor_lookup.js +3 -3
- package/dist/testing/cross_backend/actor_search.d.ts.map +1 -1
- package/dist/testing/cross_backend/actor_search.js +5 -5
- package/dist/testing/cross_backend/app_settings.d.ts.map +1 -1
- package/dist/testing/cross_backend/app_settings.js +6 -6
- package/dist/testing/cross_backend/backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/bench/bench_report.d.ts.map +1 -1
- package/dist/testing/cross_backend/bench/bench_report.js +5 -5
- package/dist/testing/cross_backend/bench/run_cross_impl_bench.d.ts.map +1 -1
- package/dist/testing/cross_backend/bench/run_cross_impl_bench.js +2 -2
- package/dist/testing/cross_backend/bench/scenario.d.ts.map +1 -1
- package/dist/testing/cross_backend/bench/scenario.js +1 -1
- package/dist/testing/cross_backend/body_size.d.ts.map +1 -1
- package/dist/testing/cross_backend/body_size.js +1 -1
- package/dist/testing/cross_backend/bootstrap_backend.d.ts.map +1 -1
- package/dist/testing/cross_backend/bootstrap_backend.js +2 -2
- package/dist/testing/cross_backend/build_test_backend_paths.js +1 -1
- package/dist/testing/cross_backend/capabilities.js +2 -2
- package/dist/testing/cross_backend/cell_cross_helpers.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.js +5 -2
- package/dist/testing/cross_backend/cell_gated_create.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_gated_create.js +8 -7
- package/dist/testing/cross_backend/cell_grant_role.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_grant_role.js +2 -2
- package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_relations.js +13 -13
- package/dist/testing/cross_backend/conformance_case.d.ts +23 -0
- package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_case.js +32 -11
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +68 -15
- package/dist/testing/cross_backend/cookie_attributes.d.ts.map +1 -1
- package/dist/testing/cross_backend/cookie_attributes.js +4 -4
- package/dist/testing/cross_backend/create_cross_backend_global_setup.d.ts +1 -1
- package/dist/testing/cross_backend/create_cross_backend_global_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/create_cross_backend_global_setup.js +1 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts +1 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.js +1 -1
- package/dist/testing/cross_backend/credential_header_robustness.js +1 -1
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +12 -12
- package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_spine_surface.js +9 -9
- package/dist/testing/cross_backend/expected_schema.json +1 -0
- package/dist/testing/cross_backend/fact_serving.d.ts.map +1 -1
- package/dist/testing/cross_backend/fact_serving.js +2 -2
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +4 -4
- package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/identity_parity.js +28 -24
- package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/in_process_setup.js +9 -9
- package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
- package/dist/testing/cross_backend/login_security.js +2 -2
- package/dist/testing/cross_backend/make_cross_backend_project.d.ts +1 -1
- package/dist/testing/cross_backend/make_cross_backend_project.d.ts.map +1 -1
- package/dist/testing/cross_backend/make_cross_backend_project.js +3 -3
- package/dist/testing/cross_backend/method_coverage.d.ts.map +1 -1
- package/dist/testing/cross_backend/origin.d.ts.map +1 -1
- package/dist/testing/cross_backend/origin.js +4 -4
- package/dist/testing/cross_backend/peer_ping_ws.d.ts.map +1 -1
- package/dist/testing/cross_backend/peer_ping_ws.js +6 -6
- package/dist/testing/cross_backend/ready.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_enumeration.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_enumeration.js +1 -1
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.js +1 -1
- package/dist/testing/cross_backend/role_grant_participation.d.ts.map +1 -1
- 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 -5
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +41 -37
- package/dist/testing/cross_backend/spawn_backend.d.ts.map +1 -1
- package/dist/testing/cross_backend/spawn_backend.js +1 -1
- package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/sse_round_trip.js +10 -7
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/standard.js +5 -5
- package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_backdoor.js +7 -7
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +24 -23
- package/dist/testing/cross_backend/testing_server_bun.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_bun.js +3 -3
- 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_deno.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_deno.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 +3 -3
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +13 -13
- package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_round_trip.js +2 -2
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +8 -8
- package/dist/testing/db.d.ts.map +1 -1
- package/dist/testing/db.js +3 -3
- package/dist/testing/db_entities.d.ts.map +1 -1
- package/dist/testing/db_entities.js +1 -1
- package/dist/testing/entities.d.ts.map +1 -1
- package/dist/testing/entities.js +5 -5
- package/dist/testing/error_coverage.d.ts.map +1 -1
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +109 -109
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +3 -3
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +11 -11
- package/dist/testing/mock_fs.js +1 -1
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +23 -23
- package/dist/testing/role_grant_helpers.d.ts.map +1 -1
- package/dist/testing/role_grant_helpers.js +3 -3
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/round_trip.js +6 -6
- package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
- package/dist/testing/rpc_attack_surface.js +12 -12
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +11 -11
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.js +3 -3
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +3 -3
- package/dist/testing/schema_introspect.d.ts.map +1 -1
- package/dist/testing/schema_introspect.js +12 -12
- package/dist/testing/schema_parity.d.ts.map +1 -1
- package/dist/testing/schema_parity.js +7 -7
- package/dist/testing/schema_ready_fixture.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +8 -8
- package/dist/testing/standard.d.ts.map +1 -1
- package/dist/testing/standard.js +8 -8
- package/dist/testing/stubs.d.ts +6 -6
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +26 -23
- package/dist/testing/surface_invariants.d.ts.map +1 -1
- package/dist/testing/surface_invariants.js +5 -5
- package/dist/testing/testing_rate_limiter.d.ts.map +1 -1
- package/dist/testing/transports/bootstrap.d.ts.map +1 -1
- package/dist/testing/transports/bootstrap.js +4 -4
- package/dist/testing/transports/fetch_transport.d.ts.map +1 -1
- package/dist/testing/transports/sse_frame_reader.d.ts.map +1 -1
- package/dist/testing/transports/sse_transport.js +1 -1
- package/dist/testing/transports/ws_client.d.ts.map +1 -1
- package/dist/testing/transports/ws_client.js +1 -1
- package/dist/testing/transports/ws_transport.js +4 -4
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +21 -21
- package/dist/ui/AccountSessions.svelte +11 -11
- package/dist/ui/AdminAccounts.svelte +10 -10
- package/dist/ui/AdminAuditLog.svelte +14 -14
- package/dist/ui/AdminInvites.svelte +13 -13
- package/dist/ui/AdminOverview.svelte +22 -22
- package/dist/ui/AdminRoleGrantHistory.svelte +11 -11
- package/dist/ui/AdminSessions.svelte +12 -12
- package/dist/ui/AdminSettings.svelte +1 -1
- package/dist/ui/AdminSurface.svelte +3 -3
- package/dist/ui/AppShell.svelte +8 -8
- package/dist/ui/AppShell.svelte.d.ts.map +1 -1
- package/dist/ui/BootstrapForm.svelte +9 -9
- package/dist/ui/CLAUDE.md +1 -1
- package/dist/ui/ColumnLayout.svelte +2 -2
- package/dist/ui/ColumnLayout.svelte.d.ts.map +1 -1
- package/dist/ui/ConfirmButton.svelte +8 -8
- package/dist/ui/ConfirmButton.svelte.d.ts.map +1 -1
- package/dist/ui/Datatable.svelte +6 -6
- package/dist/ui/Datatable.svelte.d.ts.map +1 -1
- package/dist/ui/LoginForm.svelte +6 -6
- package/dist/ui/LogoutButton.svelte +2 -2
- package/dist/ui/LogoutButton.svelte.d.ts.map +1 -1
- package/dist/ui/MenuLink.svelte +5 -5
- package/dist/ui/MenuLink.svelte.d.ts.map +1 -1
- package/dist/ui/OpenSignupToggle.svelte +2 -2
- package/dist/ui/PopoverButton.svelte +10 -10
- package/dist/ui/PopoverButton.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferForm.svelte +8 -11
- package/dist/ui/RoleGrantOfferForm.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferHistory.svelte +11 -11
- package/dist/ui/RoleGrantOfferHistory.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferInbox.svelte +6 -6
- package/dist/ui/RoleGrantOfferInbox.svelte.d.ts.map +1 -1
- package/dist/ui/SignupForm.svelte +9 -9
- package/dist/ui/SurfaceExplorer.svelte +11 -11
- package/dist/ui/SurfaceExplorer.svelte.d.ts.map +1 -1
- package/dist/ui/account_sessions_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.js +2 -2
- package/dist/ui/admin_invites_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_rpc_adapters.d.ts.map +1 -1
- package/dist/ui/admin_rpc_adapters.js +5 -5
- package/dist/ui/admin_sessions_state.svelte.d.ts.map +1 -1
- package/dist/ui/app_settings_state.svelte.d.ts.map +1 -1
- package/dist/ui/async_slot.svelte.d.ts.map +1 -1
- package/dist/ui/audit_log_state.svelte.d.ts.map +1 -1
- package/dist/ui/audit_log_state.svelte.js +1 -1
- package/dist/ui/auth_state.svelte.js +4 -4
- package/dist/ui/form_state.svelte.d.ts.map +1 -1
- package/dist/ui/format_scope.d.ts.map +1 -1
- package/dist/ui/keyed_async_slot.svelte.d.ts.map +1 -1
- package/dist/ui/popover.svelte.d.ts.map +1 -1
- package/dist/ui/popover.svelte.js +1 -1
- package/dist/ui/position_helpers.js +1 -1
- package/dist/ui/role_grant_offers_state.svelte.d.ts.map +1 -1
- package/dist/ui/role_grant_offers_state.svelte.js +1 -1
- package/dist/ui/table_state.svelte.d.ts.map +1 -1
- package/dist/ui/ui_fetch.d.ts.map +1 -1
- package/dist/ui/ui_format.js +2 -2
- package/package.json +13 -12
- package/dist/server/fact_write.d.ts +0 -32
- package/dist/server/fact_write.d.ts.map +0 -1
- package/dist/server/fact_write.js +0 -56
- package/dist/server/validate_nginx.d.ts +0 -34
- package/dist/server/validate_nginx.d.ts.map +0 -1
- package/dist/server/validate_nginx.js +0 -169
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
* @module
|
|
40
40
|
*/
|
|
41
41
|
import { z } from 'zod';
|
|
42
|
-
import { rpc_action
|
|
42
|
+
import { rpc_action } from '../actions/action_rpc.js';
|
|
43
43
|
import { jsonrpc_errors, dev_only } from '../http/jsonrpc_errors.js';
|
|
44
44
|
import { is_pg_unique_violation } from '../db/pg_error.js';
|
|
45
45
|
import { has_role } from './request_context.js';
|
|
46
46
|
import { ROLE_ADMIN } from './role_schema.js';
|
|
47
|
-
import { cell_create_action_spec, cell_get_action_spec, cell_update_action_spec, cell_delete_action_spec, cell_list_action_spec, cell_clone_action_spec, cell_moderate_action_spec, ERROR_CELL_NOT_FOUND, ERROR_CELL_PATH_ADMIN_ONLY, ERROR_CELL_PATH_TAKEN, ERROR_CELL_VISIBILITY_MANAGE_ONLY, ERROR_CELL_GET_REQUIRES_ID_OR_PATH, ERROR_CELL_KIND_IN_DATA, ERROR_CELL_KIND_EMPTY, ERROR_CELL_CREATE_FORBIDDEN, ERROR_CELL_MODERATE_FORBIDDEN, ERROR_CELL_NOT_A_CONTRIBUTION, ERROR_CELL_LIST_CREATED_BY_REQUIRES_AUTH, ERROR_CELL_LIST_SHARED_WITH_REQUIRES_AUTH, CELL_LIST_LIMIT_DEFAULT, CELL_RELATIONS_BUNDLE_LIMIT
|
|
48
|
-
import { query_cell_create, query_cell_get, query_cell_get_by_path, query_cell_update, query_cell_delete, query_cell_set_moderation, query_cell_list, query_cell_load_many
|
|
49
|
-
import { query_cell_grant_list_for_cell, query_cell_grants_for_caller_in_cells
|
|
47
|
+
import { cell_create_action_spec, cell_get_action_spec, cell_update_action_spec, cell_delete_action_spec, cell_list_action_spec, cell_clone_action_spec, cell_moderate_action_spec, ERROR_CELL_NOT_FOUND, ERROR_CELL_PATH_ADMIN_ONLY, ERROR_CELL_PATH_TAKEN, ERROR_CELL_VISIBILITY_MANAGE_ONLY, ERROR_CELL_GET_REQUIRES_ID_OR_PATH, ERROR_CELL_KIND_IN_DATA, ERROR_CELL_KIND_EMPTY, ERROR_CELL_CREATE_FORBIDDEN, ERROR_CELL_MODERATE_FORBIDDEN, ERROR_CELL_NOT_A_CONTRIBUTION, ERROR_CELL_LIST_CREATED_BY_REQUIRES_AUTH, ERROR_CELL_LIST_SHARED_WITH_REQUIRES_AUTH, CELL_LIST_LIMIT_DEFAULT, CELL_RELATIONS_BUNDLE_LIMIT } from './cell_action_specs.js';
|
|
48
|
+
import { query_cell_create, query_cell_get, query_cell_get_by_path, query_cell_update, query_cell_delete, query_cell_set_moderation, query_cell_list, query_cell_load_many } from '../db/cell_queries.js';
|
|
49
|
+
import { query_cell_grant_list_for_cell, query_cell_grants_for_caller_in_cells } from '../db/cell_grant_queries.js';
|
|
50
50
|
import { query_cell_field_list_for_source, query_cell_field_set } from '../db/cell_field_queries.js';
|
|
51
|
-
import { query_cell_item_insert, query_cell_item_list_for_parent
|
|
51
|
+
import { query_cell_item_insert, query_cell_item_list_for_parent } from '../db/cell_item_queries.js';
|
|
52
52
|
import { can_view_cell, can_edit_cell, can_manage_cell } from './cell_authorize.js';
|
|
53
53
|
import { filter_visible_target_ids } from './cell_relation_visibility.js';
|
|
54
54
|
import { to_grant_json } from './cell_grant_actions.js';
|
|
@@ -76,7 +76,7 @@ const path_taken_error = () => jsonrpc_errors.conflict('cell.path is already tak
|
|
|
76
76
|
const reject_kind_in_data = (data) => {
|
|
77
77
|
if (Object.hasOwn(data, 'kind')) {
|
|
78
78
|
throw jsonrpc_errors.invalid_params('cell.data must not contain `kind` (it is a top-level field)', {
|
|
79
|
-
reason: ERROR_CELL_KIND_IN_DATA
|
|
79
|
+
reason: ERROR_CELL_KIND_IN_DATA
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
};
|
|
@@ -95,7 +95,7 @@ export const to_cell_json = (row) => ({
|
|
|
95
95
|
created_at: typeof row.created_at === 'string' ? row.created_at : row.created_at.toISOString(),
|
|
96
96
|
updated_at: to_iso_nullable(row.updated_at),
|
|
97
97
|
deleted_at: to_iso_nullable(row.deleted_at),
|
|
98
|
-
grant_count: row.grant_count
|
|
98
|
+
grant_count: row.grant_count
|
|
99
99
|
});
|
|
100
100
|
/**
|
|
101
101
|
* Emit a cell-mutation audit event with the standard `{cell_id, kind?,
|
|
@@ -111,8 +111,8 @@ const emit_cell_audit = (ctx, event_type, row, deps, auth) => {
|
|
|
111
111
|
metadata: {
|
|
112
112
|
cell_id: row.id,
|
|
113
113
|
kind: row.kind ?? undefined,
|
|
114
|
-
path: row.path
|
|
115
|
-
}
|
|
114
|
+
path: row.path
|
|
115
|
+
}
|
|
116
116
|
});
|
|
117
117
|
};
|
|
118
118
|
/** Create the six generic cell RPC actions. */
|
|
@@ -144,7 +144,7 @@ export const create_cell_actions = (deps) => {
|
|
|
144
144
|
// + DB are clean.
|
|
145
145
|
if (input.path !== undefined && input.path !== null && !has_role(auth, ROLE_ADMIN)) {
|
|
146
146
|
throw jsonrpc_errors.forbidden('cell.path is admin-only', {
|
|
147
|
-
reason: ERROR_CELL_PATH_ADMIN_ONLY
|
|
147
|
+
reason: ERROR_CELL_PATH_ADMIN_ONLY
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
// `kind` is the top-level column — reject a stray copy inside `data`,
|
|
@@ -206,11 +206,11 @@ export const create_cell_actions = (deps) => {
|
|
|
206
206
|
parent_id,
|
|
207
207
|
root_id,
|
|
208
208
|
root_data,
|
|
209
|
-
scope_id: null
|
|
209
|
+
scope_id: null
|
|
210
210
|
});
|
|
211
211
|
if (!verdict.allow) {
|
|
212
212
|
throw jsonrpc_errors.forbidden('cell creation is not permitted here', {
|
|
213
|
-
reason: ERROR_CELL_CREATE_FORBIDDEN
|
|
213
|
+
reason: ERROR_CELL_CREATE_FORBIDDEN
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
216
|
// Moderation is a *contribution* concept — only stamp it for a create
|
|
@@ -244,7 +244,7 @@ export const create_cell_actions = (deps) => {
|
|
|
244
244
|
parent_id,
|
|
245
245
|
root_id,
|
|
246
246
|
moderation,
|
|
247
|
-
created_by: auth.actor.id
|
|
247
|
+
created_by: auth.actor.id
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
catch (err) {
|
|
@@ -261,7 +261,7 @@ export const create_cell_actions = (deps) => {
|
|
|
261
261
|
// bypass the wire schema get the same error shape.
|
|
262
262
|
if (input.id === undefined && input.path === undefined) {
|
|
263
263
|
throw jsonrpc_errors.invalid_params('cell_get requires id or path', {
|
|
264
|
-
reason: ERROR_CELL_GET_REQUIRES_ID_OR_PATH
|
|
264
|
+
reason: ERROR_CELL_GET_REQUIRES_ID_OR_PATH
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
267
|
const auth = ctx.auth;
|
|
@@ -280,11 +280,11 @@ export const create_cell_actions = (deps) => {
|
|
|
280
280
|
const [grants, fields, items] = await Promise.all([
|
|
281
281
|
auth ? query_cell_grant_list_for_cell(ctx, row.id) : Promise.resolve(null),
|
|
282
282
|
query_cell_field_list_for_source(ctx, row.id, {
|
|
283
|
-
limit: CELL_RELATIONS_BUNDLE_LIMIT + 1
|
|
283
|
+
limit: CELL_RELATIONS_BUNDLE_LIMIT + 1
|
|
284
284
|
}),
|
|
285
285
|
query_cell_item_list_for_parent(ctx, row.id, {
|
|
286
|
-
limit: CELL_RELATIONS_BUNDLE_LIMIT + 1
|
|
287
|
-
})
|
|
286
|
+
limit: CELL_RELATIONS_BUNDLE_LIMIT + 1
|
|
287
|
+
})
|
|
288
288
|
]);
|
|
289
289
|
// 404 covers both "no such cell" and "exists but caller can't view"
|
|
290
290
|
// — same response code so private-cell existence doesn't leak.
|
|
@@ -307,7 +307,7 @@ export const create_cell_actions = (deps) => {
|
|
|
307
307
|
// id-sets. `*_truncated` still reflects the raw relation size.
|
|
308
308
|
const visible_targets = await filter_visible_target_ids(ctx, auth, [
|
|
309
309
|
...fields_bundled.map((f) => f.target_id),
|
|
310
|
-
...items_bundled.map((i) => i.child_id)
|
|
310
|
+
...items_bundled.map((i) => i.child_id)
|
|
311
311
|
]);
|
|
312
312
|
const fields_visible = fields_bundled.filter((f) => visible_targets.has(f.target_id));
|
|
313
313
|
const items_visible = items_bundled.filter((i) => visible_targets.has(i.child_id));
|
|
@@ -318,7 +318,7 @@ export const create_cell_actions = (deps) => {
|
|
|
318
318
|
items: items_visible.map(to_item_json),
|
|
319
319
|
items_truncated,
|
|
320
320
|
can_edit,
|
|
321
|
-
can_grant
|
|
321
|
+
can_grant
|
|
322
322
|
};
|
|
323
323
|
};
|
|
324
324
|
const update_handler = async (input, ctx) => {
|
|
@@ -328,7 +328,7 @@ export const create_cell_actions = (deps) => {
|
|
|
328
328
|
// can't probe for cell existence by varying `path` shape.
|
|
329
329
|
if (path_provided && !has_role(auth, ROLE_ADMIN)) {
|
|
330
330
|
throw jsonrpc_errors.forbidden('cell.path is admin-only', {
|
|
331
|
-
reason: ERROR_CELL_PATH_ADMIN_ONLY
|
|
331
|
+
reason: ERROR_CELL_PATH_ADMIN_ONLY
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
334
|
const existing = await query_cell_get(ctx, input.cell_id);
|
|
@@ -349,7 +349,7 @@ export const create_cell_actions = (deps) => {
|
|
|
349
349
|
input.visibility !== existing.visibility &&
|
|
350
350
|
!can_manage_cell(auth, existing)) {
|
|
351
351
|
throw jsonrpc_errors.forbidden('cell.visibility is manage-tier only', {
|
|
352
|
-
reason: ERROR_CELL_VISIBILITY_MANAGE_ONLY
|
|
352
|
+
reason: ERROR_CELL_VISIBILITY_MANAGE_ONLY
|
|
353
353
|
});
|
|
354
354
|
}
|
|
355
355
|
// Per-kind shape validation when `data` is supplied. Patch-only —
|
|
@@ -368,7 +368,7 @@ export const create_cell_actions = (deps) => {
|
|
|
368
368
|
data: validated_data,
|
|
369
369
|
visibility: input.visibility,
|
|
370
370
|
path: path_provided ? (input.path ?? null) : undefined,
|
|
371
|
-
updated_by: auth.actor.id
|
|
371
|
+
updated_by: auth.actor.id
|
|
372
372
|
});
|
|
373
373
|
}
|
|
374
374
|
catch (err) {
|
|
@@ -431,7 +431,7 @@ export const create_cell_actions = (deps) => {
|
|
|
431
431
|
const approved = input.moderation === 'approved';
|
|
432
432
|
const updated = await query_cell_set_moderation(ctx, input.cell_id, input.moderation, {
|
|
433
433
|
set_visibility_public: approved,
|
|
434
|
-
updated_by: auth.actor.id
|
|
434
|
+
updated_by: auth.actor.id
|
|
435
435
|
});
|
|
436
436
|
// Raced with a deleter between the authz check and the UPDATE.
|
|
437
437
|
if (!updated)
|
|
@@ -444,8 +444,8 @@ export const create_cell_actions = (deps) => {
|
|
|
444
444
|
metadata: {
|
|
445
445
|
cell_id: updated.id,
|
|
446
446
|
root_id: existing.root_id,
|
|
447
|
-
moderation: input.moderation
|
|
448
|
-
}
|
|
447
|
+
moderation: input.moderation
|
|
448
|
+
}
|
|
449
449
|
});
|
|
450
450
|
return { cell: to_cell_json(updated) };
|
|
451
451
|
};
|
|
@@ -481,7 +481,7 @@ export const create_cell_actions = (deps) => {
|
|
|
481
481
|
kind: source.kind,
|
|
482
482
|
visibility: source.visibility,
|
|
483
483
|
path: null, // admin-only paths cannot auto-clone
|
|
484
|
-
created_by: auth.actor.id
|
|
484
|
+
created_by: auth.actor.id
|
|
485
485
|
});
|
|
486
486
|
};
|
|
487
487
|
const clone_handler = async (input, ctx) => {
|
|
@@ -518,7 +518,7 @@ export const create_cell_actions = (deps) => {
|
|
|
518
518
|
const child_ids = source_items.map((i) => i.child_id);
|
|
519
519
|
const [child_rows, visible_children] = await Promise.all([
|
|
520
520
|
query_cell_load_many(ctx, child_ids),
|
|
521
|
-
filter_visible_target_ids(ctx, auth, child_ids)
|
|
521
|
+
filter_visible_target_ids(ctx, auth, child_ids)
|
|
522
522
|
]);
|
|
523
523
|
const child_by_id = new Map(child_rows.map((r) => [r.id, r]));
|
|
524
524
|
for (const item of source_items) {
|
|
@@ -538,7 +538,7 @@ export const create_cell_actions = (deps) => {
|
|
|
538
538
|
// in that single transaction and rolls back together on any
|
|
539
539
|
// failure. No nested `ctx.db.transaction(...)` here.
|
|
540
540
|
const cloned_root = await clone_one_cell_row(ctx, source, auth, {
|
|
541
|
-
patch_data: input.with_data_patch
|
|
541
|
+
patch_data: input.with_data_patch
|
|
542
542
|
});
|
|
543
543
|
// Copy outgoing fields shallowly: the clone points at the same
|
|
544
544
|
// targets the source did (fields are JSON references, not
|
|
@@ -559,7 +559,7 @@ export const create_cell_actions = (deps) => {
|
|
|
559
559
|
await query_cell_field_set(ctx, {
|
|
560
560
|
source_id: cloned_root.id,
|
|
561
561
|
name: f.name,
|
|
562
|
-
target_id: f.target_id
|
|
562
|
+
target_id: f.target_id
|
|
563
563
|
});
|
|
564
564
|
}
|
|
565
565
|
if (deep) {
|
|
@@ -575,7 +575,7 @@ export const create_cell_actions = (deps) => {
|
|
|
575
575
|
await query_cell_item_insert(ctx, {
|
|
576
576
|
parent_id: cloned_root.id,
|
|
577
577
|
position: item.position,
|
|
578
|
-
child_id: cloned_child.id
|
|
578
|
+
child_id: cloned_child.id
|
|
579
579
|
});
|
|
580
580
|
}
|
|
581
581
|
}
|
|
@@ -598,7 +598,7 @@ export const create_cell_actions = (deps) => {
|
|
|
598
598
|
await query_cell_item_insert(ctx, {
|
|
599
599
|
parent_id: cloned_root.id,
|
|
600
600
|
position: item.position,
|
|
601
|
-
child_id: item.child_id
|
|
601
|
+
child_id: item.child_id
|
|
602
602
|
});
|
|
603
603
|
}
|
|
604
604
|
}
|
|
@@ -618,8 +618,8 @@ export const create_cell_actions = (deps) => {
|
|
|
618
618
|
new_id: cloned_root.id,
|
|
619
619
|
deep,
|
|
620
620
|
item_count: cloned_child_count,
|
|
621
|
-
...(source_kind !== undefined ? { kind: source_kind } : {})
|
|
622
|
-
}
|
|
621
|
+
...(source_kind !== undefined ? { kind: source_kind } : {})
|
|
622
|
+
}
|
|
623
623
|
});
|
|
624
624
|
return { cell: to_cell_json(cloned_root) };
|
|
625
625
|
};
|
|
@@ -629,14 +629,14 @@ export const create_cell_actions = (deps) => {
|
|
|
629
629
|
// ("does account X have any public cells?") — require auth to use it.
|
|
630
630
|
if (auth === null && input.created_by !== undefined) {
|
|
631
631
|
throw jsonrpc_errors.invalid_params('cell_list created_by requires authentication', {
|
|
632
|
-
reason: ERROR_CELL_LIST_CREATED_BY_REQUIRES_AUTH
|
|
632
|
+
reason: ERROR_CELL_LIST_CREATED_BY_REQUIRES_AUTH
|
|
633
633
|
});
|
|
634
634
|
}
|
|
635
635
|
// `shared_with: 'me'` resolves to the caller's actor + role_grants;
|
|
636
636
|
// no auth means no caller, no admit path.
|
|
637
637
|
if (auth === null && input.shared_with !== undefined) {
|
|
638
638
|
throw jsonrpc_errors.invalid_params('cell_list shared_with requires authentication', {
|
|
639
|
-
reason: ERROR_CELL_LIST_SHARED_WITH_REQUIRES_AUTH
|
|
639
|
+
reason: ERROR_CELL_LIST_SHARED_WITH_REQUIRES_AUTH
|
|
640
640
|
});
|
|
641
641
|
}
|
|
642
642
|
// Project the active role_grant set into parallel arrays for the
|
|
@@ -666,7 +666,7 @@ export const create_cell_actions = (deps) => {
|
|
|
666
666
|
// Apply the default cap when caller omits `limit`. Without this
|
|
667
667
|
// the SQL `LIMIT NULL` returns every matching row.
|
|
668
668
|
limit: input.limit ?? CELL_LIST_LIMIT_DEFAULT,
|
|
669
|
-
offset: input.offset
|
|
669
|
+
offset: input.offset
|
|
670
670
|
});
|
|
671
671
|
let cell_grants;
|
|
672
672
|
if (input.shared_with === 'me' && rows.length > 0 && caller_actor_id !== null) {
|
|
@@ -685,6 +685,6 @@ export const create_cell_actions = (deps) => {
|
|
|
685
685
|
rpc_action(cell_delete_action_spec, delete_handler),
|
|
686
686
|
rpc_action(cell_list_action_spec, list_handler),
|
|
687
687
|
rpc_action(cell_clone_action_spec, clone_handler),
|
|
688
|
-
rpc_action(cell_moderate_action_spec, moderate_handler)
|
|
688
|
+
rpc_action(cell_moderate_action_spec, moderate_handler)
|
|
689
689
|
];
|
|
690
690
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell_audit_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_audit_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"cell_audit_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_audit_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;kBAO7B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,2EAA2E;AAC3E,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD,eAAO,MAAM,kBAAkB;;;kBAG7B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;kBAE9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWH,CAAC;AAEtC,+DAA+D;AAC/D,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAyC,CAAC"}
|
|
@@ -44,16 +44,16 @@ export const CellAuditEventJson = z.strictObject({
|
|
|
44
44
|
event_type: z.string(),
|
|
45
45
|
outcome: z.enum(['success', 'failure']),
|
|
46
46
|
actor_id: Uuid.nullable(),
|
|
47
|
-
created_at: z.string()
|
|
47
|
+
created_at: z.string()
|
|
48
48
|
});
|
|
49
49
|
/** Page size for `cell_audit_list`. Single page at MVP; no cursor wire. */
|
|
50
50
|
export const CELL_AUDIT_LIST_DEFAULT_LIMIT = 50;
|
|
51
51
|
export const CellAuditListInput = z.strictObject({
|
|
52
52
|
cell_id: Uuid.meta({ description: 'Cell whose audit trail to fetch.' }),
|
|
53
|
-
acting: ActingActor
|
|
53
|
+
acting: ActingActor
|
|
54
54
|
});
|
|
55
55
|
export const CellAuditListOutput = z.strictObject({
|
|
56
|
-
events: z.array(CellAuditEventJson)
|
|
56
|
+
events: z.array(CellAuditEventJson)
|
|
57
57
|
});
|
|
58
58
|
export const cell_audit_list_action_spec = {
|
|
59
59
|
method: 'cell_audit_list',
|
|
@@ -64,7 +64,7 @@ export const cell_audit_list_action_spec = {
|
|
|
64
64
|
input: CellAuditListInput,
|
|
65
65
|
output: CellAuditListOutput,
|
|
66
66
|
async: true,
|
|
67
|
-
description: 'List the most-recent audit events referencing the cell on any of `cell_id`, `source_id`, `parent_id`, `child_id`, `target_id`, or `new_id` metadata keys. Manage-tier only (admin / owner) — the timeline reveals who touched the cell, so viewers and editors get the IDOR-mask 404. 404 on miss or unauthorized — same shape as `cell_get` so private-cell existence does not leak.'
|
|
67
|
+
description: 'List the most-recent audit events referencing the cell on any of `cell_id`, `source_id`, `parent_id`, `child_id`, `target_id`, or `new_id` metadata keys. Manage-tier only (admin / owner) — the timeline reveals who touched the cell, so viewers and editors get the IDOR-mask 404. 404 on miss or unauthorized — same shape as `cell_get` so private-cell existence does not leak.'
|
|
68
68
|
};
|
|
69
69
|
/** Registry export to compose into `all_cell_action_specs`. */
|
|
70
70
|
export const all_cell_audit_action_specs = [cell_audit_list_action_spec];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell_audit_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_audit_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"cell_audit_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_audit_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAgC/F,eAAO,MAAM,yBAAyB,QAAO,KAAK,CAAC,SAAS,CA0B3D,CAAC"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { rpc_action } from '../actions/action_rpc.js';
|
|
17
17
|
import { jsonrpc_errors } from '../http/jsonrpc_errors.js';
|
|
18
|
-
import { cell_audit_list_action_spec, CELL_AUDIT_LIST_DEFAULT_LIMIT
|
|
18
|
+
import { cell_audit_list_action_spec, CELL_AUDIT_LIST_DEFAULT_LIMIT } from './cell_audit_action_specs.js';
|
|
19
19
|
import { ERROR_CELL_NOT_FOUND } from './cell_action_specs.js';
|
|
20
20
|
import { query_cell_get } from '../db/cell_queries.js';
|
|
21
21
|
import { query_audit_log_list_by_cell } from '../db/cell_audit_queries.js';
|
|
@@ -32,7 +32,7 @@ const to_cell_audit_event_json = (row) => ({
|
|
|
32
32
|
event_type: row.event_type,
|
|
33
33
|
outcome: row.outcome,
|
|
34
34
|
actor_id: row.actor_id,
|
|
35
|
-
created_at: typeof row.created_at === 'string' ? row.created_at : row.created_at.toISOString()
|
|
35
|
+
created_at: typeof row.created_at === 'string' ? row.created_at : row.created_at.toISOString()
|
|
36
36
|
});
|
|
37
37
|
export const create_cell_audit_actions = () => {
|
|
38
38
|
const handler = async (input, ctx) => {
|
|
@@ -51,7 +51,7 @@ export const create_cell_audit_actions = () => {
|
|
|
51
51
|
throw jsonrpc_errors.not_found('cell', { reason: ERROR_CELL_NOT_FOUND });
|
|
52
52
|
}
|
|
53
53
|
const rows = await query_audit_log_list_by_cell(ctx, cell.id, {
|
|
54
|
-
limit: CELL_AUDIT_LIST_DEFAULT_LIMIT
|
|
54
|
+
limit: CELL_AUDIT_LIST_DEFAULT_LIMIT
|
|
55
55
|
});
|
|
56
56
|
return { events: rows.map(to_cell_audit_event_json) };
|
|
57
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell_audit_events.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_audit_events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"cell_audit_events.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_audit_events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqB7B;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAajE,CAAC"}
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
*
|
|
17
17
|
* @module
|
|
18
18
|
*/
|
|
19
|
-
import { CellAuditMetadata, CellCloneAuditMetadata, CellModerateAuditMetadata
|
|
20
|
-
import { CellGrantCreateAuditMetadata, CellGrantRevokeAuditMetadata
|
|
21
|
-
import { CellFieldSetAuditMetadata, CellFieldDeleteAuditMetadata
|
|
22
|
-
import { CellItemInsertAuditMetadata, CellItemMoveAuditMetadata, CellItemDeleteAuditMetadata
|
|
19
|
+
import { CellAuditMetadata, CellCloneAuditMetadata, CellModerateAuditMetadata } from './cell_audit_metadata.js';
|
|
20
|
+
import { CellGrantCreateAuditMetadata, CellGrantRevokeAuditMetadata } from './cell_grant_audit_metadata.js';
|
|
21
|
+
import { CellFieldSetAuditMetadata, CellFieldDeleteAuditMetadata } from './cell_field_audit_metadata.js';
|
|
22
|
+
import { CellItemInsertAuditMetadata, CellItemMoveAuditMetadata, CellItemDeleteAuditMetadata } from './cell_item_audit_metadata.js';
|
|
23
23
|
/**
|
|
24
24
|
* Cell-layer `event_type → metadata schema` map for `extra_events`.
|
|
25
25
|
*
|
|
@@ -39,5 +39,5 @@ export const cell_audit_events = {
|
|
|
39
39
|
cell_field_delete: CellFieldDeleteAuditMetadata,
|
|
40
40
|
cell_item_insert: CellItemInsertAuditMetadata,
|
|
41
41
|
cell_item_move: CellItemMoveAuditMetadata,
|
|
42
|
-
cell_item_delete: CellItemDeleteAuditMetadata
|
|
42
|
+
cell_item_delete: CellItemDeleteAuditMetadata
|
|
43
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell_audit_metadata.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_audit_metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"cell_audit_metadata.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_audit_metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB;;;;iBAI5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB;;;;;;iBAMjC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;;;;;;;iBAIpC,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -21,7 +21,7 @@ import { Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
|
21
21
|
export const CellAuditMetadata = z.looseObject({
|
|
22
22
|
cell_id: Uuid,
|
|
23
23
|
kind: z.string().optional(),
|
|
24
|
-
path: z.string().nullable().optional()
|
|
24
|
+
path: z.string().nullable().optional()
|
|
25
25
|
});
|
|
26
26
|
/**
|
|
27
27
|
* Metadata envelope for `cell_clone`.
|
|
@@ -42,7 +42,7 @@ export const CellCloneAuditMetadata = z.looseObject({
|
|
|
42
42
|
new_id: Uuid,
|
|
43
43
|
deep: z.boolean(),
|
|
44
44
|
item_count: z.number().int().nonnegative(),
|
|
45
|
-
kind: z.string().optional()
|
|
45
|
+
kind: z.string().optional()
|
|
46
46
|
});
|
|
47
47
|
/**
|
|
48
48
|
* Metadata envelope for `cell_moderate`. `cell_id` is the moderated
|
|
@@ -53,5 +53,5 @@ export const CellCloneAuditMetadata = z.looseObject({
|
|
|
53
53
|
export const CellModerateAuditMetadata = z.looseObject({
|
|
54
54
|
cell_id: Uuid,
|
|
55
55
|
root_id: Uuid,
|
|
56
|
-
moderation: z.enum(['approved', 'rejected'])
|
|
56
|
+
moderation: z.enum(['approved', 'rejected'])
|
|
57
57
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell_authorize.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_authorize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"cell_authorize.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_authorize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAIrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AA+DhE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,GACzB,MAAM,cAAc,GAAG,IAAI,EAC3B,MAAM,OAAO,EACb,QAAQ,aAAa,CAAC,YAAY,CAAC,GAAG,IAAI,KACxC,OAMF,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,GACzB,MAAM,cAAc,GAAG,IAAI,EAC3B,MAAM,OAAO,EACb,QAAQ,aAAa,CAAC,YAAY,CAAC,GAAG,IAAI,KACxC,OAUF,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,cAAc,GAAG,IAAI,EAAE,MAAM,OAAO,KAAG,OAI5E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell_data_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_data_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"cell_data_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_data_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;;;iBAGnB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell_field_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_field_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"cell_field_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_field_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,gFAAgF;AAChF,eAAO,MAAM,+CAA+C,EAC3D,2CAAoD,CAAC;AAItD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAA2B,CAAC;AAC9D,eAAO,MAAM,aAAa,yDAAiE,CAAC;AAC5F,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,2EAA2E;AAC3E,eAAO,MAAM,SAAS;;;;;kBAKpB,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAIlD;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;kBAO5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,eAAO,MAAM,kBAAkB;;;;;;;kBAAuC,CAAC;AACvE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAIpE;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;kBAI/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,eAAO,MAAM,qBAAqB;;;kBAGhC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAI1E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB;;;;;;kBAoB5B,CAAC;AACJ,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,eAAO,MAAM,mBAAmB;;;;;;;kBAE9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAItE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;CAWF,CAAC;AAEtC,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;CAWL,CAAC;AAEtC,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYH,CAAC;AAEtC,2EAA2E;AAC3E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI9B,CAAC"}
|
|
@@ -29,7 +29,7 @@ export const FieldJson = z.strictObject({
|
|
|
29
29
|
source_id: Uuid,
|
|
30
30
|
name: z.string(),
|
|
31
31
|
target_id: Uuid,
|
|
32
|
-
created_at: z.string()
|
|
32
|
+
created_at: z.string()
|
|
33
33
|
});
|
|
34
34
|
// -- cell_field_set ---------------------------------------------------------
|
|
35
35
|
/**
|
|
@@ -39,10 +39,10 @@ export const FieldJson = z.strictObject({
|
|
|
39
39
|
export const CellFieldSetInput = z.strictObject({
|
|
40
40
|
source_id: Uuid.meta({ description: 'Cell whose field to set.' }),
|
|
41
41
|
name: CellFieldName.meta({
|
|
42
|
-
description: 'Field name. snake_case identifier; max 64 chars.'
|
|
42
|
+
description: 'Field name. snake_case identifier; max 64 chars.'
|
|
43
43
|
}),
|
|
44
44
|
target_id: Uuid.meta({ description: 'Cell the field points at.' }),
|
|
45
|
-
acting: ActingActor
|
|
45
|
+
acting: ActingActor
|
|
46
46
|
});
|
|
47
47
|
export const CellFieldSetOutput = z.strictObject({ field: FieldJson });
|
|
48
48
|
// -- cell_field_delete ------------------------------------------------------
|
|
@@ -53,11 +53,11 @@ export const CellFieldSetOutput = z.strictObject({ field: FieldJson });
|
|
|
53
53
|
export const CellFieldDeleteInput = z.strictObject({
|
|
54
54
|
source_id: Uuid.meta({ description: 'Cell whose field to delete.' }),
|
|
55
55
|
name: CellFieldName.meta({ description: 'Field name to delete.' }),
|
|
56
|
-
acting: ActingActor
|
|
56
|
+
acting: ActingActor
|
|
57
57
|
});
|
|
58
58
|
export const CellFieldDeleteOutput = z.strictObject({
|
|
59
59
|
ok: z.literal(true),
|
|
60
|
-
deleted: z.boolean()
|
|
60
|
+
deleted: z.boolean()
|
|
61
61
|
});
|
|
62
62
|
// -- cell_field_list --------------------------------------------------------
|
|
63
63
|
/**
|
|
@@ -74,24 +74,24 @@ export const CellFieldDeleteOutput = z.strictObject({
|
|
|
74
74
|
export const CellFieldListInput = z
|
|
75
75
|
.strictObject({
|
|
76
76
|
source_id: Uuid.optional().meta({
|
|
77
|
-
description: 'List forward fields whose source is this cell.'
|
|
77
|
+
description: 'List forward fields whose source is this cell.'
|
|
78
78
|
}),
|
|
79
79
|
target_id: Uuid.optional().meta({
|
|
80
|
-
description: 'List reverse upfields whose target is this cell.'
|
|
80
|
+
description: 'List reverse upfields whose target is this cell.'
|
|
81
81
|
}),
|
|
82
82
|
name_after: CellFieldName.optional().meta({
|
|
83
|
-
description: 'Cursor for forward pagination — return rows whose name > this lex. Forward only.'
|
|
83
|
+
description: 'Cursor for forward pagination — return rows whose name > this lex. Forward only.'
|
|
84
84
|
}),
|
|
85
85
|
limit: z.number().int().positive().max(500).optional().meta({
|
|
86
|
-
description: 'Page size cap (max 500). Forward only. Omit for unbounded — explicit list calls escape the bundled `cell_get` cap.'
|
|
86
|
+
description: 'Page size cap (max 500). Forward only. Omit for unbounded — explicit list calls escape the bundled `cell_get` cap.'
|
|
87
87
|
}),
|
|
88
|
-
acting: ActingActor
|
|
88
|
+
acting: ActingActor
|
|
89
89
|
})
|
|
90
90
|
.refine((v) => Boolean(v.source_id) !== Boolean(v.target_id), {
|
|
91
|
-
message: ERROR_CELL_FIELD_LIST_REQUIRES_SOURCE_OR_TARGET
|
|
91
|
+
message: ERROR_CELL_FIELD_LIST_REQUIRES_SOURCE_OR_TARGET
|
|
92
92
|
});
|
|
93
93
|
export const CellFieldListOutput = z.strictObject({
|
|
94
|
-
fields: z.array(FieldJson)
|
|
94
|
+
fields: z.array(FieldJson)
|
|
95
95
|
});
|
|
96
96
|
// -- Action specs -----------------------------------------------------------
|
|
97
97
|
export const cell_field_set_action_spec = {
|
|
@@ -103,7 +103,7 @@ export const cell_field_set_action_spec = {
|
|
|
103
103
|
input: CellFieldSetInput,
|
|
104
104
|
output: CellFieldSetOutput,
|
|
105
105
|
async: true,
|
|
106
|
-
description: 'Set a named relation `(source.name) → target`. UPSERT on `(source_id, name)`: re-pointing replaces in place. Caller must be able to edit `source` and view `target`; both gate via `can_edit_cell` / `can_view_cell`.'
|
|
106
|
+
description: 'Set a named relation `(source.name) → target`. UPSERT on `(source_id, name)`: re-pointing replaces in place. Caller must be able to edit `source` and view `target`; both gate via `can_edit_cell` / `can_view_cell`.'
|
|
107
107
|
};
|
|
108
108
|
export const cell_field_delete_action_spec = {
|
|
109
109
|
method: 'cell_field_delete',
|
|
@@ -114,7 +114,7 @@ export const cell_field_delete_action_spec = {
|
|
|
114
114
|
input: CellFieldDeleteInput,
|
|
115
115
|
output: CellFieldDeleteOutput,
|
|
116
116
|
async: true,
|
|
117
|
-
description: 'Delete a named relation. Idempotent — `deleted: false` when no row matched. Caller must be able to edit `source`.'
|
|
117
|
+
description: 'Delete a named relation. Idempotent — `deleted: false` when no row matched. Caller must be able to edit `source`.'
|
|
118
118
|
};
|
|
119
119
|
export const cell_field_list_action_spec = {
|
|
120
120
|
method: 'cell_field_list',
|
|
@@ -126,11 +126,11 @@ export const cell_field_list_action_spec = {
|
|
|
126
126
|
output: CellFieldListOutput,
|
|
127
127
|
async: true,
|
|
128
128
|
rate_limit: 'ip',
|
|
129
|
-
description: 'List forward fields (pass `source_id`) or reverse upfields (pass `target_id`). Forward listing filters targets to those the caller may view (strict target-visibility). Reverse listing has 2-layer authz: gate on `can_view_cell(target)` first (404 otherwise), then filter rows by per-source `can_view_cell`. Per-IP rate-limited — symmetric with `cell_get` to bound public-surface id-walking.'
|
|
129
|
+
description: 'List forward fields (pass `source_id`) or reverse upfields (pass `target_id`). Forward listing filters targets to those the caller may view (strict target-visibility). Reverse listing has 2-layer authz: gate on `can_view_cell(target)` first (404 otherwise), then filter rows by per-source `can_view_cell`. Per-IP rate-limited — symmetric with `cell_get` to bound public-surface id-walking.'
|
|
130
130
|
};
|
|
131
131
|
/** All cell_field action specs — composed into `all_cell_action_specs`. */
|
|
132
132
|
export const all_cell_field_action_specs = [
|
|
133
133
|
cell_field_set_action_spec,
|
|
134
134
|
cell_field_delete_action_spec,
|
|
135
|
-
cell_field_list_action_spec
|
|
135
|
+
cell_field_list_action_spec
|
|
136
136
|
];
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
* @module
|
|
25
25
|
*/
|
|
26
26
|
import { type RpcAction } from '../actions/action_rpc.js';
|
|
27
|
-
import type {
|
|
27
|
+
import type { ActionFactoryDeps } from './deps.js';
|
|
28
28
|
import { type FieldJson } from './cell_field_action_specs.js';
|
|
29
29
|
import { type CellFieldRow } from '../db/cell_field_queries.js';
|
|
30
|
-
export type CellFieldActionDeps =
|
|
30
|
+
export type CellFieldActionDeps = ActionFactoryDeps;
|
|
31
31
|
export declare const to_field_json: (row: CellFieldRow) => FieldJson;
|
|
32
32
|
/** Create the three `cell_field_*` RPC actions. */
|
|
33
33
|
export declare const create_cell_field_actions: (deps: CellFieldActionDeps) => Array<RpcAction>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell_field_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_field_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAIN,KAAK,SAAS,EACd,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"cell_field_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_field_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAIN,KAAK,SAAS,EACd,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAUN,KAAK,SAAS,EACd,MAAM,8BAA8B,CAAC;AAMtC,OAAO,EAKN,KAAK,YAAY,EACjB,MAAM,6BAA6B,CAAC;AAMrC,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAEpD,eAAO,MAAM,aAAa,GAAI,KAAK,YAAY,KAAG,SAKhD,CAAC;AAEH,mDAAmD;AACnD,eAAO,MAAM,yBAAyB,GAAI,MAAM,mBAAmB,KAAG,KAAK,CAAC,SAAS,CAmIpF,CAAC"}
|
|
@@ -23,20 +23,20 @@
|
|
|
23
23
|
*
|
|
24
24
|
* @module
|
|
25
25
|
*/
|
|
26
|
-
import { rpc_action
|
|
26
|
+
import { rpc_action } from '../actions/action_rpc.js';
|
|
27
27
|
import { jsonrpc_errors } from '../http/jsonrpc_errors.js';
|
|
28
|
-
import { cell_field_set_action_spec, cell_field_delete_action_spec, cell_field_list_action_spec
|
|
28
|
+
import { cell_field_set_action_spec, cell_field_delete_action_spec, cell_field_list_action_spec } from './cell_field_action_specs.js';
|
|
29
29
|
import { ERROR_CELL_NOT_FOUND } from './cell_action_specs.js';
|
|
30
30
|
import { can_view_cell, can_edit_cell } from './cell_authorize.js';
|
|
31
31
|
import { filter_visible_target_ids } from './cell_relation_visibility.js';
|
|
32
32
|
import { query_cell_get } from '../db/cell_queries.js';
|
|
33
33
|
import { query_cell_grant_list_for_cell } from '../db/cell_grant_queries.js';
|
|
34
|
-
import { query_cell_field_set, query_cell_field_delete, query_cell_field_list_for_source, query_cell_field_list_for_target
|
|
34
|
+
import { query_cell_field_set, query_cell_field_delete, query_cell_field_list_for_source, query_cell_field_list_for_target } from '../db/cell_field_queries.js';
|
|
35
35
|
export const to_field_json = (row) => ({
|
|
36
36
|
source_id: row.source_id,
|
|
37
37
|
name: row.name,
|
|
38
38
|
target_id: row.target_id,
|
|
39
|
-
created_at: typeof row.created_at === 'string' ? row.created_at : row.created_at.toISOString()
|
|
39
|
+
created_at: typeof row.created_at === 'string' ? row.created_at : row.created_at.toISOString()
|
|
40
40
|
});
|
|
41
41
|
/** Create the three `cell_field_*` RPC actions. */
|
|
42
42
|
export const create_cell_field_actions = (deps) => {
|
|
@@ -65,7 +65,7 @@ export const create_cell_field_actions = (deps) => {
|
|
|
65
65
|
const row = await query_cell_field_set(ctx, {
|
|
66
66
|
source_id: input.source_id,
|
|
67
67
|
name: input.name,
|
|
68
|
-
target_id: input.target_id
|
|
68
|
+
target_id: input.target_id
|
|
69
69
|
});
|
|
70
70
|
deps.audit.emit(ctx, {
|
|
71
71
|
event_type: 'cell_field_set',
|
|
@@ -75,8 +75,8 @@ export const create_cell_field_actions = (deps) => {
|
|
|
75
75
|
metadata: {
|
|
76
76
|
source_id: row.source_id,
|
|
77
77
|
name: row.name,
|
|
78
|
-
target_id: row.target_id
|
|
79
|
-
}
|
|
78
|
+
target_id: row.target_id
|
|
79
|
+
}
|
|
80
80
|
});
|
|
81
81
|
return { field: to_field_json(row) };
|
|
82
82
|
};
|
|
@@ -100,8 +100,8 @@ export const create_cell_field_actions = (deps) => {
|
|
|
100
100
|
metadata: {
|
|
101
101
|
source_id: deleted.source_id,
|
|
102
102
|
name: deleted.name,
|
|
103
|
-
target_id: deleted.target_id
|
|
104
|
-
}
|
|
103
|
+
target_id: deleted.target_id
|
|
104
|
+
}
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
return { ok: true, deleted: deleted !== null };
|
|
@@ -121,7 +121,7 @@ export const create_cell_field_actions = (deps) => {
|
|
|
121
121
|
}
|
|
122
122
|
const rows = await query_cell_field_list_for_source(ctx, source.id, {
|
|
123
123
|
limit: input.limit,
|
|
124
|
-
name_after: input.name_after
|
|
124
|
+
name_after: input.name_after
|
|
125
125
|
});
|
|
126
126
|
const visible_targets = await filter_visible_target_ids(ctx, auth, rows.map((r) => r.target_id));
|
|
127
127
|
return { fields: rows.filter((r) => visible_targets.has(r.target_id)).map(to_field_json) };
|
|
@@ -148,6 +148,6 @@ export const create_cell_field_actions = (deps) => {
|
|
|
148
148
|
return [
|
|
149
149
|
rpc_action(cell_field_set_action_spec, set_handler),
|
|
150
150
|
rpc_action(cell_field_delete_action_spec, delete_handler),
|
|
151
|
-
rpc_action(cell_field_list_action_spec, list_handler)
|
|
151
|
+
rpc_action(cell_field_list_action_spec, list_handler)
|
|
152
152
|
];
|
|
153
153
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell_field_audit_metadata.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_field_audit_metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"cell_field_audit_metadata.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_field_audit_metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;;;;iBAIpC,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAElF,iDAAiD;AACjD,eAAO,MAAM,4BAA4B;;;;iBAIvC,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
|
|
@@ -18,11 +18,11 @@ import { Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
|
18
18
|
export const CellFieldSetAuditMetadata = z.looseObject({
|
|
19
19
|
source_id: Uuid,
|
|
20
20
|
name: z.string(),
|
|
21
|
-
target_id: Uuid
|
|
21
|
+
target_id: Uuid
|
|
22
22
|
});
|
|
23
23
|
/** Metadata envelope for `cell_field_delete`. */
|
|
24
24
|
export const CellFieldDeleteAuditMetadata = z.looseObject({
|
|
25
25
|
source_id: Uuid,
|
|
26
26
|
name: z.string(),
|
|
27
|
-
target_id: Uuid
|
|
27
|
+
target_id: Uuid
|
|
28
28
|
});
|