@fuzdev/fuz_app 0.44.0 → 0.45.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.
@@ -5,7 +5,8 @@
5
5
  * - **Tier 1** (simple, for tx): transport send/receive, Result return. No `environment`.
6
6
  * - **Tier 2** (full, for zzz): ActionEvent lifecycle with `environment`.
7
7
  *
8
- * Consumers cast the return to their generated `ActionsApi` interface for full type safety.
8
+ * Pass the consumer's generated `ActionsApi` interface as `<TApi>` to flow
9
+ * full type safety through without an explicit cast at the call site.
9
10
  *
10
11
  * @module
11
12
  */
@@ -20,18 +21,35 @@ import { jsonrpc_error_messages } from '../http/jsonrpc_errors.js';
20
21
  * - `remote_notification` → send notification, return Result
21
22
  * - `local_call` → execute locally (sync or async), return Result or throw
22
23
  *
23
- * @param options - client options (peer, environment, optional action history)
24
- * @returns a Proxy that responds to any method name found in the environment's specs
24
+ * Generic `TApi` is the consumer's typed Proxy interface (typically a
25
+ * codegen-derived `ActionsApi`). Required no default, so forgetting it
26
+ * is a type error rather than a silent slide into `any`. The `as unknown
27
+ * as TApi` coercion lives inside this function so call sites get a typed
28
+ * return without a cast at the seam. `TApi` is a type-layer promise about
29
+ * what the Proxy responds to; the runtime walks `specs` (kept in sync by
30
+ * the consumer, codegen recommended).
31
+ *
32
+ * ```ts
33
+ * const api_result = create_rpc_client<MyActionsApi>({peer, environment});
34
+ * ```
35
+ *
36
+ * @param options - client options (peer, environment, optional callbacks)
37
+ * @returns a Proxy typed as `TApi` that responds to any method name found in the environment's specs
25
38
  */
