@fuzdev/fuz_app 0.52.0 → 0.53.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 +24 -14
- 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_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/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 +17 -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
|
@@ -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,K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ribers 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,EAAC,WAAW,EAAc,aAAa,EAAE,iBAAiB,EAAC,MAAM,WAAW,CAAC;AAIzF;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,WAAW;IAC/C,kCAAkC;IAClC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,0CAA0C;IAC1C,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,+CAA+C;IAC/C,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACvC,mCAAmC;IACnC,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvB,wCAAwC;IACxC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,gGAAgG;IAChG,aAAa,EAAE,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAAC,OAAO,CAAC,EAAE,iBAAiB,CAAA;KAAC,CAAC,CAAC;IACtF,sCAAsC;IACtC,qBAAqB,EAAE,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;KAAC,CAAC,CAAC;IACjE,8BAA8B;IAC9B,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,4CAA4C;IAC5C,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACjD,yCAAyC;IACzC,YAAY,EAAE,UAAU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MAAM,CAAC,CAAC;IAC7B,4CAA4C;IAC5C,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACjD,yCAAyC;IACzC,YAAY,EAAE,UAAU,GAAG,IAAI,CAAC;IAChC,4BAA4B;IAC5B,WAAW,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC;QAAC,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,KAAK,CAAC;AAEtB,OAAO,EAEN,KAAK,cAAc,EAEnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAGN,KAAK,WAAW,EAChB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gCAAgC,CAAC;AAEhE,OAAO,EAKN,KAAK,WAAW,EAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAGjD,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAA2B,KAAK,kBAAkB,EAAC,MAAM,aAAa,CAAC;AAE9E,OAAO,EAEN,KAAK,cAAc,EAEnB,KAAK,eAAe,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAIN,KAAK,SAAS,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAGN,KAAK,eAAe,EACpB,MAAM,6BAA6B,CAAC;AAOrC;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,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B,gBAAgB,EAAE,eAAe,CAAC;IAClC,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,yEAAyE;IACzE,eAAe,EAAE,WAAW,GAAG,IAAI,CAAC;IACpC,iFAAiF;IACjF,0BAA0B,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/C,kFAAkF;IAClF,2BAA2B,EAAE,WAAW,GAAG,IAAI,CAAC;IAChD,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) => {
|
package/dist/server/static.d.ts
CHANGED
|
@@ -30,7 +30,6 @@ export type ServeStaticFactory = (options: ServeStaticOptions) => MiddlewareHand
|
|
|
30
30
|
*
|
|
31
31
|
* @param serve_static - runtime-specific `serveStatic` factory
|
|
32
32
|
* @param options - optional root directory and SPA fallback path
|
|
33
|
-
* @returns array of middleware handlers to apply in order
|
|
34
33
|
*/
|
|
35
34
|
export declare const create_static_middleware: (serve_static: ServeStaticFactory, options?: {
|
|
36
35
|
root?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/static.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,MAAM,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,kBAAkB,KAAK,iBAAiB,CAAC;AAKpF
|
|
1
|
+
{"version":3,"file":"static.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/static.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,MAAM,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,kBAAkB,KAAK,iBAAiB,CAAC;AAKpF;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,GACpC,cAAc,kBAAkB,EAChC,UAAU;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAA;CAAC,KACxF,KAAK,CAAC,iBAAiB,CAyBzB,CAAC"}
|
package/dist/server/static.js
CHANGED
|
@@ -17,7 +17,6 @@ const is_spa_route_default = (path) => !path.startsWith('/api/');
|
|
|
17
17
|
*
|
|
18
18
|
* @param serve_static - runtime-specific `serveStatic` factory
|
|
19
19
|
* @param options - optional root directory and SPA fallback path
|
|
20
|
-
* @returns array of middleware handlers to apply in order
|
|
21
20
|
*/
|
|
22
21
|
export const create_static_middleware = (serve_static, options) => {
|
|
23
22
|
const root = options?.root ?? './build';
|
|
@@ -29,9 +29,6 @@ export interface NginxValidationResult {
|
|
|
29
29
|
* Limitations: string pattern matching, not a real nginx parser. Catches
|
|
30
30
|
* common omissions in fuz_app deploy configs but won't catch all possible
|
|
31
31
|
* misconfigurations.
|
|
32
|
-
*
|
|
33
|
-
* @param config - nginx config template string
|
|
34
|
-
* @returns validation result with ok status, warnings, and errors
|
|
35
32
|
*/
|
|
36
33
|
export declare const validate_nginx_config: (config: string) => NginxValidationResult;
|
|
37
34
|
//# sourceMappingURL=validate_nginx.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate_nginx.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/validate_nginx.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,2EAA2E;IAC3E,EAAE,EAAE,OAAO,CAAC;IACZ,2EAA2E;IAC3E,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxB,mFAAmF;IACnF,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACtB;AAgGD
|
|
1
|
+
{"version":3,"file":"validate_nginx.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/validate_nginx.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,2EAA2E;IAC3E,EAAE,EAAE,OAAO,CAAC;IACZ,2EAA2E;IAC3E,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxB,mFAAmF;IACnF,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACtB;AAgGD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,GAAI,QAAQ,MAAM,KAAG,qBA+FtD,CAAC"}
|
|
@@ -97,9 +97,6 @@ const location_matches_api = (block) => {
|
|
|
97
97
|
* Limitations: string pattern matching, not a real nginx parser. Catches
|
|
98
98
|
* common omissions in fuz_app deploy configs but won't catch all possible
|
|
99
99
|
* misconfigurations.
|
|
100
|
-
*
|
|
101
|
-
* @param config - nginx config template string
|
|
102
|
-
* @returns validation result with ok status, warnings, and errors
|
|
103
100
|
*/
|
|
104
101
|
export const validate_nginx_config = (config) => {
|
|
105
102
|
const errors = [];
|
package/dist/testing/CLAUDE.md
CHANGED
|
@@ -584,7 +584,7 @@ three. Consumers that only wire admin will hit `method not found:
|
|
|
584
584
|
account_token_create` on first run.
|
|
585
585
|
|
|
586
586
|
Error-coverage scope is narrowed to the REST suffixes still on the
|
|
587
|
-
admin surface (`/audit
|
|
587
|
+
admin surface (`/audit/stream`); the RPC surface is covered by
|
|
588
588
|
`describe_rpc_round_trip_tests`. Post-RPC-migration that surface is
|
|
589
589
|
0–1 routes — when the scoped count is ≤1, the `afterAll` hook logs
|
|
590
590
|
`[error coverage] skipped admin REST coverage assertion — …` and
|
|
@@ -54,7 +54,6 @@ export interface StandardAdminIntegrationTestOptions {
|
|
|
54
54
|
* Output-schema conformance is not in scope — see the module docstring
|
|
55
55
|
* for the suites that cover it.
|
|
56
56
|
*
|
|
57
|
-
* @param options - session config, route factory, role schema, RPC endpoints
|
|
58
57
|
* @throws Error at setup time when `options.rpc_endpoints` is empty — admin
|
|
59
58
|
* permit grant/revoke, session/token revoke-all, and audit-log reads are
|
|
60
59
|
* all RPC-only since the 2026-04-22 migration. Hard-fails via
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin_integration.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/admin_integration.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAgC7B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAA0B,KAAK,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AAEtF,OAAO,EAA6C,KAAK,eAAe,EAAC,MAAM,iBAAiB,CAAC;AACjG,OAAO,EAIN,KAAK,SAAS,EACd,MAAM,SAAS,CAAC;AASjB,OAAO,EAKN,KAAK,uBAAuB,EAC5B,MAAM,kBAAkB,CAAC;AAqB1B;;GAEG;AACH,MAAM,WAAW,mCAAmC;IACnD,4CAA4C;IAC5C,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,wDAAwD;IACxD,kBAAkB,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE,4GAA4G;IAC5G,KAAK,EAAE,gBAAgB,CAAC;IACxB;;;;;;;;;;;;OAYG;IACH,aAAa,EAAE,uBAAuB,CAAC;IACvC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iDAAiD;IACjD,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;CAChC;AAgCD
|
|
1
|
+
{"version":3,"file":"admin_integration.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/admin_integration.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAgC7B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAA0B,KAAK,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AAEtF,OAAO,EAA6C,KAAK,eAAe,EAAC,MAAM,iBAAiB,CAAC;AACjG,OAAO,EAIN,KAAK,SAAS,EACd,MAAM,SAAS,CAAC;AASjB,OAAO,EAKN,KAAK,uBAAuB,EAC5B,MAAM,kBAAkB,CAAC;AAqB1B;;GAEG;AACH,MAAM,WAAW,mCAAmC;IACnD,4CAA4C;IAC5C,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,wDAAwD;IACxD,kBAAkB,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE,4GAA4G;IAC5G,KAAK,EAAE,gBAAgB,CAAC;IACxB;;;;;;;;;;;;OAYG;IACH,aAAa,EAAE,uBAAuB,CAAC;IACvC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iDAAiD;IACjD,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;CAChC;AAgCD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,yCAAyC,GACrD,SAAS,mCAAmC,KAC1C,IAu1BF,CAAC"}
|
|
@@ -72,7 +72,6 @@ const build_admin_test_app_options = (options, db, roles) => ({
|
|
|
72
72
|
* Output-schema conformance is not in scope — see the module docstring
|
|
73
73
|
* for the suites that cover it.
|
|
74
74
|
*
|
|
75
|
-
* @param options - session config, route factory, role schema, RPC endpoints
|
|
76
75
|
* @throws Error at setup time when `options.rpc_endpoints` is empty — admin
|
|
77
76
|
* permit grant/revoke, session/token revoke-all, and audit-log reads are
|
|
78
77
|
* all RPC-only since the 2026-04-22 migration. Hard-fails via
|
|
@@ -104,16 +103,14 @@ export const describe_standard_admin_integration_tests = (options) => {
|
|
|
104
103
|
// RPC migration: account listing, session/token revoke-all,
|
|
105
104
|
// audit-log reads, and invite CRUD are RPC-only. The only
|
|
106
105
|
// admin REST route remaining is the optional
|
|
107
|
-
// `GET /audit
|
|
106
|
+
// `GET /audit/stream` SSE, plus the shared RPC endpoint
|
|
108
107
|
// path itself (admin methods live behind spec-level role auth).
|
|
109
|
-
// The `/audit
|
|
108
|
+
// The `/audit/stream` suffix tracks the hardcoded path in
|
|
110
109
|
// `auth/audit_log_routes.ts` — if consumers ever need to mount
|
|
111
110
|
// the audit SSE at a different suffix, promote this to an
|
|
112
111
|
// `audit_log_path_suffix` option on
|
|
113
112
|
// `StandardAdminIntegrationTestOptions`.
|
|
114
|
-
const admin_routes = captured_route_specs.filter((s) => s.path.endsWith('/audit
|
|
115
|
-
s.auth.type === 'role' &&
|
|
116
|
-
s.auth.role === 'admin');
|
|
113
|
+
const admin_routes = captured_route_specs.filter((s) => s.path.endsWith('/audit/stream') && s.auth.type === 'role' && s.auth.role === 'admin');
|
|
117
114
|
// Adaptive threshold: when the scoped admin REST surface is
|
|
118
115
|
// effectively empty (0–1 routes, typical post-RPC-migration),
|
|
119
116
|
// the 20% baseline is meaningless — a single SSE route that
|
|
@@ -8,8 +8,6 @@ import type { AdversarialTestOptions } from './attack_surface.js';
|
|
|
8
8
|
* 2. Fires a request with valid-format params (nil UUIDs for UUID params)
|
|
9
9
|
* 3. Validates response status is 404
|
|
10
10
|
* 4. Validates response body matches the declared 404 Zod schema
|
|
11
|
-
*
|
|
12
|
-
* @param options - the test configuration
|
|
13
11
|
*/
|
|
14
12
|
export declare const describe_adversarial_404: (options: AdversarialTestOptions) => void;
|
|
15
13
|
//# sourceMappingURL=adversarial_404.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adversarial_404.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/adversarial_404.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAoB7B,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,qBAAqB,CAAC;AAyBhE
|
|
1
|
+
{"version":3,"file":"adversarial_404.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/adversarial_404.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAoB7B,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,qBAAqB,CAAC;AAyBhE;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,GAAI,SAAS,sBAAsB,KAAG,IA2E1E,CAAC"}
|
|
@@ -47,8 +47,6 @@ const extract_404_error_code = (schema) => {
|
|
|
47
47
|
* 2. Fires a request with valid-format params (nil UUIDs for UUID params)
|
|
48
48
|
* 3. Validates response status is 404
|
|
49
49
|
* 4. Validates response body matches the declared 404 Zod schema
|
|
50
|
-
*
|
|
51
|
-
* @param options - the test configuration
|
|
52
50
|
*/
|
|
53
51
|
export const describe_adversarial_404 = (options) => {
|
|
54
52
|
const { build, roles } = options;
|
|
@@ -16,7 +16,6 @@ export interface AdversarialHeaderCase {
|
|
|
16
16
|
* 7 standard adversarial header cases applicable to any middleware stack.
|
|
17
17
|
*
|
|
18
18
|
* @param allowed_origin - an origin that passes the origin check
|
|
19
|
-
* @returns the standard adversarial header cases
|
|
20
19
|
*/
|
|
21
20
|
export declare const create_standard_adversarial_cases: (allowed_origin: string) => Array<AdversarialHeaderCase>;
|
|
22
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adversarial_headers.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/adversarial_headers.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAY7B,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAG3B,OAAO,EAGN,KAAK,0BAA0B,EAC/B,MAAM,iBAAiB,CAAC;AAIzB,+DAA+D;AAC/D,MAAM,WAAW,qBAAqB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+GAA+G;IAC/G,qBAAqB,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IAClC,qGAAqG;IACrG,oBAAoB,EAAE,QAAQ,GAAG,YAAY,CAAC;CAC9C;AAID
|
|
1
|
+
{"version":3,"file":"adversarial_headers.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/adversarial_headers.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAY7B,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAG3B,OAAO,EAGN,KAAK,0BAA0B,EAC/B,MAAM,iBAAiB,CAAC;AAIzB,+DAA+D;AAC/D,MAAM,WAAW,qBAAqB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+GAA+G;IAC/G,qBAAqB,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IAClC,qGAAqG;IACrG,oBAAoB,EAAE,QAAQ,GAAG,YAAY,CAAC;CAC9C;AAID;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,GAC7C,gBAAgB,MAAM,KACpB,KAAK,CAAC,qBAAqB,CA+D7B,CAAC;AAIF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qCAAqC,GACjD,YAAY,MAAM,EAClB,SAAS,0BAA0B,EACnC,gBAAgB,MAAM,EACtB,cAAc,KAAK,CAAC,qBAAqB,CAAC,KACxC,IAkCF,CAAC"}
|
|
@@ -15,7 +15,6 @@ import { create_test_middleware_stack_app, TEST_MIDDLEWARE_PATH, } from './middl
|
|
|
15
15
|
* 7 standard adversarial header cases applicable to any middleware stack.
|
|
16
16
|
*
|
|
17
17
|
* @param allowed_origin - an origin that passes the origin check
|
|
18
|
-
* @returns the standard adversarial header cases
|
|
19
18
|
*/
|
|
20
19
|
export const create_standard_adversarial_cases = (allowed_origin) => [
|
|
21
20
|
{
|
|
@@ -52,8 +52,6 @@ export declare const generate_query_test_cases: (query_schema: z.ZodObject) => A
|
|
|
52
52
|
* Tests input body validation and params validation for all routes.
|
|
53
53
|
* Uses correct auth credentials so auth guards pass and validation
|
|
54
54
|
* middleware is actually exercised.
|
|
55
|
-
*
|
|
56
|
-
* @param options - the test configuration
|
|
57
55
|
*/
|
|
58
56
|
export declare const describe_adversarial_input: (options: AdversarialTestOptions) => void;
|
|
59
57
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adversarial_input.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/adversarial_input.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAiB7B,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAUtB,OAAO,EAEN,0BAA0B,EAC1B,uBAAuB,EAGvB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,qBAAqB,CAAC;AA8ChE,UAAU,aAAa;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,cAAc,EAAE,OAAO,0BAA0B,GAAG,OAAO,uBAAuB,CAAC;CACnF;AAED,UAAU,cAAc;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,UAAU,aAAa;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAID;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,yBAAyB,GAAI,cAAc,CAAC,C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AAI,cAAc,CAAC,CAAC,SAAS,KAAG,KAAK,CAAC,aAAa,CA4CxF,CAAC;AAqBF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GAAI,SAAS,sBAAsB,KAAG,IA4M5E,CAAC"}
|
|
@@ -355,8 +355,6 @@ const build_query_url = (path, query) => {
|
|
|
355
355
|
* Tests input body validation and params validation for all routes.
|
|
356
356
|
* Uses correct auth credentials so auth guards pass and validation
|
|
357
357
|
* middleware is actually exercised.
|
|
358
|
-
*
|
|
359
|
-
* @param options - the test configuration
|
|
360
358
|
*/
|
|
361
359
|
export const describe_adversarial_input = (options) => {
|
|
362
360
|
const { build, roles } = options;
|
|
@@ -126,6 +126,28 @@ export interface TestAppServerOptions {
|
|
|
126
126
|
*/
|
|
127
127
|
audit_log_config?: AuditLogConfig;
|
|
128
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Create an app server with a bootstrapped account for testing.
|
|
131
|
+
*
|
|
132
|
+
* Sets up:
|
|
133
|
+
* - Auth tables (via cached PGlite factory, or reuses existing `db`)
|
|
134
|
+
* - A keeper account with hashed password
|
|
135
|
+
* - Role permits for each role in `options.roles`
|
|
136
|
+
* - An API token for Bearer auth
|
|
137
|
+
* - A session with a signed cookie value
|
|
138
|
+
*
|
|
139
|
+
* Uses `stub_password_deps` by default — deterministic hashing that works
|
|
140
|
+
* correctly for login/logout tests without Argon2 overhead.
|
|
141
|
+
*
|
|
142
|
+
* @param options - session options and optional overrides
|
|
143
|
+
* @returns a `TestAppServer` ready for HTTP testing
|
|
144
|
+
* @mutates the underlying database — when `db` is supplied, resets singleton
|
|
145
|
+
* state (`bootstrap_lock.bootstrapped`, `app_settings.open_signup`) before
|
|
146
|
+
* bootstrapping; in either branch inserts an account, actor, role permits,
|
|
147
|
+
* API token, and session row. When `audit_log_config` is provided, also
|
|
148
|
+
* sets `backend.deps.audit_log_config` so `create_app_server`'s shallow
|
|
149
|
+
* spread picks it up.
|
|
150
|
+
*/
|
|
129
151
|
export declare const create_test_app_server: (options: TestAppServerOptions) => Promise<TestAppServer>;
|
|
130
152
|
/**
|
|
131
153
|
* Configuration for `create_test_app`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app_server.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/app_server.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAG/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAGjD,OAAO,EAA2B,KAAK,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAE1E,OAAO,KAAK,EAAC,EAAE,EAAE,MAAM,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAU1D,OAAO,EAA8B,KAAK,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAG3F,OAAO,KAAK,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC/E,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAEN,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAOrD,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,kBAAkB,CAAC;AAI9D;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,gBAIhC,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,kBAAkB,QAAiB,CAAC;AASjD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC3C,EAAE,EAAE,EAAE,CAAC;IACP,OAAO,EAAE,OAAO,CAAC;IACjB,eAA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AAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;KACtB,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;IAC3B,8DAA8D;IAC9D,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,GAAU,SAAS,oBAAoB,KAAG,OAAO,CAAC,OAAO,CAyGpF,CAAC"}
|
|
@@ -72,6 +72,8 @@ export const bootstrap_test_account = async (options) => {
|
|
|
72
72
|
session_cookie,
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
|
+
/** Silent logger for tests — suppresses all output. */
|
|
76
|
+
const test_log = new Logger('test', { level: 'off' });
|
|
75
77
|
/**
|
|
76
78
|
* Create an app server with a bootstrapped account for testing.
|
|
77
79
|
*
|
|
@@ -93,11 +95,7 @@ export const bootstrap_test_account = async (options) => {
|
|
|
93
95
|
* API token, and session row. When `audit_log_config` is provided, also
|
|
94
96
|
* sets `backend.deps.audit_log_config` so `create_app_server`'s shallow
|
|
95
97
|
* spread picks it up.
|
|
96
|
-
* @throws Error if `create_validated_keyring(TEST_COOKIE_SECRET)` rejects —
|
|
97
|
-
* should never happen with the literal stub but surfaced eagerly.
|
|
98
98
|
*/
|
|
99
|
-
/** Silent logger for tests — suppresses all output. */
|
|
100
|
-
const test_log = new Logger('test', { level: 'off' });
|
|
101
99
|
export const create_test_app_server = async (options) => {
|
|
102
100
|
const { session_options, db: existing_db, db_type = 'pglite-memory', password = stub_password_deps, username = 'keeper', password_value = 'test-password-123', roles = [ROLE_KEEPER], on_audit_event = () => { }, // eslint-disable-line @typescript-eslint/no-empty-function
|
|
103
101
|
audit_log_config, } = options;
|
|
@@ -5,9 +5,7 @@ import type { RouteErrorSchemas } from '../http/error_schemas.js';
|
|
|
5
5
|
/**
|
|
6
6
|
* Resolve an absolute path relative to the caller's module.
|
|
7
7
|
*
|
|
8
|
-
* @param filename - the filename to resolve
|
|
9
8
|
* @param import_meta_url - the caller's `import.meta.url`
|
|
10
|
-
* @returns absolute path
|
|
11
9
|
*/
|
|
12
10
|
export declare const resolve_fixture_path: (filename: string, import_meta_url: string) => string;
|
|
13
11
|
/**
|
|
@@ -26,8 +24,6 @@ export declare const resolve_fixture_path: (filename: string, import_meta_url: s
|
|
|
26
24
|
export declare const assert_surface_matches_snapshot: (surface: AppSurface, snapshot_path: string) => void;
|
|
27
25
|
/**
|
|
28
26
|
* Verify surface generation is deterministic (build twice, compare).
|
|
29
|
-
*
|
|
30
|
-
* @param build_surface - function that builds the surface
|
|
31
27
|
*/
|
|
32
28
|
export declare const assert_surface_deterministic: (build_surface: () => AppSurface) => void;
|
|
33
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/assertions.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAe7B,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAE3B,OAAO,KAAK,EAAC,UAAU,EAAE,eAAe,EAAC,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,0BAA0B,CAAC;AAEhE
|
|
1
|
+
{"version":3,"file":"assertions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/assertions.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAe7B,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAE3B,OAAO,KAAK,EAAC,UAAU,EAAE,eAAe,EAAC,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,0BAA0B,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,UAAU,MAAM,EAAE,iBAAiB,MAAM,KAAG,MACtB,CAAC;AAE5D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,+BAA+B,GAC3C,SAAS,UAAU,EACnB,eAAe,MAAM,KACnB,IAOF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,GAAI,eAAe,MAAM,UAAU,KAAG,IAE9E,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,kCAAkC,GAC9C,SAAS,UAAU,EACnB,iBAAiB,KAAK,CAAC,MAAM,CAAC,KAC5B,IAWF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,GAClC,QAAQ,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,EACtC,OAAO,eAAe,EACtB,QAAQ,MAAM,KACZ,CAAC,CAAC,OAAO,GAAG,SAGd,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB,GACrC,QAAQ,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,EACtC,OAAO,eAAe,EACtB,QAAQ,MAAM,EACd,MAAM,OAAO,KACX,IAIF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,GACxC,SAAS,UAAU,EACnB,aAAa,MAAM,EACnB,qBAAqB,KAAK,CAAC,MAAM,CAAC,KAChC,IAUF,CAAC"}
|
|
@@ -14,9 +14,7 @@ import { assert } from 'vitest';
|
|
|
14
14
|
/**
|
|
15
15
|
* Resolve an absolute path relative to the caller's module.
|
|
16
16
|
*
|
|
17
|
-
* @param filename - the filename to resolve
|
|
18
17
|
* @param import_meta_url - the caller's `import.meta.url`
|
|
19
|
-
* @returns absolute path
|
|
20
18
|
*/
|
|
21
19
|
export const resolve_fixture_path = (filename, import_meta_url) => resolve(dirname(fileURLToPath(import_meta_url)), filename);
|
|
22
20
|
/**
|
|
@@ -38,8 +36,6 @@ export const assert_surface_matches_snapshot = (surface, snapshot_path) => {
|
|
|
38
36
|
};
|
|
39
37
|
/**
|
|
40
38
|
* Verify surface generation is deterministic (build twice, compare).
|
|
41
|
-
*
|
|
42
|
-
* @param build_surface - function that builds the surface
|
|
43
39
|
*/
|
|
44
40
|
export const assert_surface_deterministic = (build_surface) => {
|
|
45
41
|
assert.deepStrictEqual(build_surface(), build_surface());
|