@fuzdev/fuz_app 0.155.1 → 0.157.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 (145) hide show
  1. package/dist/actions/CLAUDE.md +27 -14
  2. package/dist/actions/action_codegen.d.ts +10 -3
  3. package/dist/actions/action_codegen.d.ts.map +1 -1
  4. package/dist/actions/action_codegen.js +52 -13
  5. package/dist/actions/action_event.d.ts.map +1 -1
  6. package/dist/actions/action_event.js +13 -11
  7. package/dist/actions/action_rpc.d.ts +4 -3
  8. package/dist/actions/action_rpc.d.ts.map +1 -1
  9. package/dist/actions/action_rpc.js +4 -3
  10. package/dist/actions/action_spec.d.ts +102 -206
  11. package/dist/actions/action_spec.d.ts.map +1 -1
  12. package/dist/actions/action_spec.js +18 -96
  13. package/dist/actions/action_types.d.ts +4 -4
  14. package/dist/actions/action_types.d.ts.map +1 -1
  15. package/dist/actions/action_types.js +2 -2
  16. package/dist/actions/broadcast_api.d.ts.map +1 -1
  17. package/dist/actions/broadcast_api.js +6 -5
  18. package/dist/actions/compile_action_registry.d.ts +11 -6
  19. package/dist/actions/compile_action_registry.d.ts.map +1 -1
  20. package/dist/actions/compile_action_registry.js +15 -9
  21. package/dist/actions/perform_action.d.ts +4 -4
  22. package/dist/actions/perform_action.d.ts.map +1 -1
  23. package/dist/actions/perform_action.js +11 -11
  24. package/dist/auth/CLAUDE.md +1 -1
  25. package/dist/auth/account_action_specs.d.ts +50 -23
  26. package/dist/auth/account_action_specs.d.ts.map +1 -1
  27. package/dist/auth/account_action_specs.js +18 -8
  28. package/dist/auth/account_route_schema.d.ts +10 -10
  29. package/dist/auth/account_schema.d.ts +21 -21
  30. package/dist/auth/actor_lookup_action_specs.d.ts +7 -7
  31. package/dist/auth/actor_search_action_specs.d.ts +6 -6
  32. package/dist/auth/admin_action_specs.d.ts +98 -98
  33. package/dist/auth/app_settings_schema.d.ts +2 -2
  34. package/dist/auth/audit_log_route_schema.d.ts +1 -1
  35. package/dist/auth/audit_log_schema.d.ts +44 -44
  36. package/dist/auth/auth_guard_resolver.d.ts +2 -2
  37. package/dist/auth/auth_guard_resolver.js +2 -2
  38. package/dist/auth/bootstrap_route_schema.d.ts +4 -4
  39. package/dist/auth/cell_action_specs.d.ts +241 -241
  40. package/dist/auth/cell_actions.js +3 -3
  41. package/dist/auth/cell_audit_action_specs.d.ts +14 -14
  42. package/dist/auth/cell_audit_metadata.d.ts +6 -6
  43. package/dist/auth/cell_field_action_specs.d.ts +38 -38
  44. package/dist/auth/cell_field_audit_metadata.d.ts +4 -4
  45. package/dist/auth/cell_grant_action_specs.d.ts +61 -61
  46. package/dist/auth/cell_grant_audit_metadata.d.ts +10 -10
  47. package/dist/auth/cell_item_action_specs.d.ts +50 -50
  48. package/dist/auth/cell_item_audit_metadata.d.ts +5 -5
  49. package/dist/auth/invite_schema.d.ts +6 -6
  50. package/dist/auth/role_grant_offer_action_specs.d.ts +120 -120
  51. package/dist/auth/role_grant_offer_notifications.d.ts +66 -66
  52. package/dist/auth/role_grant_offer_schema.d.ts +6 -6
  53. package/dist/auth/self_service_role_action_specs.d.ts +2 -2
  54. package/dist/auth/signup_route_schema.d.ts +2 -2
  55. package/dist/http/CLAUDE.md +26 -17
  56. package/dist/http/auth_shape.d.ts +51 -17
  57. package/dist/http/auth_shape.d.ts.map +1 -1
  58. package/dist/http/auth_shape.js +101 -52
  59. package/dist/http/error_schemas.d.ts +15 -8
  60. package/dist/http/error_schemas.d.ts.map +1 -1
  61. package/dist/http/error_schemas.js +4 -9
  62. package/dist/http/jsonrpc_errors.d.ts +11 -4
  63. package/dist/http/jsonrpc_errors.d.ts.map +1 -1
  64. package/dist/http/jsonrpc_errors.js +11 -4
  65. package/dist/http/jsonrpc_helpers.d.ts.map +1 -1
  66. package/dist/http/jsonrpc_helpers.js +2 -1
  67. package/dist/http/route_spec.d.ts +37 -19
  68. package/dist/http/route_spec.d.ts.map +1 -1
  69. package/dist/http/route_spec.js +54 -24
  70. package/dist/http/schema_helpers.d.ts +27 -24
  71. package/dist/http/schema_helpers.d.ts.map +1 -1
  72. package/dist/http/schema_helpers.js +24 -19
  73. package/dist/http/surface.d.ts.map +1 -1
  74. package/dist/http/surface.js +7 -3
  75. package/dist/primitive_schemas.d.ts +16 -5
  76. package/dist/primitive_schemas.d.ts.map +1 -1
  77. package/dist/primitive_schemas.js +26 -4
  78. package/dist/primitive_schemas_fuz.d.ts +67 -0
  79. package/dist/primitive_schemas_fuz.d.ts.map +1 -0
  80. package/dist/primitive_schemas_fuz.js +47 -0
  81. package/dist/realtime/sse.d.ts +3 -3
  82. package/dist/realtime/sse.d.ts.map +1 -1
  83. package/dist/realtime/sse.js +4 -4
  84. package/dist/schema_issues.d.ts +91 -4
  85. package/dist/schema_issues.d.ts.map +1 -1
  86. package/dist/schema_issues.js +262 -1
  87. package/dist/schema_meta.d.ts +24 -8
  88. package/dist/schema_meta.d.ts.map +1 -1
  89. package/dist/schema_meta.js +31 -10
  90. package/dist/server/serve_fact_route.d.ts.map +1 -1
  91. package/dist/server/serve_fact_route.js +2 -1
  92. package/dist/testing/CLAUDE.md +23 -17
  93. package/dist/testing/admin_integration.d.ts.map +1 -1
  94. package/dist/testing/admin_integration.js +3 -2
  95. package/dist/testing/adversarial_404.d.ts +2 -2
  96. package/dist/testing/adversarial_404.d.ts.map +1 -1
  97. package/dist/testing/adversarial_404.js +8 -5
  98. package/dist/testing/adversarial_input.js +1 -1
  99. package/dist/testing/adversarial_input_cases.d.ts +18 -23
  100. package/dist/testing/adversarial_input_cases.d.ts.map +1 -1
  101. package/dist/testing/adversarial_input_cases.js +51 -46
  102. package/dist/testing/assertions.d.ts +6 -5
  103. package/dist/testing/assertions.d.ts.map +1 -1
  104. package/dist/testing/assertions.js +9 -4
  105. package/dist/testing/cross_backend/action_manifest.d.ts +2 -1
  106. package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
  107. package/dist/testing/cross_backend/action_manifest.js +3 -3
  108. package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
  109. package/dist/testing/cross_backend/cell_crud.js +3 -8
  110. package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
  111. package/dist/testing/cross_backend/conformance_table.js +5 -4
  112. package/dist/testing/cross_backend/cross_rpc.d.ts +4 -2
  113. package/dist/testing/cross_backend/cross_rpc.d.ts.map +1 -1
  114. package/dist/testing/cross_backend/cross_rpc.js +6 -4
  115. package/dist/testing/cross_backend/rpc_success_fixtures.d.ts.map +1 -1
  116. package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
  117. package/dist/testing/cross_backend/sse_round_trip.js +3 -2
  118. package/dist/testing/cross_backend/testing_reset_actions.d.ts +8 -8
  119. package/dist/testing/error_coverage.d.ts +9 -17
  120. package/dist/testing/error_coverage.d.ts.map +1 -1
  121. package/dist/testing/error_coverage.js +20 -3
  122. package/dist/testing/integration_helpers.d.ts.map +1 -1
  123. package/dist/testing/integration_helpers.js +7 -6
  124. package/dist/testing/rpc_envelope_cases.d.ts +3 -3
  125. package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
  126. package/dist/testing/rpc_envelope_cases.js +1 -1
  127. package/dist/testing/rpc_helpers.d.ts +12 -8
  128. package/dist/testing/rpc_helpers.d.ts.map +1 -1
  129. package/dist/testing/rpc_helpers.js +18 -15
  130. package/dist/testing/schema_generators.d.ts +75 -40
  131. package/dist/testing/schema_generators.d.ts.map +1 -1
  132. package/dist/testing/schema_generators.js +273 -99
  133. package/dist/testing/sse_round_trip.d.ts.map +1 -1
  134. package/dist/testing/sse_round_trip.js +4 -3
  135. package/dist/ui/admin_accounts_state.svelte.d.ts +10 -10
  136. package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
  137. package/dist/ui/admin_invites_state.svelte.d.ts +1 -1
  138. package/dist/ui/admin_invites_state.svelte.d.ts.map +1 -1
  139. package/dist/ui/admin_sessions_state.svelte.d.ts +2 -2
  140. package/dist/ui/admin_sessions_state.svelte.d.ts.map +1 -1
  141. package/dist/ui/role_grant_offers_state.svelte.d.ts +6 -6
  142. package/dist/zod.d.ts +23 -5
  143. package/dist/zod.d.ts.map +1 -1
  144. package/dist/zod.js +2 -2
  145. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"adversarial_404.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/adversarial_404.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAqB7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAOlE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,GAAI,QAAQ,gBAAgB,KAAG,MAAM,GAAG,IAe1E,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,GAAI,SAAS,sBAAsB,KAAG,IA+E1E,CAAC"}
