@fuzdev/fuz_app 0.1.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/LICENSE +21 -0
- package/README.md +49 -0
- package/dist/actions/action_bridge.d.ts +65 -0
- package/dist/actions/action_bridge.d.ts.map +1 -0
- package/dist/actions/action_bridge.js +76 -0
- package/dist/actions/action_codegen.d.ts +97 -0
- package/dist/actions/action_codegen.d.ts.map +1 -0
- package/dist/actions/action_codegen.js +280 -0
- package/dist/actions/action_registry.d.ts +35 -0
- package/dist/actions/action_registry.d.ts.map +1 -0
- package/dist/actions/action_registry.js +83 -0
- package/dist/actions/action_spec.d.ts +169 -0
- package/dist/actions/action_spec.d.ts.map +1 -0
- package/dist/actions/action_spec.js +76 -0
- package/dist/auth/account_queries.d.ts +96 -0
- package/dist/auth/account_queries.d.ts.map +1 -0
- package/dist/auth/account_queries.js +172 -0
- package/dist/auth/account_routes.d.ts +86 -0
- package/dist/auth/account_routes.d.ts.map +1 -0
- package/dist/auth/account_routes.js +406 -0
- package/dist/auth/account_schema.d.ts +192 -0
- package/dist/auth/account_schema.d.ts.map +1 -0
- package/dist/auth/account_schema.js +105 -0
- package/dist/auth/admin_routes.d.ts +29 -0
- package/dist/auth/admin_routes.d.ts.map +1 -0
- package/dist/auth/admin_routes.js +193 -0
- package/dist/auth/api_token.d.ts +33 -0
- package/dist/auth/api_token.d.ts.map +1 -0
- package/dist/auth/api_token.js +36 -0
- package/dist/auth/api_token_queries.d.ts +80 -0
- package/dist/auth/api_token_queries.d.ts.map +1 -0
- package/dist/auth/api_token_queries.js +116 -0
- package/dist/auth/app_settings_queries.d.ts +33 -0
- package/dist/auth/app_settings_queries.d.ts.map +1 -0
- package/dist/auth/app_settings_queries.js +51 -0
- package/dist/auth/app_settings_routes.d.ts +27 -0
- package/dist/auth/app_settings_routes.d.ts.map +1 -0
- package/dist/auth/app_settings_routes.js +66 -0
- package/dist/auth/app_settings_schema.d.ts +35 -0
- package/dist/auth/app_settings_schema.d.ts.map +1 -0
- package/dist/auth/app_settings_schema.js +22 -0
- package/dist/auth/audit_log_queries.d.ts +90 -0
- package/dist/auth/audit_log_queries.d.ts.map +1 -0
- package/dist/auth/audit_log_queries.js +205 -0
- package/dist/auth/audit_log_routes.d.ts +33 -0
- package/dist/auth/audit_log_routes.d.ts.map +1 -0
- package/dist/auth/audit_log_routes.js +106 -0
- package/dist/auth/audit_log_schema.d.ts +259 -0
- package/dist/auth/audit_log_schema.d.ts.map +1 -0
- package/dist/auth/audit_log_schema.js +123 -0
- package/dist/auth/bearer_auth.d.ts +32 -0
- package/dist/auth/bearer_auth.d.ts.map +1 -0
- package/dist/auth/bearer_auth.js +90 -0
- package/dist/auth/bootstrap_account.d.ts +82 -0
- package/dist/auth/bootstrap_account.d.ts.map +1 -0
- package/dist/auth/bootstrap_account.js +97 -0
- package/dist/auth/bootstrap_routes.d.ts +74 -0
- package/dist/auth/bootstrap_routes.d.ts.map +1 -0
- package/dist/auth/bootstrap_routes.js +154 -0
- package/dist/auth/daemon_token.d.ts +49 -0
- package/dist/auth/daemon_token.d.ts.map +1 -0
- package/dist/auth/daemon_token.js +49 -0
- package/dist/auth/daemon_token_middleware.d.ts +93 -0
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -0
- package/dist/auth/daemon_token_middleware.js +167 -0
- package/dist/auth/ddl.d.ts +27 -0
- package/dist/auth/ddl.d.ts.map +1 -0
- package/dist/auth/ddl.js +111 -0
- package/dist/auth/deps.d.ts +52 -0
- package/dist/auth/deps.d.ts.map +1 -0
- package/dist/auth/deps.js +10 -0
- package/dist/auth/invite_queries.d.ts +68 -0
- package/dist/auth/invite_queries.d.ts.map +1 -0
- package/dist/auth/invite_queries.js +105 -0
- package/dist/auth/invite_routes.d.ts +18 -0
- package/dist/auth/invite_routes.d.ts.map +1 -0
- package/dist/auth/invite_routes.js +129 -0
- package/dist/auth/invite_schema.d.ts +51 -0
- package/dist/auth/invite_schema.d.ts.map +1 -0
- package/dist/auth/invite_schema.js +25 -0
- package/dist/auth/keyring.d.ts +87 -0
- package/dist/auth/keyring.d.ts.map +1 -0
- package/dist/auth/keyring.js +142 -0
- package/dist/auth/middleware.d.ts +40 -0
- package/dist/auth/middleware.d.ts.map +1 -0
- package/dist/auth/middleware.js +64 -0
- package/dist/auth/migrations.d.ts +42 -0
- package/dist/auth/migrations.d.ts.map +1 -0
- package/dist/auth/migrations.js +79 -0
- package/dist/auth/password.d.ts +39 -0
- package/dist/auth/password.d.ts.map +1 -0
- package/dist/auth/password.js +25 -0
- package/dist/auth/password_argon2.d.ts +43 -0
- package/dist/auth/password_argon2.d.ts.map +1 -0
- package/dist/auth/password_argon2.js +76 -0
- package/dist/auth/permit_queries.d.ts +72 -0
- package/dist/auth/permit_queries.d.ts.map +1 -0
- package/dist/auth/permit_queries.js +116 -0
- package/dist/auth/request_context.d.ts +114 -0
- package/dist/auth/request_context.d.ts.map +1 -0
- package/dist/auth/request_context.js +176 -0
- package/dist/auth/require_keeper.d.ts +20 -0
- package/dist/auth/require_keeper.d.ts.map +1 -0
- package/dist/auth/require_keeper.js +35 -0
- package/dist/auth/role_schema.d.ts +69 -0
- package/dist/auth/role_schema.d.ts.map +1 -0
- package/dist/auth/role_schema.js +70 -0
- package/dist/auth/route_guards.d.ts +21 -0
- package/dist/auth/route_guards.d.ts.map +1 -0
- package/dist/auth/route_guards.js +32 -0
- package/dist/auth/session_cookie.d.ts +158 -0
- package/dist/auth/session_cookie.d.ts.map +1 -0
- package/dist/auth/session_cookie.js +135 -0
- package/dist/auth/session_lifecycle.d.ts +35 -0
- package/dist/auth/session_lifecycle.d.ts.map +1 -0
- package/dist/auth/session_lifecycle.js +27 -0
- package/dist/auth/session_middleware.d.ts +33 -0
- package/dist/auth/session_middleware.d.ts.map +1 -0
- package/dist/auth/session_middleware.js +62 -0
- package/dist/auth/session_queries.d.ts +135 -0
- package/dist/auth/session_queries.d.ts.map +1 -0
- package/dist/auth/session_queries.js +186 -0
- package/dist/auth/signup_routes.d.ts +32 -0
- package/dist/auth/signup_routes.d.ts.map +1 -0
- package/dist/auth/signup_routes.js +150 -0
- package/dist/cli/args.d.ts +48 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +76 -0
- package/dist/cli/config.d.ts +48 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +77 -0
- package/dist/cli/daemon.d.ts +82 -0
- package/dist/cli/daemon.d.ts.map +1 -0
- package/dist/cli/daemon.js +149 -0
- package/dist/cli/help.d.ts +85 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +138 -0
- package/dist/cli/logger.d.ts +46 -0
- package/dist/cli/logger.d.ts.map +1 -0
- package/dist/cli/logger.js +48 -0
- package/dist/cli/util.d.ts +36 -0
- package/dist/cli/util.d.ts.map +1 -0
- package/dist/cli/util.js +50 -0
- package/dist/crypto.d.ts +13 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/crypto.js +19 -0
- package/dist/db/assert_row.d.ts +18 -0
- package/dist/db/assert_row.d.ts.map +1 -0
- package/dist/db/assert_row.js +24 -0
- package/dist/db/create_db.d.ts +38 -0
- package/dist/db/create_db.d.ts.map +1 -0
- package/dist/db/create_db.js +57 -0
- package/dist/db/db.d.ts +97 -0
- package/dist/db/db.d.ts.map +1 -0
- package/dist/db/db.js +76 -0
- package/dist/db/db_pg.d.ts +21 -0
- package/dist/db/db_pg.d.ts.map +1 -0
- package/dist/db/db_pg.js +45 -0
- package/dist/db/db_pglite.d.ts +21 -0
- package/dist/db/db_pglite.d.ts.map +1 -0
- package/dist/db/db_pglite.js +28 -0
- package/dist/db/migrate.d.ts +67 -0
- package/dist/db/migrate.d.ts.map +1 -0
- package/dist/db/migrate.js +118 -0
- package/dist/db/pg_error.d.ts +16 -0
- package/dist/db/pg_error.d.ts.map +1 -0
- package/dist/db/pg_error.js +15 -0
- package/dist/db/query_deps.d.ts +14 -0
- package/dist/db/query_deps.d.ts.map +1 -0
- package/dist/db/query_deps.js +9 -0
- package/dist/db/sql_identifier.d.ts +27 -0
- package/dist/db/sql_identifier.d.ts.map +1 -0
- package/dist/db/sql_identifier.js +31 -0
- package/dist/db/status.d.ts +62 -0
- package/dist/db/status.d.ts.map +1 -0
- package/dist/db/status.js +116 -0
- package/dist/dev/setup.d.ts +159 -0
- package/dist/dev/setup.d.ts.map +1 -0
- package/dist/dev/setup.js +265 -0
- package/dist/env/dotenv.d.ts +25 -0
- package/dist/env/dotenv.d.ts.map +1 -0
- package/dist/env/dotenv.js +52 -0
- package/dist/env/load.d.ts +52 -0
- package/dist/env/load.d.ts.map +1 -0
- package/dist/env/load.js +79 -0
- package/dist/env/mask.d.ts +19 -0
- package/dist/env/mask.d.ts.map +1 -0
- package/dist/env/mask.js +26 -0
- package/dist/env/resolve.d.ts +126 -0
- package/dist/env/resolve.d.ts.map +1 -0
- package/dist/env/resolve.js +200 -0
- package/dist/hono_context.d.ts +48 -0
- package/dist/hono_context.d.ts.map +1 -0
- package/dist/hono_context.js +22 -0
- package/dist/http/common_routes.d.ts +52 -0
- package/dist/http/common_routes.d.ts.map +1 -0
- package/dist/http/common_routes.js +65 -0
- package/dist/http/db_routes.d.ts +57 -0
- package/dist/http/db_routes.d.ts.map +1 -0
- package/dist/http/db_routes.js +176 -0
- package/dist/http/error_schemas.d.ts +169 -0
- package/dist/http/error_schemas.d.ts.map +1 -0
- package/dist/http/error_schemas.js +178 -0
- package/dist/http/middleware_spec.d.ts +19 -0
- package/dist/http/middleware_spec.d.ts.map +1 -0
- package/dist/http/middleware_spec.js +9 -0
- package/dist/http/origin.d.ts +57 -0
- package/dist/http/origin.d.ts.map +1 -0
- package/dist/http/origin.js +207 -0
- package/dist/http/proxy.d.ts +112 -0
- package/dist/http/proxy.d.ts.map +1 -0
- package/dist/http/proxy.js +240 -0
- package/dist/http/route_spec.d.ts +197 -0
- package/dist/http/route_spec.d.ts.map +1 -0
- package/dist/http/route_spec.js +243 -0
- package/dist/http/schema_helpers.d.ts +64 -0
- package/dist/http/schema_helpers.d.ts.map +1 -0
- package/dist/http/schema_helpers.js +90 -0
- package/dist/http/surface.d.ts +132 -0
- package/dist/http/surface.d.ts.map +1 -0
- package/dist/http/surface.js +156 -0
- package/dist/http/surface_query.d.ts +77 -0
- package/dist/http/surface_query.d.ts.map +1 -0
- package/dist/http/surface_query.js +86 -0
- package/dist/rate_limiter.d.ts +94 -0
- package/dist/rate_limiter.d.ts.map +1 -0
- package/dist/rate_limiter.js +156 -0
- package/dist/realtime/sse.d.ts +80 -0
- package/dist/realtime/sse.d.ts.map +1 -0
- package/dist/realtime/sse.js +109 -0
- package/dist/realtime/sse_auth_guard.d.ts +93 -0
- package/dist/realtime/sse_auth_guard.d.ts.map +1 -0
- package/dist/realtime/sse_auth_guard.js +111 -0
- package/dist/realtime/subscriber_registry.d.ts +85 -0
- package/dist/realtime/subscriber_registry.d.ts.map +1 -0
- package/dist/realtime/subscriber_registry.js +108 -0
- package/dist/runtime/deno.d.ts +21 -0
- package/dist/runtime/deno.d.ts.map +1 -0
- package/dist/runtime/deno.js +83 -0
- package/dist/runtime/deps.d.ts +113 -0
- package/dist/runtime/deps.d.ts.map +1 -0
- package/dist/runtime/deps.js +10 -0
- package/dist/runtime/fs.d.ts +15 -0
- package/dist/runtime/fs.d.ts.map +1 -0
- package/dist/runtime/fs.js +17 -0
- package/dist/runtime/mock.d.ts +81 -0
- package/dist/runtime/mock.d.ts.map +1 -0
- package/dist/runtime/mock.js +195 -0
- package/dist/runtime/node.d.ts +17 -0
- package/dist/runtime/node.d.ts.map +1 -0
- package/dist/runtime/node.js +117 -0
- package/dist/schema_meta.d.ts +16 -0
- package/dist/schema_meta.d.ts.map +1 -0
- package/dist/schema_meta.js +9 -0
- package/dist/sensitivity.d.ts +15 -0
- package/dist/sensitivity.d.ts.map +1 -0
- package/dist/sensitivity.js +9 -0
- package/dist/server/app_backend.d.ts +74 -0
- package/dist/server/app_backend.d.ts.map +1 -0
- package/dist/server/app_backend.js +39 -0
- package/dist/server/app_server.d.ts +201 -0
- package/dist/server/app_server.d.ts.map +1 -0
- package/dist/server/app_server.js +266 -0
- package/dist/server/env.d.ts +68 -0
- package/dist/server/env.d.ts.map +1 -0
- package/dist/server/env.js +95 -0
- package/dist/server/startup.d.ts +22 -0
- package/dist/server/startup.d.ts.map +1 -0
- package/dist/server/startup.js +48 -0
- package/dist/server/static.d.ts +39 -0
- package/dist/server/static.d.ts.map +1 -0
- package/dist/server/static.js +38 -0
- package/dist/server/validate_nginx.d.ts +34 -0
- package/dist/server/validate_nginx.d.ts.map +1 -0
- package/dist/server/validate_nginx.js +118 -0
- package/dist/testing/CLAUDE.md +3 -0
- package/dist/testing/admin_integration.d.ts +45 -0
- package/dist/testing/admin_integration.d.ts.map +1 -0
- package/dist/testing/admin_integration.js +840 -0
- package/dist/testing/adversarial_404.d.ts +15 -0
- package/dist/testing/adversarial_404.d.ts.map +1 -0
- package/dist/testing/adversarial_404.js +118 -0
- package/dist/testing/adversarial_headers.d.ts +36 -0
- package/dist/testing/adversarial_headers.d.ts.map +1 -0
- package/dist/testing/adversarial_headers.js +128 -0
- package/dist/testing/adversarial_input.d.ts +56 -0
- package/dist/testing/adversarial_input.d.ts.map +1 -0
- package/dist/testing/adversarial_input.js +494 -0
- package/dist/testing/app_server.d.ts +169 -0
- package/dist/testing/app_server.d.ts.map +1 -0
- package/dist/testing/app_server.js +240 -0
- package/dist/testing/assert_dev_env.d.ts +10 -0
- package/dist/testing/assert_dev_env.d.ts.map +1 -0
- package/dist/testing/assert_dev_env.js +13 -0
- package/dist/testing/assertions.d.ts +61 -0
- package/dist/testing/assertions.d.ts.map +1 -0
- package/dist/testing/assertions.js +96 -0
- package/dist/testing/attack_surface.d.ts +63 -0
- package/dist/testing/attack_surface.d.ts.map +1 -0
- package/dist/testing/attack_surface.js +224 -0
- package/dist/testing/audit_completeness.d.ts +29 -0
- package/dist/testing/audit_completeness.d.ts.map +1 -0
- package/dist/testing/audit_completeness.js +410 -0
- package/dist/testing/auth_apps.d.ts +55 -0
- package/dist/testing/auth_apps.d.ts.map +1 -0
- package/dist/testing/auth_apps.js +122 -0
- package/dist/testing/data_exposure.d.ts +62 -0
- package/dist/testing/data_exposure.d.ts.map +1 -0
- package/dist/testing/data_exposure.js +297 -0
- package/dist/testing/db.d.ts +111 -0
- package/dist/testing/db.d.ts.map +1 -0
- package/dist/testing/db.js +258 -0
- package/dist/testing/entities.d.ts +21 -0
- package/dist/testing/entities.d.ts.map +1 -0
- package/dist/testing/entities.js +42 -0
- package/dist/testing/error_coverage.d.ts +78 -0
- package/dist/testing/error_coverage.d.ts.map +1 -0
- package/dist/testing/error_coverage.js +135 -0
- package/dist/testing/integration.d.ts +37 -0
- package/dist/testing/integration.d.ts.map +1 -0
- package/dist/testing/integration.js +1139 -0
- package/dist/testing/integration_helpers.d.ts +107 -0
- package/dist/testing/integration_helpers.d.ts.map +1 -0
- package/dist/testing/integration_helpers.js +246 -0
- package/dist/testing/middleware.d.ts +125 -0
- package/dist/testing/middleware.d.ts.map +1 -0
- package/dist/testing/middleware.js +210 -0
- package/dist/testing/rate_limiting.d.ts +43 -0
- package/dist/testing/rate_limiting.d.ts.map +1 -0
- package/dist/testing/rate_limiting.js +216 -0
- package/dist/testing/round_trip.d.ts +37 -0
- package/dist/testing/round_trip.d.ts.map +1 -0
- package/dist/testing/round_trip.js +128 -0
- package/dist/testing/schema_generators.d.ts +33 -0
- package/dist/testing/schema_generators.d.ts.map +1 -0
- package/dist/testing/schema_generators.js +137 -0
- package/dist/testing/standard.d.ts +49 -0
- package/dist/testing/standard.d.ts.map +1 -0
- package/dist/testing/standard.js +16 -0
- package/dist/testing/stubs.d.ts +96 -0
- package/dist/testing/stubs.d.ts.map +1 -0
- package/dist/testing/stubs.js +192 -0
- package/dist/testing/surface_invariants.d.ts +189 -0
- package/dist/testing/surface_invariants.d.ts.map +1 -0
- package/dist/testing/surface_invariants.js +450 -0
- package/dist/ui/AccountSessions.svelte +75 -0
- package/dist/ui/AccountSessions.svelte.d.ts +19 -0
- package/dist/ui/AccountSessions.svelte.d.ts.map +1 -0
- package/dist/ui/AdminAccounts.svelte +107 -0
- package/dist/ui/AdminAccounts.svelte.d.ts +19 -0
- package/dist/ui/AdminAccounts.svelte.d.ts.map +1 -0
- package/dist/ui/AdminAuditLog.svelte +144 -0
- package/dist/ui/AdminAuditLog.svelte.d.ts +4 -0
- package/dist/ui/AdminAuditLog.svelte.d.ts.map +1 -0
- package/dist/ui/AdminInvites.svelte +142 -0
- package/dist/ui/AdminInvites.svelte.d.ts +4 -0
- package/dist/ui/AdminInvites.svelte.d.ts.map +1 -0
- package/dist/ui/AdminOverview.svelte +337 -0
- package/dist/ui/AdminOverview.svelte.d.ts +4 -0
- package/dist/ui/AdminOverview.svelte.d.ts.map +1 -0
- package/dist/ui/AdminPermitHistory.svelte +61 -0
- package/dist/ui/AdminPermitHistory.svelte.d.ts +19 -0
- package/dist/ui/AdminPermitHistory.svelte.d.ts.map +1 -0
- package/dist/ui/AdminSessions.svelte +85 -0
- package/dist/ui/AdminSessions.svelte.d.ts +19 -0
- package/dist/ui/AdminSessions.svelte.d.ts.map +1 -0
- package/dist/ui/AdminSettings.svelte +32 -0
- package/dist/ui/AdminSettings.svelte.d.ts +19 -0
- package/dist/ui/AdminSettings.svelte.d.ts.map +1 -0
- package/dist/ui/AdminSurface.svelte +42 -0
- package/dist/ui/AdminSurface.svelte.d.ts +4 -0
- package/dist/ui/AdminSurface.svelte.d.ts.map +1 -0
- package/dist/ui/AppShell.svelte +93 -0
- package/dist/ui/AppShell.svelte.d.ts +20 -0
- package/dist/ui/AppShell.svelte.d.ts.map +1 -0
- package/dist/ui/BootstrapForm.svelte +105 -0
- package/dist/ui/BootstrapForm.svelte.d.ts +4 -0
- package/dist/ui/BootstrapForm.svelte.d.ts.map +1 -0
- package/dist/ui/ColumnLayout.svelte +46 -0
- package/dist/ui/ColumnLayout.svelte.d.ts +11 -0
- package/dist/ui/ColumnLayout.svelte.d.ts.map +1 -0
- package/dist/ui/ConfirmButton.svelte +125 -0
- package/dist/ui/ConfirmButton.svelte.d.ts +54 -0
- package/dist/ui/ConfirmButton.svelte.d.ts.map +1 -0
- package/dist/ui/Datatable.svelte +185 -0
- package/dist/ui/Datatable.svelte.d.ts +35 -0
- package/dist/ui/Datatable.svelte.d.ts.map +1 -0
- package/dist/ui/LoginForm.svelte +82 -0
- package/dist/ui/LoginForm.svelte.d.ts +8 -0
- package/dist/ui/LoginForm.svelte.d.ts.map +1 -0
- package/dist/ui/LogoutButton.svelte +36 -0
- package/dist/ui/LogoutButton.svelte.d.ts +10 -0
- package/dist/ui/LogoutButton.svelte.d.ts.map +1 -0
- package/dist/ui/MenuLink.svelte +35 -0
- package/dist/ui/MenuLink.svelte.d.ts +12 -0
- package/dist/ui/MenuLink.svelte.d.ts.map +1 -0
- package/dist/ui/OpenSignupToggle.svelte +36 -0
- package/dist/ui/OpenSignupToggle.svelte.d.ts +19 -0
- package/dist/ui/OpenSignupToggle.svelte.d.ts.map +1 -0
- package/dist/ui/PopoverButton.svelte +136 -0
- package/dist/ui/PopoverButton.svelte.d.ts +63 -0
- package/dist/ui/PopoverButton.svelte.d.ts.map +1 -0
- package/dist/ui/SignupForm.svelte +117 -0
- package/dist/ui/SignupForm.svelte.d.ts +7 -0
- package/dist/ui/SignupForm.svelte.d.ts.map +1 -0
- package/dist/ui/SurfaceExplorer.svelte +287 -0
- package/dist/ui/SurfaceExplorer.svelte.d.ts +8 -0
- package/dist/ui/SurfaceExplorer.svelte.d.ts.map +1 -0
- package/dist/ui/account_sessions_state.svelte.d.ts +15 -0
- package/dist/ui/account_sessions_state.svelte.d.ts.map +1 -0
- package/dist/ui/account_sessions_state.svelte.js +45 -0
- package/dist/ui/admin_accounts_state.svelte.d.ts +19 -0
- package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -0
- package/dist/ui/admin_accounts_state.svelte.js +65 -0
- package/dist/ui/admin_invites_state.svelte.d.ts +19 -0
- package/dist/ui/admin_invites_state.svelte.d.ts.map +1 -0
- package/dist/ui/admin_invites_state.svelte.js +71 -0
- package/dist/ui/admin_sessions_state.svelte.d.ts +18 -0
- package/dist/ui/admin_sessions_state.svelte.d.ts.map +1 -0
- package/dist/ui/admin_sessions_state.svelte.js +62 -0
- package/dist/ui/app_settings_state.svelte.d.ts +14 -0
- package/dist/ui/app_settings_state.svelte.d.ts.map +1 -0
- package/dist/ui/app_settings_state.svelte.js +44 -0
- package/dist/ui/audit_log_state.svelte.d.ts +40 -0
- package/dist/ui/audit_log_state.svelte.d.ts.map +1 -0
- package/dist/ui/audit_log_state.svelte.js +153 -0
- package/dist/ui/auth_state.svelte.d.ts +85 -0
- package/dist/ui/auth_state.svelte.d.ts.map +1 -0
- package/dist/ui/auth_state.svelte.js +238 -0
- package/dist/ui/datatable.d.ts +25 -0
- package/dist/ui/datatable.d.ts.map +1 -0
- package/dist/ui/datatable.js +9 -0
- package/dist/ui/enter_advance.d.ts +13 -0
- package/dist/ui/enter_advance.d.ts.map +1 -0
- package/dist/ui/enter_advance.js +30 -0
- package/dist/ui/loadable.svelte.d.ts +55 -0
- package/dist/ui/loadable.svelte.d.ts.map +1 -0
- package/dist/ui/loadable.svelte.js +75 -0
- package/dist/ui/popover.svelte.d.ts +137 -0
- package/dist/ui/popover.svelte.d.ts.map +1 -0
- package/dist/ui/popover.svelte.js +288 -0
- package/dist/ui/position_helpers.d.ts +27 -0
- package/dist/ui/position_helpers.d.ts.map +1 -0
- package/dist/ui/position_helpers.js +81 -0
- package/dist/ui/sidebar_state.svelte.d.ts +30 -0
- package/dist/ui/sidebar_state.svelte.d.ts.map +1 -0
- package/dist/ui/sidebar_state.svelte.js +39 -0
- package/dist/ui/table_state.svelte.d.ts +63 -0
- package/dist/ui/table_state.svelte.d.ts.map +1 -0
- package/dist/ui/table_state.svelte.js +117 -0
- package/dist/ui/ui_fetch.d.ts +29 -0
- package/dist/ui/ui_fetch.d.ts.map +1 -0
- package/dist/ui/ui_fetch.js +37 -0
- package/dist/ui/ui_format.d.ts +63 -0
- package/dist/ui/ui_format.d.ts.map +1 -0
- package/dist/ui/ui_format.js +196 -0
- package/package.json +121 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ActionRegistry` — query and filter utility over `ActionSpecUnion[]`.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
// TODO @action-system-review Many getters below are stub API surface — only `spec_by_method`,
|
|
7
|
+
// `request_response_specs`, `remote_notification_specs`, `local_call_specs`,
|
|
8
|
+
// `frontend_methods`, `backend_methods`, and `methods` are used by consumers (codegen).
|
|
9
|
+
// The rest are pre-built for future use. Revisit which getters to keep when the action
|
|
10
|
+
// system matures (saes-rpc quest). Also consider lazy memoization (`??=` or derived).
|
|
11
|
+
/**
|
|
12
|
+
* Utility class to manage and query action specifications.
|
|
13
|
+
* Provides helper methods to get actions by various criteria.
|
|
14
|
+
*/
|
|
15
|
+
export class ActionRegistry {
|
|
16
|
+
specs;
|
|
17
|
+
constructor(specs) {
|
|
18
|
+
this.specs = specs;
|
|
19
|
+
}
|
|
20
|
+
get spec_by_method() {
|
|
21
|
+
return new Map(this.specs.map((spec) => [spec.method, spec]));
|
|
22
|
+
}
|
|
23
|
+
get request_response_specs() {
|
|
24
|
+
return this.specs.filter((spec) => spec.kind === 'request_response');
|
|
25
|
+
}
|
|
26
|
+
get remote_notification_specs() {
|
|
27
|
+
return this.specs.filter((spec) => spec.kind === 'remote_notification');
|
|
28
|
+
}
|
|
29
|
+
get local_call_specs() {
|
|
30
|
+
return this.specs.filter((spec) => spec.kind === 'local_call');
|
|
31
|
+
}
|
|
32
|
+
// TODO @action-system-review `backend_specs` filters out local_call (can't run on backend);
|
|
33
|
+
// `frontend_specs` returns all specs (all action kinds are relevant to the frontend).
|
|
34
|
+
// Revisit whether these filters are correct as the action system matures.
|
|
35
|
+
get backend_specs() {
|
|
36
|
+
return this.specs.filter((spec) => spec.kind !== 'local_call');
|
|
37
|
+
}
|
|
38
|
+
get frontend_specs() {
|
|
39
|
+
return this.specs;
|
|
40
|
+
}
|
|
41
|
+
get backend_to_frontend_specs() {
|
|
42
|
+
return this.specs.filter((spec) => spec.initiator === 'backend' || spec.initiator === 'both');
|
|
43
|
+
}
|
|
44
|
+
get frontend_to_backend_specs() {
|
|
45
|
+
return this.specs.filter((spec) => spec.initiator === 'frontend' || spec.initiator === 'both');
|
|
46
|
+
}
|
|
47
|
+
get public_specs() {
|
|
48
|
+
return this.specs.filter((spec) => spec.auth === 'public');
|
|
49
|
+
}
|
|
50
|
+
get authenticated_specs() {
|
|
51
|
+
return this.specs.filter((spec) => spec.auth === 'authenticated');
|
|
52
|
+
}
|
|
53
|
+
get methods() {
|
|
54
|
+
return this.specs.map((spec) => spec.method);
|
|
55
|
+
}
|
|
56
|
+
get request_response_methods() {
|
|
57
|
+
return this.request_response_specs.map((spec) => spec.method);
|
|
58
|
+
}
|
|
59
|
+
get remote_notification_methods() {
|
|
60
|
+
return this.remote_notification_specs.map((spec) => spec.method);
|
|
61
|
+
}
|
|
62
|
+
get local_call_methods() {
|
|
63
|
+
return this.local_call_specs.map((spec) => spec.method);
|
|
64
|
+
}
|
|
65
|
+
get backend_methods() {
|
|
66
|
+
return this.backend_specs.map((spec) => spec.method);
|
|
67
|
+
}
|
|
68
|
+
get frontend_methods() {
|
|
69
|
+
return this.frontend_specs.map((spec) => spec.method);
|
|
70
|
+
}
|
|
71
|
+
get frontend_to_backend_methods() {
|
|
72
|
+
return this.frontend_to_backend_specs.map((spec) => spec.method);
|
|
73
|
+
}
|
|
74
|
+
get backend_to_frontend_methods() {
|
|
75
|
+
return this.backend_to_frontend_specs.map((spec) => spec.method);
|
|
76
|
+
}
|
|
77
|
+
get public_methods() {
|
|
78
|
+
return this.public_specs.map((spec) => spec.method);
|
|
79
|
+
}
|
|
80
|
+
get authenticated_methods() {
|
|
81
|
+
return this.authenticated_specs.map((spec) => spec.method);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action spec types — the canonical source of truth for action contracts.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from zzz's action system. Action specs define method, kind,
|
|
5
|
+
* auth, side effects, and input/output schemas. Bridge functions in
|
|
6
|
+
* `action_bridge.ts` derive `RouteSpec` and `SseEventSpec` from them.
|
|
7
|
+
*
|
|
8
|
+
* TODO @action-system-review The action system (action_spec, action_registry,
|
|
9
|
+
* action_codegen, action_bridge) will evolve significantly with the saes-rpc quest.
|
|
10
|
+
* Current state: bridge is stable, registry and codegen are partially stub API.
|
|
11
|
+
* Search for `@action-system-review` across the actions/ and routes/ modules.
|
|
12
|
+
*
|
|
13
|
+
* @module
|
|
14
|
+
*/
|
|
15
|
+
import { z } from 'zod';
|
|
16
|
+
export declare const ActionKind: z.ZodEnum<{
|
|
17
|
+
request_response: "request_response";
|
|
18
|
+
remote_notification: "remote_notification";
|
|
19
|
+
local_call: "local_call";
|
|
20
|
+
}>;
|
|
21
|
+
export type ActionKind = z.infer<typeof ActionKind>;
|
|
22
|
+
export declare const ActionInitiator: z.ZodEnum<{
|
|
23
|
+
both: "both";
|
|
24
|
+
frontend: "frontend";
|
|
25
|
+
backend: "backend";
|
|
26
|
+
}>;
|
|
27
|
+
export type ActionInitiator = z.infer<typeof ActionInitiator>;
|
|
28
|
+
export declare const ActionAuth: z.ZodUnion<readonly [z.ZodLiteral<"public">, z.ZodLiteral<"authenticated">, z.ZodLiteral<"keeper">, z.ZodObject<{
|
|
29
|
+
role: z.ZodString;
|
|
30
|
+
}, z.core.$strict>]>;
|
|
31
|
+
export type ActionAuth = z.infer<typeof ActionAuth>;
|
|
32
|
+
export declare const ActionSideEffects: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodNull]>;
|
|
33
|
+
export type ActionSideEffects = z.infer<typeof ActionSideEffects>;
|
|
34
|
+
export declare const ActionSpec: z.ZodObject<{
|
|
35
|
+
method: z.ZodString;
|
|
36
|
+
kind: z.ZodEnum<{
|
|
37
|
+
request_response: "request_response";
|
|
38
|
+
remote_notification: "remote_notification";
|
|
39
|
+
local_call: "local_call";
|
|
40
|
+
}>;
|
|
41
|
+
initiator: z.ZodEnum<{
|
|
42
|
+
both: "both";
|
|
43
|
+
frontend: "frontend";
|
|
44
|
+
backend: "backend";
|
|
45
|
+
}>;
|
|
46
|
+
auth: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"public">, z.ZodLiteral<"authenticated">, z.ZodLiteral<"keeper">, z.ZodObject<{
|
|
47
|
+
role: z.ZodString;
|
|
48
|
+
}, z.core.$strict>]>>;
|
|
49
|
+
side_effects: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodNull]>;
|
|
50
|
+
input: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
51
|
+
output: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
52
|
+
async: z.ZodBoolean;
|
|
53
|
+
description: z.ZodString;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
export type ActionSpec = z.infer<typeof ActionSpec>;
|
|
56
|
+
export declare const RequestResponseActionSpec: z.ZodObject<{
|
|
57
|
+
method: z.ZodString;
|
|
58
|
+
initiator: z.ZodEnum<{
|
|
59
|
+
both: "both";
|
|
60
|
+
frontend: "frontend";
|
|
61
|
+
backend: "backend";
|
|
62
|
+
}>;
|
|
63
|
+
side_effects: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodNull]>;
|
|
64
|
+
input: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
65
|
+
output: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
66
|
+
description: z.ZodString;
|
|
67
|
+
kind: z.ZodDefault<z.ZodLiteral<"request_response">>;
|
|
68
|
+
auth: z.ZodUnion<readonly [z.ZodLiteral<"public">, z.ZodLiteral<"authenticated">, z.ZodLiteral<"keeper">, z.ZodObject<{
|
|
69
|
+
role: z.ZodString;
|
|
70
|
+
}, z.core.$strict>]>;
|
|
71
|
+
async: z.ZodDefault<z.ZodLiteral<true>>;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
export type RequestResponseActionSpec = z.infer<typeof RequestResponseActionSpec>;
|
|
74
|
+
export declare const RemoteNotificationActionSpec: z.ZodObject<{
|
|
75
|
+
method: z.ZodString;
|
|
76
|
+
initiator: z.ZodEnum<{
|
|
77
|
+
both: "both";
|
|
78
|
+
frontend: "frontend";
|
|
79
|
+
backend: "backend";
|
|
80
|
+
}>;
|
|
81
|
+
input: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
82
|
+
description: z.ZodString;
|
|
83
|
+
kind: z.ZodDefault<z.ZodLiteral<"remote_notification">>;
|
|
84
|
+
auth: z.ZodDefault<z.ZodNull>;
|
|
85
|
+
side_effects: z.ZodDefault<z.ZodNullable<z.ZodLiteral<true>>>;
|
|
86
|
+
output: z.ZodCustom<z.ZodVoid, z.ZodVoid>;
|
|
87
|
+
async: z.ZodDefault<z.ZodLiteral<true>>;
|
|
88
|
+
}, z.core.$strict>;
|
|
89
|
+
export type RemoteNotificationActionSpec = z.infer<typeof RemoteNotificationActionSpec>;
|
|
90
|
+
/**
|
|
91
|
+
* Local calls can wrap synchronous or asynchronous actions,
|
|
92
|
+
* and are the escape hatch for remote APIs that do not support SAES.
|
|
93
|
+
*/
|
|
94
|
+
export declare const LocalCallActionSpec: z.ZodObject<{
|
|
95
|
+
method: z.ZodString;
|
|
96
|
+
initiator: z.ZodEnum<{
|
|
97
|
+
both: "both";
|
|
98
|
+
frontend: "frontend";
|
|
99
|
+
backend: "backend";
|
|
100
|
+
}>;
|
|
101
|
+
side_effects: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodNull]>;
|
|
102
|
+
input: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
103
|
+
output: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
104
|
+
async: z.ZodBoolean;
|
|
105
|
+
description: z.ZodString;
|
|
106
|
+
kind: z.ZodDefault<z.ZodLiteral<"local_call">>;
|
|
107
|
+
auth: z.ZodDefault<z.ZodNull>;
|
|
108
|
+
}, z.core.$strict>;
|
|
109
|
+
export type LocalCallActionSpec = z.infer<typeof LocalCallActionSpec>;
|
|
110
|
+
export declare const ActionSpecUnion: z.ZodUnion<readonly [z.ZodObject<{
|
|
111
|
+
method: z.ZodString;
|
|
112
|
+
initiator: z.ZodEnum<{
|
|
113
|
+
both: "both";
|
|
114
|
+
frontend: "frontend";
|
|
115
|
+
backend: "backend";
|
|
116
|
+
}>;
|
|
117
|
+
side_effects: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodNull]>;
|
|
118
|
+
input: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
119
|
+
output: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
120
|
+
description: z.ZodString;
|
|
121
|
+
kind: z.ZodDefault<z.ZodLiteral<"request_response">>;
|
|
122
|
+
auth: z.ZodUnion<readonly [z.ZodLiteral<"public">, z.ZodLiteral<"authenticated">, z.ZodLiteral<"keeper">, z.ZodObject<{
|
|
123
|
+
role: z.ZodString;
|
|
124
|
+
}, z.core.$strict>]>;
|
|
125
|
+
async: z.ZodDefault<z.ZodLiteral<true>>;
|
|
126
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
127
|
+
method: z.ZodString;
|
|
128
|
+
initiator: z.ZodEnum<{
|
|
129
|
+
both: "both";
|
|
130
|
+
frontend: "frontend";
|
|
131
|
+
backend: "backend";
|
|
132
|
+
}>;
|
|
133
|
+
input: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
134
|
+
description: z.ZodString;
|
|
135
|
+
kind: z.ZodDefault<z.ZodLiteral<"remote_notification">>;
|
|
136
|
+
auth: z.ZodDefault<z.ZodNull>;
|
|
137
|
+
side_effects: z.ZodDefault<z.ZodNullable<z.ZodLiteral<true>>>;
|
|
138
|
+
output: z.ZodCustom<z.ZodVoid, z.ZodVoid>;
|
|
139
|
+
async: z.ZodDefault<z.ZodLiteral<true>>;
|
|
140
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
141
|
+
method: z.ZodString;
|
|
142
|
+
initiator: z.ZodEnum<{
|
|
143
|
+
both: "both";
|
|
144
|
+
frontend: "frontend";
|
|
145
|
+
backend: "backend";
|
|
146
|
+
}>;
|
|
147
|
+
side_effects: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodNull]>;
|
|
148
|
+
input: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
149
|
+
output: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
150
|
+
async: z.ZodBoolean;
|
|
151
|
+
description: z.ZodString;
|
|
152
|
+
kind: z.ZodDefault<z.ZodLiteral<"local_call">>;
|
|
153
|
+
auth: z.ZodDefault<z.ZodNull>;
|
|
154
|
+
}, z.core.$strict>]>;
|
|
155
|
+
export type ActionSpecUnion = z.infer<typeof ActionSpecUnion>;
|
|
156
|
+
export declare const is_action_spec: (value: unknown) => value is ActionSpecUnion;
|
|
157
|
+
export declare const ActionEventPhase: z.ZodEnum<{
|
|
158
|
+
send_request: "send_request";
|
|
159
|
+
receive_request: "receive_request";
|
|
160
|
+
send_response: "send_response";
|
|
161
|
+
receive_response: "receive_response";
|
|
162
|
+
send_error: "send_error";
|
|
163
|
+
receive_error: "receive_error";
|
|
164
|
+
send: "send";
|
|
165
|
+
receive: "receive";
|
|
166
|
+
execute: "execute";
|
|
167
|
+
}>;
|
|
168
|
+
export type ActionEventPhase = z.infer<typeof ActionEventPhase>;
|
|
169
|
+
//# sourceMappingURL=action_spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action_spec.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/action_spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,UAAU;;;;EAAoE,CAAC;AAC5F,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,eAAO,MAAM,eAAe;;;;EAA0C,CAAC;AACvE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,eAAO,MAAM,UAAU;;oBAKrB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,eAAO,MAAM,iBAAiB,sDAAuC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;kBAUrB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;kBAIpC,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAElF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;kBAMvC,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAExF;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;kBAG9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAI1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,eAKoB,CAAC;AAE9E,eAAO,MAAM,gBAAgB;;;;;;;;;;EAU3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action spec types — the canonical source of truth for action contracts.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from zzz's action system. Action specs define method, kind,
|
|
5
|
+
* auth, side effects, and input/output schemas. Bridge functions in
|
|
6
|
+
* `action_bridge.ts` derive `RouteSpec` and `SseEventSpec` from them.
|
|
7
|
+
*
|
|
8
|
+
* TODO @action-system-review The action system (action_spec, action_registry,
|
|
9
|
+
* action_codegen, action_bridge) will evolve significantly with the saes-rpc quest.
|
|
10
|
+
* Current state: bridge is stable, registry and codegen are partially stub API.
|
|
11
|
+
* Search for `@action-system-review` across the actions/ and routes/ modules.
|
|
12
|
+
*
|
|
13
|
+
* @module
|
|
14
|
+
*/
|
|
15
|
+
import { z } from 'zod';
|
|
16
|
+
export const ActionKind = z.enum(['request_response', 'remote_notification', 'local_call']);
|
|
17
|
+
export const ActionInitiator = z.enum(['frontend', 'backend', 'both']);
|
|
18
|
+
export const ActionAuth = z.union([
|
|
19
|
+
z.literal('public'),
|
|
20
|
+
z.literal('authenticated'),
|
|
21
|
+
z.literal('keeper'),
|
|
22
|
+
z.strictObject({ role: z.string() }),
|
|
23
|
+
]);
|
|
24
|
+
export const ActionSideEffects = z.union([z.literal(true), z.null()]);
|
|
25
|
+
export const ActionSpec = z.strictObject({
|
|
26
|
+
method: z.string(),
|
|
27
|
+
kind: ActionKind,
|
|
28
|
+
initiator: ActionInitiator,
|
|
29
|
+
auth: ActionAuth.nullable(),
|
|
30
|
+
side_effects: ActionSideEffects,
|
|
31
|
+
input: z.custom((v) => v instanceof z.ZodType),
|
|
32
|
+
output: z.custom((v) => v instanceof z.ZodType),
|
|
33
|
+
async: z.boolean(),
|
|
34
|
+
description: z.string(),
|
|
35
|
+
});
|
|
36
|
+
export const RequestResponseActionSpec = ActionSpec.extend({
|
|
37
|
+
kind: z.literal('request_response').default('request_response'),
|
|
38
|
+
auth: ActionAuth,
|
|
39
|
+
async: z.literal(true).default(true),
|
|
40
|
+
});
|
|
41
|
+
export const RemoteNotificationActionSpec = ActionSpec.extend({
|
|
42
|
+
kind: z.literal('remote_notification').default('remote_notification'),
|
|
43
|
+
auth: z.null().default(null),
|
|
44
|
+
side_effects: z.literal(true).nullable().default(true),
|
|
45
|
+
output: z.custom((v) => v instanceof z.ZodVoid),
|
|
46
|
+
async: z.literal(true).default(true),
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* Local calls can wrap synchronous or asynchronous actions,
|
|
50
|
+
* and are the escape hatch for remote APIs that do not support SAES.
|
|
51
|
+
*/
|
|
52
|
+
export const LocalCallActionSpec = ActionSpec.extend({
|
|
53
|
+
kind: z.literal('local_call').default('local_call'),
|
|
54
|
+
auth: z.null().default(null),
|
|
55
|
+
});
|
|
56
|
+
export const ActionSpecUnion = z.union([
|
|
57
|
+
RequestResponseActionSpec,
|
|
58
|
+
RemoteNotificationActionSpec,
|
|
59
|
+
LocalCallActionSpec,
|
|
60
|
+
]);
|
|
61
|
+
export const is_action_spec = (value) => value !== null &&
|
|
62
|
+
typeof value === 'object' &&
|
|
63
|
+
'method' in value &&
|
|
64
|
+
'kind' in value &&
|
|
65
|
+
ActionKind.options.includes(value.kind);
|
|
66
|
+
export const ActionEventPhase = z.enum([
|
|
67
|
+
'send_request',
|
|
68
|
+
'receive_request',
|
|
69
|
+
'send_response',
|
|
70
|
+
'receive_response',
|
|
71
|
+
'send_error',
|
|
72
|
+
'receive_error',
|
|
73
|
+
'send',
|
|
74
|
+
'receive',
|
|
75
|
+
'execute',
|
|
76
|
+
]);
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account and actor database queries.
|
|
3
|
+
*
|
|
4
|
+
* Provides CRUD operations for the account and actor tables.
|
|
5
|
+
* For v1, every account has exactly one actor (1:1).
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import type { QueryDeps } from '../db/query_deps.js';
|
|
10
|
+
import { type Account, type Actor, type CreateAccountInput, type AdminAccountEntryJson } from './account_schema.js';
|
|
11
|
+
/**
|
|
12
|
+
* Create a new account.
|
|
13
|
+
*
|
|
14
|
+
* @param deps - query dependencies
|
|
15
|
+
* @param input - the account fields
|
|
16
|
+
* @returns the created account
|
|
17
|
+
*/
|
|
18
|
+
export declare const query_create_account: (deps: QueryDeps, input: CreateAccountInput) => Promise<Account>;
|
|
19
|
+
/**
|
|
20
|
+
* Find an account by id.
|
|
21
|
+
*/
|
|
22
|
+
export declare const query_account_by_id: (deps: QueryDeps, id: string) => Promise<Account | undefined>;
|
|
23
|
+
/**
|
|
24
|
+
* Find an account by username (case-insensitive).
|
|
25
|
+
*/
|
|
26
|
+
export declare const query_account_by_username: (deps: QueryDeps, username: string) => Promise<Account | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* Find an account by email (case-insensitive).
|
|
29
|
+
*/
|
|
30
|
+
export declare const query_account_by_email: (deps: QueryDeps, email: string) => Promise<Account | undefined>;
|
|
31
|
+
/**
|
|
32
|
+
* Find an account by username or email.
|
|
33
|
+
*
|
|
34
|
+
* If the input contains `@`, tries email lookup first then username.
|
|
35
|
+
* Otherwise tries username first then email. This supports a single
|
|
36
|
+
* login field that accepts either format.
|
|
37
|
+
*
|
|
38
|
+
* @param deps - query dependencies
|
|
39
|
+
* @param input - username or email address
|
|
40
|
+
* @returns the matching account, or `undefined`
|
|
41
|
+
*/
|
|
42
|
+
export declare const query_account_by_username_or_email: (deps: QueryDeps, input: string) => Promise<Account | undefined>;
|
|
43
|
+
/**
|
|
44
|
+
* Update the password hash for an account.
|
|
45
|
+
*/
|
|
46
|
+
export declare const query_update_account_password: (deps: QueryDeps, id: string, password_hash: string, updated_by: string | null) => Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Delete an account. Cascades to actors, permits, sessions, and tokens.
|
|
49
|
+
*/
|
|
50
|
+
export declare const query_delete_account: (deps: QueryDeps, id: string) => Promise<boolean>;
|
|
51
|
+
/**
|
|
52
|
+
* Check if any account exists.
|
|
53
|
+
*/
|
|
54
|
+
export declare const query_account_has_any: (deps: QueryDeps) => Promise<boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* Create a new actor for an account.
|
|
57
|
+
*
|
|
58
|
+
* @param deps - query dependencies
|
|
59
|
+
* @param account_id - the owning account
|
|
60
|
+
* @param name - display name (defaults to account username)
|
|
61
|
+
* @returns the created actor
|
|
62
|
+
*/
|
|
63
|
+
export declare const query_create_actor: (deps: QueryDeps, account_id: string, name: string) => Promise<Actor>;
|
|
64
|
+
/**
|
|
65
|
+
* Find the actor for an account.
|
|
66
|
+
*
|
|
67
|
+
* For v1, each account has exactly one actor.
|
|
68
|
+
*/
|
|
69
|
+
export declare const query_actor_by_account: (deps: QueryDeps, account_id: string) => Promise<Actor | undefined>;
|
|
70
|
+
/**
|
|
71
|
+
* Find an actor by id.
|
|
72
|
+
*/
|
|
73
|
+
export declare const query_actor_by_id: (deps: QueryDeps, id: string) => Promise<Actor | undefined>;
|
|
74
|
+
/**
|
|
75
|
+
* Create an account and its actor in a single operation.
|
|
76
|
+
*
|
|
77
|
+
* For v1, every account gets exactly one actor with the same name as the username.
|
|
78
|
+
*
|
|
79
|
+
* @param deps - query dependencies
|
|
80
|
+
* @param input - the account fields
|
|
81
|
+
* @returns the created account and actor
|
|
82
|
+
*/
|
|
83
|
+
export declare const query_create_account_with_actor: (deps: QueryDeps, input: CreateAccountInput) => Promise<{
|
|
84
|
+
account: Account;
|
|
85
|
+
actor: Actor;
|
|
86
|
+
}>;
|
|
87
|
+
/**
|
|
88
|
+
* List all accounts with their actors and active permits for admin display.
|
|
89
|
+
*
|
|
90
|
+
* Uses 3 flat queries instead of N+1 per-account loops.
|
|
91
|
+
*
|
|
92
|
+
* @param deps - query dependencies
|
|
93
|
+
* @returns admin account entries sorted by creation date
|
|
94
|
+
*/
|
|
95
|
+
export declare const query_admin_account_list: (deps: QueryDeps) => Promise<Array<AdminAccountEntryJson>>;
|
|
96
|
+
//# sourceMappingURL=account_queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account_queries.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/account_queries.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAEN,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,MAAM,qBAAqB,CAAC;AAE7B;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAChC,MAAM,SAAS,EACf,OAAO,kBAAkB,KACvB,OAAO,CAAC,OAAO,CAQjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC/B,MAAM,SAAS,EACf,IAAI,MAAM,KACR,OAAO,CAAC,OAAO,GAAG,SAAS,CAE7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,GACrC,MAAM,SAAS,EACf,UAAU,MAAM,KACd,OAAO,CAAC,OAAO,GAAG,SAAS,CAI7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAClC,MAAM,SAAS,EACf,OAAO,MAAM,KACX,OAAO,CAAC,OAAO,GAAG,SAAS,CAI7B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kCAAkC,GAC9C,MAAM,SAAS,EACf,OAAO,MAAM,KACX,OAAO,CAAC,OAAO,GAAG,SAAS,CAS7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B,GACzC,MAAM,SAAS,EACf,IAAI,MAAM,EACV,eAAe,MAAM,EACrB,YAAY,MAAM,GAAG,IAAI,KACvB,OAAO,CAAC,IAAI,CAKd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAU,MAAM,SAAS,EAAE,IAAI,MAAM,KAAG,OAAO,CAAC,OAAO,CAKvF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAU,MAAM,SAAS,KAAG,OAAO,CAAC,OAAO,CAK5E,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC9B,MAAM,SAAS,EACf,YAAY,MAAM,EAClB,MAAM,MAAM,KACV,OAAO,CAAC,KAAK,CAMf,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAClC,MAAM,SAAS,EACf,YAAY,MAAM,KAChB,OAAO,CAAC,KAAK,GAAG,SAAS,CAE3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC7B,MAAM,SAAS,EACf,IAAI,MAAM,KACR,OAAO,CAAC,KAAK,GAAG,SAAS,CAE3B,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,+BAA+B,GAC3C,MAAM,SAAS,EACf,OAAO,kBAAkB,KACvB,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAC,CAI1C,CAAC;AAYF;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,GACpC,MAAM,SAAS,KACb,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CA4CtC,CAAC"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account and actor database queries.
|
|
3
|
+
*
|
|
4
|
+
* Provides CRUD operations for the account and actor tables.
|
|
5
|
+
* For v1, every account has exactly one actor (1:1).
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { assert_row } from '../db/assert_row.js';
|
|
10
|
+
import { to_admin_account, } from './account_schema.js';
|
|
11
|
+
/**
|
|
12
|
+
* Create a new account.
|
|
13
|
+
*
|
|
14
|
+
* @param deps - query dependencies
|
|
15
|
+
* @param input - the account fields
|
|
16
|
+
* @returns the created account
|
|
17
|
+
*/
|
|
18
|
+
export const query_create_account = async (deps, input) => {
|
|
19
|
+
const row = await deps.db.query_one(`INSERT INTO account (username, password_hash, email)
|
|
20
|
+
VALUES ($1, $2, $3)
|
|
21
|
+
RETURNING *`, [input.username, input.password_hash, input.email ?? null]);
|
|
22
|
+
return assert_row(row, 'INSERT INTO account');
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Find an account by id.
|
|
26
|
+
*/
|
|
27
|
+
export const query_account_by_id = async (deps, id) => {
|
|
28
|
+
return deps.db.query_one(`SELECT * FROM account WHERE id = $1`, [id]);
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Find an account by username (case-insensitive).
|
|
32
|
+
*/
|
|
33
|
+
export const query_account_by_username = async (deps, username) => {
|
|
34
|
+
return deps.db.query_one(`SELECT * FROM account WHERE LOWER(username) = LOWER($1)`, [
|
|
35
|
+
username,
|
|
36
|
+
]);
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Find an account by email (case-insensitive).
|
|
40
|
+
*/
|
|
41
|
+
export const query_account_by_email = async (deps, email) => {
|
|
42
|
+
return deps.db.query_one(`SELECT * FROM account WHERE LOWER(email) = LOWER($1)`, [
|
|
43
|
+
email,
|
|
44
|
+
]);
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Find an account by username or email.
|
|
48
|
+
*
|
|
49
|
+
* If the input contains `@`, tries email lookup first then username.
|
|
50
|
+
* Otherwise tries username first then email. This supports a single
|
|
51
|
+
* login field that accepts either format.
|
|
52
|
+
*
|
|
53
|
+
* @param deps - query dependencies
|
|
54
|
+
* @param input - username or email address
|
|
55
|
+
* @returns the matching account, or `undefined`
|
|
56
|
+
*/
|
|
57
|
+
export const query_account_by_username_or_email = async (deps, input) => {
|
|
58
|
+
if (input.includes('@')) {
|
|
59
|
+
return ((await query_account_by_email(deps, input)) ?? (await query_account_by_username(deps, input)));
|
|
60
|
+
}
|
|
61
|
+
return ((await query_account_by_username(deps, input)) ?? (await query_account_by_email(deps, input)));
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Update the password hash for an account.
|
|
65
|
+
*/
|
|
66
|
+
export const query_update_account_password = async (deps, id, password_hash, updated_by) => {
|
|
67
|
+
await deps.db.query(`UPDATE account SET password_hash = $1, updated_at = NOW(), updated_by = $2 WHERE id = $3`, [password_hash, updated_by ?? null, id]);
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Delete an account. Cascades to actors, permits, sessions, and tokens.
|
|
71
|
+
*/
|
|
72
|
+
export const query_delete_account = async (deps, id) => {
|
|
73
|
+
const rows = await deps.db.query(`DELETE FROM account WHERE id = $1 RETURNING id`, [
|
|
74
|
+
id,
|
|
75
|
+
]);
|
|
76
|
+
return rows.length > 0;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Check if any account exists.
|
|
80
|
+
*/
|
|
81
|
+
export const query_account_has_any = async (deps) => {
|
|
82
|
+
const row = await deps.db.query_one(`SELECT EXISTS(SELECT 1 FROM account) AS exists`);
|
|
83
|
+
return row?.exists ?? false;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Create a new actor for an account.
|
|
87
|
+
*
|
|
88
|
+
* @param deps - query dependencies
|
|
89
|
+
* @param account_id - the owning account
|
|
90
|
+
* @param name - display name (defaults to account username)
|
|
91
|
+
* @returns the created actor
|
|
92
|
+
*/
|
|
93
|
+
export const query_create_actor = async (deps, account_id, name) => {
|
|
94
|
+
const row = await deps.db.query_one(`INSERT INTO actor (account_id, name) VALUES ($1, $2) RETURNING *`, [account_id, name]);
|
|
95
|
+
return assert_row(row, 'INSERT INTO actor');
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Find the actor for an account.
|
|
99
|
+
*
|
|
100
|
+
* For v1, each account has exactly one actor.
|
|
101
|
+
*/
|
|
102
|
+
export const query_actor_by_account = async (deps, account_id) => {
|
|
103
|
+
return deps.db.query_one(`SELECT * FROM actor WHERE account_id = $1`, [account_id]);
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Find an actor by id.
|
|
107
|
+
*/
|
|
108
|
+
export const query_actor_by_id = async (deps, id) => {
|
|
109
|
+
return deps.db.query_one(`SELECT * FROM actor WHERE id = $1`, [id]);
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Create an account and its actor in a single operation.
|
|
113
|
+
*
|
|
114
|
+
* For v1, every account gets exactly one actor with the same name as the username.
|
|
115
|
+
*
|
|
116
|
+
* @param deps - query dependencies
|
|
117
|
+
* @param input - the account fields
|
|
118
|
+
* @returns the created account and actor
|
|
119
|
+
*/
|
|
120
|
+
export const query_create_account_with_actor = async (deps, input) => {
|
|
121
|
+
const account = await query_create_account(deps, input);
|
|
122
|
+
const actor = await query_create_actor(deps, account.id, input.username);
|
|
123
|
+
return { account, actor };
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* List all accounts with their actors and active permits for admin display.
|
|
127
|
+
*
|
|
128
|
+
* Uses 3 flat queries instead of N+1 per-account loops.
|
|
129
|
+
*
|
|
130
|
+
* @param deps - query dependencies
|
|
131
|
+
* @returns admin account entries sorted by creation date
|
|
132
|
+
*/
|
|
133
|
+
export const query_admin_account_list = async (deps) => {
|
|
134
|
+
const [accounts, actors, permits] = await Promise.all([
|
|
135
|
+
deps.db.query(`SELECT * FROM account ORDER BY created_at`),
|
|
136
|
+
deps.db.query(`SELECT * FROM actor`),
|
|
137
|
+
deps.db.query(`SELECT id, actor_id, role, created_at, expires_at, granted_by
|
|
138
|
+
FROM permit
|
|
139
|
+
WHERE revoked_at IS NULL
|
|
140
|
+
AND (expires_at IS NULL OR expires_at > NOW())`),
|
|
141
|
+
]);
|
|
142
|
+
// Index actors by account_id (1:1 in v1)
|
|
143
|
+
const actor_by_account = new Map();
|
|
144
|
+
for (const actor of actors) {
|
|
145
|
+
actor_by_account.set(actor.account_id, actor);
|
|
146
|
+
}
|
|
147
|
+
// Group permits by actor_id
|
|
148
|
+
const permits_by_actor = new Map();
|
|
149
|
+
for (const permit of permits) {
|
|
150
|
+
let list = permits_by_actor.get(permit.actor_id);
|
|
151
|
+
if (!list) {
|
|
152
|
+
list = [];
|
|
153
|
+
permits_by_actor.set(permit.actor_id, list);
|
|
154
|
+
}
|
|
155
|
+
list.push(permit);
|
|
156
|
+
}
|
|
157
|
+
return accounts.map((account) => {
|
|
158
|
+
const actor = actor_by_account.get(account.id);
|
|
159
|
+
const actor_permits = actor ? (permits_by_actor.get(actor.id) ?? []) : [];
|
|
160
|
+
return {
|
|
161
|
+
account: to_admin_account(account),
|
|
162
|
+
actor: actor ? { id: actor.id, name: actor.name } : null,
|
|
163
|
+
permits: actor_permits.map((p) => ({
|
|
164
|
+
id: p.id,
|
|
165
|
+
role: p.role,
|
|
166
|
+
created_at: p.created_at,
|
|
167
|
+
expires_at: p.expires_at,
|
|
168
|
+
granted_by: p.granted_by,
|
|
169
|
+
})),
|
|
170
|
+
};
|
|
171
|
+
});
|
|
172
|
+
};
|