@fuzdev/fuz_app 0.165.0 → 0.167.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 +3 -3
- package/dist/actions/action_codegen.d.ts +10 -1
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +17 -8
- package/dist/actions/action_event_data.d.ts +1 -1
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +24 -15
- package/dist/actions/action_spec.d.ts +2 -2
- package/dist/actions/perform_action.d.ts +2 -1
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/auth/CLAUDE.md +10 -8
- package/dist/auth/account_action_specs.d.ts +8 -8
- package/dist/auth/account_route_schema.d.ts +197 -164
- package/dist/auth/account_route_schema.d.ts.map +1 -1
- package/dist/auth/account_route_schema.js +19 -17
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +285 -294
- package/dist/auth/admin_action_specs.d.ts +64 -64
- package/dist/auth/audit_log_route_schema.d.ts +16 -8
- package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_route_schema.js +4 -3
- package/dist/auth/audit_log_routes.d.ts +1 -1
- package/dist/auth/audit_log_routes.d.ts.map +1 -1
- package/dist/auth/audit_log_routes.js +112 -111
- package/dist/auth/audit_log_schema.d.ts +22 -22
- package/dist/auth/bootstrap_route_schema.d.ts +46 -69
- package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
- package/dist/auth/bootstrap_route_schema.js +8 -7
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/bootstrap_routes.js +100 -98
- package/dist/auth/cell_action_specs.d.ts +6092 -1092
- package/dist/auth/cell_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_action_specs.js +96 -97
- package/dist/auth/cell_actions.d.ts.map +1 -1
- package/dist/auth/cell_actions.js +1 -0
- package/dist/auth/cell_audit_action_specs.d.ts +301 -69
- package/dist/auth/cell_audit_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_audit_action_specs.js +21 -16
- package/dist/auth/cell_audit_actions.js +2 -2
- package/dist/auth/cell_audit_events.d.ts +2 -2
- package/dist/auth/cell_audit_events.d.ts.map +1 -1
- package/dist/auth/cell_audit_metadata.d.ts +93 -30
- package/dist/auth/cell_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_audit_metadata.js +15 -14
- package/dist/auth/cell_authorize.d.ts +3 -3
- package/dist/auth/cell_authorize.js +3 -3
- package/dist/auth/cell_data_schema.d.ts +17 -9
- package/dist/auth/cell_data_schema.d.ts.map +1 -1
- package/dist/auth/cell_data_schema.js +9 -7
- package/dist/auth/cell_field_action_specs.d.ts +697 -130
- package/dist/auth/cell_field_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_field_action_specs.js +25 -27
- package/dist/auth/cell_field_actions.d.ts.map +1 -1
- package/dist/auth/cell_field_actions.js +2 -0
- package/dist/auth/cell_field_audit_metadata.d.ts +49 -13
- package/dist/auth/cell_field_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_field_audit_metadata.js +6 -6
- package/dist/auth/cell_grant_action_specs.d.ts +1044 -208
- package/dist/auth/cell_grant_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_grant_action_specs.js +36 -33
- package/dist/auth/cell_grant_actions.js +2 -2
- package/dist/auth/cell_grant_audit_metadata.d.ts +188 -40
- package/dist/auth/cell_grant_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_grant_audit_metadata.js +12 -11
- package/dist/auth/cell_item_action_specs.d.ts +949 -175
- package/dist/auth/cell_item_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_item_action_specs.js +30 -34
- package/dist/auth/cell_item_actions.js +1 -1
- package/dist/auth/cell_item_audit_metadata.d.ts +68 -19
- package/dist/auth/cell_item_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_item_audit_metadata.js +9 -9
- package/dist/auth/cell_relation_list_limit.d.ts +1 -2
- package/dist/auth/cell_relation_list_limit.d.ts.map +1 -1
- package/dist/auth/cell_relation_list_limit.js +3 -8
- package/dist/auth/role_grant_offer_action_specs.d.ts +4 -4
- package/dist/auth/signup_route_schema.d.ts +9 -4
- package/dist/auth/signup_route_schema.d.ts.map +1 -1
- package/dist/auth/signup_route_schema.js +5 -3
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +170 -170
- package/dist/db/cell_moderation.d.ts +6 -7
- package/dist/db/cell_moderation.d.ts.map +1 -1
- package/dist/db/cell_moderation.js +6 -7
- package/dist/http/CLAUDE.md +48 -3
- package/dist/http/common_routes.d.ts +1 -1
- package/dist/http/common_routes.d.ts.map +1 -1
- package/dist/http/common_routes.js +13 -11
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +25 -28
- package/dist/http/error_schemas.d.ts +5 -1
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +5 -1
- package/dist/http/route_result.d.ts +101 -0
- package/dist/http/route_result.d.ts.map +1 -0
- package/dist/http/route_result.js +56 -0
- package/dist/http/route_spec.d.ts +110 -6
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +82 -14
- package/dist/rate_limiter.d.ts +0 -9
- package/dist/rate_limiter.d.ts.map +1 -1
- package/dist/rate_limiter.js +0 -15
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +23 -21
- package/dist/server/surface_route.d.ts +1 -1
- package/dist/server/surface_route.d.ts.map +1 -1
- package/dist/server/surface_route.js +4 -2
- package/dist/testing/CLAUDE.md +5 -3
- package/dist/testing/adversarial_404.d.ts.map +1 -1
- package/dist/testing/adversarial_404.js +12 -7
- package/dist/testing/cross_backend/cell_crud.js +2 -2
- package/dist/testing/cross_backend/cell_relations.js +2 -2
- package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
- package/dist/testing/cross_backend/login_security.js +3 -2
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.js +2 -6
- package/dist/testing/stubs.d.ts +14 -3
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +21 -6
- package/package.json +1 -1
package/dist/testing/stubs.js
CHANGED
|
@@ -12,7 +12,8 @@ import { REST_FORBIDDEN_ORIGIN } from '../http/error_schemas.js';
|
|
|
12
12
|
import { body_limit_middleware_shape } from '../http/body_limit_schema.js';
|
|
13
13
|
import { create_realtime_closer } from '../actions/connection_closer.js';
|
|
14
14
|
import { Db } from '../db/db.js';
|
|
15
|
-
import { prefix_route_specs } from '../http/route_spec.js';
|
|
15
|
+
import { attach_route_handler, prefix_route_specs } from '../http/route_spec.js';
|
|
16
|
+
import { route_raw } from '../http/route_result.js';
|
|
16
17
|
import { bootstrap_route_shape } from '../auth/bootstrap_route_schema.js';
|
|
17
18
|
import { create_rpc_endpoint } from '../actions/action_rpc.js';
|
|
18
19
|
import { create_surface_route_spec } from '../server/surface_route.js';
|
|
@@ -90,8 +91,22 @@ export const create_stub_db = () => new Db({
|
|
|
90
91
|
client: { query: async () => ({ rows: [] }) },
|
|
91
92
|
transaction: async (fn) => fn(create_stub_db())
|
|
92
93
|
});
|
|
93
|
-
/** Stub handler that
|
|
94
|
-
export const stub_handler = () => new Response('stub');
|
|
94
|
+
/** Stub handler that answers a 200 `stub` text response, as a raw result. */
|
|
95
|
+
export const stub_handler = () => route_raw(new Response('stub'));
|
|
96
|
+
/**
|
|
97
|
+
* A route spec for a surface that is described and never served — a
|
|
98
|
+
* backend's routes declared from their shapes: `shape` with a handler that
|
|
99
|
+
* throws when it is run. Its handler is checked against nothing, as it
|
|
100
|
+
* returns nothing.
|
|
101
|
+
*
|
|
102
|
+
* @param shape - the route minus its handler (`define_route_shape`)
|
|
103
|
+
* @returns the spec, for surface generation
|
|
104
|
+
*/
|
|
105
|
+
export const stub_route_spec = (shape) =>
|
|
106
|
+
// a handler that never returns fits any route, so the shape's own types are not needed
|
|
107
|
+
attach_route_handler(shape, () => {
|
|
108
|
+
throw new Error(`stub_route_spec: ${shape.method} ${shape.path} is surface-only, its handler never runs`);
|
|
109
|
+
});
|
|
95
110
|
/** Stub middleware that passes through. */
|
|
96
111
|
export const stub_mw = async (_c, next) => next();
|
|
97
112
|
const stub_db = create_noop_stub('stub_db');
|
|
@@ -324,9 +339,9 @@ export const create_test_app_surface_spec = (options) => {
|
|
|
324
339
|
const bootstrap_route_specs = options.bootstrap && options.bootstrap.mode !== 'disabled'
|
|
325
340
|
? prefix_route_specs(options.bootstrap.route_prefix ?? '/api/account', [
|
|
326
341
|
// Surface generation reads the route shape only — the live hono
|
|
327
|
-
// handler never runs here, so a stub
|
|
328
|
-
//
|
|
329
|
-
|
|
342
|
+
// handler never runs here, so a stub stands in for it without
|
|
343
|
+
// pulling the in-process Hono app onto cross-process consumers.
|
|
344
|
+
attach_route_handler(bootstrap_route_shape, stub_handler)
|
|
330
345
|
])
|
|
331
346
|
: [];
|
|
332
347
|
for (const route of bootstrap_route_specs) {
|