1
+ {"version":3,"file":"adversarial_404.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/adversarial_404.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAsB7B,OAAO,EAAa,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAOlE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,GAAI,QAAQ,gBAAgB,KAAG,MAAM,GAAG,IAe1E,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,GAAI,SAAS,sBAAsB,KAAG,IAqF1E,CAAC"}
@@ -4,7 +4,8 @@ import './assert_dev_env.js';
4
4
  *
5
5
  * Creates stub handlers that return 404 with the declared error code,
6
6
  * fires requests with valid-format-but-nonexistent params (nil UUIDs),
7
- * and validates response bodies against the declared 404 Zod schemas.
7
+ * and validates response bodies against the declared 404 schemas, Zod or
8
+ * `@fuzdev/fuz_schema`.
8
9
  *
9
10
  * No DB needed — tests schema conformance of 404 responses, not real handlers.
10
11
  *
@@ -15,6 +16,7 @@ import { z } from 'zod';
15
16
  import { is_schema } from '@fuzdev/fuz_schema/schema.ts';
16
17
  import { to_json_schema } from '@fuzdev/fuz_schema/json_schema.ts';
17
18
  import { is_null_schema } from '../http/schema_helpers.js';
19
+ import { parse_any } from '../schema_issues.js';
18
20
  import { create_auth_test_apps, create_route_skip_filter, select_auth_app } from './auth_apps.js';
19
21
  import { resolve_valid_path, generate_valid_body, to_route_content_type } from './schema_generators.js';
20
22
  /**
@@ -53,13 +55,13 @@ export const extract_404_error_code = (schema) => {
53
55
  * 1. Creates a stub handler returning 404 with the declared error code
54
56
  * 2. Fires a request with valid-format params (nil UUIDs for UUID params)
55
57
  * 3. Validates response status is 404
56
- * 4. Validates response body matches the declared 404 Zod schema
58
+ * 4. Validates response body matches the declared 404 schema (`parse_any`)
57
59
  */
