@fuzdev/fuz_app 0.54.0 → 0.56.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 +214 -103
- package/dist/actions/action_bridge.d.ts +8 -5
- package/dist/actions/action_bridge.d.ts.map +1 -1
- package/dist/actions/action_bridge.js +1 -11
- package/dist/actions/action_codegen.d.ts +32 -0
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +35 -15
- package/dist/actions/action_registry.d.ts.map +1 -1
- package/dist/actions/action_registry.js +5 -2
- package/dist/actions/action_rpc.d.ts +141 -22
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +106 -187
- package/dist/actions/action_spec.d.ts +55 -16
- package/dist/actions/action_spec.d.ts.map +1 -1
- package/dist/actions/action_spec.js +16 -11
- package/dist/actions/action_types.d.ts +28 -60
- package/dist/actions/action_types.d.ts.map +1 -1
- package/dist/actions/action_types.js +13 -5
- package/dist/actions/broadcast_api.d.ts +2 -2
- package/dist/actions/broadcast_api.js +2 -2
- package/dist/actions/compile_action_registry.d.ts +50 -0
- package/dist/actions/compile_action_registry.d.ts.map +1 -0
- package/dist/actions/compile_action_registry.js +69 -0
- package/dist/actions/heartbeat.d.ts +8 -4
- package/dist/actions/heartbeat.d.ts.map +1 -1
- package/dist/actions/heartbeat.js +5 -4
- package/dist/actions/perform_action.d.ts +145 -0
- package/dist/actions/perform_action.d.ts.map +1 -0
- package/dist/actions/perform_action.js +258 -0
- package/dist/actions/register_action_ws.d.ts +46 -40
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +101 -159
- package/dist/actions/register_ws_endpoint.d.ts +15 -10
- package/dist/actions/register_ws_endpoint.d.ts.map +1 -1
- package/dist/actions/register_ws_endpoint.js +54 -7
- package/dist/actions/transports.d.ts.map +1 -1
- package/dist/actions/transports.js +0 -4
- package/dist/actions/transports_ws_auth_guard.d.ts +1 -1
- package/dist/actions/transports_ws_auth_guard.js +1 -1
- package/dist/actions/transports_ws_backend.d.ts +1 -1
- package/dist/actions/transports_ws_backend.js +1 -1
- package/dist/auth/CLAUDE.md +794 -410
- package/dist/auth/account_action_specs.d.ts +28 -7
- package/dist/auth/account_action_specs.d.ts.map +1 -1
- package/dist/auth/account_action_specs.js +7 -7
- package/dist/auth/account_actions.d.ts +7 -13
- package/dist/auth/account_actions.d.ts.map +1 -1
- package/dist/auth/account_actions.js +26 -35
- package/dist/auth/account_queries.d.ts +52 -16
- package/dist/auth/account_queries.d.ts.map +1 -1
- package/dist/auth/account_queries.js +87 -38
- package/dist/auth/account_routes.d.ts +9 -11
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +118 -46
- package/dist/auth/account_schema.d.ts +46 -35
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +21 -28
- package/dist/auth/admin_action_specs.d.ts +100 -32
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +64 -33
- package/dist/auth/admin_actions.d.ts +13 -19
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +37 -41
- package/dist/auth/audit_emitter.d.ts +160 -0
- package/dist/auth/audit_emitter.d.ts.map +1 -0
- package/dist/auth/audit_emitter.js +83 -0
- package/dist/auth/audit_log_queries.d.ts +17 -48
- package/dist/auth/audit_log_queries.d.ts.map +1 -1
- package/dist/auth/audit_log_queries.js +20 -56
- 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 +7 -3
- package/dist/auth/audit_log_schema.d.ts +92 -32
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +75 -46
- package/dist/auth/auth_guard_resolver.d.ts +44 -0
- package/dist/auth/auth_guard_resolver.d.ts.map +1 -0
- package/dist/auth/auth_guard_resolver.js +56 -0
- package/dist/auth/bearer_auth.d.ts +9 -7
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +13 -21
- package/dist/auth/bootstrap_account.d.ts +7 -7
- package/dist/auth/bootstrap_account.d.ts.map +1 -1
- package/dist/auth/bootstrap_account.js +7 -7
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/bootstrap_routes.js +11 -10
- package/dist/auth/cleanup.d.ts +20 -26
- package/dist/auth/cleanup.d.ts.map +1 -1
- package/dist/auth/cleanup.js +33 -42
- package/dist/auth/credential_type_schema.d.ts +115 -0
- package/dist/auth/credential_type_schema.d.ts.map +1 -0
- package/dist/auth/credential_type_schema.js +127 -0
- package/dist/auth/daemon_token_middleware.d.ts +23 -11
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +28 -22
- package/dist/auth/ddl.d.ts +2 -2
- package/dist/auth/ddl.d.ts.map +1 -1
- package/dist/auth/ddl.js +6 -6
- package/dist/auth/deps.d.ts +7 -18
- package/dist/auth/deps.d.ts.map +1 -1
- package/dist/auth/grant_path_schema.d.ts +117 -0
- package/dist/auth/grant_path_schema.d.ts.map +1 -0
- package/dist/auth/grant_path_schema.js +137 -0
- package/dist/auth/invite_queries.d.ts +12 -1
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_queries.js +12 -1
- package/dist/auth/invite_schema.d.ts +1 -1
- package/dist/auth/invite_schema.d.ts.map +1 -1
- package/dist/auth/invite_schema.js +1 -1
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +9 -4
- package/dist/auth/migrations.d.ts +37 -14
- package/dist/auth/migrations.d.ts.map +1 -1
- package/dist/auth/migrations.js +79 -32
- package/dist/auth/request_context.d.ts +331 -61
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +378 -95
- package/dist/auth/{permit_offer_action_specs.d.ts → role_grant_offer_action_specs.d.ts} +163 -94
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -0
- package/dist/auth/role_grant_offer_action_specs.js +262 -0
- package/dist/auth/role_grant_offer_actions.d.ts +104 -0
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -0
- package/dist/auth/role_grant_offer_actions.js +473 -0
- package/dist/auth/{permit_offer_notifications.d.ts → role_grant_offer_notifications.d.ts} +90 -70
- package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -0
- package/dist/auth/role_grant_offer_notifications.js +182 -0
- package/dist/auth/role_grant_offer_queries.d.ts +242 -0
- package/dist/auth/role_grant_offer_queries.d.ts.map +1 -0
- package/dist/auth/role_grant_offer_queries.js +533 -0
- package/dist/auth/role_grant_offer_schema.d.ts +150 -0
- package/dist/auth/role_grant_offer_schema.d.ts.map +1 -0
- package/dist/auth/{permit_offer_schema.js → role_grant_offer_schema.js} +60 -36
- package/dist/auth/role_grant_queries.d.ts +231 -0
- package/dist/auth/role_grant_queries.d.ts.map +1 -0
- package/dist/auth/role_grant_queries.js +320 -0
- package/dist/auth/role_schema.d.ts +150 -40
- package/dist/auth/role_schema.d.ts.map +1 -1
- package/dist/auth/role_schema.js +144 -45
- package/dist/auth/scope_kind_schema.d.ts +96 -0
- package/dist/auth/scope_kind_schema.d.ts.map +1 -0
- package/dist/auth/scope_kind_schema.js +94 -0
- package/dist/auth/self_service_role_action_specs.d.ts +6 -1
- package/dist/auth/self_service_role_action_specs.d.ts.map +1 -1
- package/dist/auth/self_service_role_action_specs.js +3 -1
- package/dist/auth/self_service_role_actions.d.ts +34 -27
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +68 -48
- package/dist/auth/session_cookie.d.ts +43 -6
- package/dist/auth/session_cookie.d.ts.map +1 -1
- package/dist/auth/session_cookie.js +31 -5
- package/dist/auth/session_middleware.d.ts +37 -3
- package/dist/auth/session_middleware.d.ts.map +1 -1
- package/dist/auth/session_middleware.js +33 -7
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +48 -19
- package/dist/auth/standard_action_specs.d.ts +2 -2
- package/dist/auth/standard_action_specs.js +4 -4
- package/dist/auth/standard_rpc_actions.d.ts +23 -19
- package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
- package/dist/auth/standard_rpc_actions.js +12 -12
- package/dist/db/migrate.d.ts +12 -8
- package/dist/db/migrate.d.ts.map +1 -1
- package/dist/db/migrate.js +10 -7
- package/dist/dev/setup.d.ts +2 -2
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +9 -7
- package/dist/env/load.d.ts +1 -1
- package/dist/env/load.js +1 -1
- package/dist/hono_context.d.ts +64 -5
- package/dist/hono_context.d.ts.map +1 -1
- package/dist/hono_context.js +38 -2
- package/dist/http/CLAUDE.md +264 -87
- package/dist/http/auth_shape.d.ts +191 -0
- package/dist/http/auth_shape.d.ts.map +1 -0
- package/dist/http/auth_shape.js +237 -0
- package/dist/http/common_routes.js +3 -3
- package/dist/http/db_routes.d.ts +4 -0
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +44 -7
- package/dist/http/error_schemas.d.ts +132 -19
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +132 -40
- package/dist/http/jsonrpc_errors.d.ts +27 -2
- package/dist/http/jsonrpc_errors.d.ts.map +1 -1
- package/dist/http/jsonrpc_errors.js +26 -2
- package/dist/http/pending_effects.d.ts +71 -18
- package/dist/http/pending_effects.d.ts.map +1 -1
- package/dist/http/pending_effects.js +87 -18
- package/dist/http/proxy.d.ts +52 -5
- package/dist/http/proxy.d.ts.map +1 -1
- package/dist/http/proxy.js +92 -14
- package/dist/http/route_spec.d.ts +113 -41
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +130 -52
- package/dist/http/schema_helpers.d.ts +3 -2
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +9 -2
- package/dist/http/surface.d.ts +2 -1
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +1 -2
- package/dist/http/surface_query.d.ts +39 -35
- package/dist/http/surface_query.d.ts.map +1 -1
- package/dist/http/surface_query.js +79 -36
- package/dist/primitive_schemas.d.ts +39 -0
- package/dist/primitive_schemas.d.ts.map +1 -0
- package/dist/primitive_schemas.js +40 -0
- package/dist/realtime/sse_auth_guard.d.ts +5 -5
- package/dist/realtime/sse_auth_guard.js +9 -9
- package/dist/runtime/mock.d.ts +1 -1
- package/dist/runtime/mock.js +1 -1
- package/dist/server/app_backend.d.ts +14 -11
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_backend.js +12 -8
- package/dist/server/app_server.d.ts +7 -7
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +36 -31
- package/dist/server/validate_nginx.d.ts +1 -1
- package/dist/server/validate_nginx.js +1 -1
- package/dist/testing/CLAUDE.md +73 -55
- package/dist/testing/admin_integration.d.ts +5 -6
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +100 -96
- package/dist/testing/adversarial_headers.js +1 -1
- package/dist/testing/app_server.d.ts +11 -14
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +18 -17
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/assertions.js +2 -1
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/attack_surface.js +15 -9
- package/dist/testing/audit_completeness.d.ts +2 -2
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +53 -39
- package/dist/testing/auth_apps.d.ts +5 -4
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +28 -22
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +5 -5
- package/dist/testing/db.d.ts +1 -1
- package/dist/testing/db.d.ts.map +1 -1
- package/dist/testing/db.js +4 -4
- package/dist/testing/db_entities.d.ts +22 -0
- package/dist/testing/db_entities.d.ts.map +1 -0
- package/dist/testing/db_entities.js +28 -0
- package/dist/testing/entities.d.ts +10 -8
- package/dist/testing/entities.d.ts.map +1 -1
- package/dist/testing/entities.js +22 -18
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +13 -14
- package/dist/testing/integration_helpers.d.ts +8 -6
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +29 -23
- package/dist/testing/middleware.d.ts +15 -11
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +75 -32
- package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
- package/dist/testing/rpc_attack_surface.js +40 -24
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +3 -1
- package/dist/testing/rpc_round_trip.d.ts +1 -1
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.js +14 -13
- package/dist/testing/sse_round_trip.d.ts +3 -4
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +7 -11
- package/dist/testing/standard.d.ts +1 -1
- package/dist/testing/stubs.d.ts +25 -0
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +43 -2
- package/dist/testing/surface_invariants.d.ts +2 -2
- package/dist/testing/ws_round_trip.d.ts +12 -13
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +24 -12
- package/dist/ui/AdminAccounts.svelte +23 -20
- package/dist/ui/AdminOverview.svelte +15 -13
- package/dist/ui/AdminOverview.svelte.d.ts.map +1 -1
- package/dist/ui/{AdminPermitHistory.svelte → AdminRoleGrantHistory.svelte} +12 -12
- package/dist/ui/AdminRoleGrantHistory.svelte.d.ts +4 -0
- package/dist/ui/AdminRoleGrantHistory.svelte.d.ts.map +1 -0
- package/dist/ui/BootstrapForm.svelte +1 -1
- package/dist/ui/CLAUDE.md +65 -59
- package/dist/ui/{PermitOfferForm.svelte → RoleGrantOfferForm.svelte} +37 -22
- package/dist/ui/RoleGrantOfferForm.svelte.d.ts +20 -0
- package/dist/ui/RoleGrantOfferForm.svelte.d.ts.map +1 -0
- package/dist/ui/{PermitOfferHistory.svelte → RoleGrantOfferHistory.svelte} +12 -12
- package/dist/ui/{PermitOfferHistory.svelte.d.ts → RoleGrantOfferHistory.svelte.d.ts} +4 -4
- package/dist/ui/RoleGrantOfferHistory.svelte.d.ts.map +1 -0
- package/dist/ui/{PermitOfferInbox.svelte → RoleGrantOfferInbox.svelte} +14 -14
- package/dist/ui/{PermitOfferInbox.svelte.d.ts → RoleGrantOfferInbox.svelte.d.ts} +4 -4
- package/dist/ui/RoleGrantOfferInbox.svelte.d.ts.map +1 -0
- package/dist/ui/SignupForm.svelte +1 -1
- package/dist/ui/SurfaceExplorer.svelte +35 -15
- package/dist/ui/SurfaceExplorer.svelte.d.ts.map +1 -1
- package/dist/ui/account_sessions_state.svelte.d.ts +2 -3
- package/dist/ui/account_sessions_state.svelte.d.ts.map +1 -1
- package/dist/ui/account_sessions_state.svelte.js +2 -3
- package/dist/ui/admin_accounts_state.svelte.d.ts +25 -18
- package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.js +28 -17
- package/dist/ui/admin_rpc_adapters.d.ts +20 -20
- package/dist/ui/admin_rpc_adapters.d.ts.map +1 -1
- package/dist/ui/admin_rpc_adapters.js +17 -17
- package/dist/ui/admin_sessions_state.svelte.d.ts +2 -2
- package/dist/ui/admin_sessions_state.svelte.js +2 -2
- package/dist/ui/audit_log_state.svelte.d.ts +7 -7
- package/dist/ui/audit_log_state.svelte.d.ts.map +1 -1
- package/dist/ui/audit_log_state.svelte.js +6 -6
- package/dist/ui/auth_state.svelte.d.ts +3 -3
- package/dist/ui/auth_state.svelte.d.ts.map +1 -1
- package/dist/ui/auth_state.svelte.js +6 -6
- package/dist/ui/format_scope.d.ts +2 -2
- package/dist/ui/format_scope.js +2 -2
- package/dist/ui/{permit_offers_state.svelte.d.ts → role_grant_offers_state.svelte.d.ts} +39 -31
- package/dist/ui/role_grant_offers_state.svelte.d.ts.map +1 -0
- package/dist/ui/{permit_offers_state.svelte.js → role_grant_offers_state.svelte.js} +25 -19
- package/dist/ui/ui_format.js +2 -2
- package/package.json +3 -3
- package/dist/auth/permit_offer_action_specs.d.ts.map +0 -1
- package/dist/auth/permit_offer_action_specs.js +0 -227
- package/dist/auth/permit_offer_actions.d.ts +0 -110
- package/dist/auth/permit_offer_actions.d.ts.map +0 -1
- package/dist/auth/permit_offer_actions.js +0 -452
- package/dist/auth/permit_offer_notifications.d.ts.map +0 -1
- package/dist/auth/permit_offer_notifications.js +0 -182
- package/dist/auth/permit_offer_queries.d.ts +0 -183
- package/dist/auth/permit_offer_queries.d.ts.map +0 -1
- package/dist/auth/permit_offer_queries.js +0 -408
- package/dist/auth/permit_offer_schema.d.ts +0 -103
- package/dist/auth/permit_offer_schema.d.ts.map +0 -1
- package/dist/auth/permit_queries.d.ts +0 -210
- package/dist/auth/permit_queries.d.ts.map +0 -1
- package/dist/auth/permit_queries.js +0 -294
- package/dist/auth/require_keeper.d.ts +0 -20
- package/dist/auth/require_keeper.d.ts.map +0 -1
- package/dist/auth/require_keeper.js +0 -35
- package/dist/auth/route_guards.d.ts +0 -21
- package/dist/auth/route_guards.d.ts.map +0 -1
- package/dist/auth/route_guards.js +0 -32
- package/dist/auth/session_lifecycle.d.ts +0 -37
- package/dist/auth/session_lifecycle.d.ts.map +0 -1
- package/dist/auth/session_lifecycle.js +0 -29
- package/dist/ui/AdminPermitHistory.svelte.d.ts +0 -4
- package/dist/ui/AdminPermitHistory.svelte.d.ts.map +0 -1
- package/dist/ui/PermitOfferForm.svelte.d.ts +0 -14
- package/dist/ui/PermitOfferForm.svelte.d.ts.map +0 -1
- package/dist/ui/PermitOfferHistory.svelte.d.ts.map +0 -1
- package/dist/ui/PermitOfferInbox.svelte.d.ts.map +0 -1
- package/dist/ui/permit_offers_state.svelte.d.ts.map +0 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Role grant offer WebSocket notification specs, builders, and the narrow
|
|
3
3
|
* `NotificationSender` interface that decouples offer/revoke send sites
|
|
4
4
|
* from `BackendWebsocketTransport`.
|
|
5
5
|
*
|
|
6
|
-
* Six `RemoteNotificationActionSpec`s cover the consentful-
|
|
6
|
+
* Six `RemoteNotificationActionSpec`s cover the consentful-role-grants
|
|
7
7
|
* lifecycle events the server pushes to affected accounts:
|
|
8
8
|
*
|
|
9
|
-
* - `
|
|
10
|
-
* - `
|
|
11
|
-
* - `
|
|
12
|
-
* - `
|
|
13
|
-
* - `
|
|
14
|
-
* a revoke of the resulting
|
|
9
|
+
* - `role_grant_offer_received` → recipient's sockets when an offer is created
|
|
10
|
+
* - `role_grant_offer_retracted` → recipient's sockets when a grantor retracts
|
|
11
|
+
* - `role_grant_offer_accepted` → grantor's sockets when the recipient accepts
|
|
12
|
+
* - `role_grant_offer_declined` → grantor's sockets when the recipient declines
|
|
13
|
+
* - `role_grant_offer_supersede` → grantor's sockets when a sibling accept,
|
|
14
|
+
* a revoke of the resulting role_grant, or destruction of the parent scope
|
|
15
15
|
* row obsoletes their pending offer
|
|
16
|
-
* - `
|
|
17
|
-
* is revoked (companion to the `
|
|
16
|
+
* - `role_grant_revoke` → revokee's sockets when one of their active role_grants
|
|
17
|
+
* is revoked (companion to the `role_grant_revoke` audit event)
|
|
18
18
|
*
|
|
19
|
-
* Payloads are flat and normalized — `
|
|
19
|
+
* Payloads are flat and normalized — `RoleGrantOfferJson` for the offer-lifecycle
|
|
20
20
|
* notifications (decline reason rides on `offer.decline_reason`, not a
|
|
21
|
-
* sibling field), and `{
|
|
21
|
+
* sibling field), and `{role_grant_id, role, scope_id, reason?}` for `role_grant_revoke`. The
|
|
22
22
|
* revokee/grantor/recipient account id travels via the send target (the
|
|
23
23
|
* `NotificationSender.send_to_account` argument), not in the payload.
|
|
24
24
|
*
|
|
25
25
|
* The specs surface as `EventSpec`s via `create_action_event_spec` — callers
|
|
26
|
-
* append `
|
|
26
|
+
* append `ROLE_GRANT_OFFER_NOTIFICATION_SPECS` to their `event_specs` on
|
|
27
27
|
* `create_app_server` so the surface reflects them and DEV-mode broadcast
|
|
28
28
|
* validation catches payload drift.
|
|
29
29
|
*
|
|
@@ -50,19 +50,21 @@ import type { JsonrpcNotification } from '../http/jsonrpc.js';
|
|
|
50
50
|
export interface NotificationSender {
|
|
51
51
|
send_to_account: (account_id: Uuid, message: JsonrpcNotification) => number;
|
|
52
52
|
}
|
|
53
|
-
export declare const
|
|
54
|
-
export declare const
|
|
55
|
-
export declare const
|
|
56
|
-
export declare const
|
|
57
|
-
export declare const
|
|
58
|
-
export declare const
|
|
59
|
-
/** Params for `
|
|
60
|
-
export declare const
|
|
53
|
+
export declare const ROLE_GRANT_OFFER_RECEIVED_NOTIFICATION_METHOD = "role_grant_offer_received";
|
|
54
|
+
export declare const ROLE_GRANT_OFFER_RETRACTED_NOTIFICATION_METHOD = "role_grant_offer_retracted";
|
|
55
|
+
export declare const ROLE_GRANT_OFFER_ACCEPTED_NOTIFICATION_METHOD = "role_grant_offer_accepted";
|
|
56
|
+
export declare const ROLE_GRANT_OFFER_DECLINED_NOTIFICATION_METHOD = "role_grant_offer_declined";
|
|
57
|
+
export declare const ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD = "role_grant_offer_supersede";
|
|
58
|
+
export declare const ROLE_GRANT_REVOKE_NOTIFICATION_METHOD = "role_grant_revoke";
|
|
59
|
+
/** Params for `role_grant_offer_received` — offer delivered to its recipient. */
|
|
60
|
+
export declare const RoleGrantOfferReceivedParams: z.ZodObject<{
|
|
61
61
|
offer: z.ZodObject<{
|
|
62
62
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
63
63
|
from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
64
64
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
65
|
+
to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
65
66
|
role: z.ZodString;
|
|
67
|
+
scope_kind: z.ZodNullable<z.ZodString>;
|
|
66
68
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
67
69
|
message: z.ZodNullable<z.ZodString>;
|
|
68
70
|
created_at: z.ZodString;
|
|
@@ -72,17 +74,19 @@ export declare const PermitOfferReceivedParams: z.ZodObject<{
|
|
|
72
74
|
decline_reason: z.ZodNullable<z.ZodString>;
|
|
73
75
|
retracted_at: z.ZodNullable<z.ZodString>;
|
|
74
76
|
superseded_at: z.ZodNullable<z.ZodString>;
|
|
75
|
-
|
|
77
|
+
resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
76
78
|
}, z.core.$strict>;
|
|
77
79
|
}, z.core.$strict>;
|
|
78
|
-
export type
|
|
79
|
-
/** Params for `
|
|
80
|
-
export declare const
|
|
80
|
+
export type RoleGrantOfferReceivedParams = z.infer<typeof RoleGrantOfferReceivedParams>;
|
|
81
|
+
/** Params for `role_grant_offer_retracted` — grantor-side retraction. */
|
|
82
|
+
export declare const RoleGrantOfferRetractedParams: z.ZodObject<{
|
|
81
83
|
offer: z.ZodObject<{
|
|
82
84
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
83
85
|
from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
84
86
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
87
|
+
to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
85
88
|
role: z.ZodString;
|
|
89
|
+
scope_kind: z.ZodNullable<z.ZodString>;
|
|
86
90
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
87
91
|
message: z.ZodNullable<z.ZodString>;
|
|
88
92
|
created_at: z.ZodString;
|
|
@@ -92,17 +96,19 @@ export declare const PermitOfferRetractedParams: z.ZodObject<{
|
|
|
92
96
|
decline_reason: z.ZodNullable<z.ZodString>;
|
|
93
97
|
retracted_at: z.ZodNullable<z.ZodString>;
|
|
94
98
|
superseded_at: z.ZodNullable<z.ZodString>;
|
|
95
|
-
|
|
99
|
+
resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
96
100
|
}, z.core.$strict>;
|
|
97
101
|
}, z.core.$strict>;
|
|
98
|
-
export type
|
|
99
|
-
/** Params for `
|
|
100
|
-
export declare const
|
|
102
|
+
export type RoleGrantOfferRetractedParams = z.infer<typeof RoleGrantOfferRetractedParams>;
|
|
103
|
+
/** Params for `role_grant_offer_accepted` — recipient accepted the offer. */
|
|
104
|
+
export declare const RoleGrantOfferAcceptedParams: z.ZodObject<{
|
|
101
105
|
offer: z.ZodObject<{
|
|
102
106
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
103
107
|
from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
104
108
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
109
|
+
to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
105
110
|
role: z.ZodString;
|
|
111
|
+
scope_kind: z.ZodNullable<z.ZodString>;
|
|
106
112
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
107
113
|
message: z.ZodNullable<z.ZodString>;
|
|
108
114
|
created_at: z.ZodString;
|
|
@@ -112,21 +118,23 @@ export declare const PermitOfferAcceptedParams: z.ZodObject<{
|
|
|
112
118
|
decline_reason: z.ZodNullable<z.ZodString>;
|
|
113
119
|
retracted_at: z.ZodNullable<z.ZodString>;
|
|
114
120
|
superseded_at: z.ZodNullable<z.ZodString>;
|
|
115
|
-
|
|
121
|
+
resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
116
122
|
}, z.core.$strict>;
|
|
117
123
|
}, z.core.$strict>;
|
|
118
|
-
export type
|
|
124
|
+
export type RoleGrantOfferAcceptedParams = z.infer<typeof RoleGrantOfferAcceptedParams>;
|
|
119
125
|
/**
|
|
120
|
-
* Params for `
|
|
126
|
+
* Params for `role_grant_offer_declined`. The decline reason (if any) rides along
|
|
121
127
|
* inside `offer.decline_reason` — the DB stamps it on the offer row during
|
|
122
128
|
* decline, so a sibling `reason` field would just duplicate it.
|
|
123
129
|
*/
|
|
124
|
-
export declare const
|
|
130
|
+
export declare const RoleGrantOfferDeclinedParams: z.ZodObject<{
|
|
125
131
|
offer: z.ZodObject<{
|
|
126
132
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
127
133
|
from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
128
134
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
135
|
+
to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
129
136
|
role: z.ZodString;
|
|
137
|
+
scope_kind: z.ZodNullable<z.ZodString>;
|
|
130
138
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
131
139
|
message: z.ZodNullable<z.ZodString>;
|
|
132
140
|
created_at: z.ZodString;
|
|
@@ -136,25 +144,27 @@ export declare const PermitOfferDeclinedParams: z.ZodObject<{
|
|
|
136
144
|
decline_reason: z.ZodNullable<z.ZodString>;
|
|
137
145
|
retracted_at: z.ZodNullable<z.ZodString>;
|
|
138
146
|
superseded_at: z.ZodNullable<z.ZodString>;
|
|
139
|
-
|
|
147
|
+
resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
140
148
|
}, z.core.$strict>;
|
|
141
149
|
}, z.core.$strict>;
|
|
142
|
-
export type
|
|
150
|
+
export type RoleGrantOfferDeclinedParams = z.infer<typeof RoleGrantOfferDeclinedParams>;
|
|
143
151
|
/**
|
|
144
|
-
* Params for `
|
|
152
|
+
* Params for `role_grant_offer_supersede`. Fires to the grantor's sockets when
|
|
145
153
|
* their pending offer is obsoleted — either by a sibling accept
|
|
146
|
-
* (`reason: 'sibling_accepted'`), by revoke of the resulting
|
|
147
|
-
* (`reason: '
|
|
154
|
+
* (`reason: 'sibling_accepted'`), by revoke of the resulting role_grant
|
|
155
|
+
* (`reason: 'role_grant_revoked'`), or by deletion of the parent scope row
|
|
148
156
|
* the offer was bound to (`reason: 'scope_destroyed'`). `cause_id` points
|
|
149
|
-
* at the accepted offer id, the revoked
|
|
157
|
+
* at the accepted offer id, the revoked role_grant id, or the destroyed scope
|
|
150
158
|
* row id respectively.
|
|
151
159
|
*/
|
|
152
|
-
export declare const
|
|
160
|
+
export declare const RoleGrantOfferSupersedeParams: z.ZodObject<{
|
|
153
161
|
offer: z.ZodObject<{
|
|
154
162
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
155
163
|
from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
156
164
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
165
|
+
to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
157
166
|
role: z.ZodString;
|
|
167
|
+
scope_kind: z.ZodNullable<z.ZodString>;
|
|
158
168
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
159
169
|
message: z.ZodNullable<z.ZodString>;
|
|
160
170
|
created_at: z.ZodString;
|
|
@@ -164,31 +174,31 @@ export declare const PermitOfferSupersedeParams: z.ZodObject<{
|
|
|
164
174
|
decline_reason: z.ZodNullable<z.ZodString>;
|
|
165
175
|
retracted_at: z.ZodNullable<z.ZodString>;
|
|
166
176
|
superseded_at: z.ZodNullable<z.ZodString>;
|
|
167
|
-
|
|
177
|
+
resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
168
178
|
}, z.core.$strict>;
|
|
169
179
|
reason: z.ZodEnum<{
|
|
170
180
|
sibling_accepted: "sibling_accepted";
|
|
171
|
-
|
|
181
|
+
role_grant_revoked: "role_grant_revoked";
|
|
172
182
|
scope_destroyed: "scope_destroyed";
|
|
173
183
|
}>;
|
|
174
184
|
cause_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
175
185
|
}, z.core.$strict>;
|
|
176
|
-
export type
|
|
186
|
+
export type RoleGrantOfferSupersedeParams = z.infer<typeof RoleGrantOfferSupersedeParams>;
|
|
177
187
|
/**
|
|
178
|
-
* Params for `
|
|
179
|
-
* of their active
|
|
188
|
+
* Params for `role_grant_revoke`. Delivered to the revokee's sockets when one
|
|
189
|
+
* of their active role_grants is revoked. Flat wire shape — `revoked_by` is
|
|
180
190
|
* admin-UI-visible but deliberately omitted here (the revokee doesn't need
|
|
181
191
|
* to learn the admin's identity). Target account is implicit in the send
|
|
182
192
|
* target.
|
|
183
193
|
*/
|
|
184
|
-
export declare const
|
|
185
|
-
|
|
194
|
+
export declare const RoleGrantRevokeParams: z.ZodObject<{
|
|
195
|
+
role_grant_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
186
196
|
role: z.ZodString;
|
|
187
197
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
188
198
|
reason: z.ZodNullable<z.ZodString>;
|
|
189
199
|
}, z.core.$strict>;
|
|
190
|
-
export type
|
|
191
|
-
export declare const
|
|
200
|
+
export type RoleGrantRevokeParams = z.infer<typeof RoleGrantRevokeParams>;
|
|
201
|
+
export declare const role_grant_offer_received_notification_spec: {
|
|
192
202
|
method: string;
|
|
193
203
|
kind: "remote_notification";
|
|
194
204
|
initiator: "backend";
|
|
@@ -199,7 +209,9 @@ export declare const permit_offer_received_notification_spec: {
|
|
|
199
209
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
200
210
|
from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
201
211
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
212
|
+
to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
202
213
|
role: z.ZodString;
|
|
214
|
+
scope_kind: z.ZodNullable<z.ZodString>;
|
|
203
215
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
204
216
|
message: z.ZodNullable<z.ZodString>;
|
|
205
217
|
created_at: z.ZodString;
|
|
@@ -209,14 +221,14 @@ export declare const permit_offer_received_notification_spec: {
|
|
|
209
221
|
decline_reason: z.ZodNullable<z.ZodString>;
|
|
210
222
|
retracted_at: z.ZodNullable<z.ZodString>;
|
|
211
223
|
superseded_at: z.ZodNullable<z.ZodString>;
|
|
212
|
-
|
|
224
|
+
resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
213
225
|
}, z.core.$strict>;
|
|
214
226
|
}, z.core.$strict>;
|
|
215
227
|
output: z.ZodVoid;
|
|
216
228
|
async: true;
|
|
217
229
|
description: string;
|
|
218
230
|
};
|
|
219
|
-
export declare const
|
|
231
|
+
export declare const role_grant_offer_retracted_notification_spec: {
|
|
220
232
|
method: string;
|
|
221
233
|
kind: "remote_notification";
|
|
222
234
|
initiator: "backend";
|
|
@@ -227,7 +239,9 @@ export declare const permit_offer_retracted_notification_spec: {
|
|
|
227
239
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
228
240
|
from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
229
241
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
242
|
+
to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
230
243
|
role: z.ZodString;
|
|
244
|
+
scope_kind: z.ZodNullable<z.ZodString>;
|
|
231
245
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
232
246
|
message: z.ZodNullable<z.ZodString>;
|
|
233
247
|
created_at: z.ZodString;
|
|
@@ -237,14 +251,14 @@ export declare const permit_offer_retracted_notification_spec: {
|
|
|
237
251
|
decline_reason: z.ZodNullable<z.ZodString>;
|
|
238
252
|
retracted_at: z.ZodNullable<z.ZodString>;
|
|
239
253
|
superseded_at: z.ZodNullable<z.ZodString>;
|
|
240
|
-
|
|
254
|
+
resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
241
255
|
}, z.core.$strict>;
|
|
242
256
|
}, z.core.$strict>;
|
|
243
257
|
output: z.ZodVoid;
|
|
244
258
|
async: true;
|
|
245
259
|
description: string;
|
|
246
260
|
};
|
|
247
|
-
export declare const
|
|
261
|
+
export declare const role_grant_offer_accepted_notification_spec: {
|
|
248
262
|
method: string;
|
|
249
263
|
kind: "remote_notification";
|
|
250
264
|
initiator: "backend";
|
|
@@ -255,7 +269,9 @@ export declare const permit_offer_accepted_notification_spec: {
|
|
|
255
269
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
256
270
|
from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
257
271
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
272
|
+
to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
258
273
|
role: z.ZodString;
|
|
274
|
+
scope_kind: z.ZodNullable<z.ZodString>;
|
|
259
275
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
260
276
|
message: z.ZodNullable<z.ZodString>;
|
|
261
277
|
created_at: z.ZodString;
|
|
@@ -265,14 +281,14 @@ export declare const permit_offer_accepted_notification_spec: {
|
|
|
265
281
|
decline_reason: z.ZodNullable<z.ZodString>;
|
|
266
282
|
retracted_at: z.ZodNullable<z.ZodString>;
|
|
267
283
|
superseded_at: z.ZodNullable<z.ZodString>;
|
|
268
|
-
|
|
284
|
+
resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
269
285
|
}, z.core.$strict>;
|
|
270
286
|
}, z.core.$strict>;
|
|
271
287
|
output: z.ZodVoid;
|
|
272
288
|
async: true;
|
|
273
289
|
description: string;
|
|
274
290
|
};
|
|
275
|
-
export declare const
|
|
291
|
+
export declare const role_grant_offer_declined_notification_spec: {
|
|
276
292
|
method: string;
|
|
277
293
|
kind: "remote_notification";
|
|
278
294
|
initiator: "backend";
|
|
@@ -283,7 +299,9 @@ export declare const permit_offer_declined_notification_spec: {
|
|
|
283
299
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
284
300
|
from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
285
301
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
302
|
+
to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
286
303
|
role: z.ZodString;
|
|
304
|
+
scope_kind: z.ZodNullable<z.ZodString>;
|
|
287
305
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
288
306
|
message: z.ZodNullable<z.ZodString>;
|
|
289
307
|
created_at: z.ZodString;
|
|
@@ -293,14 +311,14 @@ export declare const permit_offer_declined_notification_spec: {
|
|
|
293
311
|
decline_reason: z.ZodNullable<z.ZodString>;
|
|
294
312
|
retracted_at: z.ZodNullable<z.ZodString>;
|
|
295
313
|
superseded_at: z.ZodNullable<z.ZodString>;
|
|
296
|
-
|
|
314
|
+
resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
297
315
|
}, z.core.$strict>;
|
|
298
316
|
}, z.core.$strict>;
|
|
299
317
|
output: z.ZodVoid;
|
|
300
318
|
async: true;
|
|
301
319
|
description: string;
|
|
302
320
|
};
|
|
303
|
-
export declare const
|
|
321
|
+
export declare const role_grant_offer_supersede_notification_spec: {
|
|
304
322
|
method: string;
|
|
305
323
|
kind: "remote_notification";
|
|
306
324
|
initiator: "backend";
|
|
@@ -311,7 +329,9 @@ export declare const permit_offer_supersede_notification_spec: {
|
|
|
311
329
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
312
330
|
from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
313
331
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
332
|
+
to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
314
333
|
role: z.ZodString;
|
|
334
|
+
scope_kind: z.ZodNullable<z.ZodString>;
|
|
315
335
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
316
336
|
message: z.ZodNullable<z.ZodString>;
|
|
317
337
|
created_at: z.ZodString;
|
|
@@ -321,11 +341,11 @@ export declare const permit_offer_supersede_notification_spec: {
|
|
|
321
341
|
decline_reason: z.ZodNullable<z.ZodString>;
|
|
322
342
|
retracted_at: z.ZodNullable<z.ZodString>;
|
|
323
343
|
superseded_at: z.ZodNullable<z.ZodString>;
|
|
324
|
-
|
|
344
|
+
resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
325
345
|
}, z.core.$strict>;
|
|
326
346
|
reason: z.ZodEnum<{
|
|
327
347
|
sibling_accepted: "sibling_accepted";
|
|
328
|
-
|
|
348
|
+
role_grant_revoked: "role_grant_revoked";
|
|
329
349
|
scope_destroyed: "scope_destroyed";
|
|
330
350
|
}>;
|
|
331
351
|
cause_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
@@ -334,14 +354,14 @@ export declare const permit_offer_supersede_notification_spec: {
|
|
|
334
354
|
async: true;
|
|
335
355
|
description: string;
|
|
336
356
|
};
|
|
337
|
-
export declare const
|
|
357
|
+
export declare const role_grant_revoke_notification_spec: {
|
|
338
358
|
method: string;
|
|
339
359
|
kind: "remote_notification";
|
|
340
360
|
initiator: "backend";
|
|
341
361
|
auth: null;
|
|
342
362
|
side_effects: true;
|
|
343
363
|
input: z.ZodObject<{
|
|
344
|
-
|
|
364
|
+
role_grant_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
345
365
|
role: z.ZodString;
|
|
346
366
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
347
367
|
reason: z.ZodNullable<z.ZodString>;
|
|
@@ -351,16 +371,16 @@ export declare const permit_revoke_notification_spec: {
|
|
|
351
371
|
description: string;
|
|
352
372
|
};
|
|
353
373
|
/**
|
|
354
|
-
* SSE/WS event specs for the consentful-
|
|
374
|
+
* SSE/WS event specs for the consentful-role-grants notification surface.
|
|
355
375
|
*
|
|
356
376
|
* Pass to `create_app_server`'s `event_specs` so the attack surface reflects
|
|
357
377
|
* them and DEV-mode `create_validated_broadcaster` catches payload drift.
|
|
358
378
|
*/
|
|
359
|
-
export declare const
|
|
360
|
-
export declare const
|
|
361
|
-
export declare const
|
|
362
|
-
export declare const
|
|
363
|
-
export declare const
|
|
364
|
-
export declare const
|
|
365
|
-
export declare const
|
|
366
|
-
//# sourceMappingURL=
|
|
379
|
+
export declare const ROLE_GRANT_OFFER_NOTIFICATION_SPECS: Array<EventSpec>;
|
|
380
|
+
export declare const build_role_grant_offer_received_notification: (params: RoleGrantOfferReceivedParams) => JsonrpcNotification;
|
|
381
|
+
export declare const build_role_grant_offer_retracted_notification: (params: RoleGrantOfferRetractedParams) => JsonrpcNotification;
|
|
382
|
+
export declare const build_role_grant_offer_accepted_notification: (params: RoleGrantOfferAcceptedParams) => JsonrpcNotification;
|
|
383
|
+
export declare const build_role_grant_offer_declined_notification: (params: RoleGrantOfferDeclinedParams) => JsonrpcNotification;
|
|
384
|
+
export declare const build_role_grant_offer_supersede_notification: (params: RoleGrantOfferSupersedeParams) => JsonrpcNotification;
|
|
385
|
+
export declare const build_role_grant_revoke_notification: (params: RoleGrantRevokeParams) => JsonrpcNotification;
|
|
386
|
+
//# sourceMappingURL=role_grant_offer_notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role_grant_offer_notifications.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/role_grant_offer_notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,EAAqB,KAAK,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAIrE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AAM5D;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,kBAAkB;IAClC,eAAe,EAAE,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,mBAAmB,KAAK,MAAM,CAAC;CAC5E;AAID,eAAO,MAAM,6CAA6C,8BAA8B,CAAC;AACzF,eAAO,MAAM,8CAA8C,+BAA+B,CAAC;AAC3F,eAAO,MAAM,6CAA6C,8BAA8B,CAAC;AACzF,eAAO,MAAM,6CAA6C,8BAA8B,CAAC;AACzF,eAAO,MAAM,8CAA8C,+BAA+B,CAAC;AAC3F,eAAO,MAAM,qCAAqC,sBAAsB,CAAC;AAIzE,iFAAiF;AACjF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;kBAEvC,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAExF,yEAAyE;AACzE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;kBAExC,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAE1F,6EAA6E;AAC7E,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;kBAEvC,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAExF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;kBAEvC,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAExF;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;kBAIxC,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAE1F;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;;;;kBAKhC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAI1E,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUhB,CAAC;AAEzC,eAAO,MAAM,4CAA4C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUjB,CAAC;AAEzC,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUhB,CAAC;AAEzC,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUhB,CAAC;AAEzC,eAAO,MAAM,4CAA4C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWjB,CAAC;AAEzC,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;CAUR,CAAC;AAIzC;;;;;GAKG;AACH,eAAO,MAAM,mCAAmC,EAAE,KAAK,CAAC,SAAS,CAOhE,CAAC;AAIF,eAAO,MAAM,4CAA4C,GACxD,QAAQ,4BAA4B,KAClC,mBACgF,CAAC;AAEpF,eAAO,MAAM,6CAA6C,GACzD,QAAQ,6BAA6B,KACnC,mBACiF,CAAC;AAErF,eAAO,MAAM,4CAA4C,GACxD,QAAQ,4BAA4B,KAClC,mBACgF,CAAC;AAEpF,eAAO,MAAM,4CAA4C,GACxD,QAAQ,4BAA4B,KAClC,mBACgF,CAAC;AAEpF,eAAO,MAAM,6CAA6C,GACzD,QAAQ,6BAA6B,KACnC,mBACiF,CAAC;AAErF,eAAO,MAAM,oCAAoC,GAChD,QAAQ,qBAAqB,KAC3B,mBACwE,CAAC"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Role grant offer WebSocket notification specs, builders, and the narrow
|
|
3
|
+
* `NotificationSender` interface that decouples offer/revoke send sites
|
|
4
|
+
* from `BackendWebsocketTransport`.
|
|
5
|
+
*
|
|
6
|
+
* Six `RemoteNotificationActionSpec`s cover the consentful-role-grants
|
|
7
|
+
* lifecycle events the server pushes to affected accounts:
|
|
8
|
+
*
|
|
9
|
+
* - `role_grant_offer_received` → recipient's sockets when an offer is created
|
|
10
|
+
* - `role_grant_offer_retracted` → recipient's sockets when a grantor retracts
|
|
11
|
+
* - `role_grant_offer_accepted` → grantor's sockets when the recipient accepts
|
|
12
|
+
* - `role_grant_offer_declined` → grantor's sockets when the recipient declines
|
|
13
|
+
* - `role_grant_offer_supersede` → grantor's sockets when a sibling accept,
|
|
14
|
+
* a revoke of the resulting role_grant, or destruction of the parent scope
|
|
15
|
+
* row obsoletes their pending offer
|
|
16
|
+
* - `role_grant_revoke` → revokee's sockets when one of their active role_grants
|
|
17
|
+
* is revoked (companion to the `role_grant_revoke` audit event)
|
|
18
|
+
*
|
|
19
|
+
* Payloads are flat and normalized — `RoleGrantOfferJson` for the offer-lifecycle
|
|
20
|
+
* notifications (decline reason rides on `offer.decline_reason`, not a
|
|
21
|
+
* sibling field), and `{role_grant_id, role, scope_id, reason?}` for `role_grant_revoke`. The
|
|
22
|
+
* revokee/grantor/recipient account id travels via the send target (the
|
|
23
|
+
* `NotificationSender.send_to_account` argument), not in the payload.
|
|
24
|
+
*
|
|
25
|
+
* The specs surface as `EventSpec`s via `create_action_event_spec` — callers
|
|
26
|
+
* append `ROLE_GRANT_OFFER_NOTIFICATION_SPECS` to their `event_specs` on
|
|
27
|
+
* `create_app_server` so the surface reflects them and DEV-mode broadcast
|
|
28
|
+
* validation catches payload drift.
|
|
29
|
+
*
|
|
30
|
+
* @module
|
|
31
|
+
*/
|
|
32
|
+
import { z } from 'zod';
|
|
33
|
+
import { Uuid as UuidSchema } from '@fuzdev/fuz_util/id.js';
|
|
34
|
+
import { create_action_event_spec } from '../actions/action_bridge.js';
|
|
35
|
+
import { create_jsonrpc_notification } from '../http/jsonrpc_helpers.js';
|
|
36
|
+
import { RoleName } from './role_schema.js';
|
|
37
|
+
import { RoleGrantOfferJson } from './role_grant_offer_schema.js';
|
|
38
|
+
import { ROLE_GRANT_REVOKED_REASON_LENGTH_MAX } from './account_schema.js';
|
|
39
|
+
// -- Method constants -------------------------------------------------------
|
|
40
|
+
export const ROLE_GRANT_OFFER_RECEIVED_NOTIFICATION_METHOD = 'role_grant_offer_received';
|
|
41
|
+
export const ROLE_GRANT_OFFER_RETRACTED_NOTIFICATION_METHOD = 'role_grant_offer_retracted';
|
|
42
|
+
export const ROLE_GRANT_OFFER_ACCEPTED_NOTIFICATION_METHOD = 'role_grant_offer_accepted';
|
|
43
|
+
export const ROLE_GRANT_OFFER_DECLINED_NOTIFICATION_METHOD = 'role_grant_offer_declined';
|
|
44
|
+
export const ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD = 'role_grant_offer_supersede';
|
|
45
|
+
export const ROLE_GRANT_REVOKE_NOTIFICATION_METHOD = 'role_grant_revoke';
|
|
46
|
+
// -- Params schemas ---------------------------------------------------------
|
|
47
|
+
/** Params for `role_grant_offer_received` — offer delivered to its recipient. */
|
|
48
|
+
export const RoleGrantOfferReceivedParams = z.strictObject({
|
|
49
|
+
offer: RoleGrantOfferJson,
|
|
50
|
+
});
|
|
51
|
+
/** Params for `role_grant_offer_retracted` — grantor-side retraction. */
|
|
52
|
+
export const RoleGrantOfferRetractedParams = z.strictObject({
|
|
53
|
+
offer: RoleGrantOfferJson,
|
|
54
|
+
});
|
|
55
|
+
/** Params for `role_grant_offer_accepted` — recipient accepted the offer. */
|
|
56
|
+
export const RoleGrantOfferAcceptedParams = z.strictObject({
|
|
57
|
+
offer: RoleGrantOfferJson,
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* Params for `role_grant_offer_declined`. The decline reason (if any) rides along
|
|
61
|
+
* inside `offer.decline_reason` — the DB stamps it on the offer row during
|
|
62
|
+
* decline, so a sibling `reason` field would just duplicate it.
|
|
63
|
+
*/
|
|
64
|
+
export const RoleGrantOfferDeclinedParams = z.strictObject({
|
|
65
|
+
offer: RoleGrantOfferJson,
|
|
66
|
+
});
|
|
67
|
+
/**
|
|
68
|
+
* Params for `role_grant_offer_supersede`. Fires to the grantor's sockets when
|
|
69
|
+
* their pending offer is obsoleted — either by a sibling accept
|
|
70
|
+
* (`reason: 'sibling_accepted'`), by revoke of the resulting role_grant
|
|
71
|
+
* (`reason: 'role_grant_revoked'`), or by deletion of the parent scope row
|
|
72
|
+
* the offer was bound to (`reason: 'scope_destroyed'`). `cause_id` points
|
|
73
|
+
* at the accepted offer id, the revoked role_grant id, or the destroyed scope
|
|
74
|
+
* row id respectively.
|
|
75
|
+
*/
|
|
76
|
+
export const RoleGrantOfferSupersedeParams = z.strictObject({
|
|
77
|
+
offer: RoleGrantOfferJson,
|
|
78
|
+
reason: z.enum(['sibling_accepted', 'role_grant_revoked', 'scope_destroyed']),
|
|
79
|
+
cause_id: UuidSchema,
|
|
80
|
+
});
|
|
81
|
+
/**
|
|
82
|
+
* Params for `role_grant_revoke`. Delivered to the revokee's sockets when one
|
|
83
|
+
* of their active role_grants is revoked. Flat wire shape — `revoked_by` is
|
|
84
|
+
* admin-UI-visible but deliberately omitted here (the revokee doesn't need
|
|
85
|
+
* to learn the admin's identity). Target account is implicit in the send
|
|
86
|
+
* target.
|
|
87
|
+
*/
|
|
88
|
+
export const RoleGrantRevokeParams = z.strictObject({
|
|
89
|
+
role_grant_id: UuidSchema,
|
|
90
|
+
role: RoleName,
|
|
91
|
+
scope_id: UuidSchema.nullable(),
|
|
92
|
+
reason: z.string().max(ROLE_GRANT_REVOKED_REASON_LENGTH_MAX).nullable(),
|
|
93
|
+
});
|
|
94
|
+
// -- Action specs -----------------------------------------------------------
|
|
95
|
+
export const role_grant_offer_received_notification_spec = {
|
|
96
|
+
method: ROLE_GRANT_OFFER_RECEIVED_NOTIFICATION_METHOD,
|
|
97
|
+
kind: 'remote_notification',
|
|
98
|
+
initiator: 'backend',
|
|
99
|
+
auth: null,
|
|
100
|
+
side_effects: true,
|
|
101
|
+
input: RoleGrantOfferReceivedParams,
|
|
102
|
+
output: z.void(),
|
|
103
|
+
async: true,
|
|
104
|
+
description: 'A new role_grant offer arrived in the recipient’s inbox.',
|
|
105
|
+
};
|
|
106
|
+
export const role_grant_offer_retracted_notification_spec = {
|
|
107
|
+
method: ROLE_GRANT_OFFER_RETRACTED_NOTIFICATION_METHOD,
|
|
108
|
+
kind: 'remote_notification',
|
|
109
|
+
initiator: 'backend',
|
|
110
|
+
auth: null,
|
|
111
|
+
side_effects: true,
|
|
112
|
+
input: RoleGrantOfferRetractedParams,
|
|
113
|
+
output: z.void(),
|
|
114
|
+
async: true,
|
|
115
|
+
description: 'A pending role_grant offer was retracted by its grantor.',
|
|
116
|
+
};
|
|
117
|
+
export const role_grant_offer_accepted_notification_spec = {
|
|
118
|
+
method: ROLE_GRANT_OFFER_ACCEPTED_NOTIFICATION_METHOD,
|
|
119
|
+
kind: 'remote_notification',
|
|
120
|
+
initiator: 'backend',
|
|
121
|
+
auth: null,
|
|
122
|
+
side_effects: true,
|
|
123
|
+
input: RoleGrantOfferAcceptedParams,
|
|
124
|
+
output: z.void(),
|
|
125
|
+
async: true,
|
|
126
|
+
description: 'A pending role_grant offer was accepted by its recipient.',
|
|
127
|
+
};
|
|
128
|
+
export const role_grant_offer_declined_notification_spec = {
|
|
129
|
+
method: ROLE_GRANT_OFFER_DECLINED_NOTIFICATION_METHOD,
|
|
130
|
+
kind: 'remote_notification',
|
|
131
|
+
initiator: 'backend',
|
|
132
|
+
auth: null,
|
|
133
|
+
side_effects: true,
|
|
134
|
+
input: RoleGrantOfferDeclinedParams,
|
|
135
|
+
output: z.void(),
|
|
136
|
+
async: true,
|
|
137
|
+
description: 'A pending role_grant offer was declined by its recipient.',
|
|
138
|
+
};
|
|
139
|
+
export const role_grant_offer_supersede_notification_spec = {
|
|
140
|
+
method: ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD,
|
|
141
|
+
kind: 'remote_notification',
|
|
142
|
+
initiator: 'backend',
|
|
143
|
+
auth: null,
|
|
144
|
+
side_effects: true,
|
|
145
|
+
input: RoleGrantOfferSupersedeParams,
|
|
146
|
+
output: z.void(),
|
|
147
|
+
async: true,
|
|
148
|
+
description: 'A grantor’s pending role_grant offer was obsoleted by a sibling accept, by revoke of the resulting role_grant, or by destruction of the parent scope row.',
|
|
149
|
+
};
|
|
150
|
+
export const role_grant_revoke_notification_spec = {
|
|
151
|
+
method: ROLE_GRANT_REVOKE_NOTIFICATION_METHOD,
|
|
152
|
+
kind: 'remote_notification',
|
|
153
|
+
initiator: 'backend',
|
|
154
|
+
auth: null,
|
|
155
|
+
side_effects: true,
|
|
156
|
+
input: RoleGrantRevokeParams,
|
|
157
|
+
output: z.void(),
|
|
158
|
+
async: true,
|
|
159
|
+
description: 'An active role_grant on the revokee’s account was revoked.',
|
|
160
|
+
};
|
|
161
|
+
// -- EventSpec surface ------------------------------------------------------
|
|
162
|
+
/**
|
|
163
|
+
* SSE/WS event specs for the consentful-role-grants notification surface.
|
|
164
|
+
*
|
|
165
|
+
* Pass to `create_app_server`'s `event_specs` so the attack surface reflects
|
|
166
|
+
* them and DEV-mode `create_validated_broadcaster` catches payload drift.
|
|
167
|
+
*/
|
|
168
|
+
export const ROLE_GRANT_OFFER_NOTIFICATION_SPECS = [
|
|
169
|
+
create_action_event_spec(role_grant_offer_received_notification_spec),
|
|
170
|
+
create_action_event_spec(role_grant_offer_retracted_notification_spec),
|
|
171
|
+
create_action_event_spec(role_grant_offer_accepted_notification_spec),
|
|
172
|
+
create_action_event_spec(role_grant_offer_declined_notification_spec),
|
|
173
|
+
create_action_event_spec(role_grant_offer_supersede_notification_spec),
|
|
174
|
+
create_action_event_spec(role_grant_revoke_notification_spec),
|
|
175
|
+
];
|
|
176
|
+
// -- Notification builders --------------------------------------------------
|
|
177
|
+
export const build_role_grant_offer_received_notification = (params) => create_jsonrpc_notification(ROLE_GRANT_OFFER_RECEIVED_NOTIFICATION_METHOD, params);
|
|
178
|
+
export const build_role_grant_offer_retracted_notification = (params) => create_jsonrpc_notification(ROLE_GRANT_OFFER_RETRACTED_NOTIFICATION_METHOD, params);
|
|
179
|
+
export const build_role_grant_offer_accepted_notification = (params) => create_jsonrpc_notification(ROLE_GRANT_OFFER_ACCEPTED_NOTIFICATION_METHOD, params);
|
|
180
|
+
export const build_role_grant_offer_declined_notification = (params) => create_jsonrpc_notification(ROLE_GRANT_OFFER_DECLINED_NOTIFICATION_METHOD, params);
|
|
181
|
+
export const build_role_grant_offer_supersede_notification = (params) => create_jsonrpc_notification(ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD, params);
|
|
182
|
+
export const build_role_grant_revoke_notification = (params) => create_jsonrpc_notification(ROLE_GRANT_REVOKE_NOTIFICATION_METHOD, params);
|