@fuzdev/fuz_app 0.169.0 → 0.171.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/CLAUDE.md +19 -21
- package/dist/actions/action_codegen.d.ts +27 -18
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +90 -90
- package/dist/actions/action_event.d.ts +0 -8
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_event.js +7 -6
- package/dist/actions/action_event_data.d.ts +4 -4
- package/dist/actions/action_rpc.d.ts +1 -1
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +6 -7
- package/dist/actions/action_spec.d.ts +8 -10
- package/dist/actions/action_spec.d.ts.map +1 -1
- package/dist/actions/action_spec.js +1 -1
- package/dist/actions/action_types.d.ts +4 -4
- package/dist/actions/action_types.d.ts.map +1 -1
- package/dist/actions/action_types.js +2 -2
- package/dist/actions/broadcast_api.d.ts +2 -2
- package/dist/actions/broadcast_api.js +4 -4
- package/dist/actions/compile_action_registry.d.ts +6 -7
- package/dist/actions/compile_action_registry.d.ts.map +1 -1
- package/dist/actions/compile_action_registry.js +8 -9
- package/dist/actions/peer_ping.d.ts.map +1 -1
- package/dist/actions/peer_ping.js +3 -2
- package/dist/actions/perform_action.d.ts +6 -6
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +11 -10
- package/dist/actions/socket.svelte.d.ts +1 -1
- package/dist/actions/socket.svelte.js +2 -2
- package/dist/actions/ws_socket_session.d.ts.map +1 -1
- package/dist/actions/ws_socket_session.js +2 -1
- package/dist/auth/CLAUDE.md +11 -11
- package/dist/auth/admin_action_specs.d.ts +24 -24
- package/dist/auth/audit_emitter.d.ts +6 -7
- package/dist/auth/audit_emitter.d.ts.map +1 -1
- package/dist/auth/audit_emitter.js +11 -22
- package/dist/auth/audit_log_ddl.d.ts +1 -1
- package/dist/auth/audit_log_ddl.js +1 -1
- package/dist/auth/audit_log_queries.d.ts +0 -13
- package/dist/auth/audit_log_queries.d.ts.map +1 -1
- package/dist/auth/audit_log_queries.js +3 -3
- package/dist/auth/audit_log_schema.d.ts +14 -15
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +1 -1
- package/dist/auth/auth_ddl.d.ts +1 -1
- package/dist/auth/auth_ddl.js +1 -1
- package/dist/auth/cell_action_specs.d.ts +54 -54
- package/dist/auth/cell_actions.d.ts +2 -2
- package/dist/auth/cell_actions.js +5 -5
- package/dist/auth/middleware.d.ts +6 -2
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +14 -2
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +7 -9
- package/dist/auth/role_grant_offer_action_specs.d.ts +6 -6
- package/dist/auth/role_grant_offer_ddl.d.ts +1 -1
- package/dist/auth/role_grant_offer_ddl.js +1 -1
- package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_notifications.js +2 -3
- package/dist/auth/self_service_role_actions.d.ts +1 -1
- package/dist/auth/self_service_role_actions.js +1 -1
- package/dist/env/env_schemas.d.ts +1 -2
- package/dist/env/env_schemas.d.ts.map +1 -1
- package/dist/env/env_schemas.js +3 -4
- package/dist/http/CLAUDE.md +30 -31
- package/dist/http/auth_shape.d.ts +14 -32
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/auth_shape.js +14 -49
- package/dist/http/error_schemas.d.ts +18 -18
- package/dist/http/json_text.d.ts +53 -0
- package/dist/http/json_text.d.ts.map +1 -0
- package/dist/http/json_text.js +152 -0
- package/dist/http/jsonrpc_helpers.js +1 -1
- package/dist/http/route_error_check.d.ts +2 -2
- package/dist/http/route_error_check.d.ts.map +1 -1
- package/dist/http/route_error_check.js +2 -3
- package/dist/http/route_errors.d.ts +4 -4
- package/dist/http/route_errors.d.ts.map +1 -1
- package/dist/http/route_errors.js +0 -13
- package/dist/http/route_result.d.ts +2 -1
- package/dist/http/route_result.d.ts.map +1 -1
- package/dist/http/route_spec.d.ts +34 -37
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +31 -31
- package/dist/http/schema_helpers.d.ts +77 -68
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +54 -77
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +6 -8
- package/dist/primitive_schemas.d.ts +9 -17
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas.js +9 -17
- package/dist/realtime/sse.d.ts +3 -3
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +2 -2
- package/dist/schema_issues.d.ts +39 -147
- package/dist/schema_issues.d.ts.map +1 -1
- package/dist/schema_issues.js +39 -352
- package/dist/schema_meta.d.ts +63 -136
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/schema_meta.js +37 -184
- package/dist/sensitivity.d.ts +3 -5
- package/dist/sensitivity.d.ts.map +1 -1
- package/dist/sensitivity.js +3 -5
- package/dist/testing/CLAUDE.md +20 -22
- package/dist/testing/adversarial_headers.js +2 -2
- package/dist/testing/adversarial_input_cases.d.ts +19 -18
- package/dist/testing/adversarial_input_cases.d.ts.map +1 -1
- package/dist/testing/adversarial_input_cases.js +31 -46
- package/dist/testing/assertions.d.ts +2 -2
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/assertions.js +3 -3
- package/dist/testing/cross_backend/account_lifecycle.js +2 -2
- package/dist/testing/cross_backend/action_manifest.d.ts +10 -9
- package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest.js +4 -3
- package/dist/testing/cross_backend/cell_crud.js +1 -1
- package/dist/testing/cross_backend/conformance_rpc_auth.d.ts +0 -62
- package/dist/testing/cross_backend/conformance_rpc_auth.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +3 -3
- package/dist/testing/cross_backend/cross_rpc.d.ts +3 -4
- package/dist/testing/cross_backend/cross_rpc.d.ts.map +1 -1
- package/dist/testing/cross_backend/cross_rpc.js +4 -4
- package/dist/testing/cross_backend/differential.js +2 -2
- package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/identity_parity.js +16 -11
- package/dist/testing/cross_backend/origin_conformance.d.ts +9 -9
- package/dist/testing/cross_backend/query_shape.js +1 -1
- package/dist/testing/cross_backend/rpc_success_fixtures.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +1 -1
- package/dist/testing/cross_backend/setup.d.ts +25 -3
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +4 -4
- package/dist/testing/cross_backend/sse_round_trip.js +2 -2
- package/dist/testing/cross_backend/testing_origin_check.d.ts +4 -4
- package/dist/testing/cross_backend/token_lifetime.js +3 -3
- package/dist/testing/cross_backend/wire_shapes.js +1 -1
- package/dist/testing/cross_backend/ws_envelope.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_envelope.js +8 -0
- package/dist/testing/cross_backend/ws_round_trip.js +1 -1
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +1 -1
- package/dist/testing/integration.js +2 -2
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +2 -2
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +2 -2
- package/dist/testing/rpc_attack_surface.js +1 -1
- package/dist/testing/rpc_envelope_cases.d.ts +10 -3
- package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
- package/dist/testing/rpc_envelope_cases.js +22 -1
- package/dist/testing/rpc_helpers.d.ts +12 -14
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +9 -10
- package/dist/testing/schema_generators.d.ts +67 -60
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +154 -159
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +2 -2
- package/dist/testing/surface_invariants.d.ts +1 -1
- package/dist/testing/surface_invariants.js +1 -1
- package/dist/ui/form_state.svelte.d.ts +1 -1
- package/dist/ui/form_state.svelte.js +1 -1
- package/package.json +5 -7
- package/dist/zod.d.ts +0 -116
- package/dist/zod.d.ts.map +0 -1
- package/dist/zod.js +0 -218
- package/dist/zod_schemas.d.ts +0 -100
- package/dist/zod_schemas.d.ts.map +0 -1
- package/dist/zod_schemas.js +0 -157
|
@@ -1,40 +1,49 @@
|
|
|
1
1
|
import './assert_dev_env.js';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Schema-driven value generation helpers for testing.
|
|
4
|
+
*
|
|
5
|
+
* Walks `@fuzdev/fuz_schema` schemas to generate valid values for route
|
|
6
|
+
* params, request bodies, and URL paths. Used by adversarial input,
|
|
7
|
+
* adversarial 404, and round-trip validation test suites. A value that is no
|
|
8
|
+
* schema throws, and so does an input no body can be generated for, rather
|
|
9
|
+
* than yielding no body.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
import { type AnySchema, type SchemaResult } from '@fuzdev/fuz_schema/schema.ts';
|
|
14
|
+
import { type SchemaFieldInfo } from '../http/schema_helpers.js';
|
|
4
15
|
/**
|
|
5
16
|
* The JSON Schema of a field's input side — where its format, pattern and
|
|
6
|
-
* bounds live.
|
|
17
|
+
* bounds live.
|
|
7
18
|
*
|
|
8
|
-
* Rendered with `io: 'input'`, so a field carrying a
|
|
19
|
+
* Rendered with `io: 'input'`, so a field carrying a `transform` in a pipe
|
|
9
20
|
* (`Username`) still yields the constraints its input is checked against;
|
|
10
21
|
* the default output side throws on a transform. A pipe yields its input
|
|
11
22
|
* side only, so constraints of the stage after it are not here. A
|
|
12
|
-
*
|
|
13
|
-
*
|
|
23
|
+
* `nullable` field renders as `anyOf: [{…}, {type: 'null'}]`, or a bare
|
|
24
|
+
* type as `type: [type, 'null']`;
|
|
14
25
|
* its one non-null branch or type is returned, so the bounds, pattern and
|
|
15
26
|
* `type` read the same as on the bare field. A union of two or more non-null
|
|
16
27
|
* branches returns the whole schema — its branches' bounds are no single
|
|
17
28
|
* field's bounds.
|
|
18
29
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* generators build from it is checked against the field itself before it's
|
|
25
|
-
* used. What an emitter refuses even then (a fuz_schema entry named like a
|
|
30
|
+
* It renders with `unrepresentable: 'any'`: a part JSON Schema can't say (a
|
|
31
|
+
* `check` or a `bigint`) is left out or `{}`, and the bounds around it still
|
|
32
|
+
* read, so a `pipe(string, max_length(n), check(…))` keeps its `maxLength` —
|
|
33
|
+
* every case the generators build from it is checked against the field itself
|
|
34
|
+
* before it's used. What the emitter refuses even then (an entry named like a
|
|
26
35
|
* member of `Object.prototype`, metadata that isn't JSON) throws: a mistake in
|
|
27
36
|
* the schema, not a gap in JSON Schema.
|
|
28
37
|
*
|
|
29
|
-
* A
|
|
30
|
-
*
|
|
31
|
-
*
|
|
38
|
+
* A `check` is never here: JSON Schema can't express one, so a bound a check
|
|
39
|
+
* enforces (a code-point length, a cross-field rule) generates no boundary
|
|
40
|
+
* case.
|
|
32
41
|
*
|
|
33
42
|
* @param field_schema - the field to read
|
|
34
43
|
* @returns the field's input-side JSON Schema
|
|
35
44
|
* @throws Error when the emitter refuses `field_schema` with `unrepresentable: 'any'`
|
|
36
45
|
*/
|
|
37
|
-
export declare const to_field_json_schema: (field_schema:
|
|
46
|
+
export declare const to_field_json_schema: (field_schema: AnySchema) => Record<string, unknown>;
|
|
38
47
|
/**
|
|
39
48
|
* The format constraint a field's input-side JSON Schema carries: its
|
|
40
49
|
* `format` (e.g. `'uuid'`, `'email'`), `'pattern'` for a regex, or `null`.
|
|
@@ -51,39 +60,37 @@ export declare const detect_json_schema_format: (json: Record<string, unknown>)
|
|
|
51
60
|
* (`to_field_json_schema`). Returns the format string (e.g. `'uuid'`,
|
|
52
61
|
* `'email'`), `'pattern'` for a regex, or `null`.
|
|
53
62
|
*/
|
|
54
|
-
export declare const detect_format: (field_schema:
|
|
55
|
-
/** An object schema's fields and the schema of each
|
|
63
|
+
export declare const detect_format: (field_schema: AnySchema) => string | null;
|
|
64
|
+
/** An object schema's fields and the schema of each. */
|
|
56
65
|
export interface ObjectSchemaView {
|
|
57
66
|
/** The fields, in declaration order. */
|
|
58
67
|
fields: Array<SchemaFieldInfo>;
|
|
59
68
|
/** The schema of the field named `name`, or `undefined` when there is none. */
|
|
60
|
-
field_schema: (name: string) =>
|
|
69
|
+
field_schema: (name: string) => AnySchema | undefined;
|
|
61
70
|
}
|
|
62
71
|
/**
|
|
63
|
-
* The fields of an object schema
|
|
64
|
-
*
|
|
65
|
-
* (`
|
|
66
|
-
* schema whose innermost layer is an object schema (`get_schema_entries`,
|
|
67
|
-
* `get_schema_fields`).
|
|
72
|
+
* The fields of an object schema and the schema of each, through its
|
|
73
|
+
* wrappers: a schema whose innermost layer is an object schema
|
|
74
|
+
* (`get_schema_entries`, `get_schema_fields`).
|
|
68
75
|
*
|
|
69
|
-
* @param schema - an object schema, possibly wrapped
|
|
76
|
+
* @param schema - an object schema, possibly wrapped
|
|
70
77
|
* @param label - names the schema in the error
|
|
71
|
-
* @throws Error naming `label` when `schema` is no object schema, or
|
|
78
|
+
* @throws Error naming `label` when `schema` is no object schema, or no schema
|
|
72
79
|
*/
|
|
73
|
-
export declare const to_object_schema_view: (schema:
|
|
80
|
+
export declare const to_object_schema_view: (schema: AnySchema, label: string) => ObjectSchemaView;
|
|
74
81
|
/**
|
|
75
82
|
* Generate a valid-ish value for a field based on its base type.
|
|
76
83
|
*
|
|
77
|
-
* @param field - the field's info, from `to_object_schema_view`
|
|
78
|
-
* @param field_schema - the field's schema
|
|
84
|
+
* @param field - the field's info, from `to_object_schema_view`
|
|
85
|
+
* @param field_schema - the field's schema
|
|
79
86
|
* @returns the value, checked by the caller against the whole schema
|
|
80
87
|
*/
|
|
81
|
-
export declare const generate_valid_value: (field: SchemaFieldInfo, field_schema:
|
|
88
|
+
export declare const generate_valid_value: (field: SchemaFieldInfo, field_schema: AnySchema) => unknown;
|
|
82
89
|
/** What `generate_valid_object` returns: the object and its last parse. */
|
|
83
90
|
export interface GeneratedObject {
|
|
84
91
|
value: Record<string, unknown>;
|
|
85
|
-
/** The last `
|
|
86
|
-
result:
|
|
92
|
+
/** The last `parse` of `value` against the schema — the caller decides whether a failure throws. */
|
|
93
|
+
result: SchemaResult<unknown>;
|
|
87
94
|
}
|
|
88
95
|
/**
|
|
89
96
|
* Generate a valid object for an object schema: its required and defaulted
|
|
@@ -98,16 +105,15 @@ export interface GeneratedObject {
|
|
|
98
105
|
* Shared by the top-level body generators and `generate_valid_value`'s
|
|
99
106
|
* nested-object case, so a refined object validates the same way at any depth.
|
|
100
107
|
*
|
|
101
|
-
* @param object_schema - the object whose fields are generated:
|
|
102
|
-
*
|
|
108
|
+
* @param object_schema - the object whose fields are generated: an object
|
|
109
|
+
* schema, possibly wrapped
|
|
103
110
|
* @param schema - the schema the object must satisfy, refinements included
|
|
104
111
|
* (`object_schema` or a schema wrapping it)
|
|
105
|
-
* @returns the generated object and its last `
|
|
112
|
+
* @returns the generated object and its last `parse` result — the caller
|
|
106
113
|
* decides whether a failure throws
|
|
107
|
-
* @throws Error when `object_schema` is no object schema, or
|
|
108
|
-
* of neither library
|
|
114
|
+
* @throws Error when `object_schema` is no object schema, or no schema
|
|
109
115
|
*/
|
|
110
|
-
export declare const generate_valid_object: (object_schema:
|
|
116
|
+
export declare const generate_valid_object: (object_schema: AnySchema, schema: AnySchema) => GeneratedObject;
|
|
111
117
|
/**
|
|
112
118
|
* A valid object that carries `field`, built from `base`, a valid object of
|
|
113
119
|
* `object_schema` — the body a case breaking `field` changes, so the case
|
|
@@ -118,43 +124,44 @@ export declare const generate_valid_object: (object_schema: ValidationSchema, sc
|
|
|
118
124
|
* replaces `base`'s optional fields, refilled the same way around it (an
|
|
119
125
|
* exactly-one-of rule: adding `slug` means dropping `id`).
|
|
120
126
|
*
|
|
121
|
-
* @param object_schema - the object schema `base` is an instance of,
|
|
122
|
-
*
|
|
127
|
+
* @param object_schema - the object schema `base` is an instance of,
|
|
128
|
+
* possibly wrapped
|
|
123
129
|
* @param schema - the schema the object must satisfy, refinements included
|
|
124
130
|
* @param base - a valid object, the generated or seeded base
|
|
125
131
|
* @param field - the field the object must carry
|
|
126
132
|
* @returns the object, or `null` when no object the generator can build
|
|
127
133
|
* carries the field and passes `schema`
|
|
128
|
-
* @throws Error when `object_schema` is no object schema, or
|
|
129
|
-
* of neither library
|
|
134
|
+
* @throws Error when `object_schema` is no object schema, or no schema
|
|
130
135
|
*/
|
|
131
|
-
export declare const generate_valid_object_with_field: (object_schema:
|
|
136
|
+
export declare const generate_valid_object_with_field: (object_schema: AnySchema, schema: AnySchema, base: Record<string, unknown>, field: SchemaFieldInfo) => Record<string, unknown> | null;
|
|
132
137
|
/**
|
|
133
138
|
* A string a URL-sourced field accepts — a route param or a query value, which
|
|
134
139
|
* arrive as strings whatever the schema parses them into. The nil UUID for a
|
|
135
140
|
* UUID field; else the first the field accepts of `test_value`, the generated
|
|
136
141
|
* valid value written as a string, `1`, `0`, `true` and `false`, the field's
|
|
137
|
-
* JSON Schema `default` or lower bound written as a string
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
142
|
+
* JSON Schema `default` or lower bound written as a string, each
|
|
143
|
+
* `min_value` and `max_value` bound anywhere in the schema written as an
|
|
144
|
+
* integer (a string parsed into an integer whose range excludes the small
|
|
145
|
+
* candidates, `to_numeric_bounds`), and a string synthesized from the field's
|
|
146
|
+
* constraints.
|
|
147
|
+
*
|
|
148
|
+
* @param field - the field's info, from `to_object_schema_view`
|
|
149
|
+
* @param field_schema - the field's schema
|
|
143
150
|
* @returns the string, or `null` when no candidate passes
|
|
144
151
|
*/
|
|
145
|
-
export declare const generate_valid_string_param: (field: SchemaFieldInfo, field_schema:
|
|
152
|
+
export declare const generate_valid_string_param: (field: SchemaFieldInfo, field_schema: AnySchema) => string | null;
|
|
146
153
|
/**
|
|
147
154
|
* The input a body is generated for: `null` for a void or null input
|
|
148
155
|
* (`is_void_schema`, `is_null_schema`), which takes no body, else its object
|
|
149
156
|
* view (`to_object_schema_view`).
|
|
150
157
|
*
|
|
151
|
-
* @param input_schema - a route's or action's input schema
|
|
158
|
+
* @param input_schema - a route's or action's input schema
|
|
152
159
|
* @param label - names the input in the error
|
|
153
|
-
* @throws Error naming `label` when the input is
|
|
160
|
+
* @throws Error naming `label` when the input is no schema, or is
|
|
154
161
|
* neither void, null, nor an object schema — no body can be generated for
|
|
155
162
|
* it, and no body is not the same as one the generator can't build
|
|
156
163
|
*/
|
|
157
|
-
export declare const to_body_input: (input_schema:
|
|
164
|
+
export declare const to_body_input: (input_schema: AnySchema, label: string) => ObjectSchemaView | null;
|
|
158
165
|
/**
|
|
159
166
|
* The `Content-Type` a well-formed request to a route sends: `application/json`,
|
|
160
167
|
* or `application/octet-stream` for a `raw_body` route. Every `POST` route
|
|
@@ -211,25 +218,25 @@ export type RouteParamValues = Readonly<Record<string, Readonly<Record<string, s
|
|
|
211
218
|
* (`''`, `.`, `..`) is refused by name.
|
|
212
219
|
*
|
|
213
220
|
* @param path - the route's path template
|
|
214
|
-
* @param params_schema - the route's params schema,
|
|
221
|
+
* @param params_schema - the route's params schema, an object schema
|
|
215
222
|
* @param param_values - the route's supplied param values by name, its entry of `RouteParamValues`
|
|
216
|
-
* @throws Error when `params_schema` is no object schema, or
|
|
223
|
+
* @throws Error when `params_schema` is no object schema, or no schema;
|
|
217
224
|
* when `param_values` names no param of the path; when a supplied value is
|
|
218
225
|
* `''`, `.` or `..`, or holds a lone surrogate, which can't be encoded; and
|
|
219
226
|
* when a `{re}` param's value is one its pattern refuses, naming the route
|
|
220
227
|
* and the param
|
|
221
228
|
*/
|
|
222
|
-
export declare const resolve_valid_path: (path: string, params_schema?:
|
|
229
|
+
export declare const resolve_valid_path: (path: string, params_schema?: AnySchema, param_values?: Readonly<Record<string, string>>) => string;
|
|
223
230
|
/**
|
|
224
231
|
* Generate a valid request body for a route's or action's input schema.
|
|
225
232
|
*
|
|
226
|
-
* @param input_schema - the input schema
|
|
233
|
+
* @param input_schema - the input schema
|
|
227
234
|
* @returns a generated body that passes the schema, or `undefined` for a void
|
|
228
235
|
* or null input, which takes no body
|
|
229
|
-
* @throws Error if the input is
|
|
236
|
+
* @throws Error if the input is no schema, or is neither void, null,
|
|
230
237
|
* nor an object schema, or if the generated body fails the input — catching
|
|
231
238
|
* broken `generate_valid_value` logic early with the parse's issues instead
|
|
232
239
|
* of a confusing 400 in downstream tests
|
|
233
240
|
*/
|
|
234
|
-
export declare const generate_valid_body: (input_schema:
|
|
241
|
+
export declare const generate_valid_body: (input_schema: AnySchema) => Record<string, unknown> | undefined;
|
|
235
242
|
//# sourceMappingURL=schema_generators.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema_generators.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/schema_generators.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"schema_generators.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/schema_generators.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;;;;GAUG;AAEH,OAAO,EAEN,KAAK,SAAS,EAEd,KAAK,YAAY,EACjB,MAAM,8BAA8B,CAAC;AAQtC,OAAO,EAIN,KAAK,eAAe,EACpB,MAAM,2BAA2B,CAAC;AASnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,oBAAoB,GAAI,cAAc,SAAS,KAAG,M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