58
60
  export const describe_adversarial_404 = (options) => {
59
61
  const { build, roles } = options;
60
62
  const { surface, route_specs } = build();
61
63
  const is_skipped = create_route_skip_filter(options.skip_routes);
62
- // Build spec lookup for Zod schema access
64
+ // Build spec lookup for schema access
63
65
  const spec_lookup = new Map();
64
66
  for (const spec of route_specs) {
65
67
  spec_lookup.set(`${spec.method} ${spec.path}`, spec);
@@ -120,8 +122,9 @@ export const describe_adversarial_404 = (options) => {
120
122
  assert.strictEqual(res.status, 404, `Expected 404 for ${key}, got ${res.status}`);
121
123
  const body = await res.json();
122
124
  assert.strictEqual(body.error, error_code, `Expected error '${error_code}' for ${key}, got: ${body.error}`);
123
- // Validate against declared 404 Zod schema
124
- spec.errors[404].parse(body);
125
+ // Validate against the declared 404 schema
126
+ const parsed = parse_any(spec.errors[404], body);
127
+ assert.ok(parsed.ok, `404 body for ${key} does not match its declared schema: ${parsed.ok ? '' : JSON.stringify(parsed.issues)}`);
125
128
  });
126
129
  }
127
130
  });
@@ -46,7 +46,7 @@ export const describe_adversarial_input = (options) => {
46
46
  routes_with_params.length === 0 &&
47
47
  routes_with_query.length === 0)
48
48
  return;
49
- // lookup RouteSpec by method+path for Zod schema access
49
+ // lookup RouteSpec by method+path for schema access
50
50
  const spec_lookup = new Map();
