@fuzdev/fuz_app 0.180.0 → 0.182.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/CLAUDE.md +38 -20
- package/dist/actions/action_rpc.d.ts +25 -6
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +56 -48
- package/dist/actions/action_types.d.ts +31 -13
- package/dist/actions/action_types.d.ts.map +1 -1
- package/dist/actions/action_types.js +1 -1
- package/dist/actions/notification_sender.d.ts +83 -0
- package/dist/actions/notification_sender.d.ts.map +1 -0
- package/dist/actions/notification_sender.js +85 -0
- package/dist/actions/perform_action.d.ts +13 -4
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +27 -18
- package/dist/actions/register_action_ws.d.ts +20 -2
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +17 -5
- package/dist/actions/ws_socket_session.d.ts +3 -0
- package/dist/actions/ws_socket_session.d.ts.map +1 -1
- package/dist/actions/ws_socket_session.js +3 -2
- package/dist/auth/CLAUDE.md +84 -59
- package/dist/auth/account_actions.d.ts.map +1 -1
- package/dist/auth/account_actions.js +30 -3
- package/dist/auth/account_queries.d.ts +213 -2
- package/dist/auth/account_queries.d.ts.map +1 -1
- package/dist/auth/account_queries.js +255 -2
- package/dist/auth/account_route_schema.d.ts +26 -16
- package/dist/auth/account_route_schema.d.ts.map +1 -1
- package/dist/auth/account_route_schema.js +10 -24
- package/dist/auth/account_routes.d.ts +5 -7
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +110 -89
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +117 -25
- package/dist/auth/api_token_queries.d.ts +29 -12
- package/dist/auth/api_token_queries.d.ts.map +1 -1
- package/dist/auth/api_token_queries.js +42 -27
- package/dist/auth/audit_log_route_schema.d.ts +1 -1
- package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_routes.d.ts +1 -1
- package/dist/auth/audit_log_routes.d.ts.map +1 -1
- package/dist/auth/audit_log_routes.js +10 -12
- package/dist/auth/audit_log_schema.js +4 -4
- package/dist/auth/bearer_auth.d.ts +4 -3
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +37 -32
- package/dist/auth/bootstrap_account.d.ts +65 -37
- package/dist/auth/bootstrap_account.d.ts.map +1 -1
- package/dist/auth/bootstrap_account.js +115 -66
- package/dist/auth/bootstrap_route_schema.d.ts +6 -2
- package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
- package/dist/auth/bootstrap_route_schema.js +7 -2
- package/dist/auth/bootstrap_routes.d.ts +50 -33
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/bootstrap_routes.js +109 -87
- package/dist/auth/bootstrap_token_store.d.ts +60 -0
- package/dist/auth/bootstrap_token_store.d.ts.map +1 -0
- package/dist/auth/bootstrap_token_store.js +39 -0
- package/dist/auth/credential_headers.d.ts +71 -0
- package/dist/auth/credential_headers.d.ts.map +1 -0
- package/dist/auth/credential_headers.js +100 -0
- package/dist/auth/daemon_token.d.ts +13 -1
- package/dist/auth/daemon_token.d.ts.map +1 -1
- package/dist/auth/daemon_token.js +14 -2
- package/dist/auth/daemon_token_middleware.d.ts +10 -11
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +39 -30
- package/dist/auth/deps.d.ts +10 -11
- package/dist/auth/deps.d.ts.map +1 -1
- package/dist/auth/invite_queries.d.ts +18 -0
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_queries.js +24 -0
- package/dist/auth/request_context.d.ts +97 -76
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +93 -104
- package/dist/auth/resolved_auth.d.ts +10 -5
- package/dist/auth/resolved_auth.d.ts.map +1 -1
- package/dist/auth/resolved_auth.js +2 -2
- package/dist/auth/role_grant_offer_action_specs.d.ts +2 -2
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_action_specs.js +5 -3
- package/dist/auth/role_grant_offer_actions.d.ts +7 -11
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +97 -106
- package/dist/auth/role_grant_offer_ddl.d.ts +7 -1
- package/dist/auth/role_grant_offer_ddl.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_ddl.js +9 -2
- package/dist/auth/role_grant_offer_notifications.d.ts +87 -38
- package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_notifications.js +75 -22
- package/dist/auth/role_grant_offer_queries.d.ts +143 -9
- package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_queries.js +266 -66
- package/dist/auth/role_grant_offer_schema.js +1 -1
- package/dist/auth/role_grant_queries.d.ts +57 -10
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.js +81 -22
- package/dist/auth/role_grant_sql.d.ts +21 -0
- package/dist/auth/role_grant_sql.d.ts.map +1 -1
- package/dist/auth/role_grant_sql.js +21 -0
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +9 -2
- package/dist/auth/session_cookie.d.ts +105 -25
- package/dist/auth/session_cookie.d.ts.map +1 -1
- package/dist/auth/session_cookie.js +124 -15
- package/dist/auth/session_middleware.d.ts +83 -54
- package/dist/auth/session_middleware.d.ts.map +1 -1
- package/dist/auth/session_middleware.js +92 -66
- package/dist/auth/session_queries.d.ts +95 -14
- package/dist/auth/session_queries.d.ts.map +1 -1
- package/dist/auth/session_queries.js +98 -19
- package/dist/auth/signup_route_schema.d.ts +5 -5
- package/dist/auth/signup_route_schema.d.ts.map +1 -1
- package/dist/auth/signup_route_schema.js +4 -4
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +17 -14
- package/dist/auth/standard_rpc_actions.d.ts +6 -19
- package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
- package/dist/auth/standard_rpc_actions.js +5 -6
- package/dist/auth/token_scope.d.ts +6 -8
- package/dist/auth/token_scope.d.ts.map +1 -1
- package/dist/auth/token_scope.js +6 -9
- package/dist/dev/setup.d.ts +6 -1
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +42 -34
- package/dist/hono_context.d.ts +21 -0
- package/dist/hono_context.d.ts.map +1 -1
- package/dist/hono_context.js +17 -0
- package/dist/http/CLAUDE.md +156 -48
- package/dist/http/auth_shape.d.ts +4 -4
- package/dist/http/common_routes.js +1 -1
- package/dist/http/db_routes.d.ts +4 -3
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +14 -14
- package/dist/http/dev_route_error_check.d.ts +6 -3
- package/dist/http/dev_route_error_check.d.ts.map +1 -1
- package/dist/http/dev_route_error_check.js +6 -3
- package/dist/http/dev_set_cookie_check.d.ts +53 -0
- package/dist/http/dev_set_cookie_check.d.ts.map +1 -0
- package/dist/http/dev_set_cookie_check.js +80 -0
- package/dist/http/error_schemas.d.ts +45 -22
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +53 -26
- package/dist/http/header_lines.d.ts +42 -0
- package/dist/http/header_lines.d.ts.map +1 -0
- package/dist/http/header_lines.js +80 -0
- package/dist/http/host.d.ts +12 -9
- package/dist/http/host.d.ts.map +1 -1
- package/dist/http/host.js +25 -20
- package/dist/http/origin.d.ts +7 -22
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +11 -25
- package/dist/http/proxy.d.ts +1 -0
- package/dist/http/proxy.d.ts.map +1 -1
- package/dist/http/proxy.js +3 -0
- package/dist/http/request_headers.d.ts +95 -0
- package/dist/http/request_headers.d.ts.map +1 -0
- package/dist/http/request_headers.js +110 -0
- package/dist/http/request_target.d.ts +134 -0
- package/dist/http/request_target.d.ts.map +1 -0
- package/dist/http/request_target.js +193 -0
- package/dist/http/route_error_check.d.ts +4 -11
- package/dist/http/route_error_check.d.ts.map +1 -1
- package/dist/http/route_error_check.js +4 -21
- package/dist/http/route_result.d.ts +127 -23
- package/dist/http/route_result.d.ts.map +1 -1
- package/dist/http/route_result.js +97 -19
- package/dist/http/route_spec.d.ts +299 -83
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +548 -71
- package/dist/http/simple_request.d.ts +19 -14
- package/dist/http/simple_request.d.ts.map +1 -1
- package/dist/http/simple_request.js +17 -29
- package/dist/http/surface.d.ts +2 -0
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +4 -1
- package/dist/realtime/outbound_budget.d.ts +1 -2
- package/dist/realtime/outbound_budget.d.ts.map +1 -1
- package/dist/realtime/outbound_budget.js +1 -2
- package/dist/realtime/sse.d.ts +47 -17
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +115 -93
- package/dist/realtime/sse_constants.d.ts +7 -1
- package/dist/realtime/sse_constants.d.ts.map +1 -1
- package/dist/realtime/sse_constants.js +12 -1
- package/dist/realtime/sse_registry.d.ts +3 -3
- package/dist/realtime/sse_registry.js +3 -3
- package/dist/runtime/deps.d.ts +20 -4
- package/dist/runtime/deps.d.ts.map +1 -1
- package/dist/runtime/mock.d.ts +7 -1
- package/dist/runtime/mock.d.ts.map +1 -1
- package/dist/runtime/mock.js +33 -3
- package/dist/runtime/node.d.ts.map +1 -1
- package/dist/runtime/node.js +2 -1
- package/dist/runtime/secure_file.d.ts +71 -10
- package/dist/runtime/secure_file.d.ts.map +1 -1
- package/dist/runtime/secure_file.js +91 -11
- package/dist/server/app_backend.d.ts +0 -8
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_backend.js +4 -4
- package/dist/server/app_server.d.ts +54 -33
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +69 -41
- package/dist/server/serve_fact_route.d.ts +3 -3
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +59 -55
- package/dist/server/static.d.ts +20 -0
- package/dist/server/static.d.ts.map +1 -1
- package/dist/server/static.js +56 -8
- package/dist/server/unmatched_route.d.ts +42 -0
- package/dist/server/unmatched_route.d.ts.map +1 -0
- package/dist/server/unmatched_route.js +64 -0
- package/dist/testing/CLAUDE.md +406 -1202
- package/dist/testing/app_server.d.ts +3 -1
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +5 -9
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +3 -2
- package/dist/testing/cross_backend/account_lifecycle.d.ts +11 -4
- package/dist/testing/cross_backend/account_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/account_lifecycle.js +320 -6
- package/dist/testing/cross_backend/build_test_backend_paths.d.ts +4 -1
- package/dist/testing/cross_backend/build_test_backend_paths.d.ts.map +1 -1
- package/dist/testing/cross_backend/build_test_backend_paths.js +1 -1
- package/dist/testing/cross_backend/capabilities.d.ts +68 -5
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/capabilities.js +20 -4
- package/dist/testing/cross_backend/cell_gated_create.js +1 -1
- package/dist/testing/cross_backend/conformance_case.d.ts +63 -21
- package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.d.ts +54 -12
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +179 -23
- package/dist/testing/cross_backend/cookie_attributes.js +1 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts +7 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.js +3 -3
- package/dist/testing/cross_backend/credential_conformance.d.ts +196 -0
- package/dist/testing/cross_backend/credential_conformance.d.ts.map +1 -0
- package/dist/testing/cross_backend/credential_conformance.js +296 -0
- package/dist/testing/cross_backend/credential_conformance.json +1284 -0
- package/dist/testing/cross_backend/credential_conformance_wire.d.ts +40 -0
- package/dist/testing/cross_backend/credential_conformance_wire.d.ts.map +1 -0
- package/dist/testing/cross_backend/credential_conformance_wire.js +293 -0
- package/dist/testing/cross_backend/credential_header_robustness.d.ts +1 -3
- package/dist/testing/cross_backend/credential_header_robustness.d.ts.map +1 -1
- package/dist/testing/cross_backend/credential_header_robustness.js +24 -55
- package/dist/testing/cross_backend/credential_wire.d.ts +112 -0
- package/dist/testing/cross_backend/credential_wire.d.ts.map +1 -0
- package/dist/testing/cross_backend/credential_wire.js +188 -0
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +22 -2
- package/dist/testing/cross_backend/default_spine_surface.d.ts +1 -26
- package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_spine_surface.js +3 -7
- package/dist/testing/cross_backend/differential.d.ts +1 -1
- package/dist/testing/cross_backend/differential.d.ts.map +1 -1
- package/dist/testing/cross_backend/differential.js +3 -2
- package/dist/testing/cross_backend/differential_normalize.d.ts +23 -6
- package/dist/testing/cross_backend/differential_normalize.d.ts.map +1 -1
- package/dist/testing/cross_backend/differential_normalize.js +11 -5
- package/dist/testing/cross_backend/full_spine_mount.d.ts +4 -10
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +11 -4
- package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/identity_parity.js +4 -0
- package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/in_process_setup.js +78 -4
- package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
- package/dist/testing/cross_backend/login_security.js +13 -10
- package/dist/testing/cross_backend/peer_ping_ws.d.ts +1 -1
- package/dist/testing/cross_backend/peer_ping_ws.js +2 -2
- package/dist/testing/cross_backend/request_header_conformance.d.ts +174 -0
- package/dist/testing/cross_backend/request_header_conformance.d.ts.map +1 -0
- package/dist/testing/cross_backend/request_header_conformance.js +196 -0
- package/dist/testing/cross_backend/request_header_conformance.json +1158 -0
- package/dist/testing/cross_backend/request_header_conformance_wire.d.ts +39 -0
- package/dist/testing/cross_backend/request_header_conformance_wire.d.ts.map +1 -0
- package/dist/testing/cross_backend/request_header_conformance_wire.js +284 -0
- package/dist/testing/cross_backend/request_target_conformance.d.ts +298 -0
- package/dist/testing/cross_backend/request_target_conformance.d.ts.map +1 -0
- package/dist/testing/cross_backend/request_target_conformance.js +186 -0
- package/dist/testing/cross_backend/request_target_conformance.json +3765 -0
- package/dist/testing/cross_backend/request_target_conformance_wire.d.ts +32 -0
- package/dist/testing/cross_backend/request_target_conformance_wire.d.ts.map +1 -0
- package/dist/testing/cross_backend/request_target_conformance_wire.js +278 -0
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +173 -1
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts +5 -4
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.js +185 -31
- package/dist/testing/cross_backend/rpc_adversarial.d.ts +6 -4
- package/dist/testing/cross_backend/rpc_adversarial.d.ts.map +1 -1
- package/dist/testing/cross_backend/rpc_adversarial.js +5 -2
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +6 -7
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.js +4 -5
- package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/session_cap.js +82 -34
- package/dist/testing/cross_backend/session_cookie_effect.d.ts +43 -0
- package/dist/testing/cross_backend/session_cookie_effect.d.ts.map +1 -0
- package/dist/testing/cross_backend/session_cookie_effect.js +103 -0
- package/dist/testing/cross_backend/session_login.d.ts +24 -0
- package/dist/testing/cross_backend/session_login.d.ts.map +1 -0
- package/dist/testing/cross_backend/session_login.js +31 -0
- package/dist/testing/cross_backend/setup.d.ts +117 -0
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +193 -9
- package/dist/testing/cross_backend/simple_request.d.ts.map +1 -1
- package/dist/testing/cross_backend/simple_request.js +5 -0
- package/dist/testing/cross_backend/spine_suites.d.ts +9 -1
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +88 -5
- package/dist/testing/cross_backend/spine_surface_constants.d.ts +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.js +1 -0
- package/dist/testing/cross_backend/sse_round_trip.d.ts +8 -5
- package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/sse_round_trip.js +205 -64
- package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_backdoor.js +5 -2
- package/dist/testing/cross_backend/testing_credential_read.d.ts +165 -0
- package/dist/testing/cross_backend/testing_credential_read.d.ts.map +1 -0
- package/dist/testing/cross_backend/testing_credential_read.js +175 -0
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +19 -0
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +22 -6
- package/dist/testing/cross_backend/token_lifetime.d.ts.map +1 -1
- package/dist/testing/cross_backend/token_lifetime.js +58 -2
- package/dist/testing/cross_backend/transport_composition.d.ts +2 -4
- package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
- package/dist/testing/cross_backend/transport_composition.js +13 -10
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +5 -3
- package/dist/testing/cross_backend/ws_endpoint.d.ts +11 -1
- package/dist/testing/cross_backend/ws_endpoint.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_endpoint.js +19 -2
- package/dist/testing/cross_backend/ws_role_gated.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_role_gated.js +2 -3
- package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_round_trip.js +28 -12
- package/dist/testing/cross_backend/xfail.d.ts +44 -11
- package/dist/testing/cross_backend/xfail.d.ts.map +1 -1
- package/dist/testing/cross_backend/xfail.js +68 -23
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +4 -3
- package/dist/testing/integration.d.ts +1 -2
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +14 -8
- package/dist/testing/integration_helpers.d.ts +50 -3
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +87 -9
- package/dist/testing/middleware.d.ts +3 -1
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +14 -7
- package/dist/testing/resolved_auth.d.ts +3 -1
- package/dist/testing/resolved_auth.d.ts.map +1 -1
- package/dist/testing/resolved_auth.js +4 -4
- package/dist/testing/round_trip.d.ts +6 -2
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/round_trip.js +17 -6
- package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
- package/dist/testing/rpc_envelope_cases.js +7 -0
- package/dist/testing/rpc_helpers.d.ts +4 -2
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +6 -1
- package/dist/testing/rpc_round_trip.d.ts +13 -2
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.js +25 -6
- package/dist/testing/schema_generators.d.ts +2 -2
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +4 -4
- package/dist/testing/stubs.d.ts +2 -2
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +13 -10
- package/dist/testing/transports/fetch_transport.d.ts +6 -3
- package/dist/testing/transports/fetch_transport.d.ts.map +1 -1
- package/dist/testing/transports/fetch_transport.js +31 -19
- package/dist/testing/transports/raw_http.d.ts +61 -1
- package/dist/testing/transports/raw_http.d.ts.map +1 -1
- package/dist/testing/transports/raw_http.js +61 -1
- package/dist/testing/transports/ws_raw_client.d.ts +20 -0
- package/dist/testing/transports/ws_raw_client.d.ts.map +1 -1
- package/dist/testing/transports/ws_raw_client.js +10 -4
- package/dist/testing/transports/ws_transport.d.ts +21 -1
- package/dist/testing/transports/ws_transport.d.ts.map +1 -1
- package/dist/testing/transports/ws_transport.js +58 -20
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +8 -4
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Role grant offer WebSocket notification specs, builders, and the
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Role grant offer WebSocket notification specs, builders, and the helpers
|
|
3
|
+
* the handlers queue them with (`queue_offer_notification`,
|
|
4
|
+
* `queue_supersede_notifications`).
|
|
5
5
|
*
|
|
6
6
|
* These `RemoteNotificationActionSpec`s cover the consentful-role-grants
|
|
7
7
|
* lifecycle events the server pushes to affected accounts:
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* - `role_grant_offer_retracted` → recipient's sockets when a grantor retracts
|
|
11
11
|
* - `role_grant_offer_accepted` → grantor's sockets when the recipient accepts
|
|
12
12
|
* - `role_grant_offer_declined` → grantor's sockets when the recipient declines
|
|
13
|
-
* - `role_grant_offer_supersede` →
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* - `role_grant_offer_supersede` → each live party to a pending offer a
|
|
14
|
+
* cascade ended — a sibling accept, a revoke, an account removal — but the
|
|
15
|
+
* one the cascade's own answer or socket close already covers
|
|
16
16
|
* - `role_grant_revoked` → revokee's sockets when one of their active
|
|
17
17
|
* role_grants is revoked by the `role_grant_revoke` action (companion to the
|
|
18
18
|
* `role_grant_revoke` audit event)
|
|
@@ -29,10 +29,9 @@
|
|
|
29
29
|
* action set of an RPC list that carries the role_grant_offer actions, so the
|
|
30
30
|
* surface lists them on the WS endpoint as `remote_notification` methods. An
|
|
31
31
|
* inbound frame for one is still answered `method_not_found`, as no handler is
|
|
32
|
-
* registered. Under DEV,
|
|
33
|
-
* `
|
|
34
|
-
* against its spec's `input
|
|
35
|
-
* production sends unchecked.
|
|
32
|
+
* registered. Under DEV, `perform_action` hands every action handler a sender
|
|
33
|
+
* wrapped in `create_validated_notification_sender`, so each params object
|
|
34
|
+
* sent is checked against its spec's `input`; production sends unchecked.
|
|
36
35
|
*
|
|
37
36
|
* @module
|
|
38
37
|
*/
|
|
@@ -41,9 +40,10 @@ import { nullable, object, one_of, void as fuz_void, parse } from '@fuzdev/fuz_s
|
|
|
41
40
|
import { Uuid as UuidSchema, bounded_string } from '../primitive_schemas.js';
|
|
42
41
|
import { create_action_event_spec } from '../actions/action_bridge.js';
|
|
43
42
|
import { create_jsonrpc_notification } from '../http/jsonrpc_helpers.js';
|
|
43
|
+
import { emit_after_commit } from '../http/pending_effects.js';
|
|
44
44
|
import { RoleName } from './role_schema.js';
|
|
45
45
|
import { ScopeKindName } from './scope_kind_schema.js';
|
|
46
|
-
import { RoleGrantOfferJson } from './role_grant_offer_schema.js';
|
|
46
|
+
import { RoleGrantOfferJson, to_role_grant_offer_json } from './role_grant_offer_schema.js';
|
|
47
47
|
import { ROLE_GRANT_REVOKED_REASON_LENGTH_MAX } from './account_schema.js';
|
|
48
48
|
// -- Method constants -------------------------------------------------------
|
|
49
49
|
export const ROLE_GRANT_OFFER_RECEIVED_NOTIFICATION_METHOD = 'role_grant_offer_received';
|
|
@@ -74,18 +74,21 @@ export const RoleGrantOfferDeclinedParams = object({
|
|
|
74
74
|
offer: RoleGrantOfferJson
|
|
75
75
|
});
|
|
76
76
|
/**
|
|
77
|
-
* Params for `role_grant_offer_supersede
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
* the
|
|
82
|
-
* the
|
|
83
|
-
*
|
|
84
|
-
*
|
|
77
|
+
* Params for `role_grant_offer_supersede`, sent to a party of a pending offer
|
|
78
|
+
* a cascade ended: a sibling accept (`reason: 'sibling_accepted'`), a revoke of
|
|
79
|
+
* the recipient's grant or of any grant of the grantor's actor
|
|
80
|
+
* (`reason: 'role_grant_revoked'`), or the removal of either party's account
|
|
81
|
+
* (`reason: 'account_deleted'`). `cause_id` points at the accepted offer, the
|
|
82
|
+
* revoked role_grant, or the removed account respectively — the `cause_id` of
|
|
83
|
+
* the offer's `role_grant_offer_supersede` audit row — except on a recipient's
|
|
84
|
+
* frame of its grantor's account removal, where it is the offer's grantor
|
|
85
|
+
* actor (`from_actor_id`), an id the recipient already holds. The audit
|
|
86
|
+
* metadata's reason set is wider: a consumer's scope teardown audits
|
|
87
|
+
* `scope_destroyed`, which no notification carries.
|
|
85
88
|
*/
|
|
86
89
|
export const RoleGrantOfferSupersedeParams = object({
|
|
87
90
|
offer: RoleGrantOfferJson,
|
|
88
|
-
reason: one_of(['sibling_accepted', 'role_grant_revoked', '
|
|
91
|
+
reason: one_of(['sibling_accepted', 'role_grant_revoked', 'account_deleted']),
|
|
89
92
|
cause_id: UuidSchema
|
|
90
93
|
});
|
|
91
94
|
/**
|
|
@@ -157,7 +160,7 @@ export const role_grant_offer_supersede_notification_spec = {
|
|
|
157
160
|
input: RoleGrantOfferSupersedeParams,
|
|
158
161
|
output: fuz_void,
|
|
159
162
|
async: true,
|
|
160
|
-
description: 'A
|
|
163
|
+
description: 'A pending role_grant offer this account was a party to, as its grantor or its recipient, was ended by a sibling accept, a role_grant revoke, or the removal of the other party’s account.'
|
|
161
164
|
};
|
|
162
165
|
export const role_grant_revoked_notification_spec = {
|
|
163
166
|
method: ROLE_GRANT_REVOKED_NOTIFICATION_METHOD,
|
|
@@ -204,7 +207,8 @@ const notification_spec_by_method = new Map(role_grant_offer_notification_action
|
|
|
204
207
|
* a mismatch logged as an error the way DEV output validation logs one; the
|
|
205
208
|
* notification is sent either way, unchanged. A method that is no
|
|
206
209
|
* role_grant_offer notification passes unchecked. In production the sender is
|
|
207
|
-
* returned as it is.
|
|
210
|
+
* returned as it is. `perform_action` wraps the sender of every handler
|
|
211
|
+
* context, so every send site is checked whichever factory it sits in.
|
|
208
212
|
*
|
|
209
213
|
* @param sender - the sender to wrap
|
|
210
214
|
* @param log - where a mismatch is logged
|
|
@@ -233,3 +237,52 @@ export const build_role_grant_offer_accepted_notification = (params) => create_j
|
|
|
233
237
|
export const build_role_grant_offer_declined_notification = (params) => create_jsonrpc_notification(ROLE_GRANT_OFFER_DECLINED_NOTIFICATION_METHOD, params);
|
|
234
238
|
export const build_role_grant_offer_supersede_notification = (params) => create_jsonrpc_notification(ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD, params);
|
|
235
239
|
export const build_role_grant_revoked_notification = (params) => create_jsonrpc_notification(ROLE_GRANT_REVOKED_NOTIFICATION_METHOD, params);
|
|
240
|
+
/**
|
|
241
|
+
* Queue `message` to every socket bound to `account_id`, sent once the
|
|
242
|
+
* handler's transaction commits and dropped when it rolls back, so a
|
|
243
|
+
* notification never announces state that never landed.
|
|
244
|
+
*
|
|
245
|
+
* Twin of the Rust spine's `queue_offer_notification`.
|
|
246
|
+
*
|
|
247
|
+
* @param ctx - the handler context, whose sender the send goes through
|
|
248
|
+
* @param account_id - the recipient account
|
|
249
|
+
* @param message - the notification, from one of the builders above
|
|
250
|
+
*/
|
|
251
|
+
export const queue_offer_notification = (ctx, account_id, message) => {
|
|
252
|
+
const { notification_sender } = ctx;
|
|
253
|
+
emit_after_commit(ctx, () => {
|
|
254
|
+
notification_sender.send_to_account(account_id, message);
|
|
255
|
+
});
|
|
256
|
+
};
|
|
257
|
+
const to_supersede_cause_id = (cause, offer) => cause.kind === 'id' ? cause.id : offer.from_actor_id;
|
|
258
|
+
/**
|
|
259
|
+
* Queue a `role_grant_offer_supersede` notification to the parties of each
|
|
260
|
+
* superseded offer `audience` names, each with its own `cause_id` — the
|
|
261
|
+
* grantor (`from_account_id`, off the cascade's `RETURNING`) and the recipient
|
|
262
|
+
* (`to_account_id`). Sent in the cascade's row order, which is the order of
|
|
263
|
+
* its audit rows, each offer's parties together and its grantor ahead of its
|
|
264
|
+
* recipient — one fixed order, so both spines send a cascade's frames alike.
|
|
265
|
+
*
|
|
266
|
+
* Twin of the Rust spine's `queue_supersede_notifications`.
|
|
267
|
+
*
|
|
268
|
+
* @param ctx - the handler context, whose sender the sends go through
|
|
269
|
+
* @param superseded - the offers the cascade superseded
|
|
270
|
+
* @param reason - why they were superseded
|
|
271
|
+
* @param audience - which party of each offer is told, and the `cause_id` it is sent
|
|
272
|
+
*/
|
|
273
|
+
export const queue_supersede_notifications = (ctx, superseded, reason, audience) => {
|
|
274
|
+
for (const offer of superseded) {
|
|
275
|
+
for (const [party, cause] of [
|
|
276
|
+
[offer.from_account_id, audience.grantor],
|
|
277
|
+
[offer.to_account_id, audience.recipient]
|
|
278
|
+
]) {
|
|
279
|
+
if (!cause)
|
|
280
|
+
continue;
|
|
281
|
+
queue_offer_notification(ctx, party, build_role_grant_offer_supersede_notification({
|
|
282
|
+
offer: to_role_grant_offer_json(offer),
|
|
283
|
+
reason,
|
|
284
|
+
cause_id: to_supersede_cause_id(cause, offer)
|
|
285
|
+
}));
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
};
|
|
@@ -97,13 +97,38 @@ export declare class RoleGrantOfferBuiltinRefusedError extends Error {
|
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
99
|
* Error thrown when `query_role_grant_offer_create` is called with a
|
|
100
|
-
* `to_actor_id` that
|
|
100
|
+
* `to_actor_id` that is no active actor of `to_account_id` — missing,
|
|
101
|
+
* tombstoned, or another account's.
|
|
101
102
|
* Surfaces the actor↔account binding mismatch at the boundary instead of
|
|
102
103
|
* letting the FK silently disagree with the recipient field.
|
|
103
104
|
*/
|
|
104
105
|
export declare class RoleGrantOfferActorAccountMismatchError extends Error {
|
|
105
106
|
constructor();
|
|
106
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Error thrown when the recipient is not an active account.
|
|
110
|
+
*
|
|
111
|
+
* By `query_role_grant_offer_create`: `to_account_id` names no account, a
|
|
112
|
+
* soft-deleted one, or one with no active actor. A deleted recipient and one
|
|
113
|
+
* that never existed are the one refusal, so a caller learns nothing from it
|
|
114
|
+
* that a missing id wouldn't tell; the handler answers it as
|
|
115
|
+
* `role_grant_assign` answers the same recipient. By `query_accept_offer`: the
|
|
116
|
+
* accepting account — the caller — was deleted or purged after its credential
|
|
117
|
+
* was read, and its handler answers the dead credential. Twin of the Rust
|
|
118
|
+
* `RoleGrantOfferError::RecipientNotActive`.
|
|
119
|
+
*/
|
|
120
|
+
export declare class RoleGrantOfferRecipientNotActiveError extends Error {
|
|
121
|
+
constructor();
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Error thrown by `query_role_grant_offer_create` when the grantor is not an
|
|
125
|
+
* active account: its actor is missing or tombstoned, or its account
|
|
126
|
+
* soft-deleted — a delete that committed while the offer was in flight. Twin
|
|
127
|
+
* of the Rust `RoleGrantOfferError::GrantorNotActive`.
|
|
128
|
+
*/
|
|
129
|
+
export declare class RoleGrantOfferGrantorNotActiveError extends Error {
|
|
130
|
+
constructor();
|
|
131
|
+
}
|
|
107
132
|
/**
|
|
108
133
|
* Create a new role_grant offer, or refresh an existing pending offer for the
|
|
109
134
|
* same `(to_account_id, role, scope_id, from_actor_id)` tuple.
|
|
@@ -126,11 +151,24 @@ export declare class RoleGrantOfferActorAccountMismatchError extends Error {
|
|
|
126
151
|
* `query_accept_offer` rejects any actor other than the named one. Closes
|
|
127
152
|
* the audit hole where offer-shape events would otherwise leave
|
|
128
153
|
* `target_actor_id` null even when the recipient binding is known at
|
|
129
|
-
* offer time.
|
|
154
|
+
* offer time. A named actor must be an active actor of `to_account_id`.
|
|
155
|
+
*
|
|
156
|
+
* Both parties must be active accounts, checked here so every caller — the
|
|
157
|
+
* spine's handler and a consumer creating offers on its own path — gets the
|
|
158
|
+
* rule. Both account rows are read under `FOR SHARE` before the insert, in one
|
|
159
|
+
* statement in id order (`query_account_lock_live_many`): an account delete
|
|
160
|
+
* writes its tombstone first, so a delete committed before the read is waited
|
|
161
|
+
* for and seen (the offer is refused), and one after it waits for this
|
|
162
|
+
* transaction to commit and then supersedes the offer with the party's
|
|
163
|
+
* others. Run it inside the caller's transaction, which the lock
|
|
164
|
+
* spans. The self-target check comes first, so an offer to one's own account
|
|
165
|
+
* is refused as that whatever else it names.
|
|
130
166
|
*
|
|
131
167
|
* @mutates `role_grant_offer` table - inserts a new offer or upserts the matching pending row
|
|
132
168
|
* @throws RoleGrantOfferSelfTargetError if the offering actor belongs to `to_account_id`
|
|
133
|
-
* @throws
|
|
169
|
+
* @throws RoleGrantOfferRecipientNotActiveError if `to_account_id` is missing, soft-deleted, or has no active actor
|
|
170
|
+
* @throws RoleGrantOfferActorAccountMismatchError if `to_actor_id` is set but is no active actor of `to_account_id`
|
|
171
|
+
* @throws RoleGrantOfferGrantorNotActiveError if the grantor's actor or account is missing or tombstoned
|
|
134
172
|
*/
|
|
135
173
|
export declare const query_role_grant_offer_create: (deps: QueryDeps, input: CreateRoleGrantOfferInput) => Promise<RoleGrantOffer>;
|
|
136
174
|
/** Result of `query_role_grant_offer_decline` — the declined offer plus the grantor's `account_id`. */
|
|
@@ -197,8 +235,11 @@ export declare const query_role_grant_offer_history_for_account: (deps: QueryDep
|
|
|
197
235
|
* caller's `role_grant_offer_expire` audit inserts — committed together, or
|
|
198
236
|
* rolled back together so the next sweep retries. Concurrent sweeps claim
|
|
199
237
|
* disjoint rows: a row another sweep has stamped but not committed blocks on
|
|
200
|
-
* its row lock, then fails the re-checked `expire_audited_at IS NULL`.
|
|
201
|
-
* `
|
|
238
|
+
* its row lock, then fails the re-checked `expire_audited_at IS NULL`. The
|
|
239
|
+
* rows are locked in id order (`offer_rows_locked_in_id_order`), as every
|
|
240
|
+
* multi-row offer write takes them, so a sweep and a delete, purge, revoke or
|
|
241
|
+
* accept over the same expired offers never wait on each other in opposite
|
|
242
|
+
* orders. `cleanup_expired_role_grant_offers` is the caller.
|
|
202
243
|
*
|
|
203
244
|
* @mutates `role_grant_offer` rows - stamps `expire_audited_at` on each claimed row
|
|
204
245
|
*/
|
|
@@ -227,6 +268,12 @@ export interface AcceptOfferInput {
|
|
|
227
268
|
export interface AcceptOfferResult {
|
|
228
269
|
role_grant: RoleGrant;
|
|
229
270
|
offer: RoleGrantOffer;
|
|
271
|
+
/**
|
|
272
|
+
* The grantor's account (the offer's `from_actor_id` → account), read on the
|
|
273
|
+
* claimed row, so the caller can tell the grantor without a second read.
|
|
274
|
+
* Twin of the Rust `AcceptOfferResult::from_account_id`.
|
|
275
|
+
*/
|
|
276
|
+
from_account_id: Uuid;
|
|
230
277
|
/** `true` if this call is the one that accepted the offer (new role_grant inserted); `false` on a replay (or a race loser) returning the already-created, still-held role_grant — the caller then audits and notifies nothing. */
|
|
231
278
|
created: boolean;
|
|
232
279
|
/**
|
|
@@ -252,9 +299,29 @@ export interface AcceptOfferResult {
|
|
|
252
299
|
* creating a duplicate or throwing — while that grant is still held. A grant
|
|
253
300
|
* revoked since the accept, or gone, makes the offer terminal.
|
|
254
301
|
*
|
|
302
|
+
* Lock order — accounts, then offers, then the grant: the recipient's account
|
|
303
|
+
* row (and, for an unscoped `admin` offer, the grantor's) in id order
|
|
304
|
+
* (`query_account_lock_for_offer_accept`), then the offer and the pending
|
|
305
|
+
* siblings it supersedes in one id-ordered claim, then the grant insert. The
|
|
306
|
+
* accounts first, as every removal of either account takes them first, so a
|
|
307
|
+
* removal and an accept never meet at the offers, the actor, or a grant a
|
|
308
|
+
* purge's cascade reaches; two accepts by one recipient take turns. The
|
|
309
|
+
* offers in id order, as every transaction that writes several offer rows
|
|
310
|
+
* locks them all first in one id-ordered statement (a delete, a purge, a
|
|
311
|
+
* revoke, the expiry sweep). The grantor's authority is read unlocked after
|
|
312
|
+
* the grantor's account lock — the invariant it rests on: every write that
|
|
313
|
+
* ends a grantor's global `admin` takes the grantor's account row first (a
|
|
314
|
+
* revoke of the grant through `query_account_lock_for_revoke`, whether or not
|
|
315
|
+
* its last-admin guard ran; a delete through its write of the row; a purge
|
|
316
|
+
* through `query_account_lock_admins_for_purge` and
|
|
317
|
+
* `query_account_lock_for_purge`; the DB browser's delete, which takes none of
|
|
318
|
+
* them, excepted).
|
|
319
|
+
*
|
|
255
320
|
* Error map:
|
|
256
321
|
* - `RoleGrantOfferNotFoundError` — offer does not exist, or belongs to a
|
|
257
322
|
* different recipient (IDOR guard). The offer row is untouched.
|
|
323
|
+
* - `RoleGrantOfferRecipientNotActiveError` — the recipient's account was
|
|
324
|
+
* deleted or purged since the caller's credential was read.
|
|
258
325
|
* - `RoleGrantOfferAlreadyTerminalError` — offer is declined, retracted, or
|
|
259
326
|
* superseded; or accepted, and its grant revoked, gone, or bound to another
|
|
260
327
|
* actor.
|
|
@@ -262,8 +329,8 @@ export interface AcceptOfferResult {
|
|
|
262
329
|
* - `RoleGrantOfferActorMismatchError` — actor-targeted offer, different actor.
|
|
263
330
|
* - `RoleGrantOfferBuiltinRefusedError` — a builtin-role offer that must not
|
|
264
331
|
* mint: `keeper` at all, a builtin bound to a scope, or one whose grantor no
|
|
265
|
-
* longer holds an active global `admin` (read under
|
|
266
|
-
* stays pending.
|
|
332
|
+
* longer holds an active global `admin` (read under the grantor's account
|
|
333
|
+
* lock). The offer stays pending.
|
|
267
334
|
*
|
|
268
335
|
* Sibling supersede is what closes the "accept a pre-revoke sibling offer
|
|
269
336
|
* to bypass a revoke" path: once A is accepted, B/C/... can no longer be
|
|
@@ -274,6 +341,7 @@ export interface AcceptOfferResult {
|
|
|
274
341
|
* @mutates `role_grant_offer` siblings - stamps `superseded_at` on every other pending offer for the tuple
|
|
275
342
|
* @mutates `audit_log` table - emits `role_grant_offer_accept` + `role_grant_create` + one `role_grant_offer_supersede` per sibling
|
|
276
343
|
* @throws RoleGrantOfferNotFoundError if the offer is missing or belongs to another recipient
|
|
344
|
+
* @throws RoleGrantOfferRecipientNotActiveError if the recipient's account is deleted or gone
|
|
277
345
|
* @throws RoleGrantOfferAlreadyTerminalError if the offer is declined, retracted, or superseded, or accepted with its grant revoked, gone, or bound to another actor
|
|
278
346
|
* @throws RoleGrantOfferExpiredError if the offer is pending but past `expires_at`
|
|
279
347
|
* @throws RoleGrantOfferActorMismatchError if the offer is actor-targeted to a different actor
|
|
@@ -291,8 +359,11 @@ export declare const query_accept_offer: (deps: QueryDeps, input: AcceptOfferInp
|
|
|
291
359
|
* (`account_delete` / `account_purge`, every actor of the account) end the
|
|
292
360
|
* grantor's outgoing pending offers in the same transaction. Each row carries
|
|
293
361
|
* the grantor's `from_account_id`, as every supersede cascade's does; the
|
|
294
|
-
* caller emits a `role_grant_offer_supersede` audit event per entry
|
|
295
|
-
*
|
|
362
|
+
* caller emits a `role_grant_offer_supersede` audit event per entry and
|
|
363
|
+
* queues its notifications (`queue_supersede_notifications`). The rows are
|
|
364
|
+
* taken in id order; a caller that writes other offers too locks them all
|
|
365
|
+
* first (`query_role_grant_offer_lock_for_account_removal`,
|
|
366
|
+
* `query_role_grant_offer_lock_for_revoke`). Twin of the Rust
|
|
296
367
|
* `query_role_grant_offer_supersede_outgoing`.
|
|
297
368
|
*
|
|
298
369
|
* @param deps - query dependencies
|
|
@@ -301,4 +372,67 @@ export declare const query_accept_offer: (deps: QueryDeps, input: AcceptOfferInp
|
|
|
301
372
|
* @mutates `role_grant_offer` rows - stamps `superseded_at` on every pending offer from `from_actor_ids`
|
|
302
373
|
*/
|
|
303
374
|
export declare const query_role_grant_offer_supersede_outgoing: (deps: QueryDeps, from_actor_ids: ReadonlyArray<Uuid>) => Promise<Array<SupersededOffer>>;
|
|
375
|
+
/**
|
|
376
|
+
* Supersede every pending offer **made to** `to_account_id` — the
|
|
377
|
+
* recipient-side cascade of an account delete or purge.
|
|
378
|
+
*
|
|
379
|
+
* An undelete restores the account, so an offer left pending through the
|
|
380
|
+
* delete would come back with it and could then be accepted; superseding it
|
|
381
|
+
* in the delete's transaction makes it terminal for good. Matching on
|
|
382
|
+
* `to_account_id` alone covers the actor-addressed offers too: an offer's
|
|
383
|
+
* `to_actor_id` is bound to its `to_account_id` at create. Each row carries
|
|
384
|
+
* the grantor's `from_account_id`, as every supersede cascade's does; the
|
|
385
|
+
* caller emits a `role_grant_offer_supersede` audit event per entry and
|
|
386
|
+
* queues its notifications (`queue_supersede_notifications`). The rows are
|
|
387
|
+
* taken in id order, after the caller's
|
|
388
|
+
* `query_role_grant_offer_lock_for_account_removal`. Twin of the Rust
|
|
389
|
+
* `query_role_grant_offer_supersede_incoming`.
|
|
390
|
+
*
|
|
391
|
+
* @param deps - query dependencies
|
|
392
|
+
* @param to_account_id - the recipient account whose pending offers end
|
|
393
|
+
* @returns the superseded offers, each with its grantor's account
|
|
394
|
+
* @mutates `role_grant_offer` rows - stamps `superseded_at` on every pending offer to `to_account_id`
|
|
395
|
+
*/
|
|
396
|
+
export declare const query_role_grant_offer_supersede_incoming: (deps: QueryDeps, to_account_id: Uuid) => Promise<Array<SupersededOffer>>;
|
|
397
|
+
/**
|
|
398
|
+
* Lock every pending offer an account removal supersedes — the ones its actors
|
|
399
|
+
* made and the ones made to it — in one statement, in id order.
|
|
400
|
+
*
|
|
401
|
+
* A delete or a purge writes those offers in two statements, the outgoing
|
|
402
|
+
* then the incoming; taken that way, each could hold rows another writer of
|
|
403
|
+
* both sets (a revoke of the account's grant, the expiry sweep) waits on while
|
|
404
|
+
* waiting on rows that writer holds. Locked together first, in the order every
|
|
405
|
+
* multi-row offer write takes its rows, the two supersedes then write rows
|
|
406
|
+
* this transaction already holds. No offer to or from the account can be made
|
|
407
|
+
* meanwhile: an offer create takes both parties' account rows, which the
|
|
408
|
+
* removal has written or locked. Twin of the Rust
|
|
409
|
+
* `query_role_grant_offer_lock_for_account_removal`.
|
|
410
|
+
*
|
|
411
|
+
* @param deps - query dependencies (must be the removal's transaction)
|
|
412
|
+
* @param to_account_id - the removed account
|
|
413
|
+
* @param from_actor_ids - the removed account's actors
|
|
414
|
+
* @mutates `role_grant_offer` rows - row-locks every pending offer to the account or from its actors
|
|
415
|
+
*/
|
|
416
|
+
export declare const query_role_grant_offer_lock_for_account_removal: (deps: QueryDeps, to_account_id: Uuid, from_actor_ids: ReadonlyArray<Uuid>) => Promise<void>;
|
|
417
|
+
/**
|
|
418
|
+
* Lock every pending offer `role_grant_revoke` supersedes — the revokee
|
|
419
|
+
* account's incoming offers of the revoked grant's role and scope, and every
|
|
420
|
+
* offer the revokee's actor made — in one statement, in id order.
|
|
421
|
+
*
|
|
422
|
+
* Taken after the revokee's account row (`query_account_lock_for_revoke`),
|
|
423
|
+
* which keeps any new offer to or from the account out, and before the grant's
|
|
424
|
+
* update: an accept claims its offers before it inserts its grant (whose unique
|
|
425
|
+
* slot waits on a revoke's uncommitted update of the same grant), so a revoke
|
|
426
|
+
* updating the grant first and then reaching the offers the accept holds would
|
|
427
|
+
* close a cycle. Then the revoke's two supersedes write rows it already holds,
|
|
428
|
+
* in the order every multi-row offer write takes its rows. Twin of the Rust
|
|
429
|
+
* `query_role_grant_offer_lock_for_revoke`.
|
|
430
|
+
*
|
|
431
|
+
* @param deps - query dependencies (must be the revoke's transaction)
|
|
432
|
+
* @param actor_id - the revokee actor
|
|
433
|
+
* @param role - the revoked grant's role
|
|
434
|
+
* @param scope_id - the revoked grant's scope, `null` for global
|
|
435
|
+
* @mutates `role_grant_offer` rows - row-locks the pending offers the revoke supersedes
|
|
436
|
+
*/
|
|
437
|
+
export declare const query_role_grant_offer_lock_for_revoke: (deps: QueryDeps, actor_id: Uuid, role: string, scope_id: Uuid | null) => Promise<void>;
|
|
304
438
|
//# sourceMappingURL=role_grant_offer_queries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role_grant_offer_queries.d.ts","sourceRoot":"","sources":["../../src/lib/auth/role_grant_offer_queries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"role_grant_offer_queries.d.ts","sourceRoot":"","sources":["../../src/lib/auth/role_grant_offer_queries.ts"],"names":[],"mappings":"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"}
|