26
39
  export const create_rpc_client = (options) => {
27
- const { peer, environment, actions, transport_for_method } = options;
40
+ const { peer, environment, on_action_event, transport_for_method } = options;
41
+ // Internal factories construct broadly-typed `ActionEvent` instances; the
42
+ // public callback narrows `event.spec.method` to `keyof TApi & string`.
43
+ // Cast once here — function parameters are contravariant, so the narrow
44
+ // callback isn't directly assignable to the broad slot the helpers take.
45
+ const broad_on_action_event = on_action_event;
28
46
  return new Proxy({}, {
29
47
  get(_target, method) {
30
48
  const spec = environment.lookup_action_spec(method);
31
49
  if (!spec) {
32
50
  return undefined;
33
51
  }
34
- return create_action_method(peer, environment, spec, actions, transport_for_method);
52
+ return create_action_method(peer, environment, spec, broad_on_action_event, transport_for_method);
35
53
  },
36
54
  has(_target, method) {
37
55
  return environment.lookup_action_spec(method) !== undefined;
@@ -41,30 +59,26 @@ export const create_rpc_client = (options) => {
41
59
  /**
42
60
  * Creates a method that executes an action through its complete lifecycle.
43
61
  */
44
- const create_action_method = (peer, environment, spec, actions, transport_for_method) => {
62
+ const create_action_method = (peer, environment, spec, on_action_event, transport_for_method) => {
45
63
  switch (spec.kind) {
46
64
  case 'local_call':
47
65
  return spec.async
48
- ? create_async_local_call_method(environment, spec, actions)
49
- : create_sync_local_call_method(environment, spec, actions);
66
+ ? create_async_local_call_method(environment, spec, on_action_event)
67
+ : create_sync_local_call_method(environment, spec, on_action_event);
50
68
  case 'request_response':
51
- return create_request_response_method(peer, environment, spec, actions, transport_for_method);
69
+ return create_request_response_method(peer, environment, spec, on_action_event, transport_for_method);
52
70
  case 'remote_notification':
53
- return create_remote_notification_method(peer, environment, spec, actions, transport_for_method);
71
+ return create_remote_notification_method(peer, environment, spec, on_action_event, transport_for_method);
54
72
  }
55
73
  };
56
74
  /**
57
75
  * Creates a synchronous local call method.
58
76
  * Returns value directly - can throw on error (sync methods cannot return Result).
59
77
  */
60
- const create_sync_local_call_method = (environment, spec, actions) => {
78
+ const create_sync_local_call_method = (environment, spec, on_action_event) => {
61
79
  return (input) => {
62
80
  const event = create_action_event(environment, spec, input);
63
- const action = actions?.add_from_json({
64
- method: spec.method,
65
- action_event_data: event.toJSON(),
66
- });
67
- action?.listen_to_action_event(event);
81
+ on_action_event?.(event);
68
82
  event.parse().handle_sync();
69
83
  const result = extract_action_result(event);
70
84
  if (result.ok) {
@@ -84,7 +98,7 @@ const create_sync_local_call_method = (environment, spec, actions) => {
84
98
  * `signal` can only short-circuit before the synchronous handler runs (no
85
99
  * cooperative interrupt mid-handler).
86
100
  */
87
- const create_async_local_call_method = (environment, spec, actions) => {
101
+ const create_async_local_call_method = (environment, spec, on_action_event) => {
88
102
  return async (input, options) => {
89
103
  if (options?.signal?.aborted) {
90
104
  return {
@@ -93,11 +107,7 @@ const create_async_local_call_method = (environment, spec, actions) => {
93
107
  };
94
108
  }
95
109
  const event = create_action_event(environment, spec, input);
96
- const action = actions?.add_from_json({
97
- method: spec.method,
98
- action_event_data: event.toJSON(),
99
- });
100
- action?.listen_to_action_event(event);
110
+ on_action_event?.(event);
101
111
  await event.parse().handle_async();
102
112
  return extract_action_result(event);
103
113
  };
@@ -105,14 +115,10 @@ const create_async_local_call_method = (environment, spec, actions) => {
105
115
  /**
106
116
  * Creates a request/response method that communicates over the network.
107
117
  */
108
- const create_request_response_method = (peer, environment, spec, actions, transport_for_method) => {
118
+ const create_request_response_method = (peer, environment, spec, on_action_event, transport_for_method) => {
109
119
  return async (input, options) => {
110
120
  const event = create_action_event(environment, spec, input);
111
- const action = actions?.add_from_json({
112
- method: spec.method,
113
- action_event_data: event.toJSON(),
114
- });
115
- action?.listen_to_action_event(event);
121
+ on_action_event?.(event);
116
122
  await event.parse().handle_async();
117
123
  // Check if we're in send_error phase before type narrowing
118
124
  if (event.data.kind === 'request_response' && event.data.phase === 'send_error') {
@@ -141,14 +147,10 @@ const create_request_response_method = (peer, environment, spec, actions, transp
141
147
  * Creates a remote notification method (fire and forget).
142
148
  * Returns Result<{value: void}> for consistency.
143
149
  */
144
- const create_remote_notification_method = (peer, environment, spec, actions, transport_for_method) => {
150
+ const create_remote_notification_method = (peer, environment, spec, on_action_event, transport_for_method) => {
145
151
  return async (input, options) => {
146
152
  const event = create_action_event(environment, spec, input);
147
- const action = actions?.add_from_json({
148
- method: spec.method,
149
- action_event_data: event.toJSON(),
150
- });
151
- action?.listen_to_action_event(event);
153
+ on_action_event?.(event);
152
154
  await event.parse().handle_async();
153
155
  if (!is_notification_send(event.data))
154
156
  throw Error(); // TODO @many maybe make this an assertion helper?
@@ -168,60 +170,6 @@ const create_remote_notification_method = (peer, environment, spec, actions, tra
168
170
  return extract_action_result(event);
169
171
  };
170
172
  };
171
- /**
172
- * Wrap a typed RPC client so every call returns its unwrapped value or throws.
173
- *
174
- * On `{ok: false}`, throws an `Error` whose `message` comes from the
175
- * JSON-RPC error object, plus `{code, data}` as own properties — so
176
- * catch blocks reading `err.message` / `err.code` / `err.data?.reason`
177
- * all work. On unknown method, throws a clear "rpc method not found"
178
- * error instead of the cryptic `undefined is not a function` that
179
- * would otherwise surface.
180
- *
181
- * Invariant upheld by `create_rpc_client`: every `{ok: false}` return
182
- * carries a well-formed `JsonrpcErrorObject` with `code` + `message`.
183
- * Callers must still use optional chaining on `err.data` because the
184
- * JSON-RPC `data` field is spec-level optional — a handler that throws
185
- * `jsonrpc_errors.forbidden()` without a `data` argument produces
186
- * `err.data === undefined`.
187
- *
188
- * Only `{code, data}` cross onto the thrown Error — `message` flows
189
- * through the `Error` constructor argument, and `name` / `stack` are
190
- * left as the Error's own so attacker-shaped `result.error` payloads
191
- * cannot overwrite them.
192
- *
193
- * The mapped-type generic constraint accepts both shapes without a cast:
194
- * a codegen-derived typed `ActionsApi` (named-method interface, e.g.
195
- * `{account_verify: (input) => Promise<Result<...>>, ...}`) and a loose
196
- * `Record<string, (input?: any) => Promise<any> | void>`. Using `keyof TApi`
197
- * in the constraint avoids the index-signature requirement that would
198
- * otherwise force consumers to `as unknown as Record<string, …>` their
199
- * generated client. The `| void` arm tolerates `remote_notification`
200
- * methods, whose `ActionsApi` signature is `(input) => void` even though
201
- * `create_remote_notification_method` returns a Promise at runtime — the
202
- * throwing wrapper is intended for `request_response` calls but must
203
- * accept mixed `ActionsApi` shapes without forcing a cast at the seam.
204
- *
205
- * @param api - typed RPC client from `create_rpc_client` (or any object
206
- * whose values are all `(input?) => Promise<...> | void` functions —
207
- * notably the consumer's generated `ActionsApi` interface)
208
- */
209
- export const create_throwing_rpc_call = (api) => {
210
- const rec = api;
211
- return async (method, input) => {
212
- const fn = rec[method];
213
- if (!fn)
214
- throw new Error(`rpc method not found: ${method}`);
215
- const result = await fn(input);
216
- if (!result.ok) {
217
- throw Object.assign(new Error(result.error?.message ?? 'rpc error'), {
218
- code: result.error?.code,
219
- data: result.error?.data,
220
- });
221
- }
222
- return result.value;
223
- };
224
- };
225
173
  /**
226
174
  * Wrap a typed RPC client so every call resolves to its unwrapped value or
227
175
  * throws an `Error` carrying the JSON-RPC `{code, message, data?}` shape.
@@ -239,33 +187,30 @@ export const create_throwing_rpc_call = (api) => {
239
187
  *
240
188
  * Only `{code, data}` cross onto the thrown Error — `name` / `stack` are
241
189
  * left as the Error's own properties so attacker-shaped `result.error`
242
- * payloads cannot overwrite them. Same hardening as
243
- * `create_throwing_rpc_call`.
244
- *
245
- * Composable with `create_throwing_rpc_call` — same typed underlying
246
- * client feeds both: the Proxy form for direct call sites, the loose
247
- * method-keyed form for adapter wiring (`ui/admin_rpc_adapters.ts`).
190
+ * payloads cannot overwrite them.
248
191
  *
249
- * Recommended consumer convention: bind the throwing wrapper to `api`
250
- * (the common case at call sites) and the underlying Result-returning
251
- * Proxy to `api_raw` (the composable escape hatch for callers that
252
- * want to inspect `error.data.reason` without try/catch).
192
+ * Recommended consumer convention: `create_frontend_rpc_client` ships
193
+ * both shapes by default `api` (throwing) for hot-path call sites and
194
+ * `api_result` (Result) for sites that inspect `error.data.reason`
195
+ * without try/catch. Result is the protocol primitive; this wrapper is
196
+ * the ergonomic layer over it. Picking is per call site — both Proxies
197
+ * share the same underlying transport.
253
198
  *
254
199
  * Catch blocks read `err.data?.reason` — optional chaining required
255
200
  * because JSON-RPC `data` is spec-level optional.
256
201
  *
257
202
  * On unknown string-keyed methods, the get trap returns a function that
258
- * throws `"rpc method not found: <prop>"` on invocation — symmetric with
259
- * `create_throwing_rpc_call` and clearer than the JS default
260
- * `"api.foo is not a function"`. Symbol props and `then` stay
261
- * undefined so the Proxy isn't accidentally treated as a thenable
203
+ * throws `"rpc method not found: <prop>"` on invocation — clearer than
204
+ * the JS default `"api.foo is not a function"`. Symbol props and `then`
205
+ * stay undefined so the Proxy isn't accidentally treated as a thenable
262
206
  * (`await api` would otherwise probe `then` and trip the thrower).
263
207
  *
264
- * @param api_raw - typed RPC client from `create_rpc_client`, cast
265
- * to a consumer-generated `ActionsApi` interface
208
+ * @param api_result - typed Result-returning RPC client from
209
+ * `create_rpc_client<ActionsApi>(...)`. The "_result" suffix names
210
+ * what the underlying calls return (`Result<{value}, {error}>`).
266
211
  */
267
- export const create_throwing_api = (api_raw) => {
268
- return new Proxy(api_raw, {
212
+ export const create_throwing_api = (api_result) => {
213
+ return new Proxy(api_result, {
269
214
  get(target, prop) {
270
215
  const fn = target[prop];
271
216
  if (typeof fn === 'function') {
@@ -267,7 +267,7 @@ export declare const keeper_identity: () => WsConnectIdentity;
267
267
  * await client.wait_for(is_notification('tx_run_created'));
268
268
  * ```
269
269
  */
270
- export declare const build_broadcast_api: <TApi>(options: {
270
+ export declare const build_broadcast_api: <TApi extends object>(options: {
271
271
  harness: WsTestHarness;
272
272
  specs: ReadonlyArray<ActionSpecUnion>;
273
273
  }) => TApi;
@@ -1 +1 @@
1
- {"version":3,"file":"ws_round_trip.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/ws_round_trip.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAO,MAAM,MAAM,CAAC;AACxC,OAAO,EACN,SAAS,EAET,KAAK,gBAAgB,EAErB,KAAK,QAAQ,EACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAc,KAAK,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAE9D,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAA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G,CAAC,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,cAAc,CAAC,EAAE,uBAAuB,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,CAAC;IACjE,yDAAyD;IACzD,eAAe,CAAC,EAAE,uBAAuB,CAAC,IAAI,CAAC,CAAC,iBAAiB,CAAC,CAAC;CACnE;AAED,kEAAkE;AAClE,MAAM,WAAW,aAAa;IAC7B,SAAS,EAAE,yBAAyB,CAAC;IACrC;;;;;;OAMG;IACH,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,iBAAiB,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;CACjE;AA8DD;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,GAAI,IAAI,SAAS,kBAAkB,EACrE,SAAS,0BAA0B,CAAC,IAAI,CAAC,KACvC,aA6KF,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,eAAe,QAAO,iBAGjC,CAAC;AAYH;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB,GAAI,IAAI,SAAS,MAAM,EAAE,SAAS;IACjE,OAAO,EAAE,aAAa,CAAC;IACvB,KAAK,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;CACtC,KAAG,IAIH,CAAC"}
package/dist/ui/CLAUDE.md CHANGED
@@ -267,17 +267,16 @@ destructive actions.
267
267
  (`get`, `update`). Fields: `settings`, `updating`. Single mutation
268
268
  `update_open_signup(boolean)`.
269
269
  - `admin_rpc_adapters.ts` (plain `.ts`, no reactive state) — bundled
270
- wiring for the four admin RPC contexts. `create_admin_rpc_adapters(rpc_call)`
271
- takes a single `AdminRpcCall` closure (alias of `ThrowingRpcCall` from
272
- `../actions/rpc_client.ts`) and returns `{admin_accounts, admin_invites,
273
- audit_log, app_settings}` adapter objects. `provide_admin_rpc_contexts(adapters)`
274
- calls `set` on all four contexts in one shot. Pair with
275
- `create_throwing_rpc_call(api)` from `../actions/rpc_client.ts` to turn a
276
- typed `create_rpc_client` Proxy into the throw-on-error `rpc_call`
277
- signature two lines at the admin shell layout. Method-name mapping is
278
- in the module TSDoc (`grant_permit` → `permit_offer_create`,
279
- `retract_offer` `permit_offer_retract`, etc.) and the
280
- `admin_rpc_adapters.test.ts` fixtures.
270
+ wiring for the four admin RPC contexts. `create_admin_rpc_adapters(api)`
271
+ takes the typed throwing Proxy from `create_frontend_rpc_client` (or
272
+ any object satisfying the `AdminRpcApi` interface) and returns
273
+ `{admin_accounts, admin_invites, audit_log, app_settings}` adapter
274
+ objects. `provide_admin_rpc_contexts(adapters)` calls `set` on all
275
+ four contexts in one shot. One line at the admin shell layout:
276
+ `provide_admin_rpc_contexts(create_admin_rpc_adapters(api))`.
277
+ Method-name mapping is in the module TSDoc (`grant_permit`
278
+ `permit_offer_create`, `retract_offer` → `permit_offer_retract`, etc.)
279
+ and the `admin_rpc_adapters.test.ts` fixtures.
281
280
 
282
281
  ## RPC adapter contexts
283
282
 
@@ -4,10 +4,13 @@
4
4
  * @module
5
5
  */
6
6
  import { SvelteSet } from 'svelte/reactivity';
7
+ import type { Uuid } from '@fuzdev/fuz_util/id.js';
7
8
  import { Loadable } from './loadable.svelte.js';
8
9
  import type { AdminAccountEntryJson } from '../auth/account_schema.js';
9
- import type { AdminSessionJson } from '../auth/audit_log_schema.js';
10
+ import type { RoleName } from '../auth/role_schema.js';
10
11
  import type { PermitOfferJson } from '../auth/permit_offer_schema.js';
12
+ import type { AdminAccountListOutput, AdminSessionListOutput, AdminSessionRevokeAllInput, AdminSessionRevokeAllOutput, AdminTokenRevokeAllInput, AdminTokenRevokeAllOutput } from '../auth/admin_action_specs.js';
13
+ import type { PermitOfferCreateInput, PermitOfferCreateOutput, PermitOfferOkOutput, PermitRevokeInput, PermitRevokeOutput } from '../auth/permit_offer_action_specs.js';
11
14
  /**
12
15
  * Narrow RPC surface consumed by `AdminAccountsState`. Consumers adapt their
13
16
  * typed RPC client (e.g. a `create_rpc_client` Proxy) to this shape — the
@@ -21,44 +24,20 @@ import type { PermitOfferJson } from '../auth/permit_offer_schema.js';
21
24
  * `admin_session_revoke_all` and `admin_token_revoke_all`. Without the
22
25
  * adapter the state class cannot fetch, grant, revoke, retract, or
23
26
  * revoke-all sessions/tokens.
27
+ *
28
+ * Method signatures track the underlying action specs — `Uuid`-branded ids
29
+ * propagate from the wire through the state class to the components. The
30
+ * adapter built by `create_admin_rpc_adapters` therefore needs zero casts
31
+ * to bridge to the typed throwing Proxy.
24
32
  */
25
33
  export interface AdminAccountsRpc {
26
- list_accounts: () => Promise<{
27
- accounts: Array<AdminAccountEntryJson>;
28
- grantable_roles: Array<string>;
29
- }>;
30
- list_sessions: () => Promise<{
31
- sessions: Array<AdminSessionJson>;
32
- }>;
33
- grant_permit: (params: {
34
- to_account_id: string;
35
- role: string;
36
- }) => Promise<{
37
- offer: PermitOfferJson;
38
- }>;
39
- revoke_permit: (params: {
40
- actor_id: string;
41
- permit_id: string;
42
- reason?: string | null;
43
- }) => Promise<{
44
- ok: true;
45
- revoked: true;
46
- }>;
47
- retract_offer: (offer_id: string) => Promise<{
48
- ok: true;
49
- }>;
50
- session_revoke_all: (params: {
51
- account_id: string;
52
- }) => Promise<{
53
- ok: true;
54
- count: number;
55
- }>;
56
- token_revoke_all: (params: {
57
- account_id: string;
58
- }) => Promise<{
59
- ok: true;
60
- count: number;
61
- }>;
34
+ list_accounts: () => Promise<AdminAccountListOutput>;
35
+ list_sessions: () => Promise<AdminSessionListOutput>;
36
+ grant_permit: (params: PermitOfferCreateInput) => Promise<PermitOfferCreateOutput>;
37
+ revoke_permit: (params: PermitRevokeInput) => Promise<PermitRevokeOutput>;
38
+ retract_offer: (offer_id: Uuid) => Promise<PermitOfferOkOutput>;
39
+ session_revoke_all: (params: AdminSessionRevokeAllInput) => Promise<AdminSessionRevokeAllOutput>;
40
+ token_revoke_all: (params: AdminTokenRevokeAllInput) => Promise<AdminTokenRevokeAllOutput>;
62
41
  }
63
42
  /**
64
43
  * Svelte context carrying the reactive `AdminAccountsRpc` accessor. The
@@ -86,7 +65,7 @@ export interface AdminAccountsStateOptions {
86
65
  export declare class AdminAccountsState extends Loadable {
87
66
  #private;
88
67
  accounts: Array<AdminAccountEntryJson>;
89
- grantable_roles: Array<string>;
68
+ grantable_roles: Array<RoleName>;
90
69
  readonly granting_keys: SvelteSet<string>;
91
70
  readonly revoking_ids: SvelteSet<string>;
92
71
  readonly retracting_ids: SvelteSet<string>;
@@ -111,7 +90,7 @@ export declare class AdminAccountsState extends Loadable {
111
90
  * No-op when the rpc adapter is absent; `error` is set to a descriptive
112
91
  * message so the UI surfaces the misconfiguration.
113
92
  */
114
- grant_permit(account_id: string, role: string): Promise<PermitOfferJson | undefined>;
93
+ grant_permit(account_id: Uuid, role: RoleName): Promise<PermitOfferJson | undefined>;
115
94
  /**
116
95
  * Revoke an active permit via the `permit_revoke` RPC.
117
96
  *
@@ -121,7 +100,7 @@ export declare class AdminAccountsState extends Loadable {
121
100
  * The optional `reason` is stamped on `permit.revoked_reason` and
122
101
  * surfaced on the revokee's WS notification.
123
102
  */
124
- revoke_permit(actor_id: string, permit_id: string, reason?: string | null): Promise<void>;
103
+ revoke_permit(actor_id: Uuid, permit_id: Uuid, reason?: string | null): Promise<void>;
125
104
  /**
126
105
  * Retract a pending offer the admin issued via the `permit_offer_retract`
127
106
  * RPC. The action handles auth, audit, and the
@@ -130,6 +109,6 @@ export declare class AdminAccountsState extends Loadable {
130
109
  * After success, refetches the listing so `pending_offers` drops the
131
110
  * row and the "+ {role}" button un-hides.
132
111
  */
133
- retract_offer(offer_id: string): Promise<void>;
112
+ retract_offer(offer_id: Uuid): Promise<void>;
134
113
  }
135
114
  //# sourceMappingURL=admin_accounts_state.svelte.d.ts.map
@@ -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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I,GAAG,OAAO,CAAC,IAAI,CAAC;CAiBlD"}
@@ -8,30 +8,21 @@
8
8
  * @module
9
9
  */
10
10
  import { SvelteSet } from 'svelte/reactivity';
11
+ import type { Uuid } from '@fuzdev/fuz_util/id.js';
11
12
  import { Loadable } from './loadable.svelte.js';
12
- import type { InviteJson, InviteWithUsernamesJson } from '../auth/invite_schema.js';
13
+ import type { InviteWithUsernamesJson } from '../auth/invite_schema.js';
14
+ import type { InviteCreateInput, InviteCreateOutput, InviteDeleteInput, InviteDeleteOutput, InviteListOutput } from '../auth/admin_action_specs.js';
13
15
  /**
14
16
  * Narrow RPC surface consumed by `AdminInvitesState`. Consumers adapt their
15
17
  * typed RPC client to this shape. `error.data.reason` on thrown errors
16
18
  * carries the `ERROR_INVITE_*` constant — handled by the caller when
17
- * user-friendly messages are needed.
19
+ * user-friendly messages are needed. Method signatures track the wire
20
+ * spec types directly so the adapter needs no casts.
18
21
  */
19
22
  export interface AdminInvitesRpc {
20
- list: () => Promise<{
21
- invites: Array<InviteWithUsernamesJson>;
22
- }>;
23
- create: (params: {
24
- email?: string | null;
25
- username?: string | null;
26
- }) => Promise<{
27
- ok: true;
28
- invite: InviteJson;
29
- }>;
30
- delete: (params: {
31
- invite_id: string;
32
- }) => Promise<{
33
- ok: true;
34
- }>;
23
+ list: () => Promise<InviteListOutput>;
24
+ create: (params: InviteCreateInput) => Promise<InviteCreateOutput>;
25
+ delete: (params: InviteDeleteInput) => Promise<InviteDeleteOutput>;
35
26
  }
36
27
  /**
37
28
  * Svelte context carrying the reactive `AdminInvitesRpc` accessor. Mirrors
@@ -60,6 +51,6 @@ export declare class AdminInvitesState extends Loadable {
60
51
  get has_rpc(): boolean;
61
52
  fetch(): Promise<void>;
62
53
  create_invite(email?: string, username?: string): Promise<boolean>;
63
- delete_invite(id: string): Promise<void>;
54
+ delete_invite(id: Uuid): Promise<void>;
64
55
  }
65
56
  //# sourceMappingURL=admin_invites_state.svelte.d.ts.map
@@ -1 +1 @@
1
-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EnF,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,eAAe,GAAG,IAAI,CAAC;CACvC;AAED,qBAAa,iBAAkB,SAAQ,QAAQ;;IAG9C,OAAO,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAkB;IACzD,QAAQ,UAAqB;IAC7B,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,MAAM,CAAC,CAAmB;IAE3D,QAAQ,CAAC,YAAY,SAAiC;IACtD,QAAQ,CAAC,eAAe,SAA8D;gBAE1E,OAAO,CAAC,EAAE,wBAAwB;IAK9C,6DAA6D;IAC7D,IAAI,OAAO,IAAI,OAAO,CAErB;IAEK,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAYtB,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAoBlE,aAAa,CAAC,EAAE,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAgB5C"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Admin RPC adapter helpers for consumer UIs.
3
3
  *
4
- * Bridges a typed `rpc_call`-shaped function to the four narrow admin RPC
4
+ * Bridges a typed throwing RPC client to the four narrow admin RPC
5
5
  * interfaces the state classes consume — `AdminAccountsRpc`,
6
6
  * `AdminInvitesRpc`, `AuditLogRpc`, `AppSettingsRpc`. Two calls at the
7
7
  * admin shell layout wire everything.
@@ -16,44 +16,57 @@
16
16
  * and backend factory names diverge by design.
17
17
  *
18
18
  * ```ts
19
- * import {create_throwing_rpc_call} from '@fuzdev/fuz_app/actions/rpc_client.js';
20
- * const rpc_call = create_throwing_rpc_call(api);
21
- * provide_admin_rpc_contexts(create_admin_rpc_adapters(rpc_call));
19
+ * // `api` is the typed throwing Proxy from `create_frontend_rpc_client`.
20
+ * provide_admin_rpc_contexts(create_admin_rpc_adapters(api));
22
21
  * ```
23
22
  *
24
- * `create_throwing_rpc_call` unwraps every `Result` to throw on error, spreading
25
- * the JSON-RPC `{code, message, data?}` onto the thrown `Error` so form
26
- * components (e.g. `PermitOfferForm.svelte`) can match on
27
- * `error.data?.reason` via `ERROR_OFFER_*` constants optional chaining is
28
- * required because JSON-RPC `data` is spec-level optional. Consumers that
29
- * need a custom unwrap strategy can supply any function matching
30
- * `AdminRpcCall` directly instead.
23
+ * The throwing Proxy spreads the JSON-RPC `{code, message, data?}` onto
24
+ * the thrown `Error` so form components (e.g. `PermitOfferForm.svelte`)
25
+ * can match on `error.data?.reason` via `ERROR_OFFER_*` constants —
26
+ * optional chaining is required because JSON-RPC `data` is spec-level
27
+ * optional. Consumers that need a custom unwrap strategy can construct
28
+ * their own object satisfying `AdminRpcApi` and pass it directly.
31
29
  *
32
30
  * No `.svelte.ts` suffix — this module holds no reactive state, only
33
31
  * method-name mappings.
34
32
  *
35
33
  * @module
36
34
  */
37
- import type { ThrowingRpcCall } from '../actions/rpc_client.js';
35
+ import type { AdminAccountListOutput, AdminSessionListOutput, AdminSessionRevokeAllInput, AdminSessionRevokeAllOutput, AdminTokenRevokeAllInput, AdminTokenRevokeAllOutput, AuditLogListInput, AuditLogListOutput, AuditLogPermitHistoryInput, AuditLogPermitHistoryOutput, InviteCreateInput, InviteCreateOutput, InviteDeleteInput, InviteDeleteOutput, InviteListOutput, AppSettingsGetOutput, AppSettingsUpdateInput, AppSettingsUpdateOutput } from '../auth/admin_action_specs.js';
36
+ import type { PermitOfferCreateInput, PermitOfferCreateOutput, PermitOfferRetractInput, PermitOfferOkOutput, PermitRevokeInput, PermitRevokeOutput } from '../auth/permit_offer_action_specs.js';
38
37
  import { type AdminAccountsRpc } from './admin_accounts_state.svelte.js';
39
38
  import { type AdminInvitesRpc } from './admin_invites_state.svelte.js';
40
39
  import { type AuditLogRpc } from './audit_log_state.svelte.js';
41
40
  import { type AppSettingsRpc } from './app_settings_state.svelte.js';
42
41
  import { type FormatScope } from './format_scope.js';
43
42
  /**
44
- * Function-shaped contract for dispatching an RPC call by method name.
43
+ * The wire-method surface this module needs from the typed throwing RPC
44
+ * client. Every method returns the unwrapped value or throws an `Error`
45
+ * carrying the JSON-RPC `{code, message, data?}` shape — i.e. the
46
+ * `ThrowingApi<...>` view of the corresponding action specs.
45
47
  *
46
- * Alias of `ThrowingRpcCall` kept as a domain-specific name so reads of
47
- * the admin UI code stay self-contained. Receives the method string and
48
- * input, returns a Promise of the output or throws on error carrying the
49
- * JSON-RPC `{code, message, data?}` shape.
50
- *
51
- * The generic is load-bearing: contextual typing lets the narrow
52
- * `Admin*Rpc` return types flow into `TOutput` so adapter methods typecheck
53
- * without explicit casts.
48
+ * Consumers pass the typed throwing Proxy returned by
49
+ * `create_frontend_rpc_client` directly. Structural typing means any
50
+ * superset (e.g. the consumer's full `ThrowingApi<ActionsApi>`) is
51
+ * assignable as long as these methods are present at these signatures.
54
52
  */
55
- export type AdminRpcCall = ThrowingRpcCall;
56
- /** The four admin RPC adapters assembled from a shared `rpc_call`. */
53
+ export interface AdminRpcApi {
54
+ admin_account_list: () => Promise<AdminAccountListOutput>;
55
+ admin_session_list: () => Promise<AdminSessionListOutput>;
56
+ admin_session_revoke_all: (input: AdminSessionRevokeAllInput) => Promise<AdminSessionRevokeAllOutput>;
57
+ admin_token_revoke_all: (input: AdminTokenRevokeAllInput) => Promise<AdminTokenRevokeAllOutput>;
58
+ audit_log_list: (input?: AuditLogListInput) => Promise<AuditLogListOutput>;
59
+ audit_log_permit_history: (input?: AuditLogPermitHistoryInput) => Promise<AuditLogPermitHistoryOutput>;
60
+ invite_list: () => Promise<InviteListOutput>;
61
+ invite_create: (input: InviteCreateInput) => Promise<InviteCreateOutput>;
62
+ invite_delete: (input: InviteDeleteInput) => Promise<InviteDeleteOutput>;
63
+ app_settings_get: () => Promise<AppSettingsGetOutput>;
64
+ app_settings_update: (input: AppSettingsUpdateInput) => Promise<AppSettingsUpdateOutput>;
65
+ permit_offer_create: (input: PermitOfferCreateInput) => Promise<PermitOfferCreateOutput>;
66
+ permit_offer_retract: (input: PermitOfferRetractInput) => Promise<PermitOfferOkOutput>;
67
+ permit_revoke: (input: PermitRevokeInput) => Promise<PermitRevokeOutput>;
68
+ }
69
+ /** The four admin RPC adapters assembled from a shared `api`. */
57
70
  export interface AdminRpcAdapters {
58
71
  admin_accounts: AdminAccountsRpc;
59
72
  admin_invites: AdminInvitesRpc;
@@ -61,7 +74,7 @@ export interface AdminRpcAdapters {
61
74
  app_settings: AppSettingsRpc;
62
75
  }
63
76
  /**
64
- * Build the four admin RPC adapters from a single typed `rpc_call`.
77
+ * Build the four admin RPC adapters from a typed throwing RPC client.
65
78
  *
66
79
  * Method-name mapping:
67
80
  *
@@ -82,12 +95,11 @@ export interface AdminRpcAdapters {
82
95
  * | `app_settings.get` | `app_settings_get` |
83
96
  * | `app_settings.update` | `app_settings_update` |
84
97
  *
85
- * All four adapter factories call through the same `rpc_call` — consumers
86
- * only construct one adapter closure (typically wrapping
87
- * `create_rpc_client`'s Proxy + Result-unwrap) regardless of how many
88
- * admin surfaces they mount.
98
+ * All four adapter factories call through the same `api` — consumers
99
+ * pass the typed throwing Proxy from `create_frontend_rpc_client` once,
100
+ * regardless of how many admin surfaces they mount.
89
101
  */
90
- export declare const create_admin_rpc_adapters: (rpc_call: AdminRpcCall) => AdminRpcAdapters;
102
+ export declare const create_admin_rpc_adapters: (api: AdminRpcApi) => AdminRpcAdapters;
91
103
  /** Optional knobs alongside the adapters when wiring admin contexts. */
92
104
  export interface ProvideAdminRpcContextsOptions {
93
105
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"admin_rpc_adapters.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/admin_rpc_adapters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAA6B,KAAK,gBAAgB,EAAC,MAA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