51
51
  for (const spec of route_specs) {
52
52
  spec_lookup.set(`${spec.method} ${spec.path}`, spec);
@@ -1,19 +1,6 @@
1
1
  import './assert_dev_env.js';
2
- /**
3
- * Schema-walk generation of adversarial inputs — payloads that must fail
4
- * validation.
5
- *
6
- * Focused cases: one representative wrong-type value per field, one format
7
- * violation per constrained field, one null and one missing case per required
8
- * field, plus whole-body structural attacks (non-object body, extra unknown
9
- * keys). Hono-free, so the cross-process suites reuse the generators the
10
- * in-process `describe_adversarial_input` and `describe_rpc_attack_surface_tests`
11
- * run.
12
- *
13
- * @module
14
- */
15
- import { z } from 'zod';
16
2
  import { ERROR_INVALID_REQUEST_BODY, ERROR_INVALID_JSON_BODY } from '../http/error_schemas.js';
3
+ import { type ValidationSchema } from '../schema_issues.js';
17
4
  /** One adversarial body for an input schema, and the error code it owes. */
18
5
  export interface InputTestCase {
19
6
  label: string;
@@ -78,25 +65,29 @@ export interface InputTestCaseOptions {
78
65
  * emitted only when the field refuses its value, so no case is accidentally
79
66
  * valid.
80
67
  *
81
- * @param input_schema - the input schema to attack
68
+ * A void or null input takes no body and gets no cases; an input of neither
69
+ * library, or one that is no object schema, throws rather than yielding none.
70
+ *
71
+ * @param input_schema - the input schema to attack, Zod or `@fuzdev/fuz_schema`
82
72
  * @param options - a base body to seed the cases, and a label for errors
83
- * @throws Error if the base body fails `input_schema.safeParse` — a seeded
73
+ * @throws Error if the input is of neither library or is neither void, null,
74
+ * nor an object schema, or if the base body fails `input_schema` — a seeded
84
75
  * base the schema refuses, or a generated one that surfaces broken
85
76
  * generation logic — naming the issues rather than producing nonsense
86
77
  * adversarial cases.
87
78
  */
88
- export declare const generate_input_test_cases: (input_schema: z.ZodType, options?: InputTestCaseOptions) => Array<InputTestCase>;
79
+ export declare const generate_input_test_cases: (input_schema: ValidationSchema, options?: InputTestCaseOptions) => Array<InputTestCase>;
89
80
  /**
90
81
  * The `error.data.reason` an RPC refusal of `test_case` owes: the declared
91
82
  * `invalid_reason` of the field it breaks, resolved as the dispatcher resolves
92
83
  * a failure on that field (`resolve_invalid_reason`), or `undefined` — no
93
84
  * reason — for an undeclared field or a whole-body case.
94
85
  *
95
- * @param input_schema - the input schema the case was generated from
86
+ * @param input_schema - the input schema the case was generated from, Zod or `@fuzdev/fuz_schema`
96
87
  * @param test_case - a case `generate_input_test_cases` produced from it
97
88
  * @returns the owed reason, or `undefined` when the refusal carries none
98
89
  */
99
- export declare const expected_invalid_reason: (input_schema: z.ZodType, test_case: InputTestCase) => string | undefined;
90
+ export declare const expected_invalid_reason: (input_schema: ValidationSchema, test_case: InputTestCase) => string | undefined;
100
91
  /**
101
92
  * Generate adversarial test cases for a route's params schema.
102
93
  *
@@ -105,9 +96,11 @@ export declare const expected_invalid_reason: (input_schema: z.ZodType, test_cas
105
96
  * params accept any string value, and only a violation the field refuses.
106
97
  * Each case breaks one field of a valid params record.
107
98
  *
108
- * @throws Error if no valid params record can be generated
99
+ * @param params_schema - the params schema, a Zod or `@fuzdev/fuz_schema` object schema
100
+ * @throws Error if no valid params record can be generated, or `params_schema`
101
+ * is no object schema or of neither library
109
102
  */
110
- export declare const generate_params_test_cases: (params_schema: z.ZodObject) => Array<ParamsTestCase>;
103
+ export declare const generate_params_test_cases: (params_schema: ValidationSchema) => Array<ParamsTestCase>;
111
104
  /**
112
105
  * Generate adversarial test cases for a route's query schema.
113
106
  *
@@ -118,7 +111,9 @@ export declare const generate_params_test_cases: (params_schema: z.ZodObject) =>
118
111
  *
119
112
  * Each case breaks one field of a valid query record.
120
113
  *
121
- * @throws Error if no valid query record can be generated
114
+ * @param query_schema - the query schema, a Zod or `@fuzdev/fuz_schema` object schema
115
+ * @throws Error if no valid query record can be generated, or `query_schema`
116
+ * is no object schema or of neither library
122
117
  */
123
- export declare const generate_query_test_cases: (query_schema: z.ZodObject) => Array<QueryTestCase>;
118
+ export declare const generate_query_test_cases: (query_schema: ValidationSchema) => Array<QueryTestCase>;
124
119
  //# sourceMappingURL=adversarial_input_cases.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"adversarial_input_cases.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/adversarial_input_cases.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAmE/F,4EAA4E;AAC5E,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,OAAO,0BAA0B,GAAG,OAAO,uBAAuB,CAAC;CACnF;AAED,8DAA8D;AAC9D,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,wDAAwD;AACxD,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAID,+CAA+C;AAC/C,MAAM,WAAW,oBAAoB;IACpC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,yBAAyB,GACrC,cAAc,CAAC,CAAC,OAAO,EACvB,UAAU,oBAAoB,KAC5B,KAAK,CAAC,aAAa,CAoOrB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,GACnC,cAAc,CAAC,CAAC,OAAO,EACvB,WAAW,aAAa,KACtB,MAAM,GAAG,SAG+C,CAAC;AAkC5D;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,GAAI,eAAe,CAAC,CAAC,SAAS,KAAG,KAAK,CAAC,cAAc,CAoB3F,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,GAAI,cAAc,CAAC,CAAC,SAAS,KAAG,KAAK,CAAC,aAAa,CAkCxF,CAAC"}
1
+ {"version":3,"file":"adversarial_input_cases.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/adversarial_input_cases.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAiB7B,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EAA4B,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAwEtF,4EAA4E;AAC5E,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,OAAO,0BAA0B,GAAG,OAAO,uBAAuB,CAAC;CACnF;AAED,8DAA8D;AAC9D,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,wDAAwD;AACxD,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAID,+CAA+C;AAC/C,MAAM,WAAW,oBAAoB;IACpC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,yBAAyB,GACrC,cAAc,gBAAgB,EAC9B,UAAU,oBAAoB,KAC5B,KAAK,CAAC,aAAa,CAiOrB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,GACnC,cAAc,gBAAgB,EAC9B,WAAW,aAAa,KACtB,MAAM,GAAG,SAG+C,CAAC;AAmC5D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,GACtC,eAAe,gBAAgB,KAC7B,KAAK,CAAC,cAAc,CAoBtB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,yBAAyB,GAAI,cAAc,gBAAgB,KAAG,KAAK,CAAC,aAAa,CAkC7F,CAAC"}
@@ -12,12 +12,12 @@ import './assert_dev_env.js';
12
12
  *
13
13
  * @module
14
14
  */
15
- import { z } from 'zod';
16
- import { zod_unwrap_to_object, zod_extract_fields } from '../zod.js';
17
15
  import { resolve_invalid_reason } from '../schema_meta.js';
18
- import { is_null_schema } from '../http/schema_helpers.js';
19
16
  import { ERROR_INVALID_REQUEST_BODY, ERROR_INVALID_JSON_BODY } from '../http/error_schemas.js';
20
- import { detect_format, detect_json_schema_format, format_zod_issues, generate_valid_object, generate_valid_object_with_field, generate_valid_string_param, to_field_json_schema } from './schema_generators.js';
17
+ import { format_issues, parse_any } from '../schema_issues.js';
18
+ import { detect_format, detect_json_schema_format, generate_valid_object, generate_valid_object_with_field, generate_valid_string_param, to_body_input, to_field_json_schema, to_object_schema_view } from './schema_generators.js';
19
+ /** Whether `schema` accepts `value`, a parse of either library (`parse_any`). */
20
+ const accepts = (schema, value) => parse_any(schema, value).ok;
21
21
  // --- Payload generation ---
22
22
  /** One wrong-type value per base type — one representative is sufficient. */
23
23
  const wrong_type_for = (base_type) => {
@@ -96,37 +96,39 @@ const off_grid_in_range = (json, value, step) => {
96
96
  * emitted only when the field refuses its value, so no case is accidentally
97
97
  * valid.
98
98
  *
99
- * @param input_schema - the input schema to attack
99
+ * A void or null input takes no body and gets no cases; an input of neither
100
+ * library, or one that is no object schema, throws rather than yielding none.
101
+ *
102
+ * @param input_schema - the input schema to attack, Zod or `@fuzdev/fuz_schema`
100
103
  * @param options - a base body to seed the cases, and a label for errors
101
- * @throws Error if the base body fails `input_schema.safeParse` — a seeded
104
+ * @throws Error if the input is of neither library or is neither void, null,
105
+ * nor an object schema, or if the base body fails `input_schema` — a seeded
102
106
  * base the schema refuses, or a generated one that surfaces broken
103
107
  * generation logic — naming the issues rather than producing nonsense
104
108
  * adversarial cases.
105
109
  */
106
110
  export const generate_input_test_cases = (input_schema, options) => {
107
- if (is_null_schema(input_schema))
108
- return [];
109
- const object_schema = zod_unwrap_to_object(input_schema);
110
- if (!object_schema)
111
+ const for_label = options?.label === undefined ? '' : ` for '${options.label}'`;
112
+ const view = to_body_input(input_schema, `adversarial_input: the input${for_label}`);
113
+ if (!view)
111
114
  return [];
112
- const fields = zod_extract_fields(object_schema);
115
+ const { fields } = view;
113
116
  const cases = [];
114
- const for_label = options?.label === undefined ? '' : ` for '${options.label}'`;
115
117
  // the base object every case breaks one field of — must pass validation itself
116
118
  let base;
117
119
  if (options?.base) {
118
120
  base = { ...options.base };
119
- const base_result = input_schema.safeParse(base);
120
- if (!base_result.success) {
121
+ const base_result = parse_any(input_schema, base);
122
+ if (!base_result.ok) {
121
123
  throw new Error(`adversarial_input: the seeded base${for_label} fails validation — ` +
122
- `fix the base for: ${format_zod_issues(base_result.error)}`);
124
+ `fix the base for: ${format_issues(base_result.issues)}`);
123
125
  }
124
126
  }
125
127
  else {
126
- const generated = generate_valid_object(object_schema, input_schema);
127
- if (!generated.result.success) {
128
+ const generated = generate_valid_object(input_schema, input_schema);
129
+ if (!generated.result.ok) {
128
130
  throw new Error(`adversarial_input: generated base object fails validation${for_label} — ` +
129
- `fix generate_valid_value for: ${format_zod_issues(generated.result.error)}`);
131
+ `fix generate_valid_value for: ${format_issues(generated.result.issues)}`);
130
132
  }
131
133
  base = generated.value;
132
134
  }
@@ -137,9 +139,8 @@ export const generate_input_test_cases = (input_schema, options) => {
137
139
  expected_error: ERROR_INVALID_JSON_BODY
138
140
  });
139
141
  // whole-body structural: extra unknown key (enforces strictObject)
140
- // only emit if the schema rejects unknown keys (i.e. uses z.strictObject)
141
- const extra_key_result = input_schema.safeParse({ ...base, __adversarial_extra: 'rejected' });
142
- if (!extra_key_result.success) {
142
+ // only emit if the schema rejects unknown keys (a `z.strictObject`, a fuz_schema `object`)
143
+ if (!accepts(input_schema, { ...base, __adversarial_extra: 'rejected' })) {
143
144
  cases.push({
144
145
  label: 'extra unknown key',
145
146
  body: { ...base, __adversarial_extra: 'should_be_rejected' },
@@ -147,11 +148,11 @@ export const generate_input_test_cases = (input_schema, options) => {
147
148
  });
148
149
  }
149
150
  for (const field of fields) {
150
- const field_schema = object_schema.shape[field.name];
151
+ const field_schema = view.field_schema(field.name);
151
152
  // the valid body every case on this field changes only the field of: the
152
153
  // base, or for a field the base omits, one that carries it — so the case
153
154
  // can't also break an object-level rule (exactly one of, both or neither)
154
- const field_base = generate_valid_object_with_field(object_schema, input_schema, base, field);
155
+ const field_base = generate_valid_object_with_field(input_schema, input_schema, base, field);
155
156
  // every per-field case breaks the field, so the field itself must refuse
156
157
  // its value — a candidate it accepts (a `z.coerce` field given a wrong
157
158
  // type, a pattern that admits the violation string) is no invalid case.
@@ -159,7 +160,7 @@ export const generate_input_test_cases = (input_schema, options) => {
159
160
  // back to the base; a value case — a format or a bound — is built only on
160
161
  // a body that is valid but for the field, or it tests no bound at all
161
162
  const push_field_case = (label, value, kind) => {
162
- if (field_schema.safeParse(value).success)
163
+ if (accepts(field_schema, value))
163
164
  return;
164
165
  const body_base = field_base ?? (kind === 'type' ? base : null);
165
166
  if (!body_base)
@@ -173,8 +174,8 @@ export const generate_input_test_cases = (input_schema, options) => {
173
174
  };
174
175
  // the field's valid value the value cases start from
175
176
  const valid_value = field_base?.[field.name];
176
- // missing required field (skip fields with defaults — Zod fills them)
177
- if (field.required && !field.has_default && !field_schema.safeParse(undefined).success) {
177
+ // missing required field (skip fields with defaults — the parse fills them)
178
+ if (field.required && !field.has_default && !accepts(field_schema, undefined)) {
178
179
  const without = {};
179
180
  for (const [k, v] of Object.entries(base)) {
180
181
  if (k !== field.name)
@@ -286,7 +287,7 @@ export const generate_input_test_cases = (input_schema, options) => {
286
287
  * a failure on that field (`resolve_invalid_reason`), or `undefined` — no
287
288
  * reason — for an undeclared field or a whole-body case.
288
289
  *
289
- * @param input_schema - the input schema the case was generated from
290
+ * @param input_schema - the input schema the case was generated from, Zod or `@fuzdev/fuz_schema`
290
291
  * @param test_case - a case `generate_input_test_cases` produced from it
291
292
  * @returns the owed reason, or `undefined` when the refusal carries none
292
293
  */
@@ -302,19 +303,19 @@ export const expected_invalid_reason = (input_schema, test_case) => test_case.fi
302
303
  * @throws Error if a field has no string it accepts, or the record fails the
303
304
  * schema, naming the issues
304
305
  */
305
- const generate_string_record_base = (schema, kind) => {
306
+ const generate_string_record_base = (schema, view, kind) => {
306
307
  const base = {};
307
- for (const field of zod_extract_fields(schema)) {
308
- const value = generate_valid_string_param(field, schema.shape[field.name]);
308
+ for (const field of view.fields) {
309
+ const value = generate_valid_string_param(field, view.field_schema(field.name));
309
310
  if (value === null) {
310
311
  throw new Error(`adversarial_input: no generated ${kind} value passes field '${field.name}'`);
311
312
  }
312
313
  base[field.name] = value;
313
314
  }
314
- const result = schema.safeParse(base);
315
- if (!result.success) {
315
+ const result = parse_any(schema, base);
316
+ if (!result.ok) {
316
317
  throw new Error(`adversarial_input: generated ${kind} base fails validation — ` +
317
- `fix generate_valid_string_param for: ${format_zod_issues(result.error)}`);
318
+ `fix generate_valid_string_param for: ${format_issues(result.issues)}`);
318
319
  }
319
320
  return base;
320
321
  };
@@ -326,19 +327,21 @@ const generate_string_record_base = (schema, kind) => {
326
327
  * params accept any string value, and only a violation the field refuses.
327
328
  * Each case breaks one field of a valid params record.
328
329
  *
329
- * @throws Error if no valid params record can be generated
330
+ * @param params_schema - the params schema, a Zod or `@fuzdev/fuz_schema` object schema
331
+ * @throws Error if no valid params record can be generated, or `params_schema`
332
+ * is no object schema or of neither library
330
333
  */
331
334
  export const generate_params_test_cases = (params_schema) => {
332
- const fields = zod_extract_fields(params_schema);
335
+ const view = to_object_schema_view(params_schema, 'adversarial_input: the params schema');
333
336
  const cases = [];
334
- const base_params = generate_string_record_base(params_schema, 'params');
335
- for (const field of fields) {
336
- const field_schema = params_schema.shape[field.name];
337
+ const base_params = generate_string_record_base(params_schema, view, 'params');
338
+ for (const field of view.fields) {
339
+ const field_schema = view.field_schema(field.name);
337
340
  const format = detect_format(field_schema);
338
341
  if (!format)
339
342
  continue; // unconstrained string — any value passes
340
343
  const violation = format_violation(format);
341
- if (violation && !field_schema.safeParse(violation.value).success) {
344
+ if (violation && !accepts(field_schema, violation.value)) {
342
345
  cases.push({
343
346
  label: `${violation.label}: param ${field.name}`,
344
347
  params: { ...base_params, [field.name]: violation.value }
@@ -357,16 +360,18 @@ export const generate_params_test_cases = (params_schema) => {
357
360
  *
358
361
  * Each case breaks one field of a valid query record.
359
362
  *
360
- * @throws Error if no valid query record can be generated
363
+ * @param query_schema - the query schema, a Zod or `@fuzdev/fuz_schema` object schema
364
+ * @throws Error if no valid query record can be generated, or `query_schema`
365
+ * is no object schema or of neither library
361
366
  */
362
367
  export const generate_query_test_cases = (query_schema) => {
363
- const fields = zod_extract_fields(query_schema);
368
+ const view = to_object_schema_view(query_schema, 'adversarial_input: the query schema');
364
369
  const cases = [];
365
- const base_query = generate_string_record_base(query_schema, 'query');
366
- for (const field of fields) {
367
- const field_schema = query_schema.shape[field.name];
370
+ const base_query = generate_string_record_base(query_schema, view, 'query');
371
+ for (const field of view.fields) {
372
+ const field_schema = view.field_schema(field.name);
368
373
  // missing required field
369
- if (field.required && !field.has_default && !field_schema.safeParse(undefined).success) {
374
+ if (field.required && !field.has_default && !accepts(field_schema, undefined)) {
370
375
  const without = {};
371
376
  for (const [k, v] of Object.entries(base_query)) {
372
377
  if (k !== field.name)
@@ -382,7 +387,7 @@ export const generate_query_test_cases = (query_schema) => {
382
387
  if (!format)
383
388
  continue;
384
389
  const violation = format_violation(format);
385
- if (violation && !field_schema.safeParse(violation.value).success) {
390
+ if (violation && !accepts(field_schema, violation.value)) {
386
391
  cases.push({
387
392
  label: `${violation.label}: query ${field.name}`,
388
393
  query: { ...base_query, [field.name]: violation.value }
@@ -1,7 +1,7 @@
1
1
  import './assert_dev_env.js';
2
- import type { z } from 'zod';
3
2
  import type { AppSurface, AppSurfaceRoute } from '../http/surface.js';
4
3
  import type { RouteErrorSchemas } from '../http/error_schemas.js';
4
+ import { type ValidationSchema } from '../schema_issues.js';
5
5
  /**
6
6
  * Resolve an absolute path relative to the caller's module.
7
7
  *
@@ -42,10 +42,10 @@ export declare const assert_only_expected_public_routes: (surface: AppSurface, e
42
42
  * @param lookup - map from `"METHOD /path"` to merged error schemas
43
43
  * @param route - the surface route to look up
44
44
  * @param status - HTTP status code
45
- * @returns the Zod schema for that route+status, or `undefined` when no error
46
- * schema is declared for the status code
45
+ * @returns the Zod or `@fuzdev/fuz_schema` schema for that route+status, or
46
+ * `undefined` when no error schema is declared for the status code
47
47
  */
48
- export declare const get_route_error_schema: (lookup: Map<string, RouteErrorSchemas>, route: AppSurfaceRoute, status: number) => z.ZodType | undefined;
48
+ export declare const get_route_error_schema: (lookup: Map<string, RouteErrorSchemas>, route: AppSurfaceRoute, status: number) => ValidationSchema | undefined;
49
49
  /**
50
50
  * Assert that an error schema exists for a route+status and validate the body against it.
51
51
  *
@@ -57,7 +57,8 @@ export declare const get_route_error_schema: (lookup: Map<string, RouteErrorSche
57
57
  * @param status - expected HTTP status code
58
58
  * @param body - the parsed response body to validate
59
59
  * @throws AssertionError if no schema is declared for the route+status pair.
60
- * @throws ZodError if the body does not satisfy the declared schema.
60
+ * @throws Error if the body does not satisfy the declared schema, its message
61
+ * carrying the failed parse's issues (`parse_any`).
61
62
  */
62
63
  export declare const assert_error_schema_valid: (lookup: Map<string, RouteErrorSchemas>, route: AppSurfaceRoute, status: number, body: unknown) => void;
63
64
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"assertions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/assertions.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAe7B,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,UAAU,MAAM,EAAE,iBAAiB,MAAM,KAAG,MACtB,CAAC;AAE5D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,+BAA+B,GAC3C,SAAS,UAAU,EACnB,eAAe,MAAM,KACnB,IAOF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,GAAI,eAAe,MAAM,UAAU,KAAG,IAE9E,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,kCAAkC,GAC9C,SAAS,UAAU,EACnB,iBAAiB,KAAK,CAAC,MAAM,CAAC,KAC5B,IAWF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,GAClC,QAAQ,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,EACtC,OAAO,eAAe,EACtB,QAAQ,MAAM,KACZ,CAAC,CAAC,OAAO,GAAG,SAGd,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB,GACrC,QAAQ,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,EACtC,OAAO,eAAe,EACtB,QAAQ,MAAM,EACd,MAAM,OAAO,KACX,IAIF,CAA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M,4BAA4B,GACxC,SAAS,UAAU,EACnB,aAAa,MAAM,EACnB,qBAAqB,KAAK,CAAC,MAAM,CAAC,KAChC,IAUF,CAAC"}
@@ -12,6 +12,7 @@ import { resolve, dirname } from 'node:path';
12
12
  import { fileURLToPath } from 'node:url';
13
13
  import { assert } from 'vitest';
14
14
  import { is_public_auth } from '../http/auth_shape.js';
15
+ import { parse_any } from '../schema_issues.js';
15
16
  /**
16
17
  * Resolve an absolute path relative to the caller's module.
17
18
  *
@@ -66,8 +67,8 @@ export const assert_only_expected_public_routes = (surface, expected_public) =>
66
67
  * @param lookup - map from `"METHOD /path"` to merged error schemas
67
68
  * @param route - the surface route to look up
68
69
  * @param status - HTTP status code
69
- * @returns the Zod schema for that route+status, or `undefined` when no error
70
- * schema is declared for the status code
70
+ * @returns the Zod or `@fuzdev/fuz_schema` schema for that route+status, or
71
+ * `undefined` when no error schema is declared for the status code
71
72
  */
72
73
  export const get_route_error_schema = (lookup, route, status) => {
73
74
  const key = `${route.method} ${route.path}`;
@@ -84,12 +85,16 @@ export const get_route_error_schema = (lookup, route, status) => {
84
85
  * @param status - expected HTTP status code
85
86
  * @param body - the parsed response body to validate
86
87
  * @throws AssertionError if no schema is declared for the route+status pair.
87
- * @throws ZodError if the body does not satisfy the declared schema.
88
+ * @throws Error if the body does not satisfy the declared schema, its message
89
+ * carrying the failed parse's issues (`parse_any`).
88
90
  */
89
91
  export const assert_error_schema_valid = (lookup, route, status, body) => {
90
92
  const schema = get_route_error_schema(lookup, route, status);
91
93
  assert.ok(schema, `missing error schema for ${status} on ${route.method} ${route.path}`);
92
- schema.parse(body);
94
+ const result = parse_any(schema, body);
95
+ if (!result.ok) {
96
+ throw new Error(`error schema mismatch for ${status} on ${route.method} ${route.path}: ${JSON.stringify(result.issues)}`);
97
+ }
93
98
  };
94
99
  /**
95
100
  * Verify every route under a path prefix has the exact expected middleware stack.
@@ -33,6 +33,7 @@ import '../assert_dev_env.js';
33
33
  import { z } from 'zod';
34
34
  import { type RouteAuth } from '../../http/auth_shape.js';
35
35
  import { RateLimitKey } from '../../http/error_schemas.js';
36
+ import type { ValidationSchema } from '../../schema_issues.js';
36
37
  import type { RequestResponseActionSpec } from '../../actions/action_spec.js';
37
38
  /**
38
39
  * One method's normalized RPC metadata — the cross-impl-comparable unit.
@@ -106,7 +107,7 @@ export type ActionManifest = z.infer<typeof ActionManifest>;
106
107
  */
107
108
  export declare const action_manifest_entry: (spec: {
108
109
  readonly method: string;
109
- readonly input: z.ZodType;
110
+ readonly input: ValidationSchema;
110
111
  readonly auth: RouteAuth;
111
112
  readonly side_effects: boolean;
112
113
  readonly rate_limit?: RateLimitKey;
@@ -1 +1 @@
1
- {"version":3,"file":"action_manifest.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/action_manifest.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAE9E;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;kBAqB9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,kEAAkE;AAClE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;kBAEzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAM5D;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,MAAM;IAC3C,QAAQ,CAAC,MAAM,EAAE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BAAqB,GAAI,MAAM;IAC3C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC;CACnC,KAAG,mBASF,CAAC;AAMH;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GACjC,OAAO,aAAa,CACnB,IAAI,CAAC,yBAAyB,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,cAAc,GAAG,YAAY,CAAC,CAC5F,KACC,cAED,CAAC"}
@@ -47,9 +47,9 @@ export const ActionManifestEntry = z.strictObject({
47
47
  /** RPC method name (`spec.method`). */
48
48
  method: z.string(),
49
49
  /**
50
- * `'void'` when the input is `z.void()` (a parameterless method), else
51
- * `'object'` — the Rust spine's declared `InputShape`, which its dispatcher
52
- * enforces. A `z.strictObject({})` input is `'object'`.
50
+ * `'void'` when the input is a void schema (`is_void_schema`: `z.void()`
51
+ * or fuz_schema `s.void`, a parameterless method), else `'object'` — the
52
+ * Rust spine's declared `InputShape`, which its dispatcher enforces. A `z.strictObject({})` input is `'object'`.
53
53
  */
54
54
  input: z.enum(['void', 'object']),
55
55
  /** `true` when the action declares `side_effects` (mutation; POST-only on the RPC transport). */
@@ -1 +1 @@
1
- {"version":3,"file":"cell_crud.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/cell_crud.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA0E9B,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,YAAY,CAAC;AAkE1E,eAAO,MAAM,8BAA8B,GAC1C,SAAS,uCAAuC,KAC9C,IA4uBF,CAAC"}
1
+ {"version":3,"file":"cell_crud.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/cell_crud.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA2E9B,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,YAAY,CAAC;AA4D1E,eAAO,MAAM,8BAA8B,GAC1C,SAAS,uCAAuC,KAC9C,IA4uBF,CAAC"}
@@ -55,6 +55,7 @@ import '../assert_dev_env.js';
55
55
  */
56
56
  import { describe, assert } from 'vitest';
57
57
  import { jsonrpc_error_messages } from '../../http/jsonrpc_errors.js';
58
+ import { WireIssue } from '../../schema_issues.js';
58
59
  import { CELL_KIND_LENGTH_MAX, CELL_LIST_LIMIT_MAX, CellCreateOutput, CellDeleteOutput, CellGetOutput, CellListOutput, CellUpdateOutput } from '../../auth/cell_action_specs.js';
59
60
  import { test_if } from './capabilities.js';
60
61
  import { cross_rpc_call, error_reason, expect_output } from './cross_rpc.js';
@@ -80,9 +81,7 @@ const INVALID_PARAMS_MESSAGE = jsonrpc_error_messages.invalid_params().message;
80
81
  /**
81
82
  * Assert `r` is a schema refusal: 400 `invalid_params` with the generic
82
83
  * message and no `data`, save the issues a TS spine adds under DEV alone —
83
- * an array of the schema library's issue objects, and never a `reason`. A Zod
84
- * issue has a string `code` and `message`; a fuz_schema issue a string
85
- * `kind`, and a `message` only when one was set.
84
+ * an array of `WireIssue`s, and never a `reason`.
86
85
  */
87
86
  const assert_schema_refusal = (r, label) => {
88
87
  const detail = `${label}: got ${r.status} ${JSON.stringify(r.error ?? r.result)}`;
@@ -98,11 +97,7 @@ const assert_schema_refusal = (r, label) => {
98
97
  const { issues } = data;
99
98
  assert.ok(Array.isArray(issues), `${detail} — DEV-only issues that are no array`);
100
99
  for (const issue of issues) {
101
- const { code, kind, message } = (issue ?? {});
102
- assert.ok(typeof issue === 'object' &&
103
- issue !== null &&
104
- ((typeof code === 'string' && typeof message === 'string') ||
105
- (typeof kind === 'string' && (message === undefined || typeof message === 'string'))), `${detail} — a DEV-only issue that is no Zod or fuz_schema issue`);
100
+ assert.ok(WireIssue.safeParse(issue).success, `${detail} — a DEV-only issue that is no WireIssue`);
106
101
  }
107
102
  };
108
103
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"conformance_table.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/conformance_table.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA8C9B,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAOnE,OAAO,EAMN,+BAA+B,EAC/B,KAAK,uBAAuB,EAC5B,MAAM,mBAAmB,CAAC;AAI3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAGN,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IAC1C,iEAAiE;IACjE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,gEAAgE;IAChE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,sDAAsD;AACtD,MAAM,WAAW,uBAAuB;IACvC,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IAC/C,+DAA+D;IAC/D,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,oEAAoE;IACpE,QAAQ,CAA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7 @@ import { is_response_for } from '../transports/ws_client.js';
51
51
  import { SCOPED_TOKEN_ADMITTED_METHOD } from './conformance_case.js';
52
52
  import { mint_narrowed_api_token } from './narrowed_api_token.js';
53
53
  import { xfail_until } from './xfail.js';
54
+ import { parse_any } from '../../schema_issues.js';
54
55
  /**
55
56
  * Resolve the endpoints a conformance case's RPC method is looked up in: the
56
57
  * declared `rpc_endpoints`, then `live_rpc_endpoints`. `find_rpc_action`
@@ -587,8 +588,8 @@ const assert_rpc_case = (c, action, sent) => {
587
588
  if (is_success_status(c.expect.status)) {
588
589
  assert.ok(res.ok, `${c.name}: expected success (${c.expect.status}) but got error ${JSON.stringify(res.ok ? undefined : res.error)}`);
589
590
  assert.strictEqual(res.status, c.expect.status, `${c.name}: status`);
590
- const parsed = action.spec.output.safeParse(res.result);
591
- assert.ok(parsed.success, `${c.name}: result does not match spec.output: ${JSON.stringify(parsed.success ? undefined : parsed.error.issues)}`);
591
+ const parsed = parse_any(action.spec.output, res.result);
592
+ assert.ok(parsed.ok, `${c.name}: result does not match spec.output: ${JSON.stringify(parsed.ok ? undefined : parsed.issues)}`);
592
593
  if (c.expect.fields)
593
594
  assert_fields(res.result, c.expect.fields, c.name);
594
595
  return { status: res.status, body: res.result };
@@ -615,8 +616,8 @@ const assert_rest_case = (c, route, sent) => {
615
616
  const { status, body } = sent;
616
617
  assert.strictEqual(status, c.expect.status, `${c.name}: status`);
617
618
  if (is_success_status(c.expect.status)) {
618
- const parsed = route.output.safeParse(body);
619
- assert.ok(parsed.success, `${c.name}: body does not match route output: ${JSON.stringify(parsed.success ? undefined : parsed.error.issues)}`);
619
+ const parsed = parse_any(route.output, body);
620
+ assert.ok(parsed.ok, `${c.name}: body does not match route output: ${JSON.stringify(parsed.ok ? undefined : parsed.issues)}`);
620
621
  }
621
622
  else if (c.expect.error_reason !== undefined) {
622
623
  const error = body?.error;
@@ -1,5 +1,6 @@
1
1
  import '../assert_dev_env.js';
2
2
  import type { z } from 'zod';
3
+ import type { Schema } from '@fuzdev/fuz_schema/schema.ts';
3
4
  import type { FetchTransport } from '../transports/fetch_transport.js';
4
5
  /** Minimal JSON-RPC envelope shape the suites read off responses. */
5
6
  export interface RpcResult {
@@ -34,7 +35,8 @@ export declare const cross_rpc_call: (transport: FetchTransport, path: string, m
34
35
  export declare const error_reason: (r: RpcResult) => unknown;
35
36
  /**
36
37
  * Assert the call succeeded and the `result` matches the verb's declared
37
- * output schema — the wire-shape parity gate. Returns the parsed output.
38
+ * output schema, Zod or `@fuzdev/fuz_schema` — the wire-shape parity gate.
39
+ * Returns the parsed output.
38
40
  */
39
- export declare const expect_output: <T>(r: RpcResult, schema: z.ZodType<T>) => T;
41
+ export declare const expect_output: <T>(r: RpcResult, schema: z.ZodType<T> | Schema<T, any>) => T;
40
42
  //# sourceMappingURL=cross_rpc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cross_rpc.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/cross_rpc.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAgB9B,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEvE,qEAAqE;AACrE,MAAM,WAAW,SAAS;IACzB,yCAAyC;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAC9F;AAKD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,GAC1B,WAAW,cAAc,EACz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