@fuzdev/fuz_app 0.168.1 → 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 +32 -23
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +101 -80
- 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 +18 -18
- 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/account_action_specs.d.ts +11 -11
- package/dist/auth/account_action_specs.js +1 -1
- package/dist/auth/account_route_schema.d.ts +18 -18
- package/dist/auth/account_route_schema.js +1 -1
- package/dist/auth/account_routes.js +1 -1
- package/dist/auth/account_schema.d.ts +38 -40
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +7 -8
- package/dist/auth/actor_lookup_action_specs.d.ts +7 -7
- package/dist/auth/actor_lookup_action_specs.js +1 -1
- package/dist/auth/actor_search_action_specs.d.ts +6 -6
- package/dist/auth/actor_search_action_specs.js +1 -1
- package/dist/auth/admin_action_specs.d.ts +166 -166
- package/dist/auth/admin_action_specs.js +1 -1
- package/dist/auth/app_settings_schema.d.ts +3 -3
- package/dist/auth/app_settings_schema.d.ts.map +1 -1
- package/dist/auth/app_settings_schema.js +1 -1
- 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_route_schema.d.ts +1 -1
- package/dist/auth/audit_log_route_schema.js +1 -1
- package/dist/auth/audit_log_schema.d.ts +69 -70
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +2 -2
- package/dist/auth/auth_ddl.d.ts +1 -1
- package/dist/auth/auth_ddl.js +1 -1
- package/dist/auth/bootstrap_route_schema.d.ts +4 -4
- package/dist/auth/bootstrap_route_schema.js +1 -1
- package/dist/auth/cell_action_specs.d.ts +466 -466
- package/dist/auth/cell_action_specs.js +1 -1
- package/dist/auth/cell_actions.d.ts +2 -2
- package/dist/auth/cell_actions.js +5 -5
- package/dist/auth/cell_audit_action_specs.d.ts +14 -14
- package/dist/auth/cell_audit_action_specs.js +1 -1
- package/dist/auth/cell_audit_metadata.d.ts +8 -8
- package/dist/auth/cell_audit_metadata.js +1 -1
- package/dist/auth/cell_field_action_specs.d.ts +55 -55
- package/dist/auth/cell_field_action_specs.js +1 -1
- package/dist/auth/cell_field_audit_metadata.d.ts +4 -4
- package/dist/auth/cell_field_audit_metadata.js +1 -1
- package/dist/auth/cell_grant_action_specs.d.ts +61 -61
- package/dist/auth/cell_grant_action_specs.js +1 -1
- package/dist/auth/cell_grant_audit_metadata.d.ts +10 -10
- package/dist/auth/cell_grant_audit_metadata.js +1 -1
- package/dist/auth/cell_item_action_specs.d.ts +76 -76
- package/dist/auth/cell_item_action_specs.js +1 -1
- package/dist/auth/cell_item_audit_metadata.d.ts +5 -5
- package/dist/auth/cell_item_audit_metadata.js +1 -1
- package/dist/auth/invite_schema.d.ts +11 -11
- package/dist/auth/invite_schema.d.ts.map +1 -1
- package/dist/auth/invite_schema.js +1 -1
- package/dist/auth/name_schema.js +1 -1
- package/dist/auth/password.js +1 -1
- package/dist/auth/request_context.js +2 -2
- package/dist/auth/role_grant_offer_action_specs.d.ts +182 -182
- package/dist/auth/role_grant_offer_action_specs.js +1 -1
- 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 +107 -107
- package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_notifications.js +3 -4
- package/dist/auth/role_grant_offer_schema.d.ts +9 -9
- package/dist/auth/role_grant_offer_schema.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_schema.js +1 -1
- package/dist/auth/self_service_role_action_specs.d.ts +2 -2
- package/dist/auth/self_service_role_action_specs.js +1 -1
- package/dist/auth/self_service_role_actions.d.ts +1 -1
- package/dist/auth/self_service_role_actions.js +1 -1
- package/dist/auth/signup_route_schema.d.ts +2 -2
- package/dist/auth/signup_route_schema.js +1 -1
- package/dist/auth/token_scope.d.ts +8 -8
- package/dist/db/file_fact_url.d.ts +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 -32
- package/dist/http/auth_shape.d.ts +17 -52
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/auth_shape.js +19 -61
- package/dist/http/db_routes.d.ts +1 -1
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +1 -1
- package/dist/http/error_schemas.d.ts +36 -36
- package/dist/http/jsonrpc.d.ts +11 -11
- 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 -76
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +6 -8
- package/dist/primitive_schemas.d.ts +162 -112
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas.js +129 -161
- 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 +41 -146
- package/dist/schema_issues.d.ts.map +1 -1
- package/dist/schema_issues.js +39 -322
- 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/server/serve_fact_route.js +1 -1
- package/dist/server/surface_route.js +1 -1
- package/dist/testing/CLAUDE.md +23 -25
- 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_case.d.ts +96 -114
- package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_case.js +0 -256
- 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/fact_serving.js +1 -1
- 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 +26 -4
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +7 -8
- package/dist/testing/cross_backend/sse_round_trip.js +2 -2
- package/dist/testing/cross_backend/testing_origin_check.d.ts +12 -12
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +608 -201
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +46 -55
- 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_outbound_overflow.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_outbound_overflow.js +35 -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 +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 -11
- 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 +144 -151
- package/dist/testing/schema_introspect.d.ts +438 -78
- package/dist/testing/schema_introspect.d.ts.map +1 -1
- package/dist/testing/schema_introspect.js +26 -26
- 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/testing/transports/bootstrap.d.ts +1 -1
- package/dist/testing/transports/bootstrap.d.ts.map +1 -1
- package/dist/testing/transports/bootstrap.js +1 -1
- package/dist/ui/BootstrapForm.svelte +1 -2
- package/dist/ui/BootstrapForm.svelte.d.ts.map +1 -1
- package/dist/ui/SignupForm.svelte +1 -2
- package/dist/ui/SignupForm.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.d.ts +5 -5
- package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_invites_state.svelte.d.ts +1 -1
- package/dist/ui/admin_invites_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_sessions_state.svelte.d.ts +2 -2
- package/dist/ui/admin_sessions_state.svelte.d.ts.map +1 -1
- package/dist/ui/form_state.svelte.d.ts +1 -1
- package/dist/ui/form_state.svelte.js +1 -1
- package/dist/ui/role_grant_offers_state.svelte.d.ts +1 -1
- package/package.json +7 -9
- package/dist/primitive_schemas_fuz.d.ts +0 -178
- package/dist/primitive_schemas_fuz.d.ts.map +0 -1
- package/dist/primitive_schemas_fuz.js +0 -149
- package/dist/zod.d.ts +0 -101
- package/dist/zod.d.ts.map +0 -1
- package/dist/zod.js +0 -195
package/dist/http/jsonrpc.d.ts
CHANGED
|
@@ -103,7 +103,7 @@ export declare const JSONRPC_SERVER_ERROR_END = -32099;
|
|
|
103
103
|
* A server-defined error code, an integer in the -32000 to -32099 range (the
|
|
104
104
|
* Rust spine's codes are `i32`s).
|
|
105
105
|
*/
|
|
106
|
-
export declare const JsonrpcServerErrorCode: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "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<"
|
|
106
|
+
export declare const JsonrpcServerErrorCode: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "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">)[]> & {
|
|
107
107
|
readonly '~types'?: {
|
|
108
108
|
readonly input: number;
|
|
109
109
|
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>;
|
|
@@ -114,7 +114,7 @@ export type JsonrpcServerErrorCode = Infer<typeof JsonrpcServerErrorCode>;
|
|
|
114
114
|
* A valid JSON-RPC error code — one of the standard codes or a
|
|
115
115
|
* server-defined code in the -32000 to -32099 range.
|
|
116
116
|
*/
|
|
117
|
-
export declare const JsonrpcErrorCode: import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603, -32700 | -32600 | -32601 | -32602 | -32603, "one_of", readonly [-32700, -32600, -32601, -32602, -32603]>, import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "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<"
|
|
117
|
+
export declare const JsonrpcErrorCode: import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603, -32700 | -32600 | -32601 | -32602 | -32603, "one_of", readonly [-32700, -32600, -32601, -32602, -32603]>, import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "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">)[]> & {
|
|
118
118
|
readonly '~types'?: {
|
|
119
119
|
readonly input: number;
|
|
120
120
|
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>;
|
|
@@ -140,7 +140,7 @@ export declare const JsonrpcErrorObject: import("@fuzdev/fuz_schema/schema.ts").
|
|
|
140
140
|
code: number;
|
|
141
141
|
data?: unknown;
|
|
142
142
|
} & Record<string, unknown>, "loose_object", {
|
|
143
|
-
code: import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603, -32700 | -32600 | -32601 | -32602 | -32603, "one_of", readonly [-32700, -32600, -32601, -32602, -32603]>, import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "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<"
|
|
143
|
+
code: import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603, -32700 | -32600 | -32601 | -32602 | -32603, "one_of", readonly [-32700, -32600, -32601, -32602, -32603]>, import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "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">)[]> & {
|
|
144
144
|
readonly '~types'?: {
|
|
145
145
|
readonly input: number;
|
|
146
146
|
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>;
|
|
@@ -152,20 +152,20 @@ export declare const JsonrpcErrorObject: import("@fuzdev/fuz_schema/schema.ts").
|
|
|
152
152
|
export type JsonrpcErrorObject = Infer<typeof JsonrpcErrorObject>;
|
|
153
153
|
/** A response that indicates an error occurred. */
|
|
154
154
|
export declare const JsonrpcErrorResponse: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
155
|
+
id: string | number | null;
|
|
155
156
|
error: {
|
|
156
157
|
message: string;
|
|
157
158
|
code: -32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">;
|
|
158
159
|
data?: unknown;
|
|
159
160
|
} & Record<string, unknown>;
|
|
160
|
-
id: string | number | null;
|
|
161
161
|
jsonrpc: "2.0";
|
|
162
162
|
} & Record<string, unknown>, {
|
|
163
|
+
id: string | number | null;
|
|
163
164
|
error: {
|
|
164
165
|
message: string;
|
|
165
166
|
code: number;
|
|
166
167
|
data?: unknown;
|
|
167
168
|
} & Record<string, unknown>;
|
|
168
|
-
id: string | number | null;
|
|
169
169
|
jsonrpc: "2.0";
|
|
170
170
|
} & Record<string, unknown>, "loose_object", {
|
|
171
171
|
jsonrpc: import("@fuzdev/fuz_schema/schema.ts").Schema<"2.0", "2.0", "literal", "2.0">;
|
|
@@ -179,7 +179,7 @@ export declare const JsonrpcErrorResponse: import("@fuzdev/fuz_schema/schema.ts"
|
|
|
179
179
|
code: number;
|
|
180
180
|
data?: unknown;
|
|
181
181
|
} & Record<string, unknown>, "loose_object", {
|
|
182
|
-
code: import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603, -32700 | -32600 | -32601 | -32602 | -32603, "one_of", readonly [-32700, -32600, -32601, -32602, -32603]>, import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "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<"
|
|
182
|
+
code: import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603, -32700 | -32600 | -32601 | -32602 | -32603, "one_of", readonly [-32700, -32600, -32601, -32602, -32603]>, import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "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">)[]> & {
|
|
183
183
|
readonly '~types'?: {
|
|
184
184
|
readonly input: number;
|
|
185
185
|
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>;
|
|
@@ -196,24 +196,24 @@ export declare const JsonrpcResponseOrError: import("@fuzdev/fuz_schema/schema.t
|
|
|
196
196
|
jsonrpc: "2.0";
|
|
197
197
|
result: unknown;
|
|
198
198
|
} & Record<string, unknown>) | ({
|
|
199
|
+
id: string | number | null;
|
|
199
200
|
error: {
|
|
200
201
|
message: string;
|
|
201
202
|
code: -32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">;
|
|
202
203
|
data?: unknown;
|
|
203
204
|
} & Record<string, unknown>;
|
|
204
|
-
id: string | number | null;
|
|
205
205
|
jsonrpc: "2.0";
|
|
206
206
|
} & Record<string, unknown>), ({
|
|
207
207
|
id: string | number;
|
|
208
208
|
jsonrpc: "2.0";
|
|
209
209
|
result: unknown;
|
|
210
210
|
} & Record<string, unknown>) | ({
|
|
211
|
+
id: string | number | null;
|
|
211
212
|
error: {
|
|
212
213
|
message: string;
|
|
213
214
|
code: number;
|
|
214
215
|
data?: unknown;
|
|
215
216
|
} & Record<string, unknown>;
|
|
216
|
-
id: string | number | null;
|
|
217
217
|
jsonrpc: "2.0";
|
|
218
218
|
} & Record<string, unknown>), "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
219
219
|
id: string | number;
|
|
@@ -228,20 +228,20 @@ export declare const JsonrpcResponseOrError: import("@fuzdev/fuz_schema/schema.t
|
|
|
228
228
|
id: 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>]>;
|
|
229
229
|
result: import("@fuzdev/fuz_schema/schema.ts").Schema<unknown, unknown, "unknown", undefined>;
|
|
230
230
|
}>, import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
231
|
+
id: string | number | null;
|
|
231
232
|
error: {
|
|
232
233
|
message: string;
|
|
233
234
|
code: -32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">;
|
|
234
235
|
data?: unknown;
|
|
235
236
|
} & Record<string, unknown>;
|
|
236
|
-
id: string | number | null;
|
|
237
237
|
jsonrpc: "2.0";
|
|
238
238
|
} & Record<string, unknown>, {
|
|
239
|
+
id: string | number | null;
|
|
239
240
|
error: {
|
|
240
241
|
message: string;
|
|
241
242
|
code: number;
|
|
242
243
|
data?: unknown;
|
|
243
244
|
} & Record<string, unknown>;
|
|
244
|
-
id: string | number | null;
|
|
245
245
|
jsonrpc: "2.0";
|
|
246
246
|
} & Record<string, unknown>, "loose_object", {
|
|
247
247
|
jsonrpc: import("@fuzdev/fuz_schema/schema.ts").Schema<"2.0", "2.0", "literal", "2.0">;
|
|
@@ -255,7 +255,7 @@ export declare const JsonrpcResponseOrError: import("@fuzdev/fuz_schema/schema.t
|
|
|
255
255
|
code: number;
|
|
256
256
|
data?: unknown;
|
|
257
257
|
} & Record<string, unknown>, "loose_object", {
|
|
258
|
-
code: import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603, -32700 | -32600 | -32601 | -32602 | -32603, "one_of", readonly [-32700, -32600, -32601, -32602, -32603]>, import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "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<"
|
|
258
|
+
code: import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603, -32700 | -32600 | -32601 | -32602 | -32603, "one_of", readonly [-32700, -32600, -32601, -32602, -32603]>, import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "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">)[]> & {
|
|
259
259
|
readonly '~types'?: {
|
|
260
260
|
readonly input: number;
|
|
261
261
|
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>;
|
|
@@ -183,7 +183,7 @@ export const classify_jsonrpc_message = (json) => {
|
|
|
183
183
|
id,
|
|
184
184
|
error: jsonrpc_error_messages.invalid_request(dev_only(() => {
|
|
185
185
|
const parsed = parse(JsonrpcRequest, frame);
|
|
186
|
-
return { issues: parsed.ok ? [] : to_wire_issues(parsed.issues
|
|
186
|
+
return { issues: parsed.ok ? [] : to_wire_issues(parsed.issues) };
|
|
187
187
|
}))
|
|
188
188
|
};
|
|
189
189
|
};
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
*
|
|
24
24
|
* @module
|
|
25
25
|
*/
|
|
26
|
+
import { type SchemaIssue } from '@fuzdev/fuz_schema/schema.ts';
|
|
26
27
|
import { type RestErrorDef } from './error_schemas.js';
|
|
27
28
|
import type { RouteErrorMap } from './route_errors.js';
|
|
28
|
-
import { type AnyIssue } from '../schema_issues.js';
|
|
29
29
|
/**
|
|
30
30
|
* The errors any route can answer with and none declares: the catch layer's
|
|
31
31
|
* 500 `internal_error` for a generic throw, and a failed pool checkout's 503
|
|
@@ -56,7 +56,7 @@ export type RouteErrorCheck = {
|
|
|
56
56
|
} | {
|
|
57
57
|
ok: false;
|
|
58
58
|
kind: 'schema_mismatch';
|
|
59
|
-
issues: Array<
|
|
59
|
+
issues: Array<SchemaIssue>;
|
|
60
60
|
};
|
|
61
61
|
/**
|
|
62
62
|
* Check a JSON error body against its route's error map.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route_error_check.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/route_error_check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;
|
|
1
|
+
{"version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d,MAAM,MAAM,KACV,CAAC,GAAG,SAMN,CAAC"}
|
|
@@ -23,10 +23,9 @@
|
|
|
23
23
|
*
|
|
24
24
|
* @module
|
|
25
25
|
*/
|
|
26
|
-
import { is } from '@fuzdev/fuz_schema/schema.ts';
|
|
26
|
+
import { is, parse } from '@fuzdev/fuz_schema/schema.ts';
|
|
27
27
|
import { REST_INTERNAL_ERROR, REST_SERVICE_UNAVAILABLE } from './error_schemas.js';
|
|
28
28
|
import { is_jsonrpc_error_response } from './jsonrpc_helpers.js';
|
|
29
|
-
import { parse_any } from '../schema_issues.js';
|
|
30
29
|
/**
|
|
31
30
|
* The errors any route can answer with and none declares: the catch layer's
|
|
32
31
|
* 500 `internal_error` for a generic throw, and a failed pool checkout's 503
|
|
@@ -71,7 +70,7 @@ export const check_route_error = (errors, status, body, jsonrpc) => {
|
|
|
71
70
|
const schema = errors.schemas[status];
|
|
72
71
|
if (!schema)
|
|
73
72
|
return { ok: false, kind: 'undeclared_status' };
|
|
74
|
-
const result =
|
|
73
|
+
const result = parse(schema, body);
|
|
75
74
|
return result.ok ? { ok: true } : { ok: false, kind: 'schema_mismatch', issues: result.issues };
|
|
76
75
|
};
|
|
77
76
|
/**
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @module
|
|
13
13
|
*/
|
|
14
|
+
import type { AnySchema } from '@fuzdev/fuz_schema/schema.ts';
|
|
14
15
|
import type { RouteAuth } from './auth_shape.js';
|
|
15
16
|
import type { RouteMethod } from './route_spec.js';
|
|
16
17
|
import { type ErrorSchemas, type RestErrorDef } from './error_schemas.js';
|
|
17
18
|
import type { MiddlewareSpec } from './middleware_spec.js';
|
|
18
19
|
import type { RateLimitKey } from '../rate_limiter.js';
|
|
19
|
-
import type { ValidationSchema } from '../schema_issues.js';
|
|
20
20
|
/**
|
|
21
21
|
* A route's error map: every error definition the route can answer with, and
|
|
22
22
|
* the status map they group into. Built by `resolve_route_error_map`, and read by
|
|
@@ -38,9 +38,9 @@ export interface RouteErrorMapSpec {
|
|
|
38
38
|
readonly method: RouteMethod;
|
|
39
39
|
readonly path: string;
|
|
40
40
|
readonly auth: RouteAuth;
|
|
41
|
-
readonly input:
|
|
42
|
-
readonly params?:
|
|
43
|
-
readonly query?:
|
|
41
|
+
readonly input: AnySchema;
|
|
42
|
+
readonly params?: AnySchema;
|
|
43
|
+
readonly query?: AnySchema;
|
|
44
44
|
readonly rate_limit?: RateLimitKey;
|
|
45
45
|
readonly errors?: ReadonlyArray<RestErrorDef>;
|
|
46
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route_errors.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/route_errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"route_errors.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/route_errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAIN,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IAC3C,gGAAgG;IAChG,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;CAC/B;AAED,4DAA4D;AAC5D,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;CAC9C;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,GACnC,MAAM,iBAAiB,EACvB,mBAAmB,aAAa,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,YAAY,GAAG,QAAQ,CAAC,CAAC,GAAG,IAAI,KAC7F,aAiBF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACxC,aAAa,aAAa,CAAC,iBAAiB,CAAC,EAC7C,mBAAmB,aAAa,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,YAAY,GAAG,QAAQ,CAAC,CAAC,GAAG,IAAI,KAC7F,GAAG,CAAC,MAAM,EAAE,aAAa,CAM3B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,GAC/B,kBAAkB,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,IAAI,GAAG,SAAS,EACvE,MAAM,iBAAiB,KACrB,aAQF,CAAC"}
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A route's error map: every error definition it can answer with — derived
|
|
3
|
-
* from its slots (`derive_route_errors`), declared by each middleware layer
|
|
4
|
-
* that runs on it, and its own `errors` — and the status map they group into.
|
|
5
|
-
*
|
|
6
|
-
* Built once per app (`resolve_app_route_error_maps`, carried as
|
|
7
|
-
* `AppSurfaceSpec.route_error_maps`) and read by every reader of a route's
|
|
8
|
-
* declared errors: the surface, the DEV error check, the test helpers, error
|
|
9
|
-
* coverage, and the attack-surface suite. The maps are keyed `METHOD path`
|
|
10
|
-
* (`format_route_key`).
|
|
11
|
-
*
|
|
12
|
-
* @module
|
|
13
|
-
*/
|
|
14
1
|
import { dedupe_rest_errors, derive_route_errors, to_error_schemas } from './error_schemas.js';
|
|
15
2
|
import { is_null_schema, middleware_spec_applies } from './schema_helpers.js';
|
|
16
3
|
import { format_route_key } from './surface_query.js';
|
|
@@ -9,16 +9,15 @@
|
|
|
9
9
|
* which checks the handler's results against the route.
|
|
10
10
|
*
|
|
11
11
|
* Input/output schemas align with SAES `ActionSpec` conventions, and each is
|
|
12
|
-
* a
|
|
13
|
-
* - `input`: the request body schema (`
|
|
12
|
+
* a `@fuzdev/fuz_schema` schema (`AnySchema`):
|
|
13
|
+
* - `input`: the request body schema (`literal(null)` for no body)
|
|
14
14
|
* - `output`: the success response body schema
|
|
15
|
-
* - a strict object for inputs (reject unknown keys): `
|
|
15
|
+
* - a strict object for inputs (reject unknown keys): `object`
|
|
16
16
|
*
|
|
17
17
|
* @module
|
|
18
18
|
*/
|
|
19
19
|
import type { Context, Hono, MiddlewareHandler } from 'hono';
|
|
20
|
-
import type
|
|
21
|
-
import { type AnySchema } from '@fuzdev/fuz_schema/schema.ts';
|
|
20
|
+
import { type AnySchema, type InferInput, type Infer } from '@fuzdev/fuz_schema/schema.ts';
|
|
22
21
|
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
23
22
|
import type { Db } from '../db/db.js';
|
|
24
23
|
import { type RestErrorDef, type REST_AUTHENTICATION_REQUIRED, type REST_CREDENTIAL_TYPE_REQUIRED, type REST_INSUFFICIENT_PERMISSIONS, type REST_INTERNAL_ERROR, type REST_RATE_LIMIT_EXCEEDED, type REST_SERVICE_UNAVAILABLE, type REST_TOKEN_SCOPE_REQUIRED } from './error_schemas.js';
|
|
@@ -26,7 +25,6 @@ import type { RateLimitKey } from '../rate_limiter.js';
|
|
|
26
25
|
import type { MiddlewareSpec } from './middleware_spec.js';
|
|
27
26
|
import type { ReadonlyJson, RouteFailOf, RouteOk, RouteRaw, RouteResult } from './route_result.js';
|
|
28
27
|
import { type RouteAuth } from './auth_shape.js';
|
|
29
|
-
import { type ValidationInput, type ValidationOutput, type ValidationSchema } from '../schema_issues.js';
|
|
30
28
|
/**
|
|
31
29
|
* Two-phase auth guard set returned by `AuthGuardResolver`.
|
|
32
30
|
*
|
|
@@ -127,9 +125,9 @@ declare const ROUTE_SPEC_BRAND: unique symbol;
|
|
|
127
125
|
* A single route definition — the unit of the surface map.
|
|
128
126
|
*
|
|
129
127
|
* `input` and `output` schemas align with SAES `ActionSpec` naming. Every
|
|
130
|
-
* schema field takes a
|
|
131
|
-
* `
|
|
132
|
-
*
|
|
128
|
+
* schema field takes a `@fuzdev/fuz_schema` schema, validated through
|
|
129
|
+
* `parse`. Use `literal(null)` for routes with no request body (GET, DELETE
|
|
130
|
+
* without body).
|
|
133
131
|
*/
|
|
134
132
|
export interface RouteSpec {
|
|
135
133
|
method: RouteMethod;
|
|
@@ -139,30 +137,29 @@ export interface RouteSpec {
|
|
|
139
137
|
handler: RouteHandler;
|
|
140
138
|
description: string;
|
|
141
139
|
/**
|
|
142
|
-
* URL path parameter schema. Use `
|
|
143
|
-
* `
|
|
144
|
-
*
|
|
140
|
+
* URL path parameter schema. Use an `object` with string fields matching
|
|
141
|
+
* `:param` segments. It must be an object schema under any wrappers
|
|
142
|
+
* (`get_schema_entries`);
|
|
145
143
|
* `apply_route_specs` throws on one that isn't.
|
|
146
144
|
*
|
|
147
145
|
* REST-only — actions dispatch through a single JSON-RPC endpoint and encode
|
|
148
146
|
* everything in `input`, so `params` doesn't appear on `ActionSpec`.
|
|
149
147
|
*/
|
|
150
|
-
params?:
|
|
148
|
+
params?: AnySchema;
|
|
151
149
|
/**
|
|
152
|
-
* URL query parameter schema. Use `
|
|
153
|
-
*
|
|
154
|
-
* schema, as for `params`.
|
|
150
|
+
* URL query parameter schema. Use an `object` with string fields; it must
|
|
151
|
+
* be an object schema, as for `params`.
|
|
155
152
|
*/
|
|
156
|
-
query?:
|
|
157
|
-
/** Request body schema. Use `
|
|
158
|
-
input:
|
|
153
|
+
query?: AnySchema;
|
|
154
|
+
/** Request body schema. Use `literal(null)` for routes with no body. */
|
|
155
|
+
input: AnySchema;
|
|
159
156
|
/** Success response body schema. */
|
|
160
|
-
output:
|
|
157
|
+
output: AnySchema;
|
|
161
158
|
/**
|
|
162
159
|
* Marks a route whose request and/or response carries **raw bytes or a
|
|
163
160
|
* streaming protocol** rather than JSON — git smart-HTTP, file-store
|
|
164
161
|
* binary uploads/downloads, raw internal callbacks. Disambiguates the
|
|
165
|
-
* overloaded `input:
|
|
162
|
+
* overloaded `input: literal(null)`, which otherwise can't distinguish "no
|
|
166
163
|
* body" (`GET /health`) from "raw bytes" (a binary upload).
|
|
167
164
|
*
|
|
168
165
|
* A `raw_body` `POST` takes any `Content-Type` a browser can't send
|
|
@@ -267,9 +264,9 @@ export type RouteHandlerDerivedErrors<TAuth extends RouteAuth, TRateLimit> = (TA
|
|
|
267
264
|
* allows — its `errors`, the derived ones a handler may give
|
|
268
265
|
* (`RouteHandlerDerivedErrors`), and the catch layers' (`RouteAlwaysErrors`).
|
|
269
266
|
*/
|
|
270
|
-
export type RouteHandlerResult<TErrors extends ReadonlyArray<RestErrorDef>, TOutput extends
|
|
267
|
+
export type RouteHandlerResult<TErrors extends ReadonlyArray<RestErrorDef>, TOutput extends AnySchema, TAuth extends RouteAuth, TRateLimit> = RouteOk<ReadonlyJson<InferInput<TOutput>>> | RouteRaw | RouteFailOf<TErrors[number] | RouteAlwaysErrors | RouteHandlerDerivedErrors<TAuth, TRateLimit>>;
|
|
271
268
|
/** A route handler checked against its route; see `RouteHandlerResult`. */
|
|
272
|
-
export type TypedRouteHandler<TErrors extends ReadonlyArray<RestErrorDef>, TOutput extends
|
|
269
|
+
export type TypedRouteHandler<TErrors extends ReadonlyArray<RestErrorDef>, TOutput extends AnySchema, TAuth extends RouteAuth, TRateLimit> = (c: Context, route: RouteContext) => RouteHandlerResult<TErrors, TOutput, TAuth, TRateLimit> | Promise<RouteHandlerResult<TErrors, TOutput, TAuth, TRateLimit>>;
|
|
273
270
|
/** The fields of a route that carry no type parameter. */
|
|
274
271
|
type RouteShapePlain = Omit<RouteSpec, 'handler' | 'errors' | 'output' | 'auth' | 'rate_limit' | typeof ROUTE_SPEC_BRAND>;
|
|
275
272
|
/**
|
|
@@ -277,7 +274,7 @@ type RouteShapePlain = Omit<RouteSpec, 'handler' | 'errors' | 'output' | 'auth'
|
|
|
277
274
|
* kept: what `define_route_shape` returns and `attach_route_handler` takes,
|
|
278
275
|
* the hono-free half of a route a cross-process suite builds its surface from.
|
|
279
276
|
*/
|
|
280
|
-
export type RouteShape<TErrors extends ReadonlyArray<RestErrorDef> = ReadonlyArray<RestErrorDef>, TOutput extends
|
|
277
|
+
export type RouteShape<TErrors extends ReadonlyArray<RestErrorDef> = ReadonlyArray<RestErrorDef>, TOutput extends AnySchema = AnySchema, TAuth extends RouteAuth = RouteAuth, TRateLimit extends RateLimitKey | undefined = RateLimitKey | undefined> = RouteShapePlain & {
|
|
281
278
|
auth: TAuth;
|
|
282
279
|
output: TOutput;
|
|
283
280
|
errors?: TErrors;
|
|
@@ -299,7 +296,7 @@ export type KnownRouteErrors<TErrors extends ReadonlyArray<RestErrorDef>> = stri
|
|
|
299
296
|
* @param spec - the route, its handler returning `route_ok`, `route_fail`, or `route_raw`
|
|
300
297
|
* @returns `spec`
|
|
301
298
|
*/
|
|
302
|
-
export declare const define_route: <const TErrors extends ReadonlyArray<RestErrorDef> = [], TOutput extends
|
|
299
|
+
export declare const define_route: <const TErrors extends ReadonlyArray<RestErrorDef> = [], TOutput extends AnySchema = AnySchema, const TAuth extends RouteAuth = RouteAuth, TRateLimit extends RateLimitKey | undefined = undefined>(spec: RouteShape<TErrors, TOutput, TAuth, TRateLimit> & {
|
|
303
300
|
errors?: KnownRouteErrors<TErrors>;
|
|
304
301
|
handler: TypedRouteHandler<TErrors, TOutput, TAuth, TRateLimit>;
|
|
305
302
|
}) => RouteSpec;
|
|
@@ -310,7 +307,7 @@ export declare const define_route: <const TErrors extends ReadonlyArray<RestErro
|
|
|
310
307
|
* @param shape - the route without `handler`
|
|
311
308
|
* @returns `shape`
|
|
312
309
|
*/
|
|
313
|
-
export declare const define_route_shape: <const TErrors extends ReadonlyArray<RestErrorDef> = [], TOutput extends
|
|
310
|
+
export declare const define_route_shape: <const TErrors extends ReadonlyArray<RestErrorDef> = [], TOutput extends AnySchema = AnySchema, const TAuth extends RouteAuth = RouteAuth, TRateLimit extends RateLimitKey | undefined = undefined>(shape: RouteShape<TErrors, TOutput, TAuth, TRateLimit> & {
|
|
314
311
|
errors?: KnownRouteErrors<TErrors>;
|
|
315
312
|
}) => RouteShape<TErrors, TOutput, TAuth, TRateLimit>;
|
|
316
313
|
/**
|
|
@@ -321,7 +318,7 @@ export declare const define_route_shape: <const TErrors extends ReadonlyArray<Re
|
|
|
321
318
|
* @param handler - the handler, returning `route_ok`, `route_fail`, or `route_raw`
|
|
322
319
|
* @returns a new spec, `shape` with `handler`
|
|
323
320
|
*/
|
|
324
|
-
export declare const attach_route_handler: <TErrors extends ReadonlyArray<RestErrorDef>, TOutput extends
|
|
321
|
+
export declare const attach_route_handler: <TErrors extends ReadonlyArray<RestErrorDef>, TOutput extends AnySchema, TAuth extends RouteAuth, TRateLimit extends RateLimitKey | undefined>(shape: RouteShape<TErrors, TOutput, TAuth, TRateLimit> & {
|
|
325
322
|
errors?: KnownRouteErrors<TErrors>;
|
|
326
323
|
}, handler: TypedRouteHandler<TErrors, TOutput, TAuth, TRateLimit>) => RouteSpec;
|
|
327
324
|
/**
|
|
@@ -339,8 +336,8 @@ export declare const to_route_response: (c: Context, result: RouteResult) => Res
|
|
|
339
336
|
* Get validated input from the Hono context.
|
|
340
337
|
*
|
|
341
338
|
* Call after the input validation middleware has run. Pass the route's
|
|
342
|
-
* `input` schema
|
|
343
|
-
* directly (`
|
|
339
|
+
* `input` schema to infer the typed shape
|
|
340
|
+
* directly (`Infer`):
|
|
344
341
|
*
|
|
345
342
|
* ```ts
|
|
346
343
|
* const input = get_route_input(c, my_route_spec.input);
|
|
@@ -352,7 +349,7 @@ export declare const to_route_response: (c: Context, result: RouteResult) => Res
|
|
|
352
349
|
* const input = get_route_input<MyInput>(c);
|
|
353
350
|
* ```
|
|
354
351
|
*/
|
|
355
|
-
export declare function get_route_input<S extends
|
|
352
|
+
export declare function get_route_input<S extends AnySchema>(c: Context, schema: S): Infer<S>;
|
|
356
353
|
export declare function get_route_input<T = unknown>(c: Context): T;
|
|
357
354
|
/**
|
|
358
355
|
* Get validated URL path params from the Hono context.
|
|
@@ -361,7 +358,7 @@ export declare function get_route_input<T = unknown>(c: Context): T;
|
|
|
361
358
|
* `params` schema to infer the typed shape, or supply an explicit type
|
|
362
359
|
* argument. See `get_route_input` for the two call shapes.
|
|
363
360
|
*/
|
|
364
|
-
export declare function get_route_params<S extends
|
|
361
|
+
export declare function get_route_params<S extends AnySchema>(c: Context, schema: S): Infer<S>;
|
|
365
362
|
export declare function get_route_params<T = unknown>(c: Context): T;
|
|
366
363
|
/**
|
|
367
364
|
* Get validated URL query params from the Hono context.
|
|
@@ -370,7 +367,7 @@ export declare function get_route_params<T = unknown>(c: Context): T;
|
|
|
370
367
|
* `query` schema to infer the typed shape, or supply an explicit type
|
|
371
368
|
* argument. See `get_route_input` for the two call shapes.
|
|
372
369
|
*/
|
|
373
|
-
export declare function get_route_query<S extends
|
|
370
|
+
export declare function get_route_query<S extends AnySchema>(c: Context, schema: S): Infer<S>;
|
|
374
371
|
export declare function get_route_query<T = unknown>(c: Context): T;
|
|
375
372
|
/**
|
|
376
373
|
* Apply named middleware specs to a Hono app.
|
|
@@ -416,10 +413,10 @@ export declare const apply_middleware_specs: (app: Hono, specs: Array<Middleware
|
|
|
416
413
|
* registries (`compile_action_registry`) share the same helper with
|
|
417
414
|
* `input` only — `ActionSpec` has no `query` shape.
|
|
418
415
|
*
|
|
419
|
-
* Every schema slot (`params`, `query`, `input`, `output`) must hold a
|
|
420
|
-
*
|
|
416
|
+
* Every schema slot (`params`, `query`, `input`, `output`) must hold a
|
|
417
|
+
* `@fuzdev/fuz_schema` schema (`assert_validation_schema`), and every
|
|
421
418
|
* `errors` entry an error definition (`rest_error`): anything else throws
|
|
422
|
-
* naming the route and the slot. A
|
|
419
|
+
* naming the route and the slot. A `params` or `query`
|
|
423
420
|
* must be an object schema (`get_schema_entries`), as the path params and
|
|
424
421
|
* query string are an object: one that isn't throws naming the route.
|
|
425
422
|
*
|
|
@@ -431,7 +428,7 @@ export declare const apply_middleware_specs: (app: Hono, specs: Array<Middleware
|
|
|
431
428
|
* @param authorize - optional authorization phase; runs after the pre-authorization guards and before the post-authorization guards
|
|
432
429
|
* @param db - used for transaction wrapping and `RouteContext`
|
|
433
430
|
* @mutates `app`
|
|
434
|
-
* @throws Error if two specs share the same `method` + `path` (each combination must be unique), if a schema slot holds a value
|
|
431
|
+
* @throws Error if two specs share the same `method` + `path` (each combination must be unique), if a schema slot holds a value that is no schema or an `errors` entry is not a definition, if any spec violates a cross-axis auth invariant or the actor-acting biconditional, or if a `params` or `query` is not an object schema
|
|
435
432
|
*/
|
|
436
433
|
export declare const apply_route_specs: (app: Hono, specs: Array<RouteSpec>, resolve_auth_guards: AuthGuardResolver, log: Logger, db: Db, authorize?: AuthorizationHandler) => void;
|
|
437
434
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route_spec.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/route_spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAW,IAAI,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"route_spec.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/route_spec.ts"],"names":[],"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