@fuzdev/fuz_app 0.42.0 → 0.44.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.
Files changed (34) hide show
  1. package/dist/actions/CLAUDE.md +77 -0
  2. package/dist/actions/action_rpc.d.ts.map +1 -1
  3. package/dist/actions/action_rpc.js +14 -7
  4. package/dist/actions/frontend_rpc_client.d.ts +74 -0
  5. package/dist/actions/frontend_rpc_client.d.ts.map +1 -0
  6. package/dist/actions/frontend_rpc_client.js +61 -0
  7. package/dist/actions/rpc_client.d.ts +64 -0
  8. package/dist/actions/rpc_client.d.ts.map +1 -1
  9. package/dist/actions/rpc_client.js +77 -0
  10. package/dist/auth/CLAUDE.md +32 -21
  11. package/dist/auth/account_action_specs.d.ts +8 -8
  12. package/dist/auth/account_action_specs.js +4 -4
  13. package/dist/auth/admin_action_specs.d.ts +8 -8
  14. package/dist/auth/admin_action_specs.js +4 -4
  15. package/dist/auth/self_service_role_action_specs.d.ts +20 -48
  16. package/dist/auth/self_service_role_action_specs.d.ts.map +1 -1
  17. package/dist/auth/self_service_role_action_specs.js +22 -44
  18. package/dist/auth/self_service_role_actions.d.ts +9 -9
  19. package/dist/auth/self_service_role_actions.d.ts.map +1 -1
  20. package/dist/auth/self_service_role_actions.js +48 -53
  21. package/dist/auth/standard_action_specs.d.ts +31 -0
  22. package/dist/auth/standard_action_specs.d.ts.map +1 -0
  23. package/dist/auth/standard_action_specs.js +36 -0
  24. package/dist/http/schema_helpers.d.ts +9 -0
  25. package/dist/http/schema_helpers.d.ts.map +1 -1
  26. package/dist/http/schema_helpers.js +9 -0
  27. package/dist/testing/admin_integration.js +9 -9
  28. package/dist/testing/audit_completeness.js +3 -3
  29. package/dist/testing/integration.js +36 -36
  30. package/dist/testing/rpc_helpers.d.ts +14 -6
  31. package/dist/testing/rpc_helpers.d.ts.map +1 -1
  32. package/dist/testing/rpc_helpers.js +8 -5
  33. package/dist/ui/admin_rpc_adapters.js +4 -4
  34. package/package.json +1 -1
@@ -17,6 +17,15 @@ import { derive_error_schemas } from './error_schemas.js';
17
17
  * but also accept other values.
18
18
  */
19
19
  export const is_null_schema = (schema) => schema instanceof z.ZodNull;
