@fuzdev/fuz_app 0.52.0 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/CLAUDE.md +29 -9
- package/dist/actions/action_codegen.d.ts +10 -35
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +13 -42
- package/dist/actions/action_peer.d.ts.map +1 -1
- package/dist/actions/action_peer.js +0 -9
- package/dist/actions/action_registry.d.ts +0 -4
- package/dist/actions/action_registry.d.ts.map +1 -1
- package/dist/actions/action_registry.js +4 -10
- package/dist/actions/action_rpc.d.ts +16 -0
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +41 -20
- package/dist/actions/action_spec.d.ts +54 -5
- package/dist/actions/action_spec.d.ts.map +1 -1
- package/dist/actions/action_spec.js +21 -5
- package/dist/actions/frontend_rpc_client.d.ts +1 -9
- package/dist/actions/frontend_rpc_client.d.ts.map +1 -1
- package/dist/actions/frontend_rpc_client.js +1 -9
- package/dist/actions/register_action_ws.d.ts +16 -0
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +41 -1
- package/dist/actions/request_tracker.svelte.d.ts +10 -15
- package/dist/actions/request_tracker.svelte.d.ts.map +1 -1
- package/dist/actions/request_tracker.svelte.js +10 -15
- package/dist/actions/rpc_client.d.ts +0 -1
- package/dist/actions/rpc_client.d.ts.map +1 -1
- package/dist/actions/rpc_client.js +3 -17
- package/dist/actions/socket.svelte.d.ts +0 -1
- package/dist/actions/socket.svelte.d.ts.map +1 -1
- package/dist/actions/socket.svelte.js +0 -1
- package/dist/actions/transports.d.ts +4 -3
- package/dist/actions/transports.d.ts.map +1 -1
- package/dist/actions/transports.js +4 -13
- package/dist/actions/transports_ws_auth_guard.d.ts +0 -2
- package/dist/actions/transports_ws_auth_guard.d.ts.map +1 -1
- package/dist/actions/transports_ws_auth_guard.js +0 -2
- package/dist/actions/transports_ws_backend.d.ts.map +1 -1
- package/dist/actions/transports_ws_backend.js +0 -9
- package/dist/auth/CLAUDE.md +43 -19
- package/dist/auth/account_queries.d.ts +0 -3
- package/dist/auth/account_queries.d.ts.map +1 -1
- package/dist/auth/account_queries.js +0 -3
- package/dist/auth/admin_action_specs.d.ts +5 -0
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +5 -0
- package/dist/auth/api_token_queries.d.ts +0 -1
- package/dist/auth/api_token_queries.d.ts.map +1 -1
- package/dist/auth/api_token_queries.js +0 -1
- package/dist/auth/audit_log_queries.d.ts +0 -1
- package/dist/auth/audit_log_queries.d.ts.map +1 -1
- package/dist/auth/audit_log_queries.js +0 -1
- package/dist/auth/audit_log_routes.d.ts +2 -2
- package/dist/auth/audit_log_routes.js +2 -2
- package/dist/auth/invite_queries.d.ts +0 -1
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_queries.js +0 -1
- package/dist/auth/permit_offer_action_specs.d.ts +1 -0
- package/dist/auth/permit_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/permit_offer_action_specs.js +1 -0
- package/dist/auth/permit_offer_actions.d.ts.map +1 -1
- package/dist/auth/permit_offer_actions.js +9 -6
- package/dist/auth/permit_offer_queries.d.ts +0 -1
- package/dist/auth/permit_offer_queries.d.ts.map +1 -1
- package/dist/auth/permit_offer_queries.js +0 -1
- package/dist/auth/permit_queries.d.ts +0 -1
- package/dist/auth/permit_queries.d.ts.map +1 -1
- package/dist/auth/permit_queries.js +0 -1
- package/dist/auth/request_context.d.ts +47 -2
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +57 -2
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +14 -11
- package/dist/auth/session_lifecycle.d.ts +0 -1
- package/dist/auth/session_lifecycle.d.ts.map +1 -1
- package/dist/auth/session_lifecycle.js +0 -1
- package/dist/auth/session_middleware.d.ts +0 -4
- package/dist/auth/session_middleware.d.ts.map +1 -1
- package/dist/auth/session_middleware.js +0 -4
- package/dist/cli/config.d.ts +0 -3
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +0 -3
- package/dist/cli/daemon.d.ts +1 -1
- package/dist/cli/daemon.js +1 -1
- package/dist/db/create_db.d.ts +0 -1
- package/dist/db/create_db.d.ts.map +1 -1
- package/dist/db/create_db.js +0 -1
- package/dist/db/db.d.ts +0 -4
- package/dist/db/db.d.ts.map +1 -1
- package/dist/db/db.js +0 -4
- package/dist/db/db_pg.d.ts +2 -2
- package/dist/db/db_pg.js +2 -2
- package/dist/db/db_pglite.d.ts +1 -2
- package/dist/db/db_pglite.d.ts.map +1 -1
- package/dist/db/db_pglite.js +1 -2
- package/dist/db/migrate.d.ts +0 -1
- package/dist/db/migrate.d.ts.map +1 -1
- package/dist/db/migrate.js +0 -1
- package/dist/dev/setup.d.ts +0 -3
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +0 -3
- package/dist/env/load.d.ts +0 -2
- package/dist/env/load.d.ts.map +1 -1
- package/dist/env/load.js +0 -2
- package/dist/hono_context.d.ts +2 -5
- package/dist/hono_context.d.ts.map +1 -1
- package/dist/hono_context.js +2 -5
- package/dist/http/common_routes.d.ts +0 -8
- package/dist/http/common_routes.d.ts.map +1 -1
- package/dist/http/common_routes.js +0 -8
- package/dist/http/db_routes.d.ts +0 -3
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +0 -3
- package/dist/http/error_schemas.d.ts +12 -11
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +11 -7
- package/dist/http/jsonrpc_errors.d.ts +0 -6
- package/dist/http/jsonrpc_errors.d.ts.map +1 -1
- package/dist/http/jsonrpc_errors.js +0 -6
- package/dist/http/origin.d.ts +6 -13
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +7 -14
- package/dist/http/proxy.d.ts +1 -7
- package/dist/http/proxy.d.ts.map +1 -1
- package/dist/http/proxy.js +1 -7
- package/dist/http/route_spec.d.ts +13 -35
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +10 -22
- package/dist/http/schema_helpers.d.ts +0 -4
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +0 -4
- package/dist/http/surface.d.ts +2 -12
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +1 -12
- package/dist/rate_limiter.d.ts +16 -0
- package/dist/rate_limiter.d.ts.map +1 -1
- package/dist/rate_limiter.js +26 -0
- package/dist/realtime/sse.d.ts +0 -1
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +0 -1
- package/dist/realtime/subscriber_registry.d.ts +0 -3
- package/dist/realtime/subscriber_registry.d.ts.map +1 -1
- package/dist/realtime/subscriber_registry.js +0 -3
- package/dist/runtime/fs.d.ts +1 -4
- package/dist/runtime/fs.d.ts.map +1 -1
- package/dist/runtime/fs.js +1 -4
- package/dist/runtime/mock.d.ts +0 -3
- package/dist/runtime/mock.d.ts.map +1 -1
- package/dist/runtime/mock.js +0 -3
- package/dist/server/app_server.d.ts +27 -5
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +19 -7
- package/dist/server/startup.d.ts +0 -2
- package/dist/server/startup.d.ts.map +1 -1
- package/dist/server/startup.js +0 -2
- package/dist/server/static.d.ts +0 -1
- package/dist/server/static.d.ts.map +1 -1
- package/dist/server/static.js +0 -1
- package/dist/server/validate_nginx.d.ts +0 -3
- package/dist/server/validate_nginx.d.ts.map +1 -1
- package/dist/server/validate_nginx.js +0 -3
- package/dist/testing/CLAUDE.md +1 -1
- package/dist/testing/admin_integration.d.ts +0 -1
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +3 -6
- package/dist/testing/adversarial_404.d.ts +0 -2
- package/dist/testing/adversarial_404.d.ts.map +1 -1
- package/dist/testing/adversarial_404.js +0 -2
- package/dist/testing/adversarial_headers.d.ts +0 -1
- package/dist/testing/adversarial_headers.d.ts.map +1 -1
- package/dist/testing/adversarial_headers.js +0 -1
- package/dist/testing/adversarial_input.d.ts +0 -2
- package/dist/testing/adversarial_input.d.ts.map +1 -1
- package/dist/testing/adversarial_input.js +0 -2
- package/dist/testing/app_server.d.ts +22 -0
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +2 -4
- package/dist/testing/assertions.d.ts +0 -4
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/assertions.js +0 -4
- package/dist/testing/attack_surface.d.ts +0 -4
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/attack_surface.js +0 -4
- package/dist/testing/audit_completeness.d.ts +0 -1
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +0 -1
- package/dist/testing/auth_apps.d.ts +2 -10
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +2 -10
- package/dist/testing/data_exposure.d.ts +0 -11
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +0 -11
- package/dist/testing/db.d.ts +0 -6
- package/dist/testing/db.d.ts.map +1 -1
- package/dist/testing/db.js +0 -6
- package/dist/testing/error_coverage.d.ts +0 -14
- package/dist/testing/error_coverage.d.ts.map +1 -1
- package/dist/testing/error_coverage.js +0 -14
- package/dist/testing/integration.d.ts +0 -1
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +0 -1
- package/dist/testing/integration_helpers.d.ts +1 -36
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +1 -43
- package/dist/testing/middleware.d.ts +0 -10
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +0 -10
- package/dist/testing/mock_fs.d.ts +0 -2
- package/dist/testing/mock_fs.d.ts.map +1 -1
- package/dist/testing/mock_fs.js +0 -2
- package/dist/testing/rate_limiting.d.ts +0 -1
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +0 -1
- package/dist/testing/round_trip.d.ts +0 -2
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/round_trip.js +0 -2
- package/dist/testing/rpc_attack_surface.d.ts +0 -2
- package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
- package/dist/testing/rpc_attack_surface.js +0 -2
- package/dist/testing/rpc_helpers.d.ts +0 -6
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +0 -6
- package/dist/testing/rpc_round_trip.d.ts +0 -2
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.js +0 -2
- package/dist/testing/schema_generators.d.ts +0 -3
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +29 -3
- package/dist/testing/sse_round_trip.d.ts +0 -1
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +0 -1
- package/dist/testing/standard.d.ts +0 -2
- package/dist/testing/standard.d.ts.map +1 -1
- package/dist/testing/standard.js +0 -2
- package/dist/testing/stubs.d.ts +3 -5
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +5 -5
- package/dist/testing/surface_invariants.d.ts +0 -3
- package/dist/testing/surface_invariants.d.ts.map +1 -1
- package/dist/testing/surface_invariants.js +0 -3
- package/dist/ui/CLAUDE.md +1 -1
- package/dist/ui/audit_log_state.svelte.js +1 -1
- package/dist/ui/position_helpers.d.ts +0 -3
- package/dist/ui/position_helpers.d.ts.map +1 -1
- package/dist/ui/position_helpers.js +0 -3
- package/dist/ui/sidebar_state.svelte.d.ts +1 -2
- package/dist/ui/sidebar_state.svelte.d.ts.map +1 -1
- package/dist/ui/sidebar_state.svelte.js +1 -2
- package/dist/ui/ui_fetch.d.ts +1 -7
- package/dist/ui/ui_fetch.d.ts.map +1 -1
- package/dist/ui/ui_fetch.js +1 -7
- package/dist/ui/ui_format.d.ts +2 -14
- package/dist/ui/ui_format.d.ts.map +1 -1
- package/dist/ui/ui_format.js +2 -14
- package/package.json +2 -2
package/dist/http/route_spec.js
CHANGED
|
@@ -19,10 +19,8 @@ import { is_null_schema, merge_error_schemas } from './schema_helpers.js';
|
|
|
19
19
|
/**
|
|
20
20
|
* Get validated input from the Hono context.
|
|
21
21
|
*
|
|
22
|
-
* Call
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @returns the validated request body
|
|
22
|
+
* Call after the input validation middleware has run. The type parameter
|
|
23
|
+
* should match the route's `input` schema.
|
|
26
24
|
*/
|
|
27
25
|
export const get_route_input = (c) => {
|
|
28
26
|
return c.get('validated_input');
|
|
@@ -30,13 +28,11 @@ export const get_route_input = (c) => {
|
|
|
30
28
|
/**
|
|
31
29
|
* Get validated URL path params from the Hono context.
|
|
32
30
|
*
|
|
33
|
-
* Call
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* TODO @action-system-review Make typesafe — derive `T` from the `params` schema on the
|
|
37
|
-
* route spec so the type parameter isn't manually specified.
|
|
31
|
+
* Call after the params validation middleware has run. The type parameter
|
|
32
|
+
* should match the route's `params` schema.
|
|
38
33
|
*
|
|
39
|
-
*
|
|
34
|
+
* TODO derive `T` from the route spec so the type parameter isn't manually
|
|
35
|
+
* specified — same applies to `get_route_input` / `get_route_query`.
|
|
40
36
|
*/
|
|
41
37
|
export const get_route_params = (c) => {
|
|
42
38
|
return c.get('validated_params');
|
|
@@ -44,10 +40,8 @@ export const get_route_params = (c) => {
|
|
|
44
40
|
/**
|
|
45
41
|
* Get validated URL query params from the Hono context.
|
|
46
42
|
*
|
|
47
|
-
* Call
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* @returns the validated query parameters
|
|
43
|
+
* Call after the query validation middleware has run. The type parameter
|
|
44
|
+
* should match the route's `query` schema.
|
|
51
45
|
*/
|
|
52
46
|
export const get_route_query = (c) => {
|
|
53
47
|
return c.get('validated_query');
|
|
@@ -188,8 +182,6 @@ const wrap_output_validation = (handler, output_schema, error_schemas, log) => {
|
|
|
188
182
|
/**
|
|
189
183
|
* Apply named middleware specs to a Hono app.
|
|
190
184
|
*
|
|
191
|
-
* @param app - the Hono app
|
|
192
|
-
* @param specs - middleware specs to apply
|
|
193
185
|
* @mutates `app`
|
|
194
186
|
*/
|
|
195
187
|
export const apply_middleware_specs = (app, specs) => {
|
|
@@ -238,11 +230,8 @@ const wrap_error_catch = (handler, log) => {
|
|
|
238
230
|
* - `background_db`: always pool-level
|
|
239
231
|
* - `pending_effects`: fire-and-forget effect queue
|
|
240
232
|
*
|
|
241
|
-
* @param app - the Hono app
|
|
242
|
-
* @param specs - route specs to apply
|
|
243
233
|
* @param resolve_auth_guards - maps `RouteAuth` to middleware — use `fuz_auth_guard_resolver` from `auth/route_guards.ts`
|
|
244
|
-
* @param
|
|
245
|
-
* @param db - database instance for transaction wrapping and `RouteContext`
|
|
234
|
+
* @param db - used for transaction wrapping and `RouteContext`
|
|
246
235
|
* @mutates `app`
|
|
247
236
|
* @throws Error if two specs share the same `method` + `path` (each combination must be unique)
|
|
248
237
|
*/
|
|
@@ -276,8 +265,7 @@ export const apply_route_specs = (app, specs, resolve_auth_guards, log, db) => {
|
|
|
276
265
|
* Prepend a prefix to all route spec paths.
|
|
277
266
|
*
|
|
278
267
|
* @param prefix - the path prefix (e.g. `/api/account`)
|
|
279
|
-
* @
|
|
280
|
-
* @returns new array of specs with prefixed paths
|
|
268
|
+
* @returns a new array — the input specs are not mutated
|
|
281
269
|
*/
|
|
282
270
|
export const prefix_route_specs = (prefix, specs) => {
|
|
283
271
|
return specs.map((spec) => ({
|
|
@@ -47,9 +47,6 @@ export declare const schema_to_surface: (schema: z.ZodType) => unknown;
|
|
|
47
47
|
* - `/api/*` matches `/api/anything`
|
|
48
48
|
* - `/api/tx/*` matches `/api/tx/runs` but not `/api/account/login`
|
|
49
49
|
* - Exact match: `/health` matches `/health`
|
|
50
|
-
*
|
|
51
|
-
* @param mw_path - the middleware path pattern
|
|
52
|
-
* @param route_path - the route path
|
|
53
50
|
*/
|
|
54
51
|
export declare const middleware_applies: (mw_path: string, route_path: string) => boolean;
|
|
55
52
|
/**
|
|
@@ -59,7 +56,6 @@ export declare const middleware_applies: (mw_path: string, route_path: string) =
|
|
|
59
56
|
* Later layers override earlier ones for the same status code.
|
|
60
57
|
*
|
|
61
58
|
* @param spec - the route spec (needs `auth`, `input`, `params`, `rate_limit`, `errors`)
|
|
62
|
-
* @param middleware_errors - optional middleware error schemas
|
|
63
59
|
* @returns merged error schemas, or `null` if empty
|
|
64
60
|
*/
|
|
65
61
|
export declare const merge_error_schemas: (spec: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/schema_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAuB,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAEnG;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,CAAC,CAAC,OAAO,KAAG,OAAsC,CAAC;AAE1F;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,CAAC,CAAC,OAAO,KAAG,OAAsC,CAAC;AAE1F;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,QAAQ,CAAC,CAAC,OAAO,KAAG,OACe,CAAC;AAE5E;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,CAAC,CAAC,OAAO,KAAG,OAQrD,CAAC;AAoBF
|
|
1
|
+
{"version":3,"file":"schema_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/schema_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAuB,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAEnG;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,CAAC,CAAC,OAAO,KAAG,OAAsC,CAAC;AAE1F;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,CAAC,CAAC,OAAO,KAAG,OAAsC,CAAC;AAE1F;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,QAAQ,CAAC,CAAC,OAAO,KAAG,OACe,CAAC;AAE5E;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,CAAC,CAAC,OAAO,KAAG,OAQrD,CAAC;AAoBF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,EAAE,YAAY,MAAM,KAAG,OAQxE,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,GAC/B,MAAM;IACL,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC;IACpB,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC3B,EACD,oBAAoB,iBAAiB,GAAG,IAAI,KAC1C,iBAAiB,GAAG,IAUtB,CAAC"}
|
|
@@ -76,9 +76,6 @@ const strip_json_schema_noise = (value) => {
|
|
|
76
76
|
* - `/api/*` matches `/api/anything`
|
|
77
77
|
* - `/api/tx/*` matches `/api/tx/runs` but not `/api/account/login`
|
|
78
78
|
* - Exact match: `/health` matches `/health`
|
|
79
|
-
*
|
|
80
|
-
* @param mw_path - the middleware path pattern
|
|
81
|
-
* @param route_path - the route path
|
|
82
79
|
*/
|
|
83
80
|
export const middleware_applies = (mw_path, route_path) => {
|
|
84
81
|
if (mw_path === '*')
|
|
@@ -98,7 +95,6 @@ export const middleware_applies = (mw_path, route_path) => {
|
|
|
98
95
|
* Later layers override earlier ones for the same status code.
|
|
99
96
|
*
|
|
100
97
|
* @param spec - the route spec (needs `auth`, `input`, `params`, `rate_limit`, `errors`)
|
|
101
|
-
* @param middleware_errors - optional middleware error schemas
|
|
102
98
|
* @returns merged error schemas, or `null` if empty
|
|
103
99
|
*/
|
|
104
100
|
export const merge_error_schemas = (spec, middleware_errors) => {
|
package/dist/http/surface.d.ts
CHANGED
|
@@ -70,6 +70,8 @@ export interface AppSurfaceRpcMethod {
|
|
|
70
70
|
output_schema: unknown;
|
|
71
71
|
side_effects: boolean;
|
|
72
72
|
description: string;
|
|
73
|
+
/** Rate limit key declared on the action spec. `null` when not rate-limited. */
|
|
74
|
+
rate_limit_key: RateLimitKey | null;
|
|
73
75
|
}
|
|
74
76
|
/** An RPC endpoint in the generated attack surface (JSON-serializable). */
|
|
75
77
|
export interface AppSurfaceRpcEndpoint {
|
|
@@ -120,8 +122,6 @@ export interface GenerateAppSurfaceOptions {
|
|
|
120
122
|
/**
|
|
121
123
|
* Collect error schemas from all middleware that applies to a route path.
|
|
122
124
|
*
|
|
123
|
-
* @param middleware - the middleware specs
|
|
124
|
-
* @param route_path - the route path to match against
|
|
125
125
|
* @returns merged middleware error schemas, or `null` if none
|
|
126
126
|
*/
|
|
127
127
|
export declare const collect_middleware_errors: (middleware: Array<MiddlewareSpec>, route_path: string) => RouteErrorSchemas | null;
|
|
@@ -129,29 +129,19 @@ export declare const collect_middleware_errors: (middleware: Array<MiddlewareSpe
|
|
|
129
129
|
* Convert env schema to surface entries using `.meta()` metadata.
|
|
130
130
|
*
|
|
131
131
|
* @param schema - Zod object schema with `.meta()` on fields
|
|
132
|
-
* @returns array of env surface entries
|
|
133
132
|
*/
|
|
134
133
|
export declare const env_schema_to_surface: (schema: z.ZodObject) => Array<AppSurfaceEnv>;
|
|
135
134
|
/**
|
|
136
135
|
* Convert SSE event specs to surface entries.
|
|
137
|
-
*
|
|
138
|
-
* @param event_specs - event specs to convert
|
|
139
|
-
* @returns array of event surface entries
|
|
140
136
|
*/
|
|
141
137
|
export declare const events_to_surface: (event_specs: Array<EventSpec>) => Array<AppSurfaceEvent>;
|
|
142
138
|
/**
|
|
143
139
|
* Generate a JSON-serializable attack surface from middleware, route specs,
|
|
144
140
|
* and optional env/event metadata.
|
|
145
|
-
*
|
|
146
|
-
* @param options - the surface generation options
|
|
147
|
-
* @returns the attack surface
|
|
148
141
|
*/
|
|
149
142
|
export declare const generate_app_surface: (options: GenerateAppSurfaceOptions) => AppSurface;
|
|
150
143
|
/**
|
|
151
144
|
* Create an `AppSurfaceSpec` — the surface bundled with its source specs.
|
|
152
|
-
*
|
|
153
|
-
* @param options - the surface generation options
|
|
154
|
-
* @returns the surface spec with surface and raw specs
|
|
155
145
|
*/
|
|
156
146
|
export declare const create_app_surface_spec: (options: GenerateAppSurfaceOptions) => AppSurfaceSpec;
|
|
157
147
|
//# sourceMappingURL=surface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/surface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAC,YAAY,EAAE,iBAAiB,EAAC,MAAM,oBAAoB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e,CAAC,CAAC;CACvC;AAID;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GACrC,YAAY,KAAK,CAAC,cAAc,CAAC,EACjC,YAAY,MAAM,KAChB,iBAAiB,GAAG,IAQtB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,QAAQ,CAAC,CAAC,SAAS,KAAG,KAAK,CAAC,aAAa,CAe9E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,aAAa,KAAK,CAAC,SAAS,CAAC,KAAG,KAAK,CAAC,eAAe,CAOtF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,yBAAyB,KAAG,UAyFzE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,yBAAyB,KAAG,cAQ5E,CAAC"}
|
package/dist/http/surface.js
CHANGED
|
@@ -13,8 +13,6 @@ import { schema_to_surface, middleware_applies, merge_error_schemas, is_null_sch
|
|
|
13
13
|
/**
|
|
14
14
|
* Collect error schemas from all middleware that applies to a route path.
|
|
15
15
|
*
|
|
16
|
-
* @param middleware - the middleware specs
|
|
17
|
-
* @param route_path - the route path to match against
|
|
18
16
|
* @returns merged middleware error schemas, or `null` if none
|
|
19
17
|
*/
|
|
20
18
|
export const collect_middleware_errors = (middleware, route_path) => {
|
|
@@ -30,7 +28,6 @@ export const collect_middleware_errors = (middleware, route_path) => {
|
|
|
30
28
|
* Convert env schema to surface entries using `.meta()` metadata.
|
|
31
29
|
*
|
|
32
30
|
* @param schema - Zod object schema with `.meta()` on fields
|
|
33
|
-
* @returns array of env surface entries
|
|
34
31
|
*/
|
|
35
32
|
export const env_schema_to_surface = (schema) => {
|
|
36
33
|
const entries = [];
|
|
@@ -50,9 +47,6 @@ export const env_schema_to_surface = (schema) => {
|
|
|
50
47
|
};
|
|
51
48
|
/**
|
|
52
49
|
* Convert SSE event specs to surface entries.
|
|
53
|
-
*
|
|
54
|
-
* @param event_specs - event specs to convert
|
|
55
|
-
* @returns array of event surface entries
|
|
56
50
|
*/
|
|
57
51
|
export const events_to_surface = (event_specs) => {
|
|
58
52
|
return event_specs.map((spec) => ({
|
|
@@ -65,9 +59,6 @@ export const events_to_surface = (event_specs) => {
|
|
|
65
59
|
/**
|
|
66
60
|
* Generate a JSON-serializable attack surface from middleware, route specs,
|
|
67
61
|
* and optional env/event metadata.
|
|
68
|
-
*
|
|
69
|
-
* @param options - the surface generation options
|
|
70
|
-
* @returns the attack surface
|
|
71
62
|
*/
|
|
72
63
|
export const generate_app_surface = (options) => {
|
|
73
64
|
const { route_specs, middleware_specs, env_schema, event_specs, rpc_endpoints } = options;
|
|
@@ -147,6 +138,7 @@ export const generate_app_surface = (options) => {
|
|
|
147
138
|
output_schema: schema_to_surface(a.spec.output),
|
|
148
139
|
side_effects: a.spec.side_effects,
|
|
149
140
|
description: a.spec.description,
|
|
141
|
+
rate_limit_key: a.spec.rate_limit ?? null,
|
|
150
142
|
})),
|
|
151
143
|
}))
|
|
152
144
|
: [],
|
|
@@ -156,9 +148,6 @@ export const generate_app_surface = (options) => {
|
|
|
156
148
|
};
|
|
157
149
|
/**
|
|
158
150
|
* Create an `AppSurfaceSpec` — the surface bundled with its source specs.
|
|
159
|
-
*
|
|
160
|
-
* @param options - the surface generation options
|
|
161
|
-
* @returns the surface spec with surface and raw specs
|
|
162
151
|
*/
|
|
163
152
|
export const create_app_surface_spec = (options) => {
|
|
164
153
|
const surface = generate_app_surface(options);
|
package/dist/rate_limiter.d.ts
CHANGED
|
@@ -46,6 +46,22 @@ export interface RateLimiterOptions {
|
|
|
46
46
|
export declare const DEFAULT_LOGIN_IP_RATE_LIMIT: RateLimiterOptions;
|
|
47
47
|
/** Default options for per-account login rate limiting: 10 attempts per 30 minutes. */
|
|
48
48
|
export declare const DEFAULT_LOGIN_ACCOUNT_RATE_LIMIT: RateLimiterOptions;
|
|
49
|
+
/**
|
|
50
|
+
* Default options for per-IP action-dispatcher rate limiting: 600 attempts
|
|
51
|
+
* per 15 minutes. Shared by the HTTP RPC and WebSocket action dispatchers
|
|
52
|
+
* (one budget per action, not per transport). Permissive — catches runaway
|
|
53
|
+
* scripts and egregious oracle probes, but well above human or normal
|
|
54
|
+
* automation pace. Tighten downstream for stricter deployments.
|
|
55
|
+
*/
|
|
56
|
+
export declare const DEFAULT_ACTION_IP_RATE_LIMIT: RateLimiterOptions;
|
|
57
|
+
/**
|
|
58
|
+
* Default options for per-actor action-dispatcher rate limiting: 1200
|
|
59
|
+
* attempts per 15 minutes. Shared by the HTTP RPC and WebSocket action
|
|
60
|
+
* dispatchers. Permissive — sustained ~80/min is well above any human
|
|
61
|
+
* admin workflow; an oracle probing 10k addresses still finishes in
|
|
62
|
+
* ~2 hours, slow enough to surface in audit. Tighten downstream.
|
|
63
|
+
*/
|
|
64
|
+
export declare const DEFAULT_ACTION_ACCOUNT_RATE_LIMIT: RateLimiterOptions;
|
|
49
65
|
/**
|
|
50
66
|
* Result of a rate limit check or record operation.
|
|
51
67
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate_limiter.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/rate_limiter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,MAAM,CAAC;AAKlC;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,SAAU,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,kDAAkD;IAClD,YAAY,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,iFAAiF;AACjF,eAAO,MAAM,2BAA2B,EAAE,kBAKzC,CAAC;AAEF,uFAAuF;AACvF,eAAO,MA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AAC,kBAAkB,CAAC,KAAG,WAE3E,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,GAAI,GAAG,OAAO,EAAE,aAAa,MAAM,KAAG,QAI7E,CAAC"}
|
package/dist/rate_limiter.js
CHANGED
|
@@ -30,6 +30,32 @@ export const DEFAULT_LOGIN_ACCOUNT_RATE_LIMIT = {
|
|
|
30
30
|
cleanup_interval_ms: 5 * 60_000,
|
|
31
31
|
max_keys: DEFAULT_RATE_LIMITER_MAX_KEYS,
|
|
32
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Default options for per-IP action-dispatcher rate limiting: 600 attempts
|
|
35
|
+
* per 15 minutes. Shared by the HTTP RPC and WebSocket action dispatchers
|
|
36
|
+
* (one budget per action, not per transport). Permissive — catches runaway
|
|
37
|
+
* scripts and egregious oracle probes, but well above human or normal
|
|
38
|
+
* automation pace. Tighten downstream for stricter deployments.
|
|
39
|
+
*/
|
|
40
|
+
export const DEFAULT_ACTION_IP_RATE_LIMIT = {
|
|
41
|
+
max_attempts: 600,
|
|
42
|
+
window_ms: 15 * 60_000,
|
|
43
|
+
cleanup_interval_ms: 5 * 60_000,
|
|
44
|
+
max_keys: DEFAULT_RATE_LIMITER_MAX_KEYS,
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Default options for per-actor action-dispatcher rate limiting: 1200
|
|
48
|
+
* attempts per 15 minutes. Shared by the HTTP RPC and WebSocket action
|
|
49
|
+
* dispatchers. Permissive — sustained ~80/min is well above any human
|
|
50
|
+
* admin workflow; an oracle probing 10k addresses still finishes in
|
|
51
|
+
* ~2 hours, slow enough to surface in audit. Tighten downstream.
|
|
52
|
+
*/
|
|
53
|
+
export const DEFAULT_ACTION_ACCOUNT_RATE_LIMIT = {
|
|
54
|
+
max_attempts: 1200,
|
|
55
|
+
window_ms: 15 * 60_000,
|
|
56
|
+
cleanup_interval_ms: 5 * 60_000,
|
|
57
|
+
max_keys: DEFAULT_RATE_LIMITER_MAX_KEYS,
|
|
58
|
+
};
|
|
33
59
|
/**
|
|
34
60
|
* In-memory sliding window rate limiter.
|
|
35
61
|
*
|
package/dist/realtime/sse.d.ts
CHANGED
|
@@ -46,7 +46,6 @@ export interface SseNotification {
|
|
|
46
46
|
* Uses `hono_stream.write()` directly (not `writeSSE`) to avoid
|
|
47
47
|
* Hono's HTML callback resolution — keeps the same `data: JSON\n\n` format.
|
|
48
48
|
*
|
|
49
|
-
* @param c - Hono context
|
|
50
49
|
* @param log - logger for serialization and `on_close` listener errors
|
|
51
50
|
* @returns object with the streaming `Response` and an `SseStream` controller
|
|
52
51
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/realtime/sse.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,OAAO;IACrC,mDAAmD;IACnD,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IACxB,6CAA6C;IAC7C,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,wBAAwB;IACxB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,+FAA+F;IAC/F,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC/B,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,MAAM,EAAE,OAAO,CAAC;CAChB;AAED
|
|
1
|
+
{"version":3,"file":"sse.d.ts","sourceRoot":"../src/lib/","sources":["../../src/l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AO,MAAM,4BAA4B,GAAI,CAAC,SAAS,eAAe,EACrE,aAAa;IAAC,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,IAAI,CAAA;CAAC,EAC5D,aAAa,KAAK,CAAC,SAAS,CAAC,EAC7B,KAAK,MAAM,KACT;IAAC,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,IAAI,CAAA;CAmBhD,CAAC"}
|
package/dist/realtime/sse.js
CHANGED
|
@@ -20,7 +20,6 @@ import { DEV } from 'esm-env';
|
|
|
20
20
|
* Uses `hono_stream.write()` directly (not `writeSSE`) to avoid
|
|
21
21
|
* Hono's HTML callback resolution — keeps the same `data: JSON\n\n` format.
|
|
22
22
|
*
|
|
23
|
-
* @param c - Hono context
|
|
24
23
|
* @param log - logger for serialization and `on_close` listener errors
|
|
25
24
|
* @returns object with the streaming `Response` and an `SseStream` controller
|
|
26
25
|
*/
|
|
@@ -111,9 +111,6 @@ export declare class SubscriberRegistry<T> {
|
|
|
111
111
|
*
|
|
112
112
|
* Subscribers with no channel filter receive all broadcasts.
|
|
113
113
|
* Subscribers with a channel filter only receive matching broadcasts.
|
|
114
|
-
*
|
|
115
|
-
* @param channel - the channel to broadcast on
|
|
116
|
-
* @param data - the data to send
|
|
117
114
|
*/
|
|
118
115
|
broadcast(channel: string, data: T): void;
|
|
119
116
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriber_registry.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/realtime/subscriber_registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,UAAU,CAAC;AAExC,MAAM,WAAW,UAAU,CAAC,CAAC;IAC5B,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IACrB,sEAAsE;IACtE,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAC7B,mDAAmD;IACnD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,qEAAqE;IACrE,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;CAC3B;AAED,wCAAwC;AACxC,MAAM,WAAW,yBAAyB;IACzC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,kDAAkD;AAClD,MAAM,WAAW,gBAAgB;IAChC,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBAAa,kBAAkB,CAAC,CAAC;;gBAIpB,OAAO,CAAC,EAAE,yBAAyB;IAI/C,oCAAoC;IACpC,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,MAAM,IAAI;IAmBvE
|
|
1
|
+
{"version":3,"file":"subscriber_registry.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/realtime/subscriber_registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,UAAU,CAAC;AAExC,MAAM,WAAW,UAAU,CAAC,CAAC;IAC5B,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IACrB,sEAAsE;IACtE,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAC7B,mDAAmD;IACnD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,qEAAqE;IACrE,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;CAC3B;AAED,wCAAwC;AACxC,MAAM,WAAW,yBAAyB;IACzC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,kDAAkD;AAClD,MAAM,WAAW,gBAAgB;IAChC,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBAAa,kBAAkB,CAAC,CAAC;;gBAIpB,OAAO,CAAC,EAAE,yBAAyB;IAI/C,oCAAoC;IACpC,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,MAAM,IAAI;IAmBvE;;;;;OAKG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI;IAQzC;;;;;;;;;;OAUG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;CAiC3C"}
|
|
@@ -95,9 +95,6 @@ export class SubscriberRegistry {
|
|
|
95
95
|
*
|
|
96
96
|
* Subscribers with no channel filter receive all broadcasts.
|
|
97
97
|
* Subscribers with a channel filter only receive matching broadcasts.
|
|
98
|
-
*
|
|
99
|
-
* @param channel - the channel to broadcast on
|
|
100
|
-
* @param data - the data to send
|
|
101
98
|
*/
|
|
102
99
|
broadcast(channel, data) {
|
|
103
100
|
for (const subscriber of this.#subscribers) {
|
package/dist/runtime/fs.d.ts
CHANGED
|
@@ -10,11 +10,8 @@ import type { FsWriteDeps } from './deps.js';
|
|
|
10
10
|
* Writes to `<path>.tmp` then renames over `path` so readers either see the
|
|
11
11
|
* old contents or the full new contents — never a partial write.
|
|
12
12
|
*
|
|
13
|
-
* @param deps - deps with file write capabilities
|
|
14
|
-
* @param path - destination file path
|
|
15
|
-
* @param content - file contents to write
|
|
16
13
|
* @mutates filesystem - creates `<path>.tmp` then renames it to `path`
|
|
17
|
-
* @throws if `write_text_file` or `rename` rejects (permissions, disk full, cross-device rename, etc.)
|
|
14
|
+
* @throws Error if `write_text_file` or `rename` rejects (permissions, disk full, cross-device rename, etc.)
|
|
18
15
|
*/
|
|
19
16
|
export declare const write_file_atomic: (deps: Pick<FsWriteDeps, "write_text_file" | "rename">, path: string, content: string) => Promise<void>;
|
|
20
17
|
//# sourceMappingURL=fs.d.ts.map
|
package/dist/runtime/fs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/runtime/fs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AAE3C
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/runtime/fs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AAE3C;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAC7B,MAAM,IAAI,CAAC,WAAW,EAAE,iBAAiB,GAAG,QAAQ,CAAC,EACrD,MAAM,MAAM,EACZ,SAAS,MAAM,KACb,OAAO,CAAC,IAAI,CAId,CAAC"}
|
package/dist/runtime/fs.js
CHANGED
|
@@ -9,11 +9,8 @@
|
|
|
9
9
|
* Writes to `<path>.tmp` then renames over `path` so readers either see the
|
|
10
10
|
* old contents or the full new contents — never a partial write.
|
|
11
11
|
*
|
|
12
|
-
* @param deps - deps with file write capabilities
|
|
13
|
-
* @param path - destination file path
|
|
14
|
-
* @param content - file contents to write
|
|
15
12
|
* @mutates filesystem - creates `<path>.tmp` then renames it to `path`
|
|
16
|
-
* @throws if `write_text_file` or `rename` rejects (permissions, disk full, cross-device rename, etc.)
|
|
13
|
+
* @throws Error if `write_text_file` or `rename` rejects (permissions, disk full, cross-device rename, etc.)
|
|
17
14
|
*/
|
|
18
15
|
export const write_file_atomic = async (deps, path, content) => {
|
|
19
16
|
const temp_path = path + '.tmp';
|
package/dist/runtime/mock.d.ts
CHANGED
|
@@ -54,7 +54,6 @@ export interface MockRuntime extends RuntimeDeps {
|
|
|
54
54
|
* (so the never-returning contract holds in tests). `fetch` throws `TypeError`
|
|
55
55
|
* when no `mock_fetch_responses` pattern matches the request URL.
|
|
56
56
|
*
|
|
57
|
-
* @param args - CLI arguments
|
|
58
57
|
* @returns `MockRuntime` with controllable state
|
|
59
58
|
*
|
|
60
59
|
* @example
|
|
@@ -73,14 +72,12 @@ export declare const create_mock_runtime: (args?: Array<string>) => MockRuntime;
|
|
|
73
72
|
/**
|
|
74
73
|
* Reset a mock runtime to initial state.
|
|
75
74
|
*
|
|
76
|
-
* @param runtime - `MockRuntime` to reset
|
|
77
75
|
* @mutates runtime - clears all mock state (env, fs, dirs, exit/command/stdout/fetch call records, mock results, stdin buffer)
|
|
78
76
|
*/
|
|
79
77
|
export declare const reset_mock_runtime: (runtime: MockRuntime) => void;
|
|
80
78
|
/**
|
|
81
79
|
* Set stdin buffer for simulating user input.
|
|
82
80
|
*
|
|
83
|
-
* @param runtime - `MockRuntime` to configure
|
|
84
81
|
* @param input - string to provide as stdin input
|
|
85
82
|
* @mutates `runtime.stdin_buffer`
|
|
86
83
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/runtime/mock.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,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,IAAI,CAAC,EAAE,WAAW,CAAA;KAAC,CAAC,CAAC;IACxE,wDAAwD;IACxD,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CAC5C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAM,KAAK,CAAC,MAAM,CAAM,KAAG,WAkO9D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,WAAW,KAAG,IAazD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,WAAW,EAAE,OAAO,MAAM,KAAG,IAEpE,CAAC;AAEF;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,KAAK;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,MAAM;CAKxB"}
|
package/dist/runtime/mock.js
CHANGED
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* (so the never-returning contract holds in tests). `fetch` throws `TypeError`
|
|
15
15
|
* when no `mock_fetch_responses` pattern matches the request URL.
|
|
16
16
|
*
|
|
17
|
-
* @param args - CLI arguments
|
|
18
17
|
* @returns `MockRuntime` with controllable state
|
|
19
18
|
*
|
|
20
19
|
* @example
|
|
@@ -260,7 +259,6 @@ export const create_mock_runtime = (args = []) => {
|
|
|
260
259
|
/**
|
|
261
260
|
* Reset a mock runtime to initial state.
|
|
262
261
|
*
|
|
263
|
-
* @param runtime - `MockRuntime` to reset
|
|
264
262
|
* @mutates runtime - clears all mock state (env, fs, dirs, exit/command/stdout/fetch call records, mock results, stdin buffer)
|
|
265
263
|
*/
|
|
266
264
|
export const reset_mock_runtime = (runtime) => {
|
|
@@ -280,7 +278,6 @@ export const reset_mock_runtime = (runtime) => {
|
|
|
280
278
|
/**
|
|
281
279
|
* Set stdin buffer for simulating user input.
|
|
282
280
|
*
|
|
283
|
-
* @param runtime - `MockRuntime` to configure
|
|
284
281
|
* @param input - string to provide as stdin input
|
|
285
282
|
* @mutates `runtime.stdin_buffer`
|
|
286
283
|
*/
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Server assembly factory.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* middleware, bootstrap status, surface generation, and Hono app assembly.
|
|
4
|
+
* Consumers provide a pre-initialized `AppBackend` and options (session,
|
|
5
|
+
* origins, routes); `create_app_server()` handles middleware, bootstrap
|
|
6
|
+
* status, surface generation, and Hono app assembly.
|
|
8
7
|
*
|
|
9
8
|
* @module
|
|
10
9
|
*/
|
|
@@ -80,6 +79,26 @@ export interface AppServerOptions {
|
|
|
80
79
|
* Pass `null` to explicitly disable rate limiting.
|
|
81
80
|
*/
|
|
82
81
|
bearer_ip_rate_limiter?: RateLimiter | null;
|
|
82
|
+
/**
|
|
83
|
+
* Per-IP rate limiter for the action dispatchers (HTTP RPC + WebSocket).
|
|
84
|
+
* Consulted for actions whose spec declares `rate_limit: 'ip'` or `'both'`.
|
|
85
|
+
* Same limiter applies across transports — one budget per action.
|
|
86
|
+
* Omit or `undefined` to use a default limiter (600 attempts per
|
|
87
|
+
* 15 minutes — permissive). Pass `null` to explicitly disable.
|
|
88
|
+
* Also available on `AppServerContext` for consumers wiring
|
|
89
|
+
* `register_action_ws`.
|
|
90
|
+
*/
|
|
91
|
+
action_ip_rate_limiter?: RateLimiter | null;
|
|
92
|
+
/**
|
|
93
|
+
* Per-actor rate limiter for the action dispatchers (HTTP RPC + WebSocket).
|
|
94
|
+
* Consulted for actions whose spec declares `rate_limit: 'account'` or
|
|
95
|
+
* `'both'`. Keyed on `request_context.actor.id` (post-auth).
|
|
96
|
+
* Omit or `undefined` to use a default limiter (1200 attempts per
|
|
97
|
+
* 15 minutes — permissive). Pass `null` to explicitly disable.
|
|
98
|
+
* Also available on `AppServerContext` for consumers wiring
|
|
99
|
+
* `register_action_ws`.
|
|
100
|
+
*/
|
|
101
|
+
action_account_rate_limiter?: RateLimiter | null;
|
|
83
102
|
/**
|
|
84
103
|
* Maximum allowed request body size in bytes.
|
|
85
104
|
* Omit or `undefined` to use the default (1 MiB).
|
|
@@ -176,6 +195,10 @@ export interface AppServerContext {
|
|
|
176
195
|
login_account_rate_limiter: RateLimiter | null;
|
|
177
196
|
/** Per-account signup rate limiter (from options). `null` when not configured. */
|
|
178
197
|
signup_account_rate_limiter: RateLimiter | null;
|
|
198
|
+
/** Per-IP action-dispatcher rate limiter — shared across HTTP RPC + WS. `null` when not configured. */
|
|
199
|
+
action_ip_rate_limiter: RateLimiter | null;
|
|
200
|
+
/** Per-actor action-dispatcher rate limiter — shared across HTTP RPC + WS. `null` when not configured. */
|
|
201
|
+
action_account_rate_limiter: RateLimiter | null;
|
|
179
202
|
/** Global app settings (mutable ref — mutated by settings admin route). */
|
|
180
203
|
app_settings: AppSettings;
|
|
181
204
|
/** Factory-managed audit log SSE. `null` when `audit_log_sse` option is not set. */
|
|
@@ -210,7 +233,6 @@ export declare const DEFAULT_MAX_BODY_SIZE: number;
|
|
|
210
233
|
* `on_audit_event` that fans out to the SSE registry and the original
|
|
211
234
|
* callback — `backend.deps` itself is not mutated.
|
|
212
235
|
*
|
|
213
|
-
* @param options - server configuration
|
|
214
236
|
* @returns assembled Hono app, backend, surface build, and bootstrap status
|
|
215
237
|
*/
|
|
216
238
|
export declare const create_app_server: (options: AppServerOptions) => Promise<AppServer>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app_server.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/app_server.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"app_server.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/app_server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,IAAI,EAAE,KAAK,OAAO,EAAC,MAAM,MAAM,CAAC;AAGxC,OAAO,EAAC,CAAC,EAAC,MAAM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uGAAuG;IACvG,sBAAsB,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3C,0GAA0G;IAC1G,2BAA2B,EAAE,WAAW,GAAG,IAAI,CAAC;IAChD,2EAA2E;IAC3E,YAAY,EAAE,WAAW,CAAC;IAC1B,oFAAoF;IACpF,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;CAC9B;AAED,uCAAuC;AACvC,MAAM,WAAW,SAAS;IACzB,GAAG,EAAE,IAAI,CAAC;IACV,wEAAwE;IACxE,YAAY,EAAE,cAAc,CAAC;IAC7B,gBAAgB,EAAE,eAAe,CAAC;IAClC,2EAA2E;IAC3E,YAAY,EAAE,WAAW,CAAC;IAC1B,oGAAoG;IACpG,iBAAiB,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IAClD,oFAAoF;IACpF,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,mEAAmE;IACnE,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,gDAAgD;AAChD,eAAO,MAAM,qBAAqB,QAAc,CAAC;AAEjD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,GAAU,SAAS,gBAAgB,KAAG,OAAO,CAAC,SAAS,CA4QpF,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Server assembly factory.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* middleware, bootstrap status, surface generation, and Hono app assembly.
|
|
4
|
+
* Consumers provide a pre-initialized `AppBackend` and options (session,
|
|
5
|
+
* origins, routes); `create_app_server()` handles middleware, bootstrap
|
|
6
|
+
* status, surface generation, and Hono app assembly.
|
|
8
7
|
*
|
|
9
8
|
* @module
|
|
10
9
|
*/
|
|
@@ -15,7 +14,7 @@ import { z } from 'zod';
|
|
|
15
14
|
import { SESSION_COOKIE_OPTIONS, } from '../auth/session_cookie.js';
|
|
16
15
|
import { create_audit_log_sse, AUDIT_LOG_EVENT_SPECS, } from '../realtime/sse_auth_guard.js';
|
|
17
16
|
import { query_app_settings_load } from '../auth/app_settings_queries.js';
|
|
18
|
-
import { create_rate_limiter, DEFAULT_LOGIN_ACCOUNT_RATE_LIMIT, } from '../rate_limiter.js';
|
|
17
|
+
import { create_rate_limiter, DEFAULT_LOGIN_ACCOUNT_RATE_LIMIT, DEFAULT_ACTION_ACCOUNT_RATE_LIMIT, DEFAULT_ACTION_IP_RATE_LIMIT, } from '../rate_limiter.js';
|
|
19
18
|
// Side-effect import: augments Hono's ContextVariableMap so consumers
|
|
20
19
|
// that import app_server get type-safe c.get('auth_session_id') etc.
|
|
21
20
|
import '../hono_context.js';
|
|
@@ -44,7 +43,6 @@ export const DEFAULT_MAX_BODY_SIZE = 1024 * 1024;
|
|
|
44
43
|
* `on_audit_event` that fans out to the SSE registry and the original
|
|
45
44
|
* callback — `backend.deps` itself is not mutated.
|
|
46
45
|
*
|
|
47
|
-
* @param options - server configuration
|
|
48
46
|
* @returns assembled Hono app, backend, surface build, and bootstrap status
|
|
49
47
|
*/
|
|
50
48
|
export const create_app_server = async (options) => {
|
|
@@ -61,6 +59,12 @@ export const create_app_server = async (options) => {
|
|
|
61
59
|
const bearer_ip_rate_limiter = options.bearer_ip_rate_limiter === undefined
|
|
62
60
|
? create_rate_limiter()
|
|
63
61
|
: options.bearer_ip_rate_limiter;
|
|
62
|
+
const action_ip_rate_limiter = options.action_ip_rate_limiter === undefined
|
|
63
|
+
? create_rate_limiter(DEFAULT_ACTION_IP_RATE_LIMIT)
|
|
64
|
+
: options.action_ip_rate_limiter;
|
|
65
|
+
const action_account_rate_limiter = options.action_account_rate_limiter === undefined
|
|
66
|
+
? create_rate_limiter(DEFAULT_ACTION_ACCOUNT_RATE_LIMIT)
|
|
67
|
+
: options.action_account_rate_limiter;
|
|
64
68
|
// Factory-managed audit SSE (shallow copy deps, no mutation of backend.deps)
|
|
65
69
|
const audit_sse = options.audit_log_sse
|
|
66
70
|
? create_audit_log_sse({
|
|
@@ -108,6 +112,8 @@ export const create_app_server = async (options) => {
|
|
|
108
112
|
ip_rate_limiter,
|
|
109
113
|
login_account_rate_limiter,
|
|
110
114
|
signup_account_rate_limiter,
|
|
115
|
+
action_ip_rate_limiter,
|
|
116
|
+
action_account_rate_limiter,
|
|
111
117
|
app_settings,
|
|
112
118
|
audit_sse,
|
|
113
119
|
};
|
|
@@ -132,7 +138,13 @@ export const create_app_server = async (options) => {
|
|
|
132
138
|
: options.rpc_endpoints;
|
|
133
139
|
if (resolved_rpc_endpoints) {
|
|
134
140
|
for (const endpoint of resolved_rpc_endpoints) {
|
|
135
|
-
factory_routes.push(...create_rpc_endpoint({
|
|
141
|
+
factory_routes.push(...create_rpc_endpoint({
|
|
142
|
+
path: endpoint.path,
|
|
143
|
+
actions: endpoint.actions,
|
|
144
|
+
log,
|
|
145
|
+
action_ip_rate_limiter,
|
|
146
|
+
action_account_rate_limiter,
|
|
147
|
+
}));
|
|
136
148
|
}
|
|
137
149
|
}
|
|
138
150
|
// Surface route (default: enabled)
|
package/dist/server/startup.d.ts
CHANGED
|
@@ -14,8 +14,6 @@ import type { AppSurface } from '../http/surface.js';
|
|
|
14
14
|
* and event/channel counts (when non-empty). When `env_values` is provided,
|
|
15
15
|
* non-secret values are logged and secrets are masked with `***`.
|
|
16
16
|
*
|
|
17
|
-
* @param surface - the app surface to summarize
|
|
18
|
-
* @param log - the logger instance
|
|
19
17
|
* @param env_values - optional env values to log (secrets are masked)
|
|
20
18
|
*/
|
|
21
19
|
export declare const log_startup_summary: (surface: AppSurface, log: Logger, env_values?: Record<string, unknown>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startup.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/startup.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAGpD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAEnD
|
|
1
|
+
{"version":3,"file":"startup.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/startup.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAGpD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAEnD;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,GAC/B,SAAS,UAAU,EACnB,KAAK,MAAM,EACX,aAAa,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAClC,IAqCF,CAAC"}
|
package/dist/server/startup.js
CHANGED
|
@@ -13,8 +13,6 @@ import { format_env_display_value } from '../env/mask.js';
|
|
|
13
13
|
* and event/channel counts (when non-empty). When `env_values` is provided,
|
|
14
14
|
* non-secret values are logged and secrets are masked with `***`.
|
|
15
15
|
*
|
|
16
|
-
* @param surface - the app surface to summarize
|
|
17
|
-
* @param log - the logger instance
|
|
18
16
|
* @param env_values - optional env values to log (secrets are masked)
|
|
19
17
|
*/
|
|
20
18
|
export const log_startup_summary = (surface, log, env_values) => {
|