@fuzdev/fuz_app 0.169.0 → 0.170.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 +17 -19
- package/dist/actions/action_codegen.d.ts +25 -18
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +83 -67
- 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.js +1 -1
- 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/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/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/request_context.js +2 -2
- 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 +29 -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/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_spec.d.ts +33 -36
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +21 -22
- package/dist/http/schema_helpers.d.ts +75 -67
- 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 +29 -42
- 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.js +9 -9
- 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_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 +3 -3
- package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
- package/dist/testing/rpc_envelope_cases.js +1 -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 +150 -145
- 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
|
@@ -9,12 +9,6 @@
|
|
|
9
9
|
* all reach for the same primitives without going through auth. A URL is
|
|
10
10
|
* `Url` from `@fuzdev/fuz_util/url.ts`.
|
|
11
11
|
*
|
|
12
|
-
* The Zod forms a consumer's Zod schema embeds — `ZodUuid`,
|
|
13
|
-
* `ZodUuidWithDefault`, `ZodFactHashSchema`, `ZodUsername`,
|
|
14
|
-
* `ZodActingActor` — are in `zod_schemas.ts`, built on the grammars here and
|
|
15
|
-
* sharing their output types, so a value parsed by either goes where the
|
|
16
|
-
* other's is taken.
|
|
17
|
-
*
|
|
18
12
|
* Client-safe: nothing here imports `@fuzdev/blake3-wasm`, so wire schemas
|
|
19
13
|
* that validate a hash don't pull the WASM binary into a bundle.
|
|
20
14
|
*
|
|
@@ -151,9 +145,9 @@ export declare const is_email_within_length_max: (s: string) => boolean;
|
|
|
151
145
|
* Deliberately permissive — a structural shape check (`EMAIL_REGEX` plus the
|
|
152
146
|
* `EMAIL_LENGTH_MAX` byte bound), not RFC 5322 conformance or deliverability
|
|
153
147
|
* (real delivery is proven by a confirmation email). The rule is one explicit
|
|
154
|
-
* regex the Rust spine's `is_valid_email` mirrors, looser than
|
|
155
|
-
*
|
|
156
|
-
*
|
|
148
|
+
* regex the Rust spine's `is_valid_email` mirrors, looser than grammars
|
|
149
|
+
* requiring a 2+ char TLD and no consecutive dots, which reject addresses like
|
|
150
|
+
* `a@b.c`. The length bound is the UTF-8 **byte** count (RFC 5321
|
|
157
151
|
* measures octets), so a multibyte address is bounded identically to the
|
|
158
152
|
* Rust spine's `s.len()`. No transform: case is preserved and surrounding
|
|
159
153
|
* whitespace is rejected (not trimmed), so storage is verbatim and the
|
|
@@ -172,11 +166,9 @@ export declare const create_uuid: () => Uuid;
|
|
|
172
166
|
/**
|
|
173
167
|
* The UUID grammar of RFC 9562, in either case: five groups of hex digits,
|
|
174
168
|
* 8-4-4-4-12, with a version from 1 to 8 and the RFC's variant, or the nil or
|
|
175
|
-
* the max UUID
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
* which a test holds it to, the `pattern` of `ZodUuid`, and the grammar of
|
|
179
|
-
* the Rust spine's `is_valid_uuid`.
|
|
169
|
+
* the max UUID, read case-insensitively as RFC 9562 §4 reads a UUID. The same
|
|
170
|
+
* source as the pattern fuz_schema's `uuid` renders to JSON Schema, which a
|
|
171
|
+
* test holds it to, and the grammar of the Rust spine's `is_valid_uuid`.
|
|
180
172
|
*/
|
|
181
173
|
export declare const UUID_REGEX: RegExp;
|
|
182
174
|
/**
|
|
@@ -205,7 +197,7 @@ export type UuidWithDefault = Infer<typeof UuidWithDefault>;
|
|
|
205
197
|
* A timestamp on the wire: a date and time of RFC 3339 in UTC, fuz_schema's
|
|
206
198
|
* `iso_datetime`, which both spines' `YYYY-MM-DDTHH:MM:SSZ`
|
|
207
199
|
* (`iso8601_timestamp_column`) and a `toISOString()` stamp satisfy. Not
|
|
208
|
-
* branded
|
|
200
|
+
* branded.
|
|
209
201
|
*/
|
|
210
202
|
export declare const Timestamp: PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
211
203
|
export type Timestamp = Infer<typeof Timestamp>;
|
|
@@ -233,7 +225,7 @@ export declare const BLAKE3_HASH_MESSAGE = "Expected a 64-character lowercase he
|
|
|
233
225
|
*/
|
|
234
226
|
export declare const Blake3Hash: PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
235
227
|
export type Blake3Hash = Infer<typeof Blake3Hash>;
|
|
236
|
-
/** The `description` of `ActingActor
|
|
228
|
+
/** The `description` of `ActingActor`. */
|
|
237
229
|
export declare const ACTING_ACTOR_DESCRIPTION = "Actor on the authenticated account that this request acts as. Omit on single-actor accounts; required on multi-actor.";
|
|
238
230
|
/**
|
|
239
231
|
* `acting` field shared by every input that needs the caller's acting actor.
|
|
@@ -254,7 +246,7 @@ export declare const ACTING_ACTOR_DESCRIPTION = "Actor on the authenticated acco
|
|
|
254
246
|
* 2: `auth.actor !== 'none'` ⟺ input (or query, on REST GETs) declares
|
|
255
247
|
* `acting?: ActingActor`. The dispatcher finds it by reference
|
|
256
248
|
* (`input_schema_declares_acting`), so an input declares this export, not a
|
|
257
|
-
* copy of it
|
|
249
|
+
* copy of it.
|
|
258
250
|
*/
|
|
259
251
|
export declare const ActingActor: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | undefined, string | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform">)[]> & {
|
|
260
252
|
readonly '~types'?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitive_schemas.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/primitive_schemas.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"primitive_schemas.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/primitive_schemas.ts"],"names":[],"mappings":"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"}
|
|
@@ -9,12 +9,6 @@
|
|
|
9
9
|
* all reach for the same primitives without going through auth. A URL is
|
|
10
10
|
* `Url` from `@fuzdev/fuz_util/url.ts`.
|
|
11
11
|
*
|
|
12
|
-
* The Zod forms a consumer's Zod schema embeds — `ZodUuid`,
|
|
13
|
-
* `ZodUuidWithDefault`, `ZodFactHashSchema`, `ZodUsername`,
|
|
14
|
-
* `ZodActingActor` — are in `zod_schemas.ts`, built on the grammars here and
|
|
15
|
-
* sharing their output types, so a value parsed by either goes where the
|
|
16
|
-
* other's is taken.
|
|
17
|
-
*
|
|
18
12
|
* Client-safe: nothing here imports `@fuzdev/blake3-wasm`, so wire schemas
|
|
19
13
|
* that validate a hash don't pull the WASM binary into a bundle.
|
|
20
14
|
*
|
|
@@ -147,9 +141,9 @@ export const is_email_within_length_max = (s) => s.length <= EMAIL_LENGTH_MAX &&
|
|
|
147
141
|
* Deliberately permissive — a structural shape check (`EMAIL_REGEX` plus the
|
|
148
142
|
* `EMAIL_LENGTH_MAX` byte bound), not RFC 5322 conformance or deliverability
|
|
149
143
|
* (real delivery is proven by a confirmation email). The rule is one explicit
|
|
150
|
-
* regex the Rust spine's `is_valid_email` mirrors, looser than
|
|
151
|
-
*
|
|
152
|
-
*
|
|
144
|
+
* regex the Rust spine's `is_valid_email` mirrors, looser than grammars
|
|
145
|
+
* requiring a 2+ char TLD and no consecutive dots, which reject addresses like
|
|
146
|
+
* `a@b.c`. The length bound is the UTF-8 **byte** count (RFC 5321
|
|
153
147
|
* measures octets), so a multibyte address is bounded identically to the
|
|
154
148
|
* Rust spine's `s.len()`. No transform: case is preserved and surrounding
|
|
155
149
|
* whitespace is rejected (not trimmed), so storage is verbatim and the
|
|
@@ -167,11 +161,9 @@ export const create_uuid = () => crypto.randomUUID();
|
|
|
167
161
|
/**
|
|
168
162
|
* The UUID grammar of RFC 9562, in either case: five groups of hex digits,
|
|
169
163
|
* 8-4-4-4-12, with a version from 1 to 8 and the RFC's variant, or the nil or
|
|
170
|
-
* the max UUID
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
* which a test holds it to, the `pattern` of `ZodUuid`, and the grammar of
|
|
174
|
-
* the Rust spine's `is_valid_uuid`.
|
|
164
|
+
* the max UUID, read case-insensitively as RFC 9562 §4 reads a UUID. The same
|
|
165
|
+
* source as the pattern fuz_schema's `uuid` renders to JSON Schema, which a
|
|
166
|
+
* test holds it to, and the grammar of the Rust spine's `is_valid_uuid`.
|
|
175
167
|
*/
|
|
176
168
|
export const UUID_REGEX = /^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$/;
|
|
177
169
|
/**
|
|
@@ -188,7 +180,7 @@ export const UuidWithDefault = with_default_fn(Uuid, create_uuid);
|
|
|
188
180
|
* A timestamp on the wire: a date and time of RFC 3339 in UTC, fuz_schema's
|
|
189
181
|
* `iso_datetime`, which both spines' `YYYY-MM-DDTHH:MM:SSZ`
|
|
190
182
|
* (`iso8601_timestamp_column`) and a `toISOString()` stamp satisfy. Not
|
|
191
|
-
* branded
|
|
183
|
+
* branded.
|
|
192
184
|
*/
|
|
193
185
|
export const Timestamp = pipe(string, iso_datetime);
|
|
194
186
|
/**
|
|
@@ -209,7 +201,7 @@ export const BLAKE3_HASH_MESSAGE = 'Expected a 64-character lowercase hex blake3
|
|
|
209
201
|
* `BLAKE3_HASH_MESSAGE`. A value that is no string gets fuz_schema's message.
|
|
210
202
|
*/
|
|
211
203
|
export const Blake3Hash = pipe(string, message(regex(BLAKE3_HASH_REGEX), BLAKE3_HASH_MESSAGE));
|
|
212
|
-
/** The `description` of `ActingActor
|
|
204
|
+
/** The `description` of `ActingActor`. */
|
|
213
205
|
export const ACTING_ACTOR_DESCRIPTION = 'Actor on the authenticated account that this request acts as. Omit on single-actor accounts; required on multi-actor.';
|
|
214
206
|
/**
|
|
215
207
|
* `acting` field shared by every input that needs the caller's acting actor.
|
|
@@ -230,6 +222,6 @@ export const ACTING_ACTOR_DESCRIPTION = 'Actor on the authenticated account that
|
|
|
230
222
|
* 2: `auth.actor !== 'none'` ⟺ input (or query, on REST GETs) declares
|
|
231
223
|
* `acting?: ActingActor`. The dispatcher finds it by reference
|
|
232
224
|
* (`input_schema_declares_acting`), so an input declares this export, not a
|
|
233
|
-
* copy of it
|
|
225
|
+
* copy of it.
|
|
234
226
|
*/
|
|
235
227
|
export const ActingActor = meta(optional(Uuid), { description: ACTING_ACTOR_DESCRIPTION });
|
package/dist/realtime/sse.d.ts
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
*/
|
|
33
33
|
import type { Context } from 'hono';
|
|
34
34
|
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
35
|
-
import { type
|
|
35
|
+
import { type AnySchema } from '@fuzdev/fuz_schema/schema.ts';
|
|
36
36
|
/**
|
|
37
37
|
* Generic SSE stream controller interface.
|
|
38
38
|
*
|
|
@@ -118,8 +118,8 @@ export declare const create_sse_response: <T = unknown>(c: Context, log: Logger,
|
|
|
118
118
|
export interface EventSpec {
|
|
119
119
|
/** Event method name, used as the JSON-RPC notification `method`. */
|
|
120
120
|
method: string;
|
|
121
|
-
/** Schema for the notification `params` payload
|
|
122
|
-
params:
|
|
121
|
+
/** Schema for the notification `params` payload. */
|
|
122
|
+
params: AnySchema;
|
|
123
123
|
/** Human-readable description for surface output and docs. */
|
|
124
124
|
description: string;
|
|
125
125
|
/** Channel this event broadcasts on. Omit for cross-channel events. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/realtime/sse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"sse.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/realtime/sse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAYrE;;;;GAIG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,OAAO;IACrC;;;;OAIG;IACH,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IACxB,wBAAwB;IACxB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC/B,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,MAAM,EAAE,OAAO,CAAC;CAChB;AAED,yCAAyC;AACzC,MAAM,WAAW,kBAAkB;IAClC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AA8DD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,mBAAmB,GAAI,CAAC,GAAG,OAAO,EAC9C,GAAG,OAAO,EACV,KAAK,MAAM,EACX,UAAU,kBAAkB,KAC1B;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;CAsG5C,CAAC;AAEF,gFAAgF;AAChF,MAAM,WAAW,SAAS;IACzB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,MAAM,EAAE,SAAS,CAAC;IAClB,8DAA8D;IAC9D,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,GAAI,CAAC,SAAS,eAAe,EACrE,aAAa;IAAE,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,IAAI,CAAA;CAAE,EAC9D,aAAa,KAAK,CAAC,SAAS,CAAC,EAC7B,KAAK,MAAM,KACT;IAAE,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,IAAI,CAAA;CAmBjD,CAAC"}
|
package/dist/realtime/sse.js
CHANGED
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
*/
|
|
33
33
|
import { streamSSE } from 'hono/streaming';
|
|
34
34
|
import { DEV } from 'esm-env';
|
|
35
|
+
import { parse } from '@fuzdev/fuz_schema/schema.ts';
|
|
35
36
|
import { utf8_length } from '../actions/transports.js';
|
|
36
37
|
import { OutboundBudget } from './outbound_budget.js';
|
|
37
|
-
import { parse_any } from '../schema_issues.js';
|
|
38
38
|
import { SSE_CONNECTED_COMMENT, SSE_KEEP_ALIVE_COMMENT, SSE_KEEP_ALIVE_INTERVAL_MS, SSE_OUTBOUND_QUEUE_BYTES, validate_sse_keep_alive_ms } from './sse_constants.js';
|
|
39
39
|
const is_node_connection_stream = (value) => {
|
|
40
40
|
if (typeof value !== 'object' || value === null)
|
|
@@ -249,7 +249,7 @@ export const create_validated_broadcaster = (broadcaster, event_specs, log) => {
|
|
|
249
249
|
log.warn(`Unknown event method: '${data.method}'`);
|
|
250
250
|
}
|
|
251
251
|
else {
|
|
252
|
-
const result =
|
|
252
|
+
const result = parse(spec.params, data.params);
|
|
253
253
|
if (!result.ok) {
|
|
254
254
|
log.warn(`Params mismatch for '${data.method}':`, result.issues);
|
|
255
255
|
}
|
package/dist/schema_issues.d.ts
CHANGED
|
@@ -1,102 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Validation issues
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* helpers read either, so the dispatcher, `ActionEvent` and the
|
|
6
|
-
* forward-compatible reads treat a spec the same whichever library it is
|
|
7
|
-
* written in, and an error response carries either library's issues in one
|
|
8
|
-
* shape, `WireIssue`.
|
|
2
|
+
* Validation issues of a `@fuzdev/fuz_schema` parse (`SchemaIssue`) as the
|
|
3
|
+
* stack reads them: on the input or on a field, unknown keys, text, and the
|
|
4
|
+
* one shape every error response carries them in, `WireIssue`.
|
|
9
5
|
*
|
|
10
6
|
* @module
|
|
11
7
|
*/
|
|
12
|
-
import type
|
|
13
|
-
import { SchemaError, type AnySchema, type Infer, type InferInput, type Schema, type SchemaIssue } from '@fuzdev/fuz_schema/schema.ts';
|
|
14
|
-
import type { Result } from '@fuzdev/fuz_util/result.ts';
|
|
15
|
-
/** A schema of either library: a Zod schema or a `@fuzdev/fuz_schema` one. */
|
|
16
|
-
export type ValidationSchema = z.ZodType | AnySchema;
|
|
8
|
+
import { SchemaError, type AnySchema, type Infer, type SchemaIssue } from '@fuzdev/fuz_schema/schema.ts';
|
|
17
9
|
/**
|
|
18
|
-
*
|
|
19
|
-
* `
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* @param value - any value
|
|
23
|
-
*/
|
|
24
|
-
export declare const is_zod_schema: (value: unknown) => value is z.ZodType;
|
|
25
|
-
/**
|
|
26
|
-
* Throw unless `value` is a Zod schema, naming `label` — what a reader of a
|
|
27
|
-
* spec's schema calls once it has ruled out a `@fuzdev/fuz_schema` schema
|
|
28
|
-
* (`is_schema`), so a value of neither library fails loudly where it is read,
|
|
29
|
-
* rather than as a `TypeError` deeper in or a silent `undefined`.
|
|
30
|
-
*
|
|
31
|
-
* @param value - the schema, known not to be a fuz_schema schema
|
|
32
|
-
* @param label - names the schema in the error, e.g. `` `action 'foo' input` ``
|
|
33
|
-
* @throws Error when `value` is not a Zod schema, saying it is of neither library
|
|
34
|
-
*/
|
|
35
|
-
export declare function assert_zod_schema(value: unknown, label: string): asserts value is z.ZodType;
|
|
36
|
-
/**
|
|
37
|
-
* Throw unless `value` is a schema of either library (`is_schema` or
|
|
38
|
-
* `is_zod_schema`), naming `label` — what spec registration runs on each
|
|
39
|
-
* schema slot, so a value of neither library fails at registration rather
|
|
40
|
-
* than at request time.
|
|
10
|
+
* Throw unless `value` is a `@fuzdev/fuz_schema` schema (`is_schema`), naming
|
|
11
|
+
* `label` — what spec registration runs on each schema slot, so a value that
|
|
12
|
+
* is no schema fails at registration rather than at request time.
|
|
41
13
|
*
|
|
42
14
|
* @param value - the value a spec declares as a schema
|
|
43
15
|
* @param label - names the spec and slot in the error, e.g. `` `RPC action "foo": input` ``
|
|
44
|
-
* @throws Error when `value` is
|
|
45
|
-
*/
|
|
46
|
-
export declare function assert_validation_schema(value: unknown, label: string): asserts value is ValidationSchema;
|
|
47
|
-
/**
|
|
48
|
-
* The output type of a `ValidationSchema`: fuz_schema's `Infer` or Zod's
|
|
49
|
-
* `z.output`. The test narrows `T` itself: `Infer<T & Schema>` would read as
|
|
50
|
-
* `unknown`.
|
|
51
|
-
*/
|
|
52
|
-
export type ValidationOutput<T extends ValidationSchema> = T extends Schema ? Infer<T> : T extends z.ZodType ? z.output<T> : never;
|
|
53
|
-
/** The input type of a `ValidationSchema`: fuz_schema's `InferInput` or Zod's `z.input`. */
|
|
54
|
-
export type ValidationInput<T extends ValidationSchema> = T extends Schema ? InferInput<T> : T extends z.ZodType ? z.input<T> : never;
|
|
55
|
-
/** One issue of a failed parse, in the library's own shape. */
|
|
56
|
-
export type AnyIssue = z.core.$ZodIssue | SchemaIssue;
|
|
57
|
-
/** What `parse_any` returns: the output, or the failed parse's issues in the library's order. */
|
|
58
|
-
export type ParseAnyResult<T> = Result<{
|
|
59
|
-
value: T;
|
|
60
|
-
}, {
|
|
61
|
-
issues: Array<AnyIssue>;
|
|
62
|
-
}>;
|
|
63
|
-
/**
|
|
64
|
-
* Parse `value` with a schema of either library: `parse` for a fuz_schema
|
|
65
|
-
* schema (`is_schema`), `safeParse` for a Zod one.
|
|
66
|
-
*
|
|
67
|
-
* A fuz_schema parse reports at most its first hundred issues, a Zod parse
|
|
68
|
-
* every issue.
|
|
69
|
-
*
|
|
70
|
-
* @param schema - a Zod or fuz_schema schema
|
|
71
|
-
* @param value - the value to validate
|
|
72
|
-
* @returns the output, or the issues
|
|
73
|
-
* @throws Error when `schema` is neither a Zod nor a fuz_schema schema
|
|
16
|
+
* @throws Error when `value` is not a fuz_schema schema
|
|
74
17
|
*/
|
|
75
|
-
export declare
|
|
76
|
-
/**
|
|
77
|
-
* Whether `issue` is Zod's: every Zod issue has a `code`, a fuz_schema issue a `kind`.
|
|
78
|
-
*/
|
|
79
|
-
export declare const is_zod_issue: (issue: AnyIssue) => issue is z.core.$ZodIssue;
|
|
18
|
+
export declare function assert_validation_schema(value: unknown, label: string): asserts value is AnySchema;
|
|
80
19
|
/**
|
|
81
20
|
* Whether `issue` sits on the input itself rather than on one of its fields:
|
|
82
21
|
* a non-object input, or an unknown key on the input object — what the Rust
|
|
83
22
|
* twin refuses before reading any field.
|
|
84
23
|
*
|
|
85
|
-
*
|
|
86
|
-
* fuz_schema reports a non-object at an empty path and each unknown key as an
|
|
24
|
+
* A non-object is reported at an empty path, and each unknown key as an
|
|
87
25
|
* `unknown_key` issue whose path ends at the key, so one on the input has a
|
|
88
|
-
* path of the key alone. An unknown key on a nested object is on that field
|
|
89
|
-
* as Zod's is.
|
|
26
|
+
* path of the key alone. An unknown key on a nested object is on that field.
|
|
90
27
|
*
|
|
91
28
|
* On the wire the `unknown_key` rule changes no answer today: a root
|
|
92
29
|
* `unknown_key` comes from a root `object`, which `resolve_issues_invalid_reason`
|
|
93
30
|
* already answers with none from its check of the input's keys, or from a
|
|
94
31
|
* schema such as a `variant` whose fields resolve no reason. It is kept as the
|
|
95
|
-
* direct statement of
|
|
32
|
+
* direct statement of the rule.
|
|
96
33
|
*
|
|
97
34
|
* @param issue - one issue of a failed parse
|
|
98
35
|
*/
|
|
99
|
-
export declare const issue_is_on_input: (issue:
|
|
36
|
+
export declare const issue_is_on_input: (issue: SchemaIssue) => boolean;
|
|
100
37
|
/** Keys a parse refused as unknown, and the path of the object holding them. */
|
|
101
38
|
export interface UnknownKeyTarget {
|
|
102
39
|
/** The path of the object the keys are on, `[]` for the input itself. */
|
|
@@ -106,110 +43,65 @@ export interface UnknownKeyTarget {
|
|
|
106
43
|
}
|
|
107
44
|
/**
|
|
108
45
|
* The unknown keys among `issues`, each with the path of its object, or
|
|
109
|
-
* `null` when any issue is something else.
|
|
110
|
-
*
|
|
111
|
-
* A Zod `unrecognized_keys` issue is at its object's path and names every
|
|
112
|
-
* key; a fuz_schema `unknown_key` issue is one key, the last element of its
|
|
113
|
-
* path.
|
|
46
|
+
* `null` when any issue is something else. An `unknown_key` issue is one
|
|
47
|
+
* key, the last element of its path.
|
|
114
48
|
*
|
|
115
49
|
* @param issues - a failed parse's issues
|
|
116
50
|
* @returns a target per issue, or `null` when not every issue is an unknown key
|
|
117
51
|
*/
|
|
118
|
-
export declare const unknown_key_targets: (issues: ReadonlyArray<
|
|
52
|
+
export declare const unknown_key_targets: (issues: ReadonlyArray<SchemaIssue>) => Array<UnknownKeyTarget> | null;
|
|
119
53
|
/**
|
|
120
|
-
* A failed parse's issues as text
|
|
121
|
-
* writes them — shortest path first, each `✖ message` and, when it has a
|
|
122
|
-
* path, ` → at path` — without importing Zod at runtime; fuz_schema issues
|
|
123
|
-
* are their `format_issue` lines.
|
|
54
|
+
* A failed parse's issues as text, a `format_issue` line each.
|
|
124
55
|
*
|
|
125
|
-
* @param issues - a failed parse's issues
|
|
56
|
+
* @param issues - a failed parse's issues
|
|
126
57
|
*/
|
|
127
|
-
export declare const format_issues: (issues: ReadonlyArray<
|
|
58
|
+
export declare const format_issues: (issues: ReadonlyArray<SchemaIssue>) => string;
|
|
128
59
|
/**
|
|
129
|
-
* Whether `err` is a thrown validation failure
|
|
130
|
-
* `
|
|
131
|
-
* the failed parse's `issues`.
|
|
60
|
+
* Whether `err` is a thrown validation failure, a `SchemaError`
|
|
61
|
+
* (`parse_or_throw`), which carries the failed parse's `issues`.
|
|
132
62
|
*
|
|
133
63
|
* @param err - a caught value
|
|
134
64
|
*/
|
|
135
|
-
export declare const is_schema_validation_error: (err: unknown) => err is
|
|
65
|
+
export declare const is_schema_validation_error: (err: unknown) => err is SchemaError;
|
|
136
66
|
/**
|
|
137
67
|
* A `@fuzdev/fuz_schema` `loose_object`: a validation issue as an error
|
|
138
|
-
* response carries it
|
|
139
|
-
*
|
|
140
|
-
* from either library's issues.
|
|
68
|
+
* response carries it — `SchemaIssue` as JSON, with `message` the text of the
|
|
69
|
+
* issue. `to_wire_issues` builds it.
|
|
141
70
|
*
|
|
142
71
|
* Loose: a client reads it, and a newer server may add fields.
|
|
143
72
|
*/
|
|
144
|
-
export declare const WireIssue: Schema<{
|
|
73
|
+
export declare const WireIssue: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
145
74
|
kind: string;
|
|
146
|
-
message: string;
|
|
147
75
|
path: (string | number)[];
|
|
148
76
|
expected: string;
|
|
149
77
|
received: string;
|
|
78
|
+
message: string;
|
|
150
79
|
} & Record<string, unknown>, {
|
|
151
80
|
kind: string;
|
|
152
|
-
message: string;
|
|
153
81
|
path: (string | number)[];
|
|
154
82
|
expected: string;
|
|
155
83
|
received: string;
|
|
84
|
+
message: string;
|
|
156
85
|
} & Record<string, unknown>, "loose_object", {
|
|
157
86
|
/** The fuz_schema kind of the check that failed, or `unknown_key` / `missing_key`. */
|
|
158
|
-
kind: Schema<string, string, "string", undefined>;
|
|
87
|
+
kind: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
159
88
|
/** Keys from the root value to the one that failed, outermost first. */
|
|
160
|
-
path: Schema<(string | number)[], (string | number)[], "array", Schema<string | number, string | number, "union", readonly [Schema<string, string, "string", undefined>, Schema<number, number, "number", undefined>]>>;
|
|
89
|
+
path: import("@fuzdev/fuz_schema/schema.ts").Schema<(string | number)[], (string | number)[], "array", import("@fuzdev/fuz_schema/schema.ts").Schema<string | number, string | number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>, import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>]>>;
|
|
161
90
|
/** Describes what was expected, as fuz_schema writes it. */
|
|
162
|
-
expected: Schema<string, string, "string", undefined>;
|
|
91
|
+
expected: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
163
92
|
/** The type of the value that failed: `'null'`, `'array'`, `'NaN'`, `'Infinity'`, `'-Infinity'`, or its `typeof`. */
|
|
164
|
-
received: Schema<string, string, "string", undefined>;
|
|
165
|
-
/** The issue as text
|
|
166
|
-
message: Schema<string, string, "string", undefined>;
|
|
93
|
+
received: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
94
|
+
/** The issue as text, `format_issue`'s. */
|
|
95
|
+
message: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
167
96
|
}>;
|
|
168
97
|
export type WireIssue = Infer<typeof WireIssue>;
|
|
169
98
|
/**
|
|
170
|
-
* A failed parse's issues as `WireIssue`s
|
|
171
|
-
*
|
|
172
|
-
* A
|
|
173
|
-
* its `message` is `format_issue`'s text, the path included.
|
|
174
|
-
*
|
|
175
|
-
* A Zod issue maps to the kind fuz_schema reports for the same check, its
|
|
176
|
-
* `message` Zod's own text, which names no path:
|
|
99
|
+
* A failed parse's issues as `WireIssue`s: each keeps its `kind`, `path`,
|
|
100
|
+
* `expected` and `received`, and its `message` is `format_issue`'s text, the
|
|
101
|
+
* path included. A symbol key in a path goes as its text.
|
|
177
102
|
*
|
|
178
|
-
* -
|
|
179
|
-
*
|
|
180
|
-
* `array`, `null`, `undefined`, `void` and `nan` a `literal` of the value,
|
|
181
|
-
* `nonoptional` a `missing_key`, and a type fuz_schema has no kind for
|
|
182
|
-
* (`date`, `map`, `set`, `file`, `symbol`, `function`, `never`) a `check`
|
|
183
|
-
* expecting the type's name. A missing key is reported as fuz_schema
|
|
184
|
-
* reports it, as the type expected with `received: 'undefined'`.
|
|
185
|
-
* - `too_small` / `too_big` — `min_length` / `max_length` for a string,
|
|
186
|
-
* array, set or file (`length >= N`), `min_value` / `max_value` otherwise
|
|
187
|
-
* (`>= N`); an exclusive bound writes `>` or `<`, which fuz_schema has no
|
|
188
|
-
* check for, and an exact length is reported as the bound it broke.
|
|
189
|
-
* - `invalid_format` — `uuid` for a `uuid` or `guid`, `iso_datetime` for a
|
|
190
|
-
* `datetime`, `regex` for a `regex` (expecting its pattern), and a `check`
|
|
191
|
-
* expecting the format's name for every other format.
|
|
192
|
-
* - `unrecognized_keys` — an `unknown_key` per key, the key appended to the
|
|
193
|
-
* path, as fuz_schema reports them.
|
|
194
|
-
* - `invalid_union` — a `variant` expecting the options when Zod names a
|
|
195
|
-
* discriminator, else a `union` expecting each option as fuz_schema names
|
|
196
|
-
* it: by the type or the values it expected of the value, or by the
|
|
197
|
-
* value's type when the option took the type and failed a refinement or a
|
|
198
|
-
* field below. A union refused because more than one option matched is a
|
|
199
|
-
* `union` expecting `exactly one option`.
|
|
200
|
-
* - `invalid_value` — a `literal` of one value, a `one_of` of more.
|
|
201
|
-
* - `custom` — a `check`; `not_multiple_of` a `check` expecting
|
|
202
|
-
* `multiple of N`; `invalid_key` and `invalid_element` a `check` expecting
|
|
203
|
-
* `a valid key` / `a valid element`.
|
|
204
|
-
*
|
|
205
|
-
* A Zod issue holds no value, so `received` is read from `input` at the
|
|
206
|
-
* issue's path: `'undefined'` where a key is missing or the path leads
|
|
207
|
-
* through something that isn't an object. Where an earlier step of a Zod
|
|
208
|
-
* pipe replaced the value, it names the input's value, not the replacement.
|
|
209
|
-
*
|
|
210
|
-
* @param issues - a failed parse's issues, either library
|
|
211
|
-
* @param input - the value that was parsed
|
|
212
|
-
* @returns the issues, one per issue but for a Zod `unrecognized_keys`, which is one per key
|
|
103
|
+
* @param issues - a failed parse's issues
|
|
104
|
+
* @returns one per issue
|
|
213
105
|
*/
|
|
214
|
-
export declare const to_wire_issues: (issues: ReadonlyArray<
|
|
106
|
+
export declare const to_wire_issues: (issues: ReadonlyArray<SchemaIssue>) => Array<WireIssue>;
|
|
215
107
|
//# sourceMappingURL=schema_issues.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema_issues.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/schema_issues.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"schema_issues.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/schema_issues.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAMN,WAAW,EAGX,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,MAAM,8BAA8B,CAAC;AAEtC;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACvC,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,KAAK,IAAI,SAAS,CAG5B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,WAAW,KAAG,OAC8B,CAAC;AAEtF,gFAAgF;AAChF,MAAM,WAAW,gBAAgB;IAChC,yEAAyE;IACzE,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IACjC,wBAAwB;IACxB,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAC/B,QAAQ,aAAa,CAAC,WAAW,CAAC,KAChC,KAAK,CAAC,gBAAgB,CAAC,GAAG,IAO5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,aAAa,CAAC,WAAW,CAAC,KAAG,MAC/B,CAAC;AAErC;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,GAAI,KAAK,OAAO,KAAG,GAAG,IAAI,WACtC,CAAC;AAE5B;;;;;;GAMG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;IACrB,sFAAsF;;IAEtF,wEAAwE;;IAExE,4DAA4D;;IAE5D,qHAAqH;;IAErH,2CAA2C;;EAE1C,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAEhD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,aAAa,CAAC,WAAW,CAAC,KAAG,KAAK,CAAC,SAAS,CAO/E,CAAC"}
|