20
+ /**
21
+ * Check if a schema is exactly `z.void()`.
22
+ *
23
+ * RPC action specs use `z.void()` to declare a parameterless method —
24
+ * JSON-RPC 2.0 forbids `params: null` (params must be omitted or be a
25
+ * Structured value), so `z.void()` is the correct schema for "no params"
26
+ * and the dispatcher maps absent params to `undefined` for these specs.
27
+ */
28
+ export const is_void_schema = (schema) => schema instanceof z.ZodVoid;
20
29
  /**
21
30
  * Check if a schema is a strict object (`z.strictObject()`).
22
31
  *
@@ -163,7 +163,7 @@ export const describe_standard_admin_integration_tests = (options) => {
163
163
  app: test_app.app,
164
164
  path: rpc_path,
165
165
  spec: admin_account_list_action_spec,
166
- params: null,
166
+ params: undefined,
167
167
  headers: test_app.create_session_headers(),
168
168
  });
169
169
  assert.ok(res.ok, `admin_account_list failed: ${res.ok ? '' : JSON.stringify(res.error)}`);
@@ -181,7 +181,7 @@ export const describe_standard_admin_integration_tests = (options) => {
181
181
  app: test_app.app,
182
182
  path: rpc_path,
183
183
  spec: admin_account_list_action_spec,
184
- params: null,
184
+ params: undefined,
185
185
  headers: test_app.create_session_headers(),
186
186
  });
187
187
  assert.ok(!res.ok, 'Expected admin_account_list to fail for non-admin');
@@ -205,7 +205,7 @@ export const describe_standard_admin_integration_tests = (options) => {
205
205
  app: test_app.app,
206
206
  path: rpc_path,
207
207
  spec: admin_session_list_action_spec,
208
- params: null,
208
+ params: undefined,
209
209
  headers: test_app.create_session_headers(),
210
210
  });
211
211
  assert.ok(res.ok, `admin_session_list failed: ${res.ok ? '' : JSON.stringify(res.error)}`);
@@ -220,7 +220,7 @@ export const describe_standard_admin_integration_tests = (options) => {
220
220
  app: test_app.app,
221
221
  path: rpc_path,
222
222
  spec: account_verify_action_spec,
223
- params: null,
223
+ params: undefined,
224
224
  headers: create_headers(user_two.session_cookie),
225
225
  });
226
226
  assert.strictEqual(before.status, 200);
@@ -240,7 +240,7 @@ export const describe_standard_admin_integration_tests = (options) => {
240
240
  app: test_app.app,
241
241
  path: rpc_path,
242
242
  spec: account_verify_action_spec,
243
- params: null,
243
+ params: undefined,
244
244
  headers: create_headers(user_two.session_cookie),
245
245
  });
246
246
  assert.strictEqual(after.status, 401);
@@ -263,7 +263,7 @@ export const describe_standard_admin_integration_tests = (options) => {
263
263
  app: test_app.app,
264
264
  path: rpc_path,
265
265
  spec: account_verify_action_spec,
266
- params: null,
266
+ params: undefined,
267
267
  headers: test_app.create_session_headers(),
268
268
  });
269
269
  assert.strictEqual(after.status, 401);
@@ -279,7 +279,7 @@ export const describe_standard_admin_integration_tests = (options) => {
279
279
  app: test_app.app,
280
280
  path: rpc_path,
281
281
  spec: account_verify_action_spec,
282
- params: null,
282
+ params: undefined,
283
283
  headers: { authorization: `Bearer ${user_two.api_token}` },
284
284
  suppress_default_origin: true,
285
285
  });
@@ -300,7 +300,7 @@ export const describe_standard_admin_integration_tests = (options) => {
300
300
  app: test_app.app,
301
301
  path: rpc_path,
302
302
  spec: account_verify_action_spec,
303
- params: null,
303
+ params: undefined,
304
304
  headers: { authorization: `Bearer ${user_two.api_token}` },
305
305
  suppress_default_origin: true,
306
306
  });
@@ -725,7 +725,7 @@ export const describe_standard_admin_integration_tests = (options) => {
725
725
  app: test_app.app,
726
726
  path: rpc_path,
727
727
  spec: admin_account_list_action_spec,
728
- params: null,
728
+ params: undefined,
729
729
  headers: create_headers(regular_user.session_cookie),
730
730
  });
731
731
  assert.ok(!res.ok, 'Expected admin_account_list to fail for non-admin');
@@ -144,7 +144,7 @@ export const describe_audit_completeness_tests = (options) => {
144
144
  app: test_app.app,
145
145
  path: rpc_path,
146
146
  spec: account_token_list_action_spec,
147
- params: null,
147
+ params: undefined,
148
148
  headers: test_app.create_session_headers(),
149
149
  });
150
150
  assert.ok(list_res.ok, 'account_token_list should succeed');
@@ -179,7 +179,7 @@ export const describe_audit_completeness_tests = (options) => {
179
179
  app: test_app.app,
180
180
  path: rpc_path,
181
181
  spec: account_session_list_action_spec,
182
- params: null,
182
+ params: undefined,
183
183
  headers: test_app.create_session_headers(),
184
184
  });
185
185
  assert.ok(list_res.ok, 'account_session_list should succeed');
@@ -203,7 +203,7 @@ export const describe_audit_completeness_tests = (options) => {
203
203
  app: test_app.app,
204
204
  path: rpc_path,
205
205
  spec: account_session_revoke_all_action_spec,
206
- params: null,
206
+ params: undefined,
207
207
  headers: test_app.create_session_headers(),
208
208
  });
209
209
  assert.ok(res.ok, `account_session_revoke_all failed: ${res.ok ? '' : JSON.stringify(res.error)}`);
@@ -225,7 +225,7 @@ export const describe_standard_integration_tests = (options) => {
225
225
  app: test_app.app,
226
226
  path: rpc_path,
227
227
  spec: account_verify_action_spec,
228
- params: null,
228
+ params: undefined,
229
229
  headers: create_headers(),
230
230
  });
231
231
  assert.strictEqual(verify_res.status, 200);
@@ -243,7 +243,7 @@ export const describe_standard_integration_tests = (options) => {
243
243
  app: test_app.app,
244
244
  path: rpc_path,
245
245
  spec: account_verify_action_spec,
246
- params: null,
246
+ params: undefined,
247
247
  headers: create_headers(),
248
248
  });
249
249
  assert.strictEqual(verify_after.status, 401);
@@ -315,7 +315,7 @@ export const describe_standard_integration_tests = (options) => {
315
315
  app: test_app.app,
316
316
  path: rpc_path,
317
317
  spec: account_verify_action_spec,
318
- params: null,
318
+ params: undefined,
319
319
  headers: { host: 'localhost' },
320
320
  });
321
321
  assert.strictEqual(res.status, 401);
@@ -326,7 +326,7 @@ export const describe_standard_integration_tests = (options) => {
326
326
  app: test_app.app,
327
327
  path: rpc_path,
328
328
  spec: account_verify_action_spec,
329
- params: null,
329
+ params: undefined,
330
330
  headers: { cookie: `${cookie_name}=random_garbage_value` },
331
331
  });
332
332
  assert.strictEqual(res.status, 401);
@@ -338,7 +338,7 @@ export const describe_standard_integration_tests = (options) => {
338
338
  app: test_app.app,
339
339
  path: rpc_path,
340
340
  spec: account_verify_action_spec,
341
- params: null,
341
+ params: undefined,
342
342
  headers: { cookie: `${cookie_name}=${expired_cookie}` },
343
343
  });
344
344
  assert.strictEqual(res.status, 401);
@@ -354,7 +354,7 @@ export const describe_standard_integration_tests = (options) => {
354
354
  app: test_app.app,
355
355
  path: rpc_path,
356
356
  spec: account_session_list_action_spec,
357
- params: null,
357
+ params: undefined,
358
358
  headers,
359
359
  });
360
360
  assert.ok(list_res.ok, 'account_session_list should succeed');
@@ -376,7 +376,7 @@ export const describe_standard_integration_tests = (options) => {
376
376
  app: test_app.app,
377
377
  path: rpc_path,
378
378
  spec: account_verify_action_spec,
379
- params: null,
379
+ params: undefined,
380
380
  headers,
381
381
  });
382
382
  assert.strictEqual(after.status, 401);
@@ -389,7 +389,7 @@ export const describe_standard_integration_tests = (options) => {
389
389
  app: test_app.app,
390
390
  path: rpc_path,
391
391
  spec: account_verify_action_spec,
392
- params: null,
392
+ params: undefined,
393
393
  headers,
394
394
  });
395
395
  assert.strictEqual(before.status, 200);
@@ -398,7 +398,7 @@ export const describe_standard_integration_tests = (options) => {
398
398
  app: test_app.app,
399
399
  path: rpc_path,
400
400
  spec: account_session_revoke_all_action_spec,
401
- params: null,
401
+ params: undefined,
402
402
  headers,
403
403
  });
404
404
  assert.ok(revoke_res.ok, 'account_session_revoke_all should succeed');
@@ -407,7 +407,7 @@ export const describe_standard_integration_tests = (options) => {
407
407
  app: test_app.app,
408
408
  path: rpc_path,
409
409
  spec: account_verify_action_spec,
410
- params: null,
410
+ params: undefined,
411
411
  headers,
412
412
  });
413
413
  assert.strictEqual(after.status, 401);
@@ -443,7 +443,7 @@ export const describe_standard_integration_tests = (options) => {
443
443
  app: test_app.app,
444
444
  path: rpc_path,
445
445
  spec: account_verify_action_spec,
446
- params: null,
446
+ params: undefined,
447
447
  headers: test_app.create_session_headers(),
448
448
  });
449
449
  assert.strictEqual(verify_after.status, 401);
@@ -485,7 +485,7 @@ export const describe_standard_integration_tests = (options) => {
485
485
  app: test_app.app,
486
486
  path: rpc_path,
487
487
  spec: account_verify_action_spec,
488
- params: null,
488
+ params: undefined,
489
489
  headers: test_app.create_session_headers(),
490
490
  });
491
491
  assert.strictEqual(verify_res.status, 200);
@@ -521,7 +521,7 @@ export const describe_standard_integration_tests = (options) => {
521
521
  app: test_app.app,
522
522
  path: rpc_path,
523
523
  spec: account_verify_action_spec,
524
- params: null,
524
+ params: undefined,
525
525
  headers: test_app.create_session_headers(),
526
526
  });
527
527
  assert.strictEqual(res.status, 200);
@@ -534,7 +534,7 @@ export const describe_standard_integration_tests = (options) => {
534
534
  app: test_app.app,
535
535
  path: rpc_path,
536
536
  spec: account_verify_action_spec,
537
- params: null,
537
+ params: undefined,
538
538
  headers: { cookie: `${cookie_name}=${test_app.backend.session_cookie}` },
539
539
  suppress_default_origin: true,
540
540
  });
@@ -549,7 +549,7 @@ export const describe_standard_integration_tests = (options) => {
549
549
  app: test_app.app,
550
550
  path: rpc_path,
551
551
  spec: account_verify_action_spec,
552
- params: null,
552
+ params: undefined,
553
553
  headers: test_app.create_bearer_headers(),
554
554
  suppress_default_origin: true,
555
555
  });
@@ -561,7 +561,7 @@ export const describe_standard_integration_tests = (options) => {
561
561
  app: test_app.app,
562
562
  path: rpc_path,
563
563
  spec: account_verify_action_spec,
564
- params: null,
564
+ params: undefined,
565
565
  headers: { authorization: 'Bearer secret_fuz_token_invalid' },
566
566
  suppress_default_origin: true,
567
567
  });
@@ -575,7 +575,7 @@ export const describe_standard_integration_tests = (options) => {
575
575
  app: test_app.app,
576
576
  path: rpc_path,
577
577
  spec: account_verify_action_spec,
578
- params: null,
578
+ params: undefined,
579
579
  headers: bearer_headers,
580
580
  suppress_default_origin: true,
581
581
  });
@@ -585,7 +585,7 @@ export const describe_standard_integration_tests = (options) => {
585
585
  app: test_app.app,
586
586
  path: rpc_path,
587
587
  spec: account_verify_action_spec,
588
- params: null,
588
+ params: undefined,
589
589
  headers: { ...bearer_headers, origin: 'http://localhost:5173' },
590
590
  });
591
591
  assert.strictEqual(res.status, 401);
@@ -610,7 +610,7 @@ export const describe_standard_integration_tests = (options) => {
610
610
  app: test_app.app,
611
611
  path: rpc_path,
612
612
  spec: account_verify_action_spec,
613
- params: null,
613
+ params: undefined,
614
614
  headers: { authorization: `Bearer ${token}` },
615
615
  suppress_default_origin: true,
616
616
  });
@@ -629,7 +629,7 @@ export const describe_standard_integration_tests = (options) => {
629
629
  app: test_app.app,
630
630
  path: rpc_path,
631
631
  spec: account_verify_action_spec,
632
- params: null,
632
+ params: undefined,
633
633
  headers: { authorization: `Bearer ${token}` },
634
634
  suppress_default_origin: true,
635
635
  });
@@ -662,7 +662,7 @@ export const describe_standard_integration_tests = (options) => {
662
662
  app: test_app.app,
663
663
  path: rpc_path,
664
664
  spec: account_session_revoke_all_action_spec,
665
- params: null,
665
+ params: undefined,
666
666
  headers: test_app.create_session_headers(),
667
667
  });
668
668
  assert.ok(revoke_res.ok, 'account_session_revoke_all should succeed');
@@ -671,7 +671,7 @@ export const describe_standard_integration_tests = (options) => {
671
671
  app: test_app.app,
672
672
  path: rpc_path,
673
673
  spec: account_verify_action_spec,
674
- params: null,
674
+ params: undefined,
675
675
  headers: { cookie: `${cookie_name}=${user_b.session_cookie}` },
676
676
  });
677
677
  assert.strictEqual(verify_b.status, 200);
@@ -685,7 +685,7 @@ export const describe_standard_integration_tests = (options) => {
685
685
  app: test_app.app,
686
686
  path: rpc_path,
687
687
  spec: account_session_list_action_spec,
688
- params: null,
688
+ params: undefined,
689
689
  headers: user_b_headers,
690
690
  });
691
691
  assert.ok(list_res.ok, 'account_session_list should succeed');
@@ -706,7 +706,7 @@ export const describe_standard_integration_tests = (options) => {
706
706
  app: test_app.app,
707
707
  path: rpc_path,
708
708
  spec: account_verify_action_spec,
709
- params: null,
709
+ params: undefined,
710
710
  headers: user_b_headers,
711
711
  });
712
712
  assert.strictEqual(verify_b.status, 200);
@@ -720,7 +720,7 @@ export const describe_standard_integration_tests = (options) => {
720
720
  app: test_app.app,
721
721
  path: rpc_path,
722
722
  spec: account_token_list_action_spec,
723
- params: null,
723
+ params: undefined,
724
724
  headers: user_b_headers,
725
725
  });
726
726
  assert.ok(list_res.ok, 'account_token_list should succeed');
@@ -741,7 +741,7 @@ export const describe_standard_integration_tests = (options) => {
741
741
  app: test_app.app,
742
742
  path: rpc_path,
743
743
  spec: account_verify_action_spec,
744
- params: null,
744
+ params: undefined,
745
745
  headers: { authorization: `Bearer ${user_b.api_token}` },
746
746
  suppress_default_origin: true,
747
747
  });
@@ -755,7 +755,7 @@ export const describe_standard_integration_tests = (options) => {
755
755
  app: test_app.app,
756
756
  path: rpc_path,
757
757
  spec: account_session_list_action_spec,
758
- params: null,
758
+ params: undefined,
759
759
  headers: test_app.create_session_headers(),
760
760
  });
761
761
  assert.ok(res.ok, 'account_session_list should succeed');
@@ -772,7 +772,7 @@ export const describe_standard_integration_tests = (options) => {
772
772
  app: test_app.app,
773
773
  path: rpc_path,
774
774
  spec: account_token_list_action_spec,
775
- params: null,
775
+ params: undefined,
776
776
  headers: test_app.create_session_headers(),
777
777
  });
778
778
  assert.ok(res.ok, 'account_token_list should succeed');
@@ -898,7 +898,7 @@ export const describe_standard_integration_tests = (options) => {
898
898
  app: test_app.app,
899
899
  path: rpc_path,
900
900
  spec: account_session_list_action_spec,
901
- params: null,
901
+ params: undefined,
902
902
  headers: { host: 'localhost' },
903
903
  });
904
904
  assert.strictEqual(session_list.status, 401);
@@ -907,7 +907,7 @@ export const describe_standard_integration_tests = (options) => {
907
907
  app: test_app.app,
908
908
  path: rpc_path,
909
909
  spec: account_session_revoke_all_action_spec,
910
- params: null,
910
+ params: undefined,
911
911
  headers: { host: 'localhost' },
912
912
  });
913
913
  assert.strictEqual(session_revoke_all.status, 401);
@@ -916,7 +916,7 @@ export const describe_standard_integration_tests = (options) => {
916
916
  app: test_app.app,
917
917
  path: rpc_path,
918
918
  spec: account_token_list_action_spec,
919
- params: null,
919
+ params: undefined,
920
920
  headers: { host: 'localhost' },
921
921
  });
922
922
  assert.strictEqual(token_list.status, 401);
@@ -934,7 +934,7 @@ export const describe_standard_integration_tests = (options) => {
934
934
  app: test_app.app,
935
935
  path: rpc_path,
936
936
  spec: account_verify_action_spec,
937
- params: null,
937
+ params: undefined,
938
938
  headers: { host: 'localhost' },
939
939
  });
940
940
  assert.strictEqual(verify.status, 401);
@@ -960,7 +960,7 @@ export const describe_standard_integration_tests = (options) => {
960
960
  app: test_app.app,
961
961
  path: rpc_path,
962
962
  spec: account_verify_action_spec,
963
- params: null,
963
+ params: undefined,
964
964
  headers: { host: 'localhost' },
965
965
  });
966
966
  assert.strictEqual(res.status, 401);
@@ -980,7 +980,7 @@ export const describe_standard_integration_tests = (options) => {
980
980
  app: test_app.app,
981
981
  path: rpc_path,
982
982
  spec: account_verify_action_spec,
983
- params: null,
983
+ params: undefined,
984
984
  headers: { cookie: `${cookie_name}=${expired_cookie}` },
985
985
  });
986
986
  assert.strictEqual(res.status, 401, 'Expired session cookie should be rejected');
@@ -1054,7 +1054,7 @@ export const describe_standard_integration_tests = (options) => {
1054
1054
  app: test_app.app,
1055
1055
  path: rpc_path,
1056
1056
  spec: account_verify_action_spec,
1057
- params: null,
1057
+ params: undefined,
1058
1058
  headers: { authorization: `Bearer ${raw_token}` },
1059
1059
  suppress_default_origin: true,
1060
1060
  });
@@ -1077,7 +1077,7 @@ export const describe_standard_integration_tests = (options) => {
1077
1077
  app: test_app.app,
1078
1078
  path: rpc_path,
1079
1079
  spec: account_verify_action_spec,
1080
- params: null,
1080
+ params: undefined,
1081
1081
  headers: { authorization: `Bearer ${raw_token}` },
1082
1082
  suppress_default_origin: true,
1083
1083
  });
@@ -40,10 +40,13 @@ export declare const resolve_rpc_endpoints_for_setup: (rpc_endpoints: RpcEndpoin
40
40
  * Create a `RequestInit` for a JSON-RPC POST request.
41
41
  *
42
42
  * @param method - JSON-RPC method name
43
- * @param params - params object (omit or pass `null` for null-input methods;
44
- * both are serialized without a `params` field so the envelope
45
- * schema accepts the request — `"params":null` is not a valid
46
- * JSON-RPC value)
43
+ * @param params - params (omit for parameterless methods; `null` is also
44
+ * stripped for ergonomic call sites JSON-RPC 2.0 §4.2
45
+ * forbids `"params": null` on the wire, and `create_rpc_endpoint`
46
+ * rejects `z.null()` action input schemas at registration).
47
+ * Tests that need to construct a literal `"params": null`
48
+ * envelope (e.g. asserting envelope-level rejection) should
49
+ * build the body inline rather than route through this helper.
47
50
  * @param id - request id (default `'test'`)
48
51
  * @returns a `RequestInit` with the JSON-RPC envelope as body
49
52
  */
