@fuzdev/fuz_app 0.68.0 → 0.70.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/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +10 -3
- package/dist/auth/admin_action_specs.d.ts +2 -3
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +2 -3
- package/dist/auth/admin_actions.d.ts +4 -14
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +28 -36
- package/dist/auth/signup_routes.d.ts +0 -3
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +9 -3
- package/dist/auth/standard_rpc_actions.d.ts +5 -5
- package/dist/auth/standard_rpc_actions.js +4 -4
- package/dist/server/app_server.d.ts +1 -7
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +1 -5
- package/dist/testing/CLAUDE.md +98 -10
- package/dist/testing/app_server.d.ts +34 -0
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +31 -6
- package/dist/testing/cross_backend/account_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/account_lifecycle.js +69 -1
- package/dist/testing/cross_backend/actor_lookup.d.ts +10 -0
- package/dist/testing/cross_backend/actor_lookup.d.ts.map +1 -0
- package/dist/testing/cross_backend/actor_lookup.js +83 -0
- package/dist/testing/cross_backend/actor_search.d.ts +6 -0
- package/dist/testing/cross_backend/actor_search.d.ts.map +1 -0
- package/dist/testing/cross_backend/actor_search.js +92 -0
- package/dist/testing/cross_backend/app_settings.d.ts +6 -0
- package/dist/testing/cross_backend/app_settings.d.ts.map +1 -0
- package/dist/testing/cross_backend/app_settings.js +95 -0
- package/dist/testing/cross_backend/backend_config.d.ts +1 -1
- package/dist/testing/cross_backend/capabilities.d.ts +0 -9
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/capabilities.js +0 -1
- package/dist/testing/cross_backend/cell_grant_role.d.ts +8 -0
- package/dist/testing/cross_backend/cell_grant_role.d.ts.map +1 -0
- package/dist/testing/cross_backend/cell_grant_role.js +102 -0
- package/dist/testing/cross_backend/conformance_case.d.ts +144 -0
- package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -0
- package/dist/testing/cross_backend/conformance_case.js +132 -0
- package/dist/testing/cross_backend/conformance_table.d.ts +46 -0
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -0
- package/dist/testing/cross_backend/conformance_table.js +199 -0
- package/dist/testing/cross_backend/create_cross_backend_global_setup.d.ts +57 -0
- package/dist/testing/cross_backend/create_cross_backend_global_setup.d.ts.map +1 -0
- package/dist/testing/cross_backend/create_cross_backend_global_setup.js +31 -0
- package/dist/testing/cross_backend/default_backend_configs.d.ts +13 -0
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +4 -6
- package/dist/testing/cross_backend/default_spine_surface.d.ts +17 -9
- package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_spine_surface.js +20 -12
- package/dist/testing/cross_backend/make_cross_backend_project.d.ts +72 -0
- package/dist/testing/cross_backend/make_cross_backend_project.d.ts.map +1 -0
- package/dist/testing/cross_backend/make_cross_backend_project.js +51 -0
- package/dist/testing/cross_backend/origin.d.ts +10 -0
- package/dist/testing/cross_backend/origin.d.ts.map +1 -0
- package/dist/testing/cross_backend/origin.js +73 -0
- package/dist/testing/cross_backend/setup.d.ts +22 -40
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +34 -5
- package/dist/testing/cross_backend/standard.d.ts +8 -0
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/standard.js +1 -0
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +102 -10
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +96 -5
- package/dist/testing/cross_backend/xfail.d.ts +15 -0
- package/dist/testing/cross_backend/xfail.d.ts.map +1 -0
- package/dist/testing/cross_backend/xfail.js +37 -0
- package/dist/testing/integration.d.ts +2 -3
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +40 -88
- package/dist/testing/rate_limiting.d.ts +1 -1
- package/dist/testing/rpc_helpers.d.ts +3 -3
- package/dist/testing/sse_round_trip.d.ts +1 -1
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +0 -1
- package/dist/ui/AdminAccounts.svelte +74 -83
- package/dist/ui/AdminAccounts.svelte.d.ts.map +1 -1
- package/dist/ui/AdminSessions.svelte +21 -23
- package/dist/ui/AdminSessions.svelte.d.ts.map +1 -1
- package/dist/ui/CLAUDE.md +17 -26
- package/dist/ui/OpenSignupToggle.svelte +2 -5
- package/dist/ui/OpenSignupToggle.svelte.d.ts.map +1 -1
- package/dist/ui/account_sessions_state.svelte.d.ts +9 -10
- package/dist/ui/account_sessions_state.svelte.d.ts.map +1 -1
- package/dist/ui/account_sessions_state.svelte.js +7 -17
- package/dist/ui/admin_accounts_state.svelte.d.ts +12 -19
- package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.js +10 -24
- package/dist/ui/admin_invites_state.svelte.d.ts +8 -11
- package/dist/ui/admin_invites_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_invites_state.svelte.js +7 -16
- package/dist/ui/admin_sessions_state.svelte.d.ts +6 -10
- package/dist/ui/admin_sessions_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_sessions_state.svelte.js +4 -14
- package/dist/ui/app_settings_state.svelte.d.ts +8 -12
- package/dist/ui/app_settings_state.svelte.d.ts.map +1 -1
- package/dist/ui/app_settings_state.svelte.js +6 -16
- package/dist/ui/audit_log_state.svelte.d.ts +9 -8
- package/dist/ui/audit_log_state.svelte.d.ts.map +1 -1
- package/dist/ui/audit_log_state.svelte.js +8 -20
- package/package.json +1 -1
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Single checkbox bound to `AppSettings.open_signup`. Consumes
|
|
4
4
|
* `app_settings_rpc_context`; the toggle calls `app_settings_update` RPC
|
|
5
|
-
* via `AppSettingsState.update_open_signup`.
|
|
6
|
-
* `has_rpc` is `false` (renders an "rpc adapter not wired" notice).
|
|
5
|
+
* via `AppSettingsState.update_open_signup`.
|
|
7
6
|
*
|
|
8
7
|
* @module
|
|
9
8
|
*/
|
|
@@ -17,9 +16,7 @@
|
|
|
17
16
|
</script>
|
|
18
17
|
|
|
19
18
|
<div class="open-signup-toggle">
|
|
20
|
-
{#if
|
|
21
|
-
<p class="text_50">rpc adapter not wired</p>
|
|
22
|
-
{:else if app_settings.list.loading}
|
|
19
|
+
{#if app_settings.list.loading}
|
|
23
20
|
<p class="text_50">loading settings...</p>
|
|
24
21
|
{:else if app_settings.settings}
|
|
25
22
|
<label class="row">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenSignupToggle.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/OpenSignupToggle.svelte"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OpenSignupToggle.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/OpenSignupToggle.svelte"],"names":[],"mappings":"AA8CA,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IACtG,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,gBAAgB;;kBAA+E,CAAC;AACpF,KAAK,gBAAgB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAChE,eAAe,gBAAgB,CAAC"}
|
|
@@ -43,19 +43,20 @@ export interface AccountSessionsRpc {
|
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Svelte context carrying the reactive `AccountSessionsRpc` accessor. Mirrors
|
|
46
|
-
* the admin-side RPC contexts.
|
|
47
|
-
*
|
|
46
|
+
* the admin-side RPC contexts. `get()` throws when no provisioner ran above
|
|
47
|
+
* the component — the adapter is required.
|
|
48
48
|
*/
|
|
49
49
|
export declare const account_sessions_rpc_context: {
|
|
50
|
-
get: () => () => AccountSessionsRpc
|
|
51
|
-
|
|
50
|
+
get: (error_message?: string) => () => AccountSessionsRpc;
|
|
51
|
+
get_maybe: () => (() => AccountSessionsRpc) | undefined;
|
|
52
|
+
set: (value: () => AccountSessionsRpc) => () => AccountSessionsRpc;
|
|
52
53
|
};
|
|
53
54
|
export interface AccountSessionsStateOptions {
|
|
54
55
|
/**
|
|
55
|
-
* Reactive accessor for the RPC adapter
|
|
56
|
-
*
|
|
56
|
+
* Reactive accessor for the RPC adapter. Matches the `get_rpc` pattern on
|
|
57
|
+
* the admin state classes.
|
|
57
58
|
*/
|
|
58
|
-
get_rpc
|
|
59
|
+
get_rpc: () => AccountSessionsRpc;
|
|
59
60
|
}
|
|
60
61
|
export declare class AccountSessionsState {
|
|
61
62
|
#private;
|
|
@@ -64,9 +65,7 @@ export declare class AccountSessionsState {
|
|
|
64
65
|
readonly revoke_all: AsyncSlot<void, string>;
|
|
65
66
|
sessions: Array<AuthSessionJson>;
|
|
66
67
|
readonly active_count: number;
|
|
67
|
-
constructor(options
|
|
68
|
-
/** True when an RPC adapter is wired. `fetch` / `submit_revoke` / `submit_revoke_all` no-op without it. */
|
|
69
|
-
get has_rpc(): boolean;
|
|
68
|
+
constructor(options: AccountSessionsStateOptions);
|
|
70
69
|
fetch(): Promise<void>;
|
|
71
70
|
submit_revoke(id: string): Promise<void>;
|
|
72
71
|
submit_revoke_all(): Promise<void>;
|
|
@@ -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;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AAC5D,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,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,CAAkC;gBAEnD,OAAO,EAAE,2BAA2B;IAI1C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAOtB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOxC,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;CAUxC"}
|
|
@@ -16,10 +16,10 @@ import { AsyncSlot } from './async_slot.svelte.js';
|
|
|
16
16
|
import { KeyedAsyncSlot } from './keyed_async_slot.svelte.js';
|
|
17
17
|
/**
|
|
18
18
|
* Svelte context carrying the reactive `AccountSessionsRpc` accessor. Mirrors
|
|
19
|
-
* the admin-side RPC contexts.
|
|
20
|
-
*
|
|
19
|
+
* the admin-side RPC contexts. `get()` throws when no provisioner ran above
|
|
20
|
+
* the component — the adapter is required.
|
|
21
21
|
*/
|
|
22
|
-
export const account_sessions_rpc_context = create_context(
|
|
22
|
+
export const account_sessions_rpc_context = create_context();
|
|
23
23
|
export class AccountSessionsState {
|
|
24
24
|
#get_rpc;
|
|
25
25
|
list = new AsyncSlot();
|
|
@@ -28,34 +28,24 @@ export class AccountSessionsState {
|
|
|
28
28
|
sessions = $state.raw([]);
|
|
29
29
|
active_count = $derived(this.sessions.length);
|
|
30
30
|
constructor(options) {
|
|
31
|
-
this.#get_rpc = options
|
|
32
|
-
}
|
|
33
|
-
/** True when an RPC adapter is wired. `fetch` / `submit_revoke` / `submit_revoke_all` no-op without it. */
|
|
34
|
-
get has_rpc() {
|
|
35
|
-
return this.#get_rpc() !== null;
|
|
36
|
-
}
|
|
37
|
-
#require_rpc() {
|
|
38
|
-
const rpc = this.#get_rpc();
|
|
39
|
-
if (!rpc)
|
|
40
|
-
throw new Error('rpc adapter not wired');
|
|
41
|
-
return rpc;
|
|
31
|
+
this.#get_rpc = options.get_rpc;
|
|
42
32
|
}
|
|
43
33
|
async fetch() {
|
|
44
34
|
await this.list.run(async () => {
|
|
45
|
-
const { sessions } = await this.#
|
|
35
|
+
const { sessions } = await this.#get_rpc().list();
|
|
46
36
|
this.sessions = sessions;
|
|
47
37
|
});
|
|
48
38
|
}
|
|
49
39
|
async submit_revoke(id) {
|
|
50
40
|
await this.revoke.run(id, async () => {
|
|
51
|
-
await this.#
|
|
41
|
+
await this.#get_rpc().revoke({ session_id: id });
|
|
52
42
|
});
|
|
53
43
|
if (this.revoke.succeeded(id))
|
|
54
44
|
await this.fetch();
|
|
55
45
|
}
|
|
56
46
|
async submit_revoke_all() {
|
|
57
47
|
await this.revoke_all.run(async () => {
|
|
58
|
-
await this.#
|
|
48
|
+
await this.#get_rpc().revoke_all();
|
|
59
49
|
});
|
|
60
50
|
if (this.revoke_all.succeeded) {
|
|
61
51
|
// Current session is now revoked — next API call will 401.
|
|
@@ -30,9 +30,7 @@ import type { RoleGrantOfferCreateInput, RoleGrantOfferCreateOutput, RoleGrantOf
|
|
|
30
30
|
* Every operation flows through RPC: the listing reuses `admin_account_list`,
|
|
31
31
|
* grant reuses `role_grant_offer_create`, revoke and retract have dedicated
|
|
32
32
|
* actions, and the session / token revoke-all mutations reuse
|
|
33
|
-
* `admin_session_revoke_all` and `admin_token_revoke_all`.
|
|
34
|
-
* adapter the state class cannot fetch, grant, revoke, retract, or
|
|
35
|
-
* revoke-all sessions/tokens.
|
|
33
|
+
* `admin_session_revoke_all` and `admin_token_revoke_all`.
|
|
36
34
|
*
|
|
37
35
|
* Method signatures track the underlying action specs — `Uuid`-branded ids
|
|
38
36
|
* propagate from the wire through the state class to the components. The
|
|
@@ -56,22 +54,22 @@ export interface AdminAccountsRpc {
|
|
|
56
54
|
* consumers read with `const get_rpc = admin_accounts_rpc_context.get();`
|
|
57
55
|
* and either pass the accessor straight to `AdminAccountsState`/
|
|
58
56
|
* `AdminSessionsState` or wrap it with `const rpc = $derived(get_rpc());`
|
|
59
|
-
* for direct RPC calls.
|
|
60
|
-
*
|
|
61
|
-
* not wired" path.
|
|
57
|
+
* for direct RPC calls. `get()` throws when no provisioner ran above the
|
|
58
|
+
* component — the adapter is required, not optional.
|
|
62
59
|
*/
|
|
63
60
|
export declare const admin_accounts_rpc_context: {
|
|
64
|
-
get: () => () => AdminAccountsRpc
|
|
65
|
-
|
|
61
|
+
get: (error_message?: string) => () => AdminAccountsRpc;
|
|
62
|
+
get_maybe: () => (() => AdminAccountsRpc) | undefined;
|
|
63
|
+
set: (value: () => AdminAccountsRpc) => () => AdminAccountsRpc;
|
|
66
64
|
};
|
|
67
65
|
export interface AdminAccountsStateOptions {
|
|
68
66
|
/**
|
|
69
|
-
* Reactive accessor for the RPC adapter
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
67
|
+
* Reactive accessor for the RPC adapter. Matches
|
|
68
|
+
* `RoleGrantOffersStateOptions.account_id` / `actor_id` pattern — lets the
|
|
69
|
+
* component pass a `$props()`-sourced rpc without tripping Svelte's
|
|
70
|
+
* `state_referenced_locally` warning.
|
|
73
71
|
*/
|
|
74
|
-
get_rpc
|
|
72
|
+
get_rpc: () => AdminAccountsRpc;
|
|
75
73
|
}
|
|
76
74
|
/**
|
|
77
75
|
* Compose the `grant` keyed-slot key for an offer. Account-grain offers
|
|
@@ -113,12 +111,7 @@ export declare class AdminAccountsState {
|
|
|
113
111
|
*/
|
|
114
112
|
show_deleted: boolean;
|
|
115
113
|
readonly account_count: number;
|
|
116
|
-
constructor(options
|
|
117
|
-
/**
|
|
118
|
-
* True when an RPC adapter is wired. UI uses this to gate all controls
|
|
119
|
-
* — fetch, grant, revoke, retract all flow through the same adapter.
|
|
120
|
-
*/
|
|
121
|
-
get has_rpc(): boolean;
|
|
114
|
+
constructor(options: AdminAccountsStateOptions);
|
|
122
115
|
fetch(): Promise<void>;
|
|
123
116
|
/**
|
|
124
117
|
* Toggle whether soft-deleted accounts appear in the listing, then
|
|
@@ -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;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EACX,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,EACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACX,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,0CAA0C,CAAC;AAElD
|
|
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;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EACX,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,EAC3B,wB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IAAI,CAAC;CAMnD"}
|
|
@@ -21,11 +21,10 @@ import { KeyedAsyncSlot } from './keyed_async_slot.svelte.js';
|
|
|
21
21
|
* consumers read with `const get_rpc = admin_accounts_rpc_context.get();`
|
|
22
22
|
* and either pass the accessor straight to `AdminAccountsState`/
|
|
23
23
|
* `AdminSessionsState` or wrap it with `const rpc = $derived(get_rpc());`
|
|
24
|
-
* for direct RPC calls.
|
|
25
|
-
*
|
|
26
|
-
* not wired" path.
|
|
24
|
+
* for direct RPC calls. `get()` throws when no provisioner ran above the
|
|
25
|
+
* component — the adapter is required, not optional.
|
|
27
26
|
*/
|
|
28
|
-
export const admin_accounts_rpc_context = create_context(
|
|
27
|
+
export const admin_accounts_rpc_context = create_context();
|
|
29
28
|
/**
|
|
30
29
|
* Compose the `grant` keyed-slot key for an offer. Account-grain offers
|
|
31
30
|
* key on `${account_id}:${role}`; actor-targeted offers add the actor
|
|
@@ -51,24 +50,11 @@ export class AdminAccountsState {
|
|
|
51
50
|
show_deleted = $state(false);
|
|
52
51
|
account_count = $derived(this.accounts.length);
|
|
53
52
|
constructor(options) {
|
|
54
|
-
this.#get_rpc = options
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* True when an RPC adapter is wired. UI uses this to gate all controls
|
|
58
|
-
* — fetch, grant, revoke, retract all flow through the same adapter.
|
|
59
|
-
*/
|
|
60
|
-
get has_rpc() {
|
|
61
|
-
return this.#get_rpc() !== null;
|
|
62
|
-
}
|
|
63
|
-
#require_rpc() {
|
|
64
|
-
const rpc = this.#get_rpc();
|
|
65
|
-
if (!rpc)
|
|
66
|
-
throw new Error('rpc adapter not wired');
|
|
67
|
-
return rpc;
|
|
53
|
+
this.#get_rpc = options.get_rpc;
|
|
68
54
|
}
|
|
69
55
|
async fetch() {
|
|
70
56
|
await this.list.run(async () => {
|
|
71
|
-
const { accounts, grantable_roles } = await this.#
|
|
57
|
+
const { accounts, grantable_roles } = await this.#get_rpc().list_accounts(this.show_deleted);
|
|
72
58
|
this.accounts = accounts;
|
|
73
59
|
this.grantable_roles = grantable_roles;
|
|
74
60
|
});
|
|
@@ -92,7 +78,7 @@ export class AdminAccountsState {
|
|
|
92
78
|
*/
|
|
93
79
|
async submit_delete(account_id) {
|
|
94
80
|
await this.soft_delete.run(account_id, async () => {
|
|
95
|
-
await this.#
|
|
81
|
+
await this.#get_rpc().delete_account(account_id);
|
|
96
82
|
});
|
|
97
83
|
if (this.soft_delete.succeeded(account_id))
|
|
98
84
|
await this.fetch();
|
|
@@ -104,7 +90,7 @@ export class AdminAccountsState {
|
|
|
104
90
|
*/
|
|
105
91
|
async submit_undelete(account_id) {
|
|
106
92
|
await this.undelete.run(account_id, async () => {
|
|
107
|
-
await this.#
|
|
93
|
+
await this.#get_rpc().undelete_account(account_id);
|
|
108
94
|
});
|
|
109
95
|
if (this.undelete.succeeded(account_id))
|
|
110
96
|
await this.fetch();
|
|
@@ -129,7 +115,7 @@ export class AdminAccountsState {
|
|
|
129
115
|
async submit_grant(account_id, role, to_actor_id) {
|
|
130
116
|
const key = grant_key(account_id, role, to_actor_id);
|
|
131
117
|
const offer = await this.grant.run(key, async () => {
|
|
132
|
-
const result = await this.#
|
|
118
|
+
const result = await this.#get_rpc().create_role_grant({
|
|
133
119
|
to_account_id: account_id,
|
|
134
120
|
role,
|
|
135
121
|
...(to_actor_id ? { to_actor_id } : {}),
|
|
@@ -151,7 +137,7 @@ export class AdminAccountsState {
|
|
|
151
137
|
*/
|
|
152
138
|
async submit_revoke(actor_id, role_grant_id, reason) {
|
|
153
139
|
await this.revoke.run(role_grant_id, async () => {
|
|
154
|
-
await this.#
|
|
140
|
+
await this.#get_rpc().revoke_role_grant({
|
|
155
141
|
actor_id,
|
|
156
142
|
role_grant_id,
|
|
157
143
|
reason: reason ?? null,
|
|
@@ -170,7 +156,7 @@ export class AdminAccountsState {
|
|
|
170
156
|
*/
|
|
171
157
|
async submit_retract(offer_id) {
|
|
172
158
|
await this.retract.run(offer_id, async () => {
|
|
173
|
-
await this.#
|
|
159
|
+
await this.#get_rpc().retract_offer(offer_id);
|
|
174
160
|
});
|
|
175
161
|
if (this.retract.succeeded(offer_id))
|
|
176
162
|
await this.fetch();
|
|
@@ -32,18 +32,17 @@ export interface AdminInvitesRpc {
|
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Svelte context carrying the reactive `AdminInvitesRpc` accessor. Mirrors
|
|
35
|
-
* `admin_accounts_rpc_context`.
|
|
35
|
+
* `admin_accounts_rpc_context`. `get()` throws when no provisioner ran above
|
|
36
|
+
* the component — the adapter is required.
|
|
36
37
|
*/
|
|
37
38
|
export declare const admin_invites_rpc_context: {
|
|
38
|
-
get: () => () => AdminInvitesRpc
|
|
39
|
-
|
|
39
|
+
get: (error_message?: string) => () => AdminInvitesRpc;
|
|
40
|
+
get_maybe: () => (() => AdminInvitesRpc) | undefined;
|
|
41
|
+
set: (value: () => AdminInvitesRpc) => () => AdminInvitesRpc;
|
|
40
42
|
};
|
|
41
43
|
export interface AdminInvitesStateOptions {
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
* (the state reports a descriptive error when mutations/fetches fire).
|
|
45
|
-
*/
|
|
46
|
-
get_rpc?: () => AdminInvitesRpc | null;
|
|
44
|
+
/** Reactive accessor for the RPC adapter. */
|
|
45
|
+
get_rpc: () => AdminInvitesRpc;
|
|
47
46
|
}
|
|
48
47
|
export declare class AdminInvitesState {
|
|
49
48
|
#private;
|
|
@@ -53,9 +52,7 @@ export declare class AdminInvitesState {
|
|
|
53
52
|
invites: Array<InviteWithUsernamesJson>;
|
|
54
53
|
readonly invite_count: number;
|
|
55
54
|
readonly unclaimed_count: number;
|
|
56
|
-
constructor(options
|
|
57
|
-
/** True when an RPC adapter is wired. All ops require it. */
|
|
58
|
-
get has_rpc(): boolean;
|
|
55
|
+
constructor(options: AdminInvitesStateOptions);
|
|
59
56
|
fetch(): Promise<void>;
|
|
60
57
|
submit_create(email?: string, username?: string): Promise<boolean>;
|
|
61
58
|
submit_delete(id: Uuid): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin_invites_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/admin_invites_state.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,0BAA0B,CAAC;AACtE,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,MAAM,+BAA+B,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACtC,MAAM,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACnE,MAAM,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACnE;AAED
|
|
1
|
+
{"version":3,"file":"admin_invites_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/admin_invites_state.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,0BAA0B,CAAC;AACtE,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,MAAM,+BAA+B,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACtC,MAAM,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACnE,MAAM,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACnE;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;2CAAwB,eAAe;4BAAf,eAAe;uBAAf,eAAe,WAAf,eAAe;CAAG,CAAC;AAEjF,MAAM,WAAW,wBAAwB;IACxC,6CAA6C;IAC7C,OAAO,EAAE,MAAM,eAAe,CAAC;CAC/B;AAED,qBAAa,iBAAiB;;IAG7B,QAAQ,CAAC,IAAI,0BAAyB;IACtC,QAAQ,CAAC,MAAM,0BAAyB;IACxC,QAAQ,CAAC,MAAM,sEAAoC;IAEnD,OAAO,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAkB;IAEzD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAiC;IAC9D,QAAQ,CAAC,eAAe,EAAE,MAAM,CAA8D;gBAElF,OAAO,EAAE,wBAAwB;IAIvC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAOtB,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IASlE,aAAa,CAAC,EAAE,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAM5C"}
|
|
@@ -18,9 +18,10 @@ import { AsyncSlot } from './async_slot.svelte.js';
|
|
|
18
18
|
import { KeyedAsyncSlot } from './keyed_async_slot.svelte.js';
|
|
19
19
|
/**
|
|
20
20
|
* Svelte context carrying the reactive `AdminInvitesRpc` accessor. Mirrors
|
|
21
|
-
* `admin_accounts_rpc_context`.
|
|
21
|
+
* `admin_accounts_rpc_context`. `get()` throws when no provisioner ran above
|
|
22
|
+
* the component — the adapter is required.
|
|
22
23
|
*/
|
|
23
|
-
export const admin_invites_rpc_context = create_context(
|
|
24
|
+
export const admin_invites_rpc_context = create_context();
|
|
24
25
|
export class AdminInvitesState {
|
|
25
26
|
#get_rpc;
|
|
26
27
|
list = new AsyncSlot();
|
|
@@ -30,27 +31,17 @@ export class AdminInvitesState {
|
|
|
30
31
|
invite_count = $derived(this.invites.length);
|
|
31
32
|
unclaimed_count = $derived(this.invites.filter((i) => !i.claimed_at).length);
|
|
32
33
|
constructor(options) {
|
|
33
|
-
this.#get_rpc = options
|
|
34
|
-
}
|
|
35
|
-
/** True when an RPC adapter is wired. All ops require it. */
|
|
36
|
-
get has_rpc() {
|
|
37
|
-
return this.#get_rpc() !== null;
|
|
38
|
-
}
|
|
39
|
-
#require_rpc() {
|
|
40
|
-
const rpc = this.#get_rpc();
|
|
41
|
-
if (!rpc)
|
|
42
|
-
throw new Error('rpc adapter not wired');
|
|
43
|
-
return rpc;
|
|
34
|
+
this.#get_rpc = options.get_rpc;
|
|
44
35
|
}
|
|
45
36
|
async fetch() {
|
|
46
37
|
await this.list.run(async () => {
|
|
47
|
-
const { invites } = await this.#
|
|
38
|
+
const { invites } = await this.#get_rpc().list();
|
|
48
39
|
this.invites = invites;
|
|
49
40
|
});
|
|
50
41
|
}
|
|
51
42
|
async submit_create(email, username) {
|
|
52
43
|
await this.create.run(async () => {
|
|
53
|
-
await this.#
|
|
44
|
+
await this.#get_rpc().create({ email: email ?? null, username: username ?? null });
|
|
54
45
|
});
|
|
55
46
|
if (!this.create.succeeded)
|
|
56
47
|
return false;
|
|
@@ -59,7 +50,7 @@ export class AdminInvitesState {
|
|
|
59
50
|
}
|
|
60
51
|
async submit_delete(id) {
|
|
61
52
|
await this.remove.run(id, async () => {
|
|
62
|
-
await this.#
|
|
53
|
+
await this.#get_rpc().delete({ invite_id: id });
|
|
63
54
|
});
|
|
64
55
|
if (this.remove.succeeded(id))
|
|
65
56
|
await this.fetch();
|
|
@@ -23,17 +23,15 @@ import type { AdminSessionJson } from '../auth/audit_log_schema.js';
|
|
|
23
23
|
* Options for `AdminSessionsState`.
|
|
24
24
|
*
|
|
25
25
|
* The RPC adapter drives every operation (listing + the two revoke-all
|
|
26
|
-
* mutations).
|
|
27
|
-
* `'rpc adapter not wired'` on `error`.
|
|
26
|
+
* mutations).
|
|
28
27
|
*/
|
|
29
28
|
export interface AdminSessionsStateOptions {
|
|
30
29
|
/**
|
|
31
|
-
* Reactive accessor for the RPC adapter
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* `state_referenced_locally` warning.
|
|
30
|
+
* Reactive accessor for the RPC adapter. Mirrors
|
|
31
|
+
* `AdminAccountsStateOptions.get_rpc` so a single adapter instance backs
|
|
32
|
+
* both states without tripping Svelte's `state_referenced_locally` warning.
|
|
35
33
|
*/
|
|
36
|
-
get_rpc
|
|
34
|
+
get_rpc: () => AdminAccountsRpc;
|
|
37
35
|
}
|
|
38
36
|
export declare class AdminSessionsState {
|
|
39
37
|
#private;
|
|
@@ -42,9 +40,7 @@ export declare class AdminSessionsState {
|
|
|
42
40
|
readonly revoke_tokens: KeyedAsyncSlot<string & import("zod").$brand<"Uuid">, void, string>;
|
|
43
41
|
sessions: Array<AdminSessionJson>;
|
|
44
42
|
readonly active_count: number;
|
|
45
|
-
constructor(options
|
|
46
|
-
/** True when an RPC adapter is wired. `fetch` and the revoke controls no-op without it. */
|
|
47
|
-
get has_rpc(): boolean;
|
|
43
|
+
constructor(options: AdminSessionsStateOptions);
|
|
48
44
|
fetch(): Promise<void>;
|
|
49
45
|
submit_revoke_sessions(account_id: Uuid): Promise<void>;
|
|
50
46
|
submit_revoke_tokens(account_id: Uuid): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin_sessions_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/admin_sessions_state.svelte.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oB,CAAC,UAAU,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAM3D"}
|
|
@@ -24,34 +24,24 @@ export class AdminSessionsState {
|
|
|
24
24
|
sessions = $state.raw([]);
|
|
25
25
|
active_count = $derived(this.sessions.length);
|
|
26
26
|
constructor(options) {
|
|
27
|
-
this.#get_rpc = options
|
|
28
|
-
}
|
|
29
|
-
/** True when an RPC adapter is wired. `fetch` and the revoke controls no-op without it. */
|
|
30
|
-
get has_rpc() {
|
|
31
|
-
return this.#get_rpc() !== null;
|
|
32
|
-
}
|
|
33
|
-
#require_rpc() {
|
|
34
|
-
const rpc = this.#get_rpc();
|
|
35
|
-
if (!rpc)
|
|
36
|
-
throw new Error('rpc adapter not wired');
|
|
37
|
-
return rpc;
|
|
27
|
+
this.#get_rpc = options.get_rpc;
|
|
38
28
|
}
|
|
39
29
|
async fetch() {
|
|
40
30
|
await this.list.run(async () => {
|
|
41
|
-
const { sessions } = await this.#
|
|
31
|
+
const { sessions } = await this.#get_rpc().list_sessions();
|
|
42
32
|
this.sessions = sessions;
|
|
43
33
|
});
|
|
44
34
|
}
|
|
45
35
|
async submit_revoke_sessions(account_id) {
|
|
46
36
|
await this.revoke_sessions.run(account_id, async () => {
|
|
47
|
-
await this.#
|
|
37
|
+
await this.#get_rpc().session_revoke_all({ account_id });
|
|
48
38
|
});
|
|
49
39
|
if (this.revoke_sessions.succeeded(account_id))
|
|
50
40
|
await this.fetch();
|
|
51
41
|
}
|
|
52
42
|
async submit_revoke_tokens(account_id) {
|
|
53
43
|
await this.revoke_tokens.run(account_id, async () => {
|
|
54
|
-
await this.#
|
|
44
|
+
await this.#get_rpc().token_revoke_all({ account_id });
|
|
55
45
|
});
|
|
56
46
|
if (this.revoke_tokens.succeeded(account_id))
|
|
57
47
|
await this.fetch();
|
|
@@ -25,28 +25,24 @@ export interface AppSettingsRpc {
|
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Svelte context carrying the reactive `AppSettingsRpc` accessor. Mirrors
|
|
28
|
-
* `admin_accounts_rpc_context`.
|
|
29
|
-
*
|
|
28
|
+
* `admin_accounts_rpc_context`. `get()` throws when no provisioner ran above
|
|
29
|
+
* the component — the adapter is required.
|
|
30
30
|
*/
|
|
31
31
|
export declare const app_settings_rpc_context: {
|
|
32
|
-
get: () => () => AppSettingsRpc
|
|
33
|
-
|
|
32
|
+
get: (error_message?: string) => () => AppSettingsRpc;
|
|
33
|
+
get_maybe: () => (() => AppSettingsRpc) | undefined;
|
|
34
|
+
set: (value: () => AppSettingsRpc) => () => AppSettingsRpc;
|
|
34
35
|
};
|
|
35
36
|
export interface AppSettingsStateOptions {
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
* (the state reports a descriptive error when fetch/update fires).
|
|
39
|
-
*/
|
|
40
|
-
get_rpc?: () => AppSettingsRpc | null;
|
|
37
|
+
/** Reactive accessor for the RPC adapter. */
|
|
38
|
+
get_rpc: () => AppSettingsRpc;
|
|
41
39
|
}
|
|
42
40
|
export declare class AppSettingsState {
|
|
43
41
|
#private;
|
|
44
42
|
readonly list: AsyncSlot<void, string>;
|
|
45
43
|
readonly update: AsyncSlot<void, string>;
|
|
46
44
|
settings: AppSettingsWithUsernameJson | null;
|
|
47
|
-
constructor(options
|
|
48
|
-
/** True when an RPC adapter is wired. All ops require it. */
|
|
49
|
-
get has_rpc(): boolean;
|
|
45
|
+
constructor(options: AppSettingsStateOptions);
|
|
50
46
|
fetch(): Promise<void>;
|
|
51
47
|
update_open_signup(value: boolean): Promise<void>;
|
|
52
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app_settings_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/app_settings_state.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACjD,OAAO,KAAK,EAAC,2BAA2B,EAAC,MAAM,gCAAgC,CAAC;AAChF,OAAO,KAAK,EACX,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,MAAM,+BAA+B,CAAC;AAEvC;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC9B,GAAG,EAAE,MAAM,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACzC,MAAM,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;CAC7E;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;
|
|
1
|
+
{"version":3,"file":"app_settings_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/app_settings_state.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACjD,OAAO,KAAK,EAAC,2BAA2B,EAAC,MAAM,gCAAgC,CAAC;AAChF,OAAO,KAAK,EACX,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,MAAM,+BAA+B,CAAC;AAEvC;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC9B,GAAG,EAAE,MAAM,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACzC,MAAM,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;CAC7E;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;2CAAwB,cAAc;4BAAd,cAAc;uBAAd,cAAc,WAAd,cAAc;CAAG,CAAC;AAE/E,MAAM,WAAW,uBAAuB;IACvC,6CAA6C;IAC7C,OAAO,EAAE,MAAM,cAAc,CAAC;CAC9B;AAED,qBAAa,gBAAgB;;IAG5B,QAAQ,CAAC,IAAI,0BAAyB;IACtC,QAAQ,CAAC,MAAM,0BAAyB;IAExC,QAAQ,EAAE,2BAA2B,GAAG,IAAI,CAAoB;gBAEpD,OAAO,EAAE,uBAAuB;IAItC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAOtB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAMvD"}
|
|
@@ -15,37 +15,27 @@ import { create_context } from '@fuzdev/fuz_ui/context_helpers.js';
|
|
|
15
15
|
import { AsyncSlot } from './async_slot.svelte.js';
|
|
16
16
|
/**
|
|
17
17
|
* Svelte context carrying the reactive `AppSettingsRpc` accessor. Mirrors
|
|
18
|
-
* `admin_accounts_rpc_context`.
|
|
19
|
-
*
|
|
18
|
+
* `admin_accounts_rpc_context`. `get()` throws when no provisioner ran above
|
|
19
|
+
* the component — the adapter is required.
|
|
20
20
|
*/
|
|
21
|
-
export const app_settings_rpc_context = create_context(
|
|
21
|
+
export const app_settings_rpc_context = create_context();
|
|
22
22
|
export class AppSettingsState {
|
|
23
23
|
#get_rpc;
|
|
24
24
|
list = new AsyncSlot();
|
|
25
25
|
update = new AsyncSlot();
|
|
26
26
|
settings = $state.raw(null);
|
|
27
27
|
constructor(options) {
|
|
28
|
-
this.#get_rpc = options
|
|
29
|
-
}
|
|
30
|
-
/** True when an RPC adapter is wired. All ops require it. */
|
|
31
|
-
get has_rpc() {
|
|
32
|
-
return this.#get_rpc() !== null;
|
|
33
|
-
}
|
|
34
|
-
#require_rpc() {
|
|
35
|
-
const rpc = this.#get_rpc();
|
|
36
|
-
if (!rpc)
|
|
37
|
-
throw new Error('rpc adapter not wired');
|
|
38
|
-
return rpc;
|
|
28
|
+
this.#get_rpc = options.get_rpc;
|
|
39
29
|
}
|
|
40
30
|
async fetch() {
|
|
41
31
|
await this.list.run(async () => {
|
|
42
|
-
const { settings } = await this.#
|
|
32
|
+
const { settings } = await this.#get_rpc().get();
|
|
43
33
|
this.settings = settings;
|
|
44
34
|
});
|
|
45
35
|
}
|
|
46
36
|
async update_open_signup(value) {
|
|
47
37
|
await this.update.run(async () => {
|
|
48
|
-
const { settings } = await this.#
|
|
38
|
+
const { settings } = await this.#get_rpc().update({ open_signup: value });
|
|
49
39
|
this.settings = settings;
|
|
50
40
|
});
|
|
51
41
|
}
|
|
@@ -27,18 +27,21 @@ export interface AuditLogRpc {
|
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Svelte context carrying the reactive `AuditLogRpc` accessor. Mirrors
|
|
30
|
-
* `admin_accounts_rpc_context`.
|
|
30
|
+
* `admin_accounts_rpc_context`. `get()` throws when no provisioner ran above
|
|
31
|
+
* the component — the adapter is required.
|
|
31
32
|
*/
|
|
32
33
|
export declare const audit_log_rpc_context: {
|
|
33
|
-
get: () => () => AuditLogRpc
|
|
34
|
-
|
|
34
|
+
get: (error_message?: string) => () => AuditLogRpc;
|
|
35
|
+
get_maybe: () => (() => AuditLogRpc) | undefined;
|
|
36
|
+
set: (value: () => AuditLogRpc) => () => AuditLogRpc;
|
|
35
37
|
};
|
|
36
38
|
export interface AuditLogStateOptions {
|
|
37
39
|
/**
|
|
38
40
|
* Reactive accessor for the RPC adapter. Matches the `get_rpc` pattern on
|
|
39
|
-
* `AdminAccountsState
|
|
41
|
+
* `AdminAccountsState`. The SSE stream uses `EventSource` directly and is
|
|
42
|
+
* independent of this adapter.
|
|
40
43
|
*/
|
|
41
|
-
get_rpc
|
|
44
|
+
get_rpc: () => AuditLogRpc;
|
|
42
45
|
/** SSE stream URL. Defaults to the shipped admin audit-log stream route. */
|
|
43
46
|
stream_url?: string;
|
|
44
47
|
}
|
|
@@ -51,9 +54,7 @@ export declare class AuditLogState {
|
|
|
51
54
|
readonly count: number;
|
|
52
55
|
/** Whether the SSE stream is currently connected. */
|
|
53
56
|
connected: boolean;
|
|
54
|
-
constructor(options
|
|
55
|
-
/** True when an RPC adapter is wired. `fetch`/`fetch_role_grant_history` no-op without it. */
|
|
56
|
-
get has_rpc(): boolean;
|
|
57
|
+
constructor(options: AuditLogStateOptions);
|
|
57
58
|
fetch(options?: AuditLogListInput): Promise<void>;
|
|
58
59
|
fetch_role_grant_history(limit?: number, offset?: number): Promise<void>;
|
|
59
60
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit_log_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/audit_log_state.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACjD,OAAO,KAAK,EAEX,8BAA8B,EAC9B,yBAAyB,EACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,6BAA6B,EAC7B,8BAA8B,EAC9B,MAAM,+BAA+B,CAAC;AAGvC;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,iBAAiB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACjE,kBAAkB,EAAE,CACnB,KAAK,CAAC,EAAE,6BAA6B,KACjC,OAAO,CAAC,8BAA8B,CAAC,CAAC;CAC7C;AAED
|
|
1
|
+
{"version":3,"file":"audit_log_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/audit_log_state.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACjD,OAAO,KAAK,EAEX,8BAA8B,EAC9B,yBAAyB,EACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,6BAA6B,EAC7B,8BAA8B,EAC9B,MAAM,+BAA+B,CAAC;AAGvC;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,iBAAiB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACjE,kBAAkB,EAAE,CACnB,KAAK,CAAC,EAAE,6BAA6B,KACjC,OAAO,CAAC,8BAA8B,CAAC,CAAC;CAC7C;AAED;;;;GAIG;AACH,eAAO,MAA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