@fuzdev/fuz_app 0.162.0 → 0.164.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/README.md +2 -1
- package/dist/actions/action_event_data.d.ts +1 -1
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +4 -0
- package/dist/actions/action_spec.d.ts +3 -3
- package/dist/actions/action_spec.d.ts.map +1 -1
- package/dist/auth/CLAUDE.md +39 -36
- package/dist/auth/account_action_specs.d.ts +441 -115
- package/dist/auth/account_action_specs.d.ts.map +1 -1
- package/dist/auth/account_action_specs.js +47 -46
- package/dist/auth/account_route_schema.d.ts +98 -62
- package/dist/auth/account_route_schema.d.ts.map +1 -1
- package/dist/auth/account_route_schema.js +45 -45
- package/dist/auth/account_routes.js +1 -1
- package/dist/auth/account_schema.d.ts +54 -27
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +16 -18
- package/dist/auth/admin_action_specs.d.ts +76 -76
- package/dist/auth/admin_action_specs.js +2 -4
- package/dist/auth/admin_actions.d.ts +4 -4
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +3 -3
- package/dist/auth/all_cell_actions.d.ts +3 -3
- package/dist/auth/all_cell_actions.d.ts.map +1 -1
- package/dist/auth/all_cell_actions.js +1 -1
- package/dist/auth/api_token.d.ts +4 -4
- package/dist/auth/api_token.d.ts.map +1 -1
- package/dist/auth/api_token.js +3 -3
- package/dist/auth/audit_log_route_schema.d.ts +1 -1
- package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_route_schema.js +4 -5
- package/dist/auth/audit_log_schema.d.ts +46 -66
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +34 -30
- package/dist/auth/bootstrap_route_schema.d.ts +146 -52
- package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
- package/dist/auth/bootstrap_route_schema.js +33 -19
- package/dist/auth/cell_grant_action_specs.d.ts +1 -1
- package/dist/auth/cell_grant_action_specs.js +1 -1
- package/dist/auth/cell_grant_actions.d.ts +4 -4
- package/dist/auth/cell_grant_actions.d.ts.map +1 -1
- package/dist/auth/cell_grant_actions.js +1 -1
- package/dist/auth/credential_type_schema.d.ts +16 -29
- package/dist/auth/credential_type_schema.d.ts.map +1 -1
- package/dist/auth/credential_type_schema.js +14 -18
- package/dist/auth/daemon_token.d.ts +4 -4
- package/dist/auth/daemon_token.d.ts.map +1 -1
- package/dist/auth/daemon_token.js +3 -3
- package/dist/auth/daemon_token_middleware.d.ts +1 -1
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +5 -5
- package/dist/auth/grant_path_schema.d.ts +15 -29
- package/dist/auth/grant_path_schema.d.ts.map +1 -1
- package/dist/auth/grant_path_schema.js +13 -17
- package/dist/auth/middleware.js +4 -4
- package/dist/auth/migrations.js +1 -1
- package/dist/auth/name_schema.d.ts +7 -6
- package/dist/auth/name_schema.d.ts.map +1 -1
- package/dist/auth/name_schema.js +8 -9
- package/dist/auth/password.d.ts +15 -7
- package/dist/auth/password.d.ts.map +1 -1
- package/dist/auth/password.js +16 -9
- package/dist/auth/role_grant_offer_action_specs.d.ts +2 -2
- package/dist/auth/role_grant_offer_action_specs.js +2 -2
- package/dist/auth/role_grant_offer_actions.d.ts +4 -4
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +3 -3
- package/dist/auth/role_grant_offer_notifications.js +2 -2
- package/dist/auth/role_grant_offer_schema.d.ts +2 -2
- package/dist/auth/role_grant_offer_schema.js +2 -2
- package/dist/auth/role_schema.d.ts +47 -55
- package/dist/auth/role_schema.d.ts.map +1 -1
- package/dist/auth/role_schema.js +29 -35
- package/dist/auth/scope_kind_schema.d.ts +22 -26
- package/dist/auth/scope_kind_schema.d.ts.map +1 -1
- package/dist/auth/scope_kind_schema.js +19 -19
- package/dist/auth/self_service_role_action_specs.js +1 -1
- package/dist/auth/self_service_role_actions.d.ts +6 -6
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +7 -6
- package/dist/auth/signup_route_schema.d.ts +71 -21
- package/dist/auth/signup_route_schema.d.ts.map +1 -1
- package/dist/auth/signup_route_schema.js +17 -19
- package/dist/auth/standard_rpc_actions.d.ts +1 -1
- package/dist/auth/standard_rpc_actions.js +1 -1
- package/dist/auth/token_lifetime.d.ts +33 -9
- package/dist/auth/token_lifetime.d.ts.map +1 -1
- package/dist/auth/token_lifetime.js +8 -7
- package/dist/auth/token_scope.d.ts +99 -25
- package/dist/auth/token_scope.d.ts.map +1 -1
- package/dist/auth/token_scope.js +57 -35
- package/dist/db/CLAUDE.md +2 -1
- package/dist/db/file_fact_url.d.ts +11 -6
- package/dist/db/file_fact_url.d.ts.map +1 -1
- package/dist/db/file_fact_url.js +5 -5
- package/dist/db/schema_ready.d.ts +0 -5
- package/dist/db/schema_ready.d.ts.map +1 -1
- package/dist/db/schema_ready.js +0 -5
- package/dist/http/CLAUDE.md +104 -71
- package/dist/http/auth_shape.d.ts +48 -29
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/auth_shape.js +12 -85
- package/dist/http/body_limit.d.ts +12 -0
- package/dist/http/body_limit.d.ts.map +1 -1
- package/dist/http/body_limit.js +15 -0
- package/dist/http/body_limit_schema.d.ts +20 -0
- package/dist/http/body_limit_schema.d.ts.map +1 -0
- package/dist/http/body_limit_schema.js +20 -0
- package/dist/http/common_routes.d.ts +1 -1
- package/dist/http/common_routes.d.ts.map +1 -1
- package/dist/http/common_routes.js +11 -14
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +59 -69
- package/dist/http/dev_route_error_check.d.ts +70 -0
- package/dist/http/dev_route_error_check.d.ts.map +1 -0
- package/dist/http/dev_route_error_check.js +119 -0
- package/dist/http/error_schemas.d.ts +365 -189
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +256 -149
- package/dist/http/health_schema.d.ts +10 -6
- package/dist/http/health_schema.d.ts.map +1 -1
- package/dist/http/health_schema.js +3 -3
- package/dist/http/middleware_spec.d.ts +8 -3
- package/dist/http/middleware_spec.d.ts.map +1 -1
- package/dist/http/origin.d.ts +12 -43
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +10 -6
- package/dist/http/route_error_check.d.ts +158 -0
- package/dist/http/route_error_check.d.ts.map +1 -0
- package/dist/http/route_error_check.js +247 -0
- package/dist/http/route_errors.d.ts +80 -0
- package/dist/http/route_errors.d.ts.map +1 -0
- package/dist/http/route_errors.js +83 -0
- package/dist/http/route_spec.d.ts +33 -17
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +48 -62
- package/dist/http/schema_helpers.d.ts +0 -33
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +0 -45
- package/dist/http/surface.d.ts +19 -12
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +25 -38
- package/dist/http/surface_query.d.ts +11 -2
- package/dist/http/surface_query.d.ts.map +1 -1
- package/dist/http/surface_query.js +7 -1
- package/dist/primitive_schemas.d.ts +2 -19
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas.js +2 -20
- package/dist/primitive_schemas_fuz.d.ts +39 -5
- package/dist/primitive_schemas_fuz.d.ts.map +1 -1
- package/dist/primitive_schemas_fuz.js +36 -7
- package/dist/rate_limiter.d.ts +13 -0
- package/dist/rate_limiter.d.ts.map +1 -1
- package/dist/rate_limiter.js +20 -2
- package/dist/schema_issues.d.ts +29 -11
- package/dist/schema_issues.d.ts.map +1 -1
- package/dist/schema_issues.js +11 -10
- package/dist/schema_meta.d.ts +8 -1
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/schema_meta.js +2 -1
- package/dist/server/app_server.d.ts +3 -1
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +24 -10
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +8 -31
- package/dist/server/surface_route.d.ts.map +1 -1
- package/dist/server/surface_route.js +5 -6
- package/dist/server/x_accel.d.ts +12 -7
- package/dist/server/x_accel.d.ts.map +1 -1
- package/dist/server/x_accel.js +7 -9
- package/dist/testing/CLAUDE.md +55 -44
- package/dist/testing/admin_integration.d.ts +3 -3
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +2 -2
- package/dist/testing/adversarial_404.d.ts +4 -18
- package/dist/testing/adversarial_404.d.ts.map +1 -1
- package/dist/testing/adversarial_404.js +19 -51
- package/dist/testing/adversarial_headers.d.ts +3 -4
- package/dist/testing/adversarial_headers.d.ts.map +1 -1
- package/dist/testing/adversarial_headers.js +8 -6
- package/dist/testing/adversarial_input.d.ts.map +1 -1
- package/dist/testing/adversarial_input.js +18 -17
- package/dist/testing/assertions.d.ts +33 -11
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/assertions.js +52 -12
- package/dist/testing/attack_surface.d.ts +5 -35
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/attack_surface.js +29 -91
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +2 -1
- package/dist/testing/cross_backend/action_manifest.d.ts +126 -56
- package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest.js +11 -11
- package/dist/testing/cross_backend/action_manifest_parity.d.ts +1 -1
- package/dist/testing/cross_backend/action_manifest_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.js +2 -1
- package/dist/testing/cross_backend/conformance_table.js +1 -1
- package/dist/testing/cross_backend/default_spine_surface.d.ts +2 -2
- package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_spine_surface.js +2 -2
- package/dist/testing/cross_backend/fact_serving.js +3 -3
- package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/identity_parity.js +39 -6
- package/dist/testing/cross_backend/origin_conformance.d.ts +278 -102
- package/dist/testing/cross_backend/origin_conformance.d.ts.map +1 -1
- package/dist/testing/cross_backend/origin_conformance.js +21 -21
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +3 -3
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.js +7 -1
- package/dist/testing/cross_backend/setup.d.ts +14 -1
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +68 -48
- package/dist/testing/cross_backend/spine_suites.d.ts +3 -3
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/standard.d.ts +4 -4
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_origin_check.d.ts +147 -71
- package/dist/testing/cross_backend/testing_origin_check.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_origin_check.js +16 -13
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +70 -27
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/token_lifetime.d.ts.map +1 -1
- package/dist/testing/cross_backend/token_lifetime.js +34 -1
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +5 -4
- package/dist/testing/error_coverage.d.ts +24 -34
- package/dist/testing/error_coverage.d.ts.map +1 -1
- package/dist/testing/error_coverage.js +46 -89
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +6 -14
- package/dist/testing/integration_helpers.d.ts +37 -9
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +86 -40
- package/dist/testing/middleware.d.ts +3 -5
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +5 -4
- package/dist/testing/rate_limiting.d.ts +1 -1
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +5 -4
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/round_trip.js +5 -3
- package/dist/testing/schema_generators.d.ts +10 -3
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +23 -11
- package/dist/testing/stubs.d.ts +10 -1
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +15 -5
- package/dist/testing/surface_invariants.d.ts +36 -115
- package/dist/testing/surface_invariants.d.ts.map +1 -1
- package/dist/testing/surface_invariants.js +106 -269
- package/dist/testing/token_scope_fixtures.d.ts +24 -0
- package/dist/testing/token_scope_fixtures.d.ts.map +1 -0
- package/dist/testing/token_scope_fixtures.js +49 -0
- 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 +13 -12
- package/dist/ui/BootstrapForm.svelte +4 -2
- package/dist/ui/BootstrapForm.svelte.d.ts.map +1 -1
- package/dist/ui/CLAUDE.md +4 -2
- package/dist/ui/SignupForm.svelte +4 -2
- package/dist/ui/SignupForm.svelte.d.ts.map +1 -1
- package/dist/ui/auth_state.svelte.d.ts.map +1 -1
- package/dist/ui/auth_state.svelte.js +2 -8
- package/dist/ui/backend_probe.svelte.js +3 -3
- package/dist/ui/table_state.svelte.d.ts.map +1 -1
- package/dist/ui/table_state.svelte.js +1 -8
- package/dist/ui/ui_fetch.d.ts +12 -2
- package/dist/ui/ui_fetch.d.ts.map +1 -1
- package/dist/ui/ui_fetch.js +22 -4
- package/package.json +1 -1
- package/dist/auth/audit_log_schema_fuz.d.ts +0 -53
- package/dist/auth/audit_log_schema_fuz.d.ts.map +0 -1
- package/dist/auth/audit_log_schema_fuz.js +0 -50
- package/dist/auth/role_schema_fuz.d.ts +0 -30
- package/dist/auth/role_schema_fuz.d.ts.map +0 -1
- package/dist/auth/role_schema_fuz.js +0 -30
- package/dist/auth/scope_kind_schema_fuz.d.ts +0 -31
- package/dist/auth/scope_kind_schema_fuz.d.ts.map +0 -1
- package/dist/auth/scope_kind_schema_fuz.js +0 -31
package/dist/ui/CLAUDE.md
CHANGED
|
@@ -694,8 +694,10 @@ format_scope, global_label)` helper — `global_label = null` renders no
|
|
|
694
694
|
one signal, once aborted, would fail every later probe.
|
|
695
695
|
- `ui_fetch.ts` — `ui_fetch(input, init?)` wraps `fetch` with
|
|
696
696
|
`credentials: 'include'` for cookie-based session auth;
|
|
697
|
-
`parse_response_error(response, fallback?)` safely extracts
|
|
698
|
-
|
|
697
|
+
`parse_response_error(response, fallback?)` safely extracts the text to
|
|
698
|
+
show even from non-JSON responses (HTML 404 pages, etc.) through
|
|
699
|
+
`format_error_body(body, fallback)`: the body's `message`, else its
|
|
700
|
+
`error` code. `table_state` and `auth_state` show refusals through it.
|
|
699
701
|
- `ui_format.ts` — display helpers:
|
|
700
702
|
- `format_relative_time(timestamp, now?)` — "2m ago", "3h ago",
|
|
701
703
|
"5d ago", "2mo ago", "1y ago"; "just now" when under a minute;
|
|
@@ -15,8 +15,10 @@
|
|
|
15
15
|
import { resolve } from '$app/paths';
|
|
16
16
|
import PendingButton from '@fuzdev/fuz_ui/PendingButton.svelte';
|
|
17
17
|
import { autofocus } from '@fuzdev/fuz_ui/autofocus.svelte.ts';
|
|
18
|
+
import { is } from '@fuzdev/fuz_schema/schema.ts';
|
|
18
19
|
|
|
19
|
-
import {
|
|
20
|
+
import { USERNAME_LENGTH_MAX, USERNAME_LENGTH_MIN } from '../primitive_schemas.js';
|
|
21
|
+
import { Username } from '../primitive_schemas_fuz.js';
|
|
20
22
|
import { PASSWORD_LENGTH_MIN } from '../auth/password.js';
|
|
21
23
|
import { auth_state_context } from './auth_state.svelte.js';
|
|
22
24
|
import { FormState } from './form_state.svelte.js';
|
|
@@ -39,7 +41,7 @@
|
|
|
39
41
|
let password = $state.raw('');
|
|
40
42
|
let password_confirm = $state.raw('');
|
|
41
43
|
|
|
42
|
-
const username_valid = $derived(Username
|
|
44
|
+
const username_valid = $derived(is(Username, username));
|
|
43
45
|
const passwords_match = $derived(password === password_confirm);
|
|
44
46
|
const can_submit = $derived(
|
|
45
47
|
username.trim() && username_valid && password.length >= PASSWORD_LENGTH_MIN && passwords_match
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignupForm.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/SignupForm.svelte"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SignupForm.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/SignupForm.svelte"],"names":[],"mappings":"AA0BC,KAAK,gBAAgB,GAAI;IACxB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAuGH,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/auth_state.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAMH,OAAO,EACN,KAAK,gBAAgB,EAErB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,MAAM,2BAA2B,CAAC;AAGnC;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,GAAI,aAAa,OAAO,KAAG,MAShE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;CAA8B,CAAC;AAE9D,qBAAa,SAAS;IACrB,SAAS,UAAqB;IAC9B,QAAQ,UAAqB;IAC7B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAoB;IAC/C,OAAO,EAAE,cAAc,GAAG,IAAI,CAAoB;IAClD,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAoB;IAClD,WAAW,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAkB;IAC1D;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAEtD;IACF;;;;;;;;OAQG;IACH,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAExC;IACF,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAA+C;IAEzE,gEAAgE;IAChE,eAAe,UAAqB;IAEpC;;;;;;OAMG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAItC;;;;;;;;OAQG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IA6BpC;;;;;;;OAOG;IACG,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAuCjE;;;;;OAKG;IACG,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"auth_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/auth_state.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAMH,OAAO,EACN,KAAK,gBAAgB,EAErB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,MAAM,2BAA2B,CAAC;AAGnC;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,GAAI,aAAa,OAAO,KAAG,MAShE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;CAA8B,CAAC;AAE9D,qBAAa,SAAS;IACrB,SAAS,UAAqB;IAC9B,QAAQ,UAAqB;IAC7B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAoB;IAC/C,OAAO,EAAE,cAAc,GAAG,IAAI,CAAoB;IAClD,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAoB;IAClD,WAAW,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAkB;IAC1D;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAEtD;IACF;;;;;;;;OAQG;IACH,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAExC;IACF,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAA+C;IAEzE,gEAAgE;IAChE,eAAe,UAAqB;IAEpC;;;;;;OAMG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAItC;;;;;;;;OAQG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IA6BpC;;;;;;;OAOG;IACG,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAuCjE;;;;;OAKG;IACG,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IA4BpF;;;;;;;OAOG;IACG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IA2ClF;;;;;OAKG;IACG,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CAe7B"}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
*/
|
|
34
34
|
import { to_error_message } from '@fuzdev/fuz_util/error.ts';
|
|
35
35
|
import { create_context } from '@fuzdev/fuz_ui/context_helpers.ts';
|
|
36
|
-
import { ui_fetch } from './ui_fetch.js';
|
|
36
|
+
import { parse_response_error, ui_fetch } from './ui_fetch.js';
|
|
37
37
|
import { is_role_grant_active } from '../auth/account_schema.js';
|
|
38
38
|
import { ROLE_ADMIN } from '../auth/role_schema.js';
|
|
39
39
|
/**
|
|
@@ -208,13 +208,7 @@ export class AuthState {
|
|
|
208
208
|
await this.check_session();
|
|
209
209
|
return true;
|
|
210
210
|
}
|
|
211
|
-
|
|
212
|
-
const data = await response.json();
|
|
213
|
-
this.verify_error = data.error ?? `Error: ${response.status}`;
|
|
214
|
-
}
|
|
215
|
-
catch {
|
|
216
|
-
this.verify_error = `Error: ${response.status}`;
|
|
217
|
-
}
|
|
211
|
+
this.verify_error = await parse_response_error(response);
|
|
218
212
|
return false;
|
|
219
213
|
}
|
|
220
214
|
catch (e) {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* @module
|
|
13
13
|
*/
|
|
14
14
|
import { to_error_message } from '@fuzdev/fuz_util/error.ts';
|
|
15
|
-
import {
|
|
15
|
+
import { is, loose_object } from '@fuzdev/fuz_schema/schema.ts';
|
|
16
16
|
import { HEALTH_PATH, HealthResponse } from '../http/health_schema.js';
|
|
17
17
|
/** The refusal for a `2xx` whose body isn't the health reply. */
|
|
18
18
|
export const BACKEND_PROBE_NOT_HEALTH = 'not a health response';
|
|
@@ -24,7 +24,7 @@ export const BACKEND_PROBE_TIMEOUT_MS = 10_000;
|
|
|
24
24
|
* The client's read of the health reply — loose, so a field added to the
|
|
25
25
|
* route's output never reads as a dead backend. The route spec stays strict.
|
|
26
26
|
*/
|
|
27
|
-
const HealthReply =
|
|
27
|
+
const HealthReply = loose_object(HealthResponse.def);
|
|
28
28
|
const is_timeout_error = (err) => err?.name === 'TimeoutError';
|
|
29
29
|
/**
|
|
30
30
|
* Probe whether the backend is serving: its health route must answer `2xx`
|
|
@@ -80,7 +80,7 @@ export const probe_backend = async (options) => {
|
|
|
80
80
|
// a dropped connection mid-body, not a wrong body
|
|
81
81
|
return { ok: false, error: to_error_message(err, 'network error') };
|
|
82
82
|
}
|
|
83
|
-
if (!HealthReply
|
|
83
|
+
if (!is(HealthReply, body)) {
|
|
84
84
|
return { ok: false, error: BACKEND_PROBE_NOT_HEALTH };
|
|
85
85
|
}
|
|
86
86
|
return { ok: true };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/table_state.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,EAGN,KAAK,UAAU,EACf,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,UAAU;IACtB,QAAQ,CAAC,IAAI,0BAAyB;IAEtC,UAAU,EAAE,MAAM,CAAkB;IACpC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,CAAkB;IAC5C,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAkB;IACtD,KAAK,SAAiB;IACtB,MAAM,SAAiB;IACvB,KAAK,SAA2C;IAChD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAoB;IAC9C;;;;;OAKG;IACH,SAAS,UAAqB;IAC9B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAoB;IAC3C,YAAY,EAAE,MAAM,GAAG,IAAI,CAAoB;IAE/C;;;;OAIG;IACH,QAAQ,CAAC,UAAU,UAAyD;IAG5E,QAAQ,CAAC,aAAa,SAAoD;IAC1E,QAAQ,CAAC,WAAW,SAAkE;IACtF,QAAQ,CAAC,QAAQ,UAA6B;IAC9C,QAAQ,CAAC,QAAQ,UAAmD;IAEpE;;;;;;;OAOG;IACG,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,SAAI,EAAE,KAAK,SAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBvE,OAAO,IAAI,IAAI;IAIf,OAAO,IAAI,IAAI;IAIf;;;;;;;OAOG;IACG,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"table_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/table_state.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,EAGN,KAAK,UAAU,EACf,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,UAAU;IACtB,QAAQ,CAAC,IAAI,0BAAyB;IAEtC,UAAU,EAAE,MAAM,CAAkB;IACpC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,CAAkB;IAC5C,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAkB;IACtD,KAAK,SAAiB;IACtB,MAAM,SAAiB;IACvB,KAAK,SAA2C;IAChD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAoB;IAC9C;;;;;OAKG;IACH,SAAS,UAAqB;IAC9B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAoB;IAC3C,YAAY,EAAE,MAAM,GAAG,IAAI,CAAoB;IAE/C;;;;OAIG;IACH,QAAQ,CAAC,UAAU,UAAyD;IAG5E,QAAQ,CAAC,aAAa,SAAoD;IAC1E,QAAQ,CAAC,WAAW,SAAkE;IACtF,QAAQ,CAAC,QAAQ,UAA6B;IAC9C,QAAQ,CAAC,QAAQ,UAAmD;IAEpE;;;;;;;OAOG;IACG,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,SAAI,EAAE,KAAK,SAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBvE,OAAO,IAAI,IAAI;IAIf,OAAO,IAAI,IAAI;IAIf;;;;;;;OAOG;IACG,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;CA8BhE"}
|
|
@@ -124,14 +124,7 @@ export class TableState {
|
|
|
124
124
|
try {
|
|
125
125
|
const response = await ui_fetch(`/api/db/tables/${this.table_name}/rows/${encodeURIComponent(pk_str)}`, { method: 'DELETE' });
|
|
126
126
|
if (!response.ok) {
|
|
127
|
-
|
|
128
|
-
const data = await response.json();
|
|
129
|
-
const error_msg = data.error || 'unknown error';
|
|
130
|
-
this.delete_error = data.detail ? `${error_msg}: ${data.detail}` : error_msg;
|
|
131
|
-
}
|
|
132
|
-
catch {
|
|
133
|
-
this.delete_error = `Error: ${response.status}`;
|
|
134
|
-
}
|
|
127
|
+
this.delete_error = await parse_response_error(response);
|
|
135
128
|
return false;
|
|
136
129
|
}
|
|
137
130
|
// Remove from UI
|
package/dist/ui/ui_fetch.d.ts
CHANGED
|
@@ -12,12 +12,22 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export declare const ui_fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* The text to show for an error body: its `message` when it carries one,
|
|
16
|
+
* else its `error` code — a body's `error` is a machine-readable code, and
|
|
17
|
+
* prose, when the server sends any, is in `message`.
|
|
18
|
+
*
|
|
19
|
+
* @param body - the parsed error body, of any shape
|
|
20
|
+
* @param fallback - the text when the body has neither
|
|
21
|
+
*/
|
|
22
|
+
export declare const format_error_body: (body: unknown, fallback: string) => string;
|
|
23
|
+
/**
|
|
24
|
+
* Safely extract an error message from a non-ok response: its `message`,
|
|
25
|
+
* else its `error` code (`format_error_body`).
|
|
16
26
|
*
|
|
17
27
|
* Handles responses with non-JSON bodies (e.g. HTML 404 pages)
|
|
18
28
|
* that would throw on `response.json()`.
|
|
19
29
|
*
|
|
20
|
-
* @param fallback - message when no
|
|
30
|
+
* @param fallback - message when the body has no `message` or `error`
|
|
21
31
|
*/
|
|
22
32
|
export declare const parse_response_error: (response: Response, fallback?: string) => Promise<string>;
|
|
23
33
|
//# sourceMappingURL=ui_fetch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui_fetch.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/ui_fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,WAAW,GAAG,GAAG,EAAE,OAAO,WAAW,KAAG,OAAO,CAAC,QAAQ,CACtC,CAAC;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAChC,UAAU,QAAQ,EAClB,WAAW,MAAM,KACf,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"ui_fetch.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/ui_fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,WAAW,GAAG,GAAG,EAAE,OAAO,WAAW,KAAG,OAAO,CAAC,QAAQ,CACtC,CAAC;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,OAAO,EAAE,UAAU,MAAM,KAAG,MAMnE,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,GAChC,UAAU,QAAQ,EAClB,WAAW,MAAM,KACf,OAAO,CAAC,MAAM,CAOhB,CAAC"}
|
package/dist/ui/ui_fetch.js
CHANGED
|
@@ -12,18 +12,36 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export const ui_fetch = (input, init) => fetch(input, { ...init, credentials: 'include' });
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* The text to show for an error body: its `message` when it carries one,
|
|
16
|
+
* else its `error` code — a body's `error` is a machine-readable code, and
|
|
17
|
+
* prose, when the server sends any, is in `message`.
|
|
18
|
+
*
|
|
19
|
+
* @param body - the parsed error body, of any shape
|
|
20
|
+
* @param fallback - the text when the body has neither
|
|
21
|
+
*/
|
|
22
|
+
export const format_error_body = (body, fallback) => {
|
|
23
|
+
if (body === null || typeof body !== 'object')
|
|
24
|
+
return fallback;
|
|
25
|
+
const { message, error } = body;
|
|
26
|
+
if (typeof message === 'string' && message)
|
|
27
|
+
return message;
|
|
28
|
+
if (typeof error === 'string' && error)
|
|
29
|
+
return error;
|
|
30
|
+
return fallback;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Safely extract an error message from a non-ok response: its `message`,
|
|
34
|
+
* else its `error` code (`format_error_body`).
|
|
16
35
|
*
|
|
17
36
|
* Handles responses with non-JSON bodies (e.g. HTML 404 pages)
|
|
18
37
|
* that would throw on `response.json()`.
|
|
19
38
|
*
|
|
20
|
-
* @param fallback - message when no
|
|
39
|
+
* @param fallback - message when the body has no `message` or `error`
|
|
21
40
|
*/
|
|
22
41
|
export const parse_response_error = async (response, fallback) => {
|
|
23
42
|
const default_message = fallback ?? `Error: ${response.status}`;
|
|
24
43
|
try {
|
|
25
|
-
|
|
26
|
-
return typeof data?.error === 'string' ? data.error : default_message;
|
|
44
|
+
return format_error_body(await response.json(), default_message);
|
|
27
45
|
}
|
|
28
46
|
catch {
|
|
29
47
|
return default_message;
|
package/package.json
CHANGED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `@fuzdev/fuz_schema` twins of the Zod `AuditEventTypeName` and
|
|
3
|
-
* `AuditOutcome` (`auth/audit_log_schema.ts`), under the same names, for
|
|
4
|
-
* schemas written in fuz_schema.
|
|
5
|
-
*
|
|
6
|
-
* `AuditEventTypeName` is built from the constants the Zod one is, the
|
|
7
|
-
* grammar and the two messages this module exports and the bound of
|
|
8
|
-
* `auth/name_schema.ts`, so the two can't drift apart. The constants live
|
|
9
|
-
* here, not beside the Zod schema, because `audit_log_schema.ts` builds its
|
|
10
|
-
* wire rows from these twins. They give every input
|
|
11
|
-
* the same verdict and output, and write the same JSON Schema (`maxLength`
|
|
12
|
-
* and `pattern`); a string both too long and off the grammar gets the one
|
|
13
|
-
* length issue from this twin, as its `pipe` stops at the first failing step,
|
|
14
|
-
* where the Zod one adds the grammar issue after it.
|
|
15
|
-
*
|
|
16
|
-
* The twins are `@nodocs` while the Zod schemas of the same names stay, as
|
|
17
|
-
* the docs build refuses two exports of one name.
|
|
18
|
-
*
|
|
19
|
-
* @module
|
|
20
|
-
*/
|
|
21
|
-
import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
|
|
22
|
-
/**
|
|
23
|
-
* Letter start, then letters, digits, `_`, `.`, `/`, `-`. Accepts snake_case,
|
|
24
|
-
* dotted, and namespaced consumer conventions; rejects empty strings, leading
|
|
25
|
-
* separators, whitespace, and control characters. The audit event type's own
|
|
26
|
-
* grammar, wider than the shared name grammar (`auth/name_schema.ts`), whose
|
|
27
|
-
* length cap `AuditEventTypeName` takes.
|
|
28
|
-
*/
|
|
29
|
-
export declare const AUDIT_EVENT_TYPE_NAME_REGEX: RegExp;
|
|
30
|
-
/** The message of an audit event-type name past `NAME_LENGTH_MAX`. */
|
|
31
|
-
export declare const AUDIT_EVENT_TYPE_NAME_LENGTH_MESSAGE = "must be at most 64 characters";
|
|
32
|
-
/** The message of an audit event-type name off `AUDIT_EVENT_TYPE_NAME_REGEX`. */
|
|
33
|
-
export declare const AUDIT_EVENT_TYPE_NAME_PATTERN_MESSAGE = "must start with a letter; only letters, digits, _ . / - allowed";
|
|
34
|
-
/**
|
|
35
|
-
* Valid audit event-type name: `AUDIT_EVENT_TYPE_NAME_REGEX`, at most
|
|
36
|
-
* `NAME_LENGTH_MAX` UTF-16 code units, the twin of the Zod
|
|
37
|
-
* `AuditEventTypeName`. A string it refuses gets the Zod one's message; a
|
|
38
|
-
* value that is no string, fuz_schema's.
|
|
39
|
-
*
|
|
40
|
-
* @nodocs
|
|
41
|
-
*/
|
|
42
|
-
export declare const AuditEventTypeName: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
43
|
-
/** @nodocs */
|
|
44
|
-
export type AuditEventTypeName = Infer<typeof AuditEventTypeName>;
|
|
45
|
-
/**
|
|
46
|
-
* Audit event outcome, the twin of the Zod `AuditOutcome`.
|
|
47
|
-
*
|
|
48
|
-
* @nodocs
|
|
49
|
-
*/
|
|
50
|
-
export declare const AuditOutcome: import("@fuzdev/fuz_schema/schema.ts").Schema<"success" | "failure", "success" | "failure", "one_of", readonly ["success", "failure"]>;
|
|
51
|
-
/** @nodocs */
|
|
52
|
-
export type AuditOutcome = Infer<typeof AuditOutcome>;
|
|
53
|
-
//# sourceMappingURL=audit_log_schema_fuz.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"audit_log_schema_fuz.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_log_schema_fuz.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAgC,KAAK,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAKxF;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,QAA+B,CAAC;AAExE,sEAAsE;AACtE,eAAO,MAAM,oCAAoC,kCAAkD,CAAC;AAEpG,iFAAiF;AACjF,eAAO,MAAM,qCAAqC,oEACgB,CAAC;AAEnE;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,0MAG9B,CAAC;AACF,cAAc;AACd,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,YAAY,wIAAiC,CAAC;AAC3D,cAAc;AACd,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `@fuzdev/fuz_schema` twins of the Zod `AuditEventTypeName` and
|
|
3
|
-
* `AuditOutcome` (`auth/audit_log_schema.ts`), under the same names, for
|
|
4
|
-
* schemas written in fuz_schema.
|
|
5
|
-
*
|
|
6
|
-
* `AuditEventTypeName` is built from the constants the Zod one is, the
|
|
7
|
-
* grammar and the two messages this module exports and the bound of
|
|
8
|
-
* `auth/name_schema.ts`, so the two can't drift apart. The constants live
|
|
9
|
-
* here, not beside the Zod schema, because `audit_log_schema.ts` builds its
|
|
10
|
-
* wire rows from these twins. They give every input
|
|
11
|
-
* the same verdict and output, and write the same JSON Schema (`maxLength`
|
|
12
|
-
* and `pattern`); a string both too long and off the grammar gets the one
|
|
13
|
-
* length issue from this twin, as its `pipe` stops at the first failing step,
|
|
14
|
-
* where the Zod one adds the grammar issue after it.
|
|
15
|
-
*
|
|
16
|
-
* The twins are `@nodocs` while the Zod schemas of the same names stay, as
|
|
17
|
-
* the docs build refuses two exports of one name.
|
|
18
|
-
*
|
|
19
|
-
* @module
|
|
20
|
-
*/
|
|
21
|
-
import { message, one_of, pipe, regex } from '@fuzdev/fuz_schema/schema.ts';
|
|
22
|
-
import { bounded_string } from '../primitive_schemas_fuz.js';
|
|
23
|
-
import { NAME_LENGTH_MAX } from './name_schema.js';
|
|
24
|
-
/**
|
|
25
|
-
* Letter start, then letters, digits, `_`, `.`, `/`, `-`. Accepts snake_case,
|
|
26
|
-
* dotted, and namespaced consumer conventions; rejects empty strings, leading
|
|
27
|
-
* separators, whitespace, and control characters. The audit event type's own
|
|
28
|
-
* grammar, wider than the shared name grammar (`auth/name_schema.ts`), whose
|
|
29
|
-
* length cap `AuditEventTypeName` takes.
|
|
30
|
-
*/
|
|
31
|
-
export const AUDIT_EVENT_TYPE_NAME_REGEX = /^[A-Za-z][A-Za-z0-9_./-]*$/;
|
|
32
|
-
/** The message of an audit event-type name past `NAME_LENGTH_MAX`. */
|
|
33
|
-
export const AUDIT_EVENT_TYPE_NAME_LENGTH_MESSAGE = `must be at most ${NAME_LENGTH_MAX} characters`;
|
|
34
|
-
/** The message of an audit event-type name off `AUDIT_EVENT_TYPE_NAME_REGEX`. */
|
|
35
|
-
export const AUDIT_EVENT_TYPE_NAME_PATTERN_MESSAGE = 'must start with a letter; only letters, digits, _ . / - allowed';
|
|
36
|
-
/**
|
|
37
|
-
* Valid audit event-type name: `AUDIT_EVENT_TYPE_NAME_REGEX`, at most
|
|
38
|
-
* `NAME_LENGTH_MAX` UTF-16 code units, the twin of the Zod
|
|
39
|
-
* `AuditEventTypeName`. A string it refuses gets the Zod one's message; a
|
|
40
|
-
* value that is no string, fuz_schema's.
|
|
41
|
-
*
|
|
42
|
-
* @nodocs
|
|
43
|
-
*/
|
|
44
|
-
export const AuditEventTypeName = pipe(bounded_string({ max: NAME_LENGTH_MAX, max_message: AUDIT_EVENT_TYPE_NAME_LENGTH_MESSAGE }), message(regex(AUDIT_EVENT_TYPE_NAME_REGEX), AUDIT_EVENT_TYPE_NAME_PATTERN_MESSAGE));
|
|
45
|
-
/**
|
|
46
|
-
* Audit event outcome, the twin of the Zod `AuditOutcome`.
|
|
47
|
-
*
|
|
48
|
-
* @nodocs
|
|
49
|
-
*/
|
|
50
|
-
export const AuditOutcome = one_of(['success', 'failure']);
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `@fuzdev/fuz_schema` twin of the Zod `RoleName` (`auth/role_schema.ts`),
|
|
3
|
-
* under the same name, for schemas written in fuz_schema.
|
|
4
|
-
*
|
|
5
|
-
* Both are built from the same constants, the bound and the grammar of
|
|
6
|
-
* `auth/name_schema.ts` and the two messages `role_schema.ts` exports, so
|
|
7
|
-
* they can't drift apart. They give every input
|
|
8
|
-
* the same verdict and output, and write the same JSON Schema
|
|
9
|
-
* (`maxLength` and `pattern`); a string both too long and outside the grammar
|
|
10
|
-
* gets the one length issue from this twin, as its `pipe` stops at the first
|
|
11
|
-
* failing step, where the Zod one adds the grammar issue after it.
|
|
12
|
-
*
|
|
13
|
-
* The export is `@nodocs` while the Zod `RoleName` stays, as the docs build
|
|
14
|
-
* refuses two exports of one name.
|
|
15
|
-
*
|
|
16
|
-
* @module
|
|
17
|
-
*/
|
|
18
|
-
import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
|
|
19
|
-
/**
|
|
20
|
-
* Valid role name: lowercase letters and underscores, no leading, trailing or
|
|
21
|
-
* consecutive underscores, at most `NAME_LENGTH_MAX` UTF-16 code units, the twin of
|
|
22
|
-
* the Zod `RoleName`. A string it refuses gets the Zod one's message; a
|
|
23
|
-
* value that is no string, fuz_schema's.
|
|
24
|
-
*
|
|
25
|
-
* @nodocs
|
|
26
|
-
*/
|
|
27
|
-
export declare const RoleName: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
28
|
-
/** @nodocs */
|
|
29
|
-
export type RoleName = Infer<typeof RoleName>;
|
|
30
|
-
//# sourceMappingURL=role_schema_fuz.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"role_schema_fuz.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/role_schema_fuz.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAwB,KAAK,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAMhF;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,0MAGpB,CAAC;AACF,cAAc;AACd,MAAM,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `@fuzdev/fuz_schema` twin of the Zod `RoleName` (`auth/role_schema.ts`),
|
|
3
|
-
* under the same name, for schemas written in fuz_schema.
|
|
4
|
-
*
|
|
5
|
-
* Both are built from the same constants, the bound and the grammar of
|
|
6
|
-
* `auth/name_schema.ts` and the two messages `role_schema.ts` exports, so
|
|
7
|
-
* they can't drift apart. They give every input
|
|
8
|
-
* the same verdict and output, and write the same JSON Schema
|
|
9
|
-
* (`maxLength` and `pattern`); a string both too long and outside the grammar
|
|
10
|
-
* gets the one length issue from this twin, as its `pipe` stops at the first
|
|
11
|
-
* failing step, where the Zod one adds the grammar issue after it.
|
|
12
|
-
*
|
|
13
|
-
* The export is `@nodocs` while the Zod `RoleName` stays, as the docs build
|
|
14
|
-
* refuses two exports of one name.
|
|
15
|
-
*
|
|
16
|
-
* @module
|
|
17
|
-
*/
|
|
18
|
-
import { message, pipe, regex } from '@fuzdev/fuz_schema/schema.ts';
|
|
19
|
-
import { bounded_string } from '../primitive_schemas_fuz.js';
|
|
20
|
-
import { NAME_LENGTH_MAX, NAME_REGEX } from './name_schema.js';
|
|
21
|
-
import { ROLE_NAME_LENGTH_MESSAGE, ROLE_NAME_PATTERN_MESSAGE } from './role_schema.js';
|
|
22
|
-
/**
|
|
23
|
-
* Valid role name: lowercase letters and underscores, no leading, trailing or
|
|
24
|
-
* consecutive underscores, at most `NAME_LENGTH_MAX` UTF-16 code units, the twin of
|
|
25
|
-
* the Zod `RoleName`. A string it refuses gets the Zod one's message; a
|
|
26
|
-
* value that is no string, fuz_schema's.
|
|
27
|
-
*
|
|
28
|
-
* @nodocs
|
|
29
|
-
*/
|
|
30
|
-
export const RoleName = pipe(bounded_string({ max: NAME_LENGTH_MAX, max_message: ROLE_NAME_LENGTH_MESSAGE }), message(regex(NAME_REGEX), ROLE_NAME_PATTERN_MESSAGE));
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `@fuzdev/fuz_schema` twin of the Zod `ScopeKindName`
|
|
3
|
-
* (`auth/scope_kind_schema.ts`), under the same name, for schemas written in
|
|
4
|
-
* fuz_schema.
|
|
5
|
-
*
|
|
6
|
-
* Both are built from the same constants, the bound and the grammar of
|
|
7
|
-
* `auth/name_schema.ts` and the two messages `scope_kind_schema.ts` exports,
|
|
8
|
-
* so they can't drift apart. They give every
|
|
9
|
-
* input the same verdict and output, and write the same JSON Schema
|
|
10
|
-
* (`maxLength` and `pattern`); a string both too long and outside the grammar
|
|
11
|
-
* gets the one length issue from this twin, as its `pipe` stops at the first
|
|
12
|
-
* failing step, where the Zod one adds the grammar issue after it.
|
|
13
|
-
*
|
|
14
|
-
* The export is `@nodocs` while the Zod `ScopeKindName` stays, as the docs
|
|
15
|
-
* build refuses two exports of one name.
|
|
16
|
-
*
|
|
17
|
-
* @module
|
|
18
|
-
*/
|
|
19
|
-
import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
|
|
20
|
-
/**
|
|
21
|
-
* Valid scope-kind name: runs of lowercase letters joined by single
|
|
22
|
-
* underscores, at most `NAME_LENGTH_MAX` UTF-16 code units, the twin of
|
|
23
|
-
* the Zod `ScopeKindName`. A string it refuses gets the Zod one's message; a
|
|
24
|
-
* value that is no string, fuz_schema's.
|
|
25
|
-
*
|
|
26
|
-
* @nodocs
|
|
27
|
-
*/
|
|
28
|
-
export declare const ScopeKindName: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
29
|
-
/** @nodocs */
|
|
30
|
-
export type ScopeKindName = Infer<typeof ScopeKindName>;
|
|
31
|
-
//# sourceMappingURL=scope_kind_schema_fuz.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scope_kind_schema_fuz.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/scope_kind_schema_fuz.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAwB,KAAK,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAShF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,0MAGzB,CAAC;AACF,cAAc;AACd,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `@fuzdev/fuz_schema` twin of the Zod `ScopeKindName`
|
|
3
|
-
* (`auth/scope_kind_schema.ts`), under the same name, for schemas written in
|
|
4
|
-
* fuz_schema.
|
|
5
|
-
*
|
|
6
|
-
* Both are built from the same constants, the bound and the grammar of
|
|
7
|
-
* `auth/name_schema.ts` and the two messages `scope_kind_schema.ts` exports,
|
|
8
|
-
* so they can't drift apart. They give every
|
|
9
|
-
* input the same verdict and output, and write the same JSON Schema
|
|
10
|
-
* (`maxLength` and `pattern`); a string both too long and outside the grammar
|
|
11
|
-
* gets the one length issue from this twin, as its `pipe` stops at the first
|
|
12
|
-
* failing step, where the Zod one adds the grammar issue after it.
|
|
13
|
-
*
|
|
14
|
-
* The export is `@nodocs` while the Zod `ScopeKindName` stays, as the docs
|
|
15
|
-
* build refuses two exports of one name.
|
|
16
|
-
*
|
|
17
|
-
* @module
|
|
18
|
-
*/
|
|
19
|
-
import { message, pipe, regex } from '@fuzdev/fuz_schema/schema.ts';
|
|
20
|
-
import { bounded_string } from '../primitive_schemas_fuz.js';
|
|
21
|
-
import { NAME_LENGTH_MAX, NAME_REGEX } from './name_schema.js';
|
|
22
|
-
import { SCOPE_KIND_NAME_LENGTH_MESSAGE, SCOPE_KIND_NAME_PATTERN_MESSAGE } from './scope_kind_schema.js';
|
|
23
|
-
/**
|
|
24
|
-
* Valid scope-kind name: runs of lowercase letters joined by single
|
|
25
|
-
* underscores, at most `NAME_LENGTH_MAX` UTF-16 code units, the twin of
|
|
26
|
-
* the Zod `ScopeKindName`. A string it refuses gets the Zod one's message; a
|
|
27
|
-
* value that is no string, fuz_schema's.
|
|
28
|
-
*
|
|
29
|
-
* @nodocs
|
|
30
|
-
*/
|
|
31
|
-
export const ScopeKindName = pipe(bounded_string({ max: NAME_LENGTH_MAX, max_message: SCOPE_KIND_NAME_LENGTH_MESSAGE }), message(regex(NAME_REGEX), SCOPE_KIND_NAME_PATTERN_MESSAGE));
|