@@ -53,7 +56,7 @@ export declare const create_rpc_post_init: (method: string, params?: unknown, id
53
56
  *
54
57
  * @param endpoint_path - the RPC endpoint path (e.g., `/api/rpc`)
55
58
  * @param method - JSON-RPC method name
56
- * @param params - params object (omit for null-input methods)
59
+ * @param params - params (omit for parameterless methods)
57
60
  * @param id - request id (default `'test'`)
58
61
  * @returns the full URL with query string
59
62
  */
@@ -113,7 +116,12 @@ export interface RpcCallArgs {
113
116
  path: string;
114
117
  /** JSON-RPC method name. */
115
118
  method: string;
116
- /** Params object. Omit or pass `null` for null-input methods. */
119
+ /**
120
+ * Params for the call. Omit (or pass `undefined`) for parameterless
121
+ * (`z.void()`) methods — the helper drops `params` from the envelope
122
+ * either way. See `create_rpc_post_init` for the null-stripping
123
+ * affordance and JSON-RPC 2.0 §4.2's prohibition on `params: null`.
124
+ */
117
125
  params?: unknown;
118
126
  /** Extra request headers (session cookie, bearer, etc.). Overrides defaults. */
119
127
  headers?: Record<string, string>;
@@ -1 +1 @@
1
- {"version":3,"file":"rpc_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/rpc_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAa7B,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAIN,KAAK,gBAAgB,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,2BAA2B,CAAC;AACzE,OAAO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param method - JSON-RPC method name
58
- * @param params - params object (omit or pass `null` for null-input methods;
59
- * both are serialized without a `params` field so the envelope
60
- * schema accepts the request — `"params":null` is not a valid
61
- * JSON-RPC value)
58
+ * @param params - params (omit for parameterless methods; `null` is also
59
+ * stripped for ergonomic call sites JSON-RPC 2.0 §4.2
60
+ * forbids `"params": null` on the wire, and `create_rpc_endpoint`
61
+ * rejects `z.null()` action input schemas at registration).
62
+ * Tests that need to construct a literal `"params": null`
63
+ * envelope (e.g. asserting envelope-level rejection) should
64
+ * build the body inline rather than route through this helper.
62
65
  * @param id - request id (default `'test'`)
63
66
  * @returns a `RequestInit` with the JSON-RPC envelope as body
64
67
  */
@@ -77,7 +80,7 @@ export const create_rpc_post_init = (method, params, id = 'test') => {
77
80
  *
78
81
  * @param endpoint_path - the RPC endpoint path (e.g., `/api/rpc`)
79
82
  * @param method - JSON-RPC method name
80
- * @param params - params object (omit for null-input methods)
83
+ * @param params - params (omit for parameterless methods)
81
84
  * @param id - request id (default `'test'`)
82
85
  * @returns the full URL with query string
83
86
  */
@@ -68,8 +68,8 @@ import { format_scope_context } from './format_scope.js';
68
68
  */
69
69
  export const create_admin_rpc_adapters = (rpc_call) => ({
70
70
  admin_accounts: {
71
- list_accounts: () => rpc_call('admin_account_list', null),
72
- list_sessions: () => rpc_call('admin_session_list', null),
71
+ list_accounts: () => rpc_call('admin_account_list'),
72
+ list_sessions: () => rpc_call('admin_session_list'),
73
73
  grant_permit: (params) => rpc_call('permit_offer_create', params),
74
74
  revoke_permit: (params) => rpc_call('permit_revoke', params),
75
75
  retract_offer: (offer_id) => rpc_call('permit_offer_retract', { offer_id }),
@@ -77,7 +77,7 @@ export const create_admin_rpc_adapters = (rpc_call) => ({
77
77
  token_revoke_all: (params) => rpc_call('admin_token_revoke_all', params),
78
78
  },
79
79
  admin_invites: {
80
- list: () => rpc_call('invite_list', null),
80
+ list: () => rpc_call('invite_list'),
81
81
  create: (params) => rpc_call('invite_create', params),
82
82
  delete: (params) => rpc_call('invite_delete', params),
83
83
  },
@@ -86,7 +86,7 @@ export const create_admin_rpc_adapters = (rpc_call) => ({
86
86
  permit_history: (params) => rpc_call('audit_log_permit_history', params ?? {}),
87
87
  },
88
88
  app_settings: {
89
- get: () => rpc_call('app_settings_get', null),
89
+ get: () => rpc_call('app_settings_get'),
90
90
  update: (params) => rpc_call('app_settings_update', params),
91
91
  },
92
92
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuzdev/fuz_app",
3
- "version": "0.42.0",
3
+ "version": "0.44.0",
4
4
  "description": "fullstack app library",
5
5
  "glyph": "🗝",
6
6
  "logo": "logo.svg",