@fuzdev/fuz_app 0.55.0 → 0.57.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 +211 -155
- 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 +19 -0
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +20 -14
- 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 +110 -44
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +92 -287
- 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 +44 -38
- 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 +2 -10
- package/dist/actions/register_ws_endpoint.d.ts.map +1 -1
- package/dist/actions/register_ws_endpoint.js +32 -10
- 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 +673 -442
- 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 +8 -14
- package/dist/auth/account_actions.d.ts.map +1 -1
- package/dist/auth/account_actions.js +26 -32
- package/dist/auth/account_queries.d.ts +46 -13
- package/dist/auth/account_queries.d.ts.map +1 -1
- package/dist/auth/account_queries.js +73 -33
- package/dist/auth/account_routes.d.ts +4 -3
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +58 -33
- package/dist/auth/account_schema.d.ts +46 -54
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +21 -48
- package/dist/auth/admin_action_specs.d.ts +55 -21
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +42 -26
- package/dist/auth/admin_actions.d.ts +14 -21
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +47 -44
- 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 -87
- package/dist/auth/audit_log_queries.d.ts.map +1 -1
- package/dist/auth/audit_log_queries.js +17 -96
- 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 +48 -42
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +56 -43
- 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/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 -47
- 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 +1 -1
- package/dist/auth/daemon_token_middleware.js +3 -3
- 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 -32
- 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 +5 -2
- package/dist/auth/migrations.d.ts +22 -7
- package/dist/auth/migrations.d.ts.map +1 -1
- package/dist/auth/migrations.js +64 -25
- package/dist/auth/request_context.d.ts +157 -170
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +224 -268
- package/dist/auth/{permit_offer_action_specs.d.ts → role_grant_offer_action_specs.d.ts} +130 -100
- 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/{permit_offer_actions.js → role_grant_offer_actions.js} +153 -140
- package/dist/auth/{permit_offer_notifications.d.ts → role_grant_offer_notifications.d.ts} +80 -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/{permit_offer_queries.d.ts → role_grant_offer_queries.d.ts} +64 -64
- package/dist/auth/role_grant_offer_queries.d.ts.map +1 -0
- package/dist/auth/{permit_offer_queries.js → role_grant_offer_queries.js} +136 -123
- 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} +55 -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 +4 -1
- package/dist/auth/self_service_role_action_specs.d.ts.map +1 -1
- package/dist/auth/self_service_role_action_specs.js +2 -2
- package/dist/auth/self_service_role_actions.d.ts +35 -29
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +58 -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 +1 -1
- package/dist/db/migrate.js +1 -1
- package/dist/dev/setup.d.ts +2 -2
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +4 -4
- package/dist/env/load.d.ts +1 -1
- package/dist/env/load.js +1 -1
- package/dist/hono_context.d.ts +27 -45
- package/dist/hono_context.d.ts.map +1 -1
- package/dist/hono_context.js +14 -28
- package/dist/http/CLAUDE.md +235 -121
- 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 +72 -39
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +81 -33
- 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 +89 -75
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +54 -72
- package/dist/http/schema_helpers.d.ts +3 -14
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +2 -14
- package/dist/http/surface.d.ts +2 -10
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +3 -4
- 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 +35 -40
- package/dist/server/validate_nginx.d.ts +1 -1
- package/dist/server/validate_nginx.js +1 -1
- package/dist/testing/CLAUDE.md +50 -38
- 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 +87 -85
- 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 +16 -15
- 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 +36 -36
- 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 +22 -19
- 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 +8 -7
- package/dist/testing/entities.d.ts.map +1 -1
- package/dist/testing/entities.js +21 -18
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +13 -14
- package/dist/testing/integration_helpers.d.ts +4 -4
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +20 -18
- package/dist/testing/middleware.d.ts +4 -4
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +12 -11
- package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
- package/dist/testing/rpc_attack_surface.js +40 -24
- 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 +14 -6
- package/dist/testing/surface_invariants.d.ts.map +1 -1
- package/dist/testing/surface_invariants.js +119 -43
- 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 +19 -11
- 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 +60 -60
- package/dist/ui/{PermitOfferForm.svelte → RoleGrantOfferForm.svelte} +27 -26
- package/dist/ui/{PermitOfferForm.svelte.d.ts → RoleGrantOfferForm.svelte.d.ts} +7 -7
- 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 +18 -18
- package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.js +16 -16
- 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} +30 -30
- 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} +18 -18
- 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 -258
- 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_notifications.d.ts.map +0 -1
- package/dist/auth/permit_offer_notifications.js +0 -182
- package/dist/auth/permit_offer_queries.d.ts.map +0 -1
- package/dist/auth/permit_offer_schema.d.ts +0 -125
- package/dist/auth/permit_offer_schema.d.ts.map +0 -1
- package/dist/auth/permit_queries.d.ts +0 -222
- package/dist/auth/permit_queries.d.ts.map +0 -1
- package/dist/auth/permit_queries.js +0 -305
- 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 -27
- package/dist/auth/route_guards.d.ts.map +0 -1
- package/dist/auth/route_guards.js +0 -38
- 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.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,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type RoleGrantOfferJson } from '../auth/role_grant_offer_schema.js';
|
|
2
2
|
type $$ComponentProps = {
|
|
3
3
|
to_account_id: string;
|
|
4
4
|
/**
|
|
@@ -7,14 +7,14 @@ type $$ComponentProps = {
|
|
|
7
7
|
* actor on the recipient account may accept.
|
|
8
8
|
*/
|
|
9
9
|
to_actor_id?: string | null;
|
|
10
|
-
/** Roles the caller may offer — caller filters
|
|
10
|
+
/** Roles the caller may offer — caller filters upstream (default: admin-grant-path). */
|
|
11
11
|
roles: Array<string>;
|
|
12
12
|
/** Resource scope for the offer; `null` (default) yields a global offer. */
|
|
13
13
|
scope_id?: string | null;
|
|
14
|
-
on_created?: (offer:
|
|
14
|
+
on_created?: (offer: RoleGrantOfferJson) => void;
|
|
15
15
|
format_role?: (role: string) => string;
|
|
16
16
|
};
|
|
17
|
-
declare const
|
|
18
|
-
type
|
|
19
|
-
export default
|
|
20
|
-
//# sourceMappingURL=
|
|
17
|
+
declare const RoleGrantOfferForm: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
18
|
+
type RoleGrantOfferForm = ReturnType<typeof RoleGrantOfferForm>;
|
|
19
|
+
export default RoleGrantOfferForm;
|
|
20
|
+
//# sourceMappingURL=RoleGrantOfferForm.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleGrantOfferForm.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/RoleGrantOfferForm.svelte"],"names":[],"mappings":"AAkBA,OAAO,EAEL,KAAK,kBAAkB,EACvB,MAAM,oCAAoC,CAAC;AAS5C,KAAK,gBAAgB,GAAI;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,wFAAwF;IACxF,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACjD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACvC,CAAC;AA4GH,QAAA,MAAM,kBAAkB,sDAAwC,CAAC;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
/**
|
|
3
|
-
* Both-directions
|
|
3
|
+
* Both-directions role_grant offer history table.
|
|
4
4
|
*
|
|
5
5
|
* Shows every offer involving the current account — recipient or grantor
|
|
6
6
|
* — including terminal rows (accepted, declined, retracted, superseded,
|
|
7
|
-
* expired). Backed by `
|
|
8
|
-
* via `
|
|
7
|
+
* expired). Backed by `role_grant_offer_history` (new RPC action); seeded
|
|
8
|
+
* via `RoleGrantOffersState.fetch_history()`.
|
|
9
9
|
*
|
|
10
10
|
* Consumers plug in optional `format_actor` / `format_scope` callbacks
|
|
11
11
|
* for display names.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import {
|
|
14
|
+
import {role_grant_offers_state_context} from './role_grant_offers_state.svelte.js';
|
|
15
15
|
import Datatable from './Datatable.svelte';
|
|
16
16
|
import type {DatatableColumn} from './datatable.js';
|
|
17
17
|
import {format_relative_time, format_datetime_local, truncate_uuid} from './ui_format.js';
|
|
18
|
-
import type {
|
|
18
|
+
import type {RoleGrantOfferJson} from '../auth/role_grant_offer_schema.js';
|
|
19
19
|
import {format_scope_context, resolve_scope_label, type FormatScope} from './format_scope.js';
|
|
20
20
|
|
|
21
21
|
const {
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
format_role?: (role: string) => string;
|
|
37
37
|
} = $props();
|
|
38
38
|
|
|
39
|
-
const
|
|
39
|
+
const role_grant_offers = role_grant_offers_state_context.get();
|
|
40
40
|
const get_format_scope = format_scope_context.get();
|
|
41
41
|
const format_scope_from_context = $derived(get_format_scope());
|
|
42
42
|
|
|
43
43
|
const now = $state.raw(Date.now());
|
|
44
44
|
|
|
45
|
-
const status_of = (offer:
|
|
45
|
+
const status_of = (offer: RoleGrantOfferJson): string => {
|
|
46
46
|
if (offer.accepted_at) return 'accepted';
|
|
47
47
|
if (offer.declined_at) return 'declined';
|
|
48
48
|
if (offer.retracted_at) return 'retracted';
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
const scope_label = (scope_id: string | null, role: string): string =>
|
|
71
71
|
resolve_scope_label(scope_id, role, format_scope ?? format_scope_from_context, 'global');
|
|
72
72
|
|
|
73
|
-
const columns: Array<DatatableColumn<
|
|
73
|
+
const columns: Array<DatatableColumn<RoleGrantOfferJson>> = [
|
|
74
74
|
{key: 'from_actor_id', label: 'direction', width: 110},
|
|
75
75
|
{key: 'role', label: 'role', width: 140},
|
|
76
76
|
{key: 'scope_id', label: 'scope', width: 160},
|
|
@@ -82,12 +82,12 @@
|
|
|
82
82
|
<section>
|
|
83
83
|
<h2>offer history</h2>
|
|
84
84
|
|
|
85
|
-
{#if
|
|
85
|
+
{#if role_grant_offers.loading}
|
|
86
86
|
<p class="text_50">loading history...</p>
|
|
87
|
-
{:else if
|
|
88
|
-
<p class="color_c_50">{
|
|
87
|
+
{:else if role_grant_offers.error}
|
|
88
|
+
<p class="color_c_50">{role_grant_offers.error}</p>
|
|
89
89
|
{:else}
|
|
90
|
-
<Datatable {columns} rows={
|
|
90
|
+
<Datatable {columns} rows={role_grant_offers.history} height="400px" row_key="id">
|
|
91
91
|
{#snippet cell(column, row)}
|
|
92
92
|
{#if column.key === 'from_actor_id'}
|
|
93
93
|
{#if current_actor_id && row.from_actor_id === current_actor_id}
|
|
@@ -11,7 +11,7 @@ type $$ComponentProps = {
|
|
|
11
11
|
format_scope?: FormatScope;
|
|
12
12
|
format_role?: (role: string) => string;
|
|
13
13
|
};
|
|
14
|
-
declare const
|
|
15
|
-
type
|
|
16
|
-
export default
|
|
17
|
-
//# sourceMappingURL=
|
|
14
|
+
declare const RoleGrantOfferHistory: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
15
|
+
type RoleGrantOfferHistory = ReturnType<typeof RoleGrantOfferHistory>;
|
|
16
|
+
export default RoleGrantOfferHistory;
|
|
17
|
+
//# sourceMappingURL=RoleGrantOfferHistory.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleGrantOfferHistory.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/RoleGrantOfferHistory.svelte"],"names":[],"mappings":"AAmBA,OAAO,EAA4C,KAAK,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAE7F,KAAK,gBAAgB,GAAI;IACxB,oFAAoF;IACpF,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD;;;;OAIG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACvC,CAAC;AAkGH,QAAA,MAAM,qBAAqB,sDAAwC,CAAC;AACpE,KAAK,qBAAqB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACtE,eAAe,qBAAqB,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Recipient-side pending offer inbox.
|
|
4
4
|
*
|
|
5
|
-
* Renders `
|
|
5
|
+
* Renders `RoleGrantOffersState.incoming` (pending, soonest-expiry first)
|
|
6
6
|
* with accept + decline-with-reason controls. Grantor and scope rendering
|
|
7
7
|
* are delegated via optional callback props — consumers plug in display
|
|
8
8
|
* names once they know what a `from_actor_id` / `scope_id` represents
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
import PendingButton from '@fuzdev/fuz_ui/PendingButton.svelte';
|
|
13
13
|
import {SvelteMap} from 'svelte/reactivity';
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import {role_grant_offers_state_context} from './role_grant_offers_state.svelte.js';
|
|
16
16
|
import ConfirmButton from './ConfirmButton.svelte';
|
|
17
17
|
import {format_relative_time, format_datetime_local, truncate_uuid} from './ui_format.js';
|
|
18
|
-
import {
|
|
18
|
+
import {ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX} from '../auth/role_grant_offer_schema.js';
|
|
19
19
|
import {format_scope_context, resolve_scope_label, type FormatScope} from './format_scope.js';
|
|
20
20
|
|
|
21
21
|
const {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
format_role?: (role: string) => string;
|
|
36
36
|
} = $props();
|
|
37
37
|
|
|
38
|
-
const
|
|
38
|
+
const role_grant_offers = role_grant_offers_state_context.get();
|
|
39
39
|
const get_format_scope = format_scope_context.get();
|
|
40
40
|
const format_scope_from_context = $derived(get_format_scope());
|
|
41
41
|
|
|
@@ -45,18 +45,18 @@
|
|
|
45
45
|
const decline_reasons: SvelteMap<string, string> = new SvelteMap();
|
|
46
46
|
</script>
|
|
47
47
|
|
|
48
|
-
<section class="
|
|
48
|
+
<section class="role-grant-offer-inbox">
|
|
49
49
|
<h2>pending offers</h2>
|
|
50
50
|
|
|
51
|
-
{#if
|
|
52
|
-
<p class="color_c_50">{
|
|
51
|
+
{#if role_grant_offers.error}
|
|
52
|
+
<p class="color_c_50">{role_grant_offers.error}</p>
|
|
53
53
|
{/if}
|
|
54
54
|
|
|
55
|
-
{#if
|
|
55
|
+
{#if role_grant_offers.incoming.length === 0}
|
|
56
56
|
<p class="text_50">No pending offers.</p>
|
|
57
57
|
{:else}
|
|
58
58
|
<ul class="column gap_md">
|
|
59
|
-
{#each
|
|
59
|
+
{#each role_grant_offers.incoming as offer (offer.id)}
|
|
60
60
|
<li class="box p_md column gap_sm">
|
|
61
61
|
<div class="row gap_sm align_center">
|
|
62
62
|
<span class="chip color_a">{format_role(offer.role)}</span>
|
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
|
|
77
77
|
<div class="row gap_sm">
|
|
78
78
|
<PendingButton
|
|
79
|
-
pending={
|
|
80
|
-
disabled={
|
|
81
|
-
onclick={() =>
|
|
79
|
+
pending={role_grant_offers.loading}
|
|
80
|
+
disabled={role_grant_offers.loading}
|
|
81
|
+
onclick={() => role_grant_offers.accept(offer.id)}
|
|
82
82
|
class="color_b"
|
|
83
83
|
>
|
|
84
84
|
accept
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
position="bottom"
|
|
90
90
|
onconfirm={() => {
|
|
91
91
|
const reason = decline_reasons.get(offer.id) ?? '';
|
|
92
|
-
void
|
|
92
|
+
void role_grant_offers.decline(offer.id, reason || null);
|
|
93
93
|
decline_reasons.delete(offer.id);
|
|
94
94
|
}}
|
|
95
95
|
>
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
<div class="title">reason (optional)</div>
|
|
103
103
|
<textarea
|
|
104
104
|
name="decline-reason"
|
|
105
|
-
maxlength={
|
|
105
|
+
maxlength={ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX}
|
|
106
106
|
placeholder="optional reason"
|
|
107
107
|
value={decline_reasons.get(offer.id) ?? ''}
|
|
108
108
|
oninput={(e) =>
|
|
@@ -11,7 +11,7 @@ type $$ComponentProps = {
|
|
|
11
11
|
/** Display label for a role constant. Defaults to identity. */
|
|
12
12
|
format_role?: (role: string) => string;
|
|
13
13
|
};
|
|
14
|
-
declare const
|
|
15
|
-
type
|
|
16
|
-
export default
|
|
17
|
-
//# sourceMappingURL=
|
|
14
|
+
declare const RoleGrantOfferInbox: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
15
|
+
type RoleGrantOfferInbox = ReturnType<typeof RoleGrantOfferInbox>;
|
|
16
|
+
export default RoleGrantOfferInbox;
|
|
17
|
+
//# sourceMappingURL=RoleGrantOfferInbox.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleGrantOfferInbox.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/RoleGrantOfferInbox.svelte"],"names":[],"mappings":"AAmBA,OAAO,EAA4C,KAAK,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAE7F,KAAK,gBAAgB,GAAI;IACxB,uEAAuE;IACvE,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD;;;;OAIG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,+DAA+D;IAC/D,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACvC,CAAC;AA2FH,QAAA,MAAM,mBAAmB,sDAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import PendingButton from '@fuzdev/fuz_ui/PendingButton.svelte';
|
|
17
17
|
import {autofocus} from '@fuzdev/fuz_ui/autofocus.svelte.js';
|
|
18
18
|
|
|
19
|
-
import {Username} from '../
|
|
19
|
+
import {Username} from '../primitive_schemas.js';
|
|
20
20
|
import {PASSWORD_LENGTH_MIN} from '../auth/password.js';
|
|
21
21
|
import {auth_state_context} from './auth_state.svelte.js';
|
|
22
22
|
import {FormState} from './form_state.svelte.js';
|
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
|
|
13
13
|
import type {AppSurface, AppSurfaceRoute, AppSurfaceDiagnostic} from '../http/surface.js';
|
|
14
14
|
import {surface_auth_summary, format_route_key} from '../http/surface_query.js';
|
|
15
|
+
import {
|
|
16
|
+
is_keeper_auth,
|
|
17
|
+
is_plain_authenticated_auth,
|
|
18
|
+
is_public_auth,
|
|
19
|
+
is_role_auth,
|
|
20
|
+
} from '../http/auth_shape.js';
|
|
15
21
|
|
|
16
22
|
const {surface}: {surface: AppSurface} = $props();
|
|
17
23
|
|
|
@@ -22,10 +28,26 @@
|
|
|
22
28
|
|
|
23
29
|
const summary = $derived(surface_auth_summary(surface));
|
|
24
30
|
|
|
31
|
+
const auth_matches_filter = (
|
|
32
|
+
auth: AppSurfaceRoute['auth'],
|
|
33
|
+
filter: (typeof auth_types)[number],
|
|
34
|
+
): boolean => {
|
|
35
|
+
switch (filter) {
|
|
36
|
+
case 'all':
|
|
37
|
+
return true;
|
|
38
|
+
case 'none':
|
|
39
|
+
return is_public_auth(auth);
|
|
40
|
+
case 'authenticated':
|
|
41
|
+
return is_plain_authenticated_auth(auth);
|
|
42
|
+
case 'role':
|
|
43
|
+
return is_role_auth(auth);
|
|
44
|
+
case 'keeper':
|
|
45
|
+
return is_keeper_auth(auth);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
25
49
|
const filtered_routes: Array<AppSurfaceRoute> = $derived(
|
|
26
|
-
|
|
27
|
-
? surface.routes
|
|
28
|
-
: surface.routes.filter((r) => r.auth.type === auth_filter),
|
|
50
|
+
surface.routes.filter((r) => auth_matches_filter(r.auth, auth_filter)),
|
|
29
51
|
);
|
|
30
52
|
|
|
31
53
|
let expanded_event: string | null = $state.raw(null);
|
|
@@ -39,21 +61,19 @@
|
|
|
39
61
|
};
|
|
40
62
|
|
|
41
63
|
const format_auth = (auth: AppSurfaceRoute['auth']): string => {
|
|
42
|
-
if (auth
|
|
43
|
-
return
|
|
64
|
+
if (is_public_auth(auth)) return 'none';
|
|
65
|
+
if (is_keeper_auth(auth)) return 'keeper';
|
|
66
|
+
if (is_role_auth(auth)) return `role:${auth.roles!.join('|')}`;
|
|
67
|
+
if (is_plain_authenticated_auth(auth)) return 'authenticated';
|
|
68
|
+
return 'other';
|
|
44
69
|
};
|
|
45
70
|
|
|
46
71
|
const auth_chip_class = (auth: AppSurfaceRoute['auth']): string => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
case 'role':
|
|
53
|
-
return 'chip color_d';
|
|
54
|
-
case 'keeper':
|
|
55
|
-
return 'chip color_c';
|
|
56
|
-
}
|
|
72
|
+
if (is_public_auth(auth)) return 'chip color_b';
|
|
73
|
+
if (is_keeper_auth(auth)) return 'chip color_c';
|
|
74
|
+
if (is_role_auth(auth)) return 'chip color_d';
|
|
75
|
+
if (is_plain_authenticated_auth(auth)) return 'chip color_a';
|
|
76
|
+
return 'chip';
|
|
57
77
|
};
|
|
58
78
|
|
|
59
79
|
const role_count = $derived(Array.from(summary.role.values()).reduce((sum, n) => sum + n, 0));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SurfaceExplorer.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/SurfaceExplorer.svelte"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAC,UAAU,EAAwC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"SurfaceExplorer.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/SurfaceExplorer.svelte"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAC,UAAU,EAAwC,MAAM,oBAAoB,CAAC;AASzF,KAAK,gBAAgB,GAAI;IAAC,OAAO,EAAE,UAAU,CAAA;CAAC,CAAC;AAuShD,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Reactive state for managing the authenticated account's auth sessions on a
|
|
3
|
-
* settings page. Reads and mutations flow through a narrow RPC adapter
|
|
4
|
-
*
|
|
5
|
-
* 2026-04-23 RPC migration.
|
|
3
|
+
* settings page. Reads and mutations flow through a narrow RPC adapter
|
|
4
|
+
* backed by `auth/account_actions.ts`.
|
|
6
5
|
*
|
|
7
6
|
* @module
|
|
8
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account_sessions_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/account_sessions_state.svelte.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"account_sessions_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/account_sessions_state.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAE/D;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,MAAM,OAAO,CAAC;QAAC,QAAQ,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;KAAC,CAAC,CAAC;IACxD,MAAM,EAAE,CAAC,MAAM,EAAE;QAAC,UAAU,EAAE,MAAM,CAAA;KAAC,KAAK,OAAO,CAAC;QAAC,EAAE,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAC,CAAC,CAAC;IAChF,UAAU,EAAE,MAAM,OAAO,CAAC;QAAC,EAAE,EAAE,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;CACrD;AAED;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;qBAAwB,kBAAkB,GAAG,IAAI;yBAAzB,kBAAkB,GAAG,IAAI,wBAAzB,kBAAkB,GAAG,IAAI;CAEzF,CAAC;AAEF,MAAM,WAAW,2BAA2B;IAC3C;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,kBAAkB,GAAG,IAAI,CAAC;CAC1C;AAED,qBAAa,oBAAqB,SAAQ,QAAQ;;IAGjD,QAAQ,EAAE,KAAK,CAAC,eAAe,CAAC,CAAkB;IAElD,QAAQ,CAAC,YAAY,SAAkC;gBAE3C,OAAO,CAAC,EAAE,2BAA2B;IAKjD,6FAA6F;IAC7F,IAAI,OAAO,IAAI,OAAO,CAErB;IAEK,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAYtB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAcjC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAejC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Reactive state for managing the authenticated account's auth sessions on a
|
|
3
|
-
* settings page. Reads and mutations flow through a narrow RPC adapter
|
|
4
|
-
*
|
|
5
|
-
* 2026-04-23 RPC migration.
|
|
3
|
+
* settings page. Reads and mutations flow through a narrow RPC adapter
|
|
4
|
+
* backed by `auth/account_actions.ts`.
|
|
6
5
|
*
|
|
7
6
|
* @module
|
|
8
7
|
*/
|
|
@@ -8,18 +8,18 @@ import type { Uuid } from '@fuzdev/fuz_util/id.js';
|
|
|
8
8
|
import { Loadable } from './loadable.svelte.js';
|
|
9
9
|
import type { AdminAccountEntryJson } from '../auth/account_schema.js';
|
|
10
10
|
import type { RoleName } from '../auth/role_schema.js';
|
|
11
|
-
import type {
|
|
11
|
+
import type { RoleGrantOfferJson } from '../auth/role_grant_offer_schema.js';
|
|
12
12
|
import type { AdminAccountListOutput, AdminSessionListOutput, AdminSessionRevokeAllInput, AdminSessionRevokeAllOutput, AdminTokenRevokeAllInput, AdminTokenRevokeAllOutput } from '../auth/admin_action_specs.js';
|
|
13
|
-
import type {
|
|
13
|
+
import type { RoleGrantOfferCreateInput, RoleGrantOfferCreateOutput, RoleGrantOfferOkOutput, RoleGrantRevokeInput, RoleGrantRevokeOutput } from '../auth/role_grant_offer_action_specs.js';
|
|
14
14
|
/**
|
|
15
15
|
* Narrow RPC surface consumed by `AdminAccountsState`. Consumers adapt their
|
|
16
16
|
* typed RPC client (e.g. a `create_rpc_client` Proxy) to this shape — the
|
|
17
17
|
* state class stays decoupled from the client's `Result` return type so
|
|
18
|
-
* tests can inject plain-function stubs. Mirrors the `
|
|
18
|
+
* tests can inject plain-function stubs. Mirrors the `RoleGrantOffersRpc`
|
|
19
19
|
* pattern.
|
|
20
20
|
*
|
|
21
21
|
* Every operation flows through RPC: the listing reuses `admin_account_list`,
|
|
22
|
-
* grant reuses `
|
|
22
|
+
* grant reuses `role_grant_offer_create`, revoke and retract have dedicated
|
|
23
23
|
* actions, and the session / token revoke-all mutations reuse
|
|
24
24
|
* `admin_session_revoke_all` and `admin_token_revoke_all`. Without the
|
|
25
25
|
* adapter the state class cannot fetch, grant, revoke, retract, or
|
|
@@ -33,9 +33,9 @@ import type { PermitOfferCreateInput, PermitOfferCreateOutput, PermitOfferOkOutp
|
|
|
33
33
|
export interface AdminAccountsRpc {
|
|
34
34
|
list_accounts: () => Promise<AdminAccountListOutput>;
|
|
35
35
|
list_sessions: () => Promise<AdminSessionListOutput>;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
retract_offer: (offer_id: Uuid) => Promise<
|
|
36
|
+
create_role_grant: (params: RoleGrantOfferCreateInput) => Promise<RoleGrantOfferCreateOutput>;
|
|
37
|
+
revoke_role_grant: (params: RoleGrantRevokeInput) => Promise<RoleGrantRevokeOutput>;
|
|
38
|
+
retract_offer: (offer_id: Uuid) => Promise<RoleGrantOfferOkOutput>;
|
|
39
39
|
session_revoke_all: (params: AdminSessionRevokeAllInput) => Promise<AdminSessionRevokeAllOutput>;
|
|
40
40
|
token_revoke_all: (params: AdminTokenRevokeAllInput) => Promise<AdminTokenRevokeAllOutput>;
|
|
41
41
|
}
|
|
@@ -56,7 +56,7 @@ export declare const admin_accounts_rpc_context: {
|
|
|
56
56
|
export interface AdminAccountsStateOptions {
|
|
57
57
|
/**
|
|
58
58
|
* Reactive accessor for the RPC adapter; returns `null` when unwired.
|
|
59
|
-
* Matches `
|
|
59
|
+
* Matches `RoleGrantOffersStateOptions.account_id` / `actor_id` pattern —
|
|
60
60
|
* lets the component pass a `$props()`-sourced rpc without tripping
|
|
61
61
|
* Svelte's `state_referenced_locally` warning.
|
|
62
62
|
*/
|
|
@@ -78,10 +78,10 @@ export declare class AdminAccountsState extends Loadable {
|
|
|
78
78
|
get has_rpc(): boolean;
|
|
79
79
|
fetch(): Promise<void>;
|
|
80
80
|
/**
|
|
81
|
-
* Offer the role to the recipient via the `
|
|
81
|
+
* Offer the role to the recipient via the `role_grant_offer_create` RPC.
|
|
82
82
|
* Server returns the pending offer; the recipient must accept before
|
|
83
|
-
* the
|
|
84
|
-
* callers can drive follow-up UX (e.g. seed `
|
|
83
|
+
* the role_grant materializes. Returns the offer payload on success so
|
|
84
|
+
* callers can drive follow-up UX (e.g. seed `RoleGrantOffersState.outgoing`).
|
|
85
85
|
*
|
|
86
86
|
* A re-offer from the same admin to the same `(account, role)`
|
|
87
87
|
* refreshes the existing pending row — the returned offer id is stable
|
|
@@ -97,21 +97,21 @@ export declare class AdminAccountsState extends Loadable {
|
|
|
97
97
|
* No-op when the rpc adapter is absent; `error` is set to a descriptive
|
|
98
98
|
* message so the UI surfaces the misconfiguration.
|
|
99
99
|
*/
|
|
100
|
-
|
|
100
|
+
create_role_grant(account_id: Uuid, role: RoleName, to_actor_id?: Uuid | null): Promise<RoleGrantOfferJson | undefined>;
|
|
101
101
|
/**
|
|
102
|
-
* Revoke an active
|
|
102
|
+
* Revoke an active role_grant via the `role_grant_revoke` RPC.
|
|
103
103
|
*
|
|
104
|
-
* `actor_id` is the natural key —
|
|
104
|
+
* `actor_id` is the natural key — role_grants are actor-scoped, and the
|
|
105
105
|
* admin UI reads `row.actor.id` straight from the listing, so the state
|
|
106
106
|
* class takes it directly rather than deriving it from `account_id`.
|
|
107
|
-
* The optional `reason` is stamped on `
|
|
107
|
+
* The optional `reason` is stamped on `role_grant.revoked_reason` and
|
|
108
108
|
* surfaced on the revokee's WS notification.
|
|
109
109
|
*/
|
|
110
|
-
|
|
110
|
+
revoke_role_grant(actor_id: Uuid, role_grant_id: Uuid, reason?: string | null): Promise<void>;
|
|
111
111
|
/**
|
|
112
|
-
* Retract a pending offer the admin issued via the `
|
|
112
|
+
* Retract a pending offer the admin issued via the `role_grant_offer_retract`
|
|
113
113
|
* RPC. The action handles auth, audit, and the
|
|
114
|
-
* `
|
|
114
|
+
* `role_grant_offer_retracted` WS notification.
|
|
115
115
|
*
|
|
116
116
|
* After success, refetches the listing so `pending_offers` drops the
|
|
117
117
|
* row and the "+ {role}" button un-hides.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin_accounts_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/admin_accounts_state.svelte.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAE5C,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"admin_accounts_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/admin_accounts_state.svelte.ts"],"names":[],"mappings":"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"}
|
|
@@ -49,10 +49,10 @@ export class AdminAccountsState extends Loadable {
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
* Offer the role to the recipient via the `
|
|
52
|
+
* Offer the role to the recipient via the `role_grant_offer_create` RPC.
|
|
53
53
|
* Server returns the pending offer; the recipient must accept before
|
|
54
|
-
* the
|
|
55
|
-
* callers can drive follow-up UX (e.g. seed `
|
|
54
|
+
* the role_grant materializes. Returns the offer payload on success so
|
|
55
|
+
* callers can drive follow-up UX (e.g. seed `RoleGrantOffersState.outgoing`).
|
|
56
56
|
*
|
|
57
57
|
* A re-offer from the same admin to the same `(account, role)`
|
|
58
58
|
* refreshes the existing pending row — the returned offer id is stable
|
|
@@ -68,7 +68,7 @@ export class AdminAccountsState extends Loadable {
|
|
|
68
68
|
* No-op when the rpc adapter is absent; `error` is set to a descriptive
|
|
69
69
|
* message so the UI surfaces the misconfiguration.
|
|
70
70
|
*/
|
|
71
|
-
async
|
|
71
|
+
async create_role_grant(account_id, role, to_actor_id) {
|
|
72
72
|
const rpc = this.#get_rpc();
|
|
73
73
|
if (!rpc) {
|
|
74
74
|
this.error = 'rpc adapter not wired';
|
|
@@ -77,7 +77,7 @@ export class AdminAccountsState extends Loadable {
|
|
|
77
77
|
const key = to_actor_id ? `${account_id}:${role}:${to_actor_id}` : `${account_id}:${role}`;
|
|
78
78
|
this.granting_keys.add(key);
|
|
79
79
|
try {
|
|
80
|
-
const { offer } = await rpc.
|
|
80
|
+
const { offer } = await rpc.create_role_grant({
|
|
81
81
|
to_account_id: account_id,
|
|
82
82
|
role,
|
|
83
83
|
...(to_actor_id ? { to_actor_id } : {}),
|
|
@@ -87,7 +87,7 @@ export class AdminAccountsState extends Loadable {
|
|
|
87
87
|
return offer;
|
|
88
88
|
}
|
|
89
89
|
catch (e) {
|
|
90
|
-
this.error = e instanceof Error ? e.message : 'Failed to grant
|
|
90
|
+
this.error = e instanceof Error ? e.message : 'Failed to grant role_grant';
|
|
91
91
|
return undefined;
|
|
92
92
|
}
|
|
93
93
|
finally {
|
|
@@ -95,37 +95,37 @@ export class AdminAccountsState extends Loadable {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
98
|
-
* Revoke an active
|
|
98
|
+
* Revoke an active role_grant via the `role_grant_revoke` RPC.
|
|
99
99
|
*
|
|
100
|
-
* `actor_id` is the natural key —
|
|
100
|
+
* `actor_id` is the natural key — role_grants are actor-scoped, and the
|
|
101
101
|
* admin UI reads `row.actor.id` straight from the listing, so the state
|
|
102
102
|
* class takes it directly rather than deriving it from `account_id`.
|
|
103
|
-
* The optional `reason` is stamped on `
|
|
103
|
+
* The optional `reason` is stamped on `role_grant.revoked_reason` and
|
|
104
104
|
* surfaced on the revokee's WS notification.
|
|
105
105
|
*/
|
|
106
|
-
async
|
|
106
|
+
async revoke_role_grant(actor_id, role_grant_id, reason) {
|
|
107
107
|
const rpc = this.#get_rpc();
|
|
108
108
|
if (!rpc) {
|
|
109
109
|
this.error = 'rpc adapter not wired';
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
|
-
this.revoking_ids.add(
|
|
112
|
+
this.revoking_ids.add(role_grant_id);
|
|
113
113
|
try {
|
|
114
|
-
await rpc.
|
|
114
|
+
await rpc.revoke_role_grant({ actor_id, role_grant_id, reason: reason ?? null });
|
|
115
115
|
this.error = null;
|
|
116
116
|
await this.fetch();
|
|
117
117
|
}
|
|
118
118
|
catch (e) {
|
|
119
|
-
this.error = e instanceof Error ? e.message : 'Failed to revoke
|
|
119
|
+
this.error = e instanceof Error ? e.message : 'Failed to revoke role_grant';
|
|
120
120
|
}
|
|
121
121
|
finally {
|
|
122
|
-
this.revoking_ids.delete(
|
|
122
|
+
this.revoking_ids.delete(role_grant_id);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
|
-
* Retract a pending offer the admin issued via the `
|
|
126
|
+
* Retract a pending offer the admin issued via the `role_grant_offer_retract`
|
|
127
127
|
* RPC. The action handles auth, audit, and the
|
|
128
|
-
* `
|
|
128
|
+
* `role_grant_offer_retracted` WS notification.
|
|
129
129
|
*
|
|
130
130
|
* After success, refetches the listing so `pending_offers` drops the
|
|
131
131
|
* row and the "+ {role}" button un-hides.
|