@fuzdev/fuz_app 0.165.0 → 0.166.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.
Files changed (66) hide show
  1. package/dist/actions/CLAUDE.md +2 -2
  2. package/dist/actions/action_event_data.d.ts +1 -1
  3. package/dist/actions/action_rpc.d.ts.map +1 -1
  4. package/dist/actions/action_rpc.js +24 -15
  5. package/dist/actions/action_spec.d.ts +2 -2
  6. package/dist/actions/perform_action.d.ts +2 -1
  7. package/dist/actions/perform_action.d.ts.map +1 -1
  8. package/dist/auth/account_action_specs.d.ts +8 -8
  9. package/dist/auth/account_route_schema.d.ts +197 -164
  10. package/dist/auth/account_route_schema.d.ts.map +1 -1
  11. package/dist/auth/account_route_schema.js +19 -17
  12. package/dist/auth/account_routes.d.ts.map +1 -1
  13. package/dist/auth/account_routes.js +285 -294
  14. package/dist/auth/admin_action_specs.d.ts +64 -64
  15. package/dist/auth/audit_log_route_schema.d.ts +16 -8
  16. package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
  17. package/dist/auth/audit_log_route_schema.js +4 -3
  18. package/dist/auth/audit_log_routes.d.ts +1 -1
  19. package/dist/auth/audit_log_routes.d.ts.map +1 -1
  20. package/dist/auth/audit_log_routes.js +112 -111
  21. package/dist/auth/audit_log_schema.d.ts +22 -22
  22. package/dist/auth/bootstrap_route_schema.d.ts +46 -69
  23. package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
  24. package/dist/auth/bootstrap_route_schema.js +8 -7
  25. package/dist/auth/bootstrap_routes.d.ts.map +1 -1
  26. package/dist/auth/bootstrap_routes.js +100 -98
  27. package/dist/auth/role_grant_offer_action_specs.d.ts +4 -4
  28. package/dist/auth/signup_route_schema.d.ts +9 -4
  29. package/dist/auth/signup_route_schema.d.ts.map +1 -1
  30. package/dist/auth/signup_route_schema.js +5 -3
  31. package/dist/auth/signup_routes.d.ts.map +1 -1
  32. package/dist/auth/signup_routes.js +170 -170
  33. package/dist/http/CLAUDE.md +48 -3
  34. package/dist/http/common_routes.d.ts +1 -1
  35. package/dist/http/common_routes.d.ts.map +1 -1
  36. package/dist/http/common_routes.js +13 -11
  37. package/dist/http/db_routes.d.ts.map +1 -1
  38. package/dist/http/db_routes.js +25 -28
  39. package/dist/http/error_schemas.d.ts +5 -1
  40. package/dist/http/error_schemas.d.ts.map +1 -1
  41. package/dist/http/error_schemas.js +5 -1
  42. package/dist/http/route_result.d.ts +101 -0
  43. package/dist/http/route_result.d.ts.map +1 -0
  44. package/dist/http/route_result.js +56 -0
  45. package/dist/http/route_spec.d.ts +110 -6
  46. package/dist/http/route_spec.d.ts.map +1 -1
  47. package/dist/http/route_spec.js +82 -14
  48. package/dist/rate_limiter.d.ts +0 -9
  49. package/dist/rate_limiter.d.ts.map +1 -1
  50. package/dist/rate_limiter.js +0 -15
  51. package/dist/server/serve_fact_route.d.ts.map +1 -1
  52. package/dist/server/serve_fact_route.js +23 -21
  53. package/dist/server/surface_route.d.ts +1 -1
  54. package/dist/server/surface_route.d.ts.map +1 -1
  55. package/dist/server/surface_route.js +4 -2
  56. package/dist/testing/CLAUDE.md +5 -3
  57. package/dist/testing/adversarial_404.d.ts.map +1 -1
  58. package/dist/testing/adversarial_404.js +12 -7
  59. package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
  60. package/dist/testing/cross_backend/login_security.js +3 -2
  61. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
  62. package/dist/testing/cross_backend/rust_spine_consumer_surface.js +2 -6
  63. package/dist/testing/stubs.d.ts +14 -3
  64. package/dist/testing/stubs.d.ts.map +1 -1
  65. package/dist/testing/stubs.js +21 -6
  66. package/package.json +1 -1
@@ -3,7 +3,10 @@
3
3
  *
4
4
  * Routes are defined as data (method, path, auth, input/output schemas, handler),
5
5
  * then applied to Hono. The attack surface is generated from the specs —
6
- * always accurate, always complete.
6
+ * always accurate, always complete. A handler returns a result
7
+ * (`http/route_result.ts`) and `apply_route_specs` builds the response; a spec
8
+ * is made by `define_route` (or `define_route_shape` + `attach_route_handler`),
9
+ * which checks the handler's results against the route.
7
10
  *
8
11
  * Input/output schemas align with SAES `ActionSpec` conventions, and each is
9
12
  * a Zod or `@fuzdev/fuz_schema` schema (`ValidationSchema`):
@@ -26,6 +29,66 @@ import { is_json_response } from './route_error_check.js';
26
29
  import { dispatch_with_post_commit_rollback } from './pending_effects.js';
27
30
  import { assert_route_auth_acting_biconditional, assert_route_auth_invariants } from './auth_shape.js';
28
31
  import { assert_validation_schema, parse_any, to_wire_issues } from '../schema_issues.js';
32
+ /**
33
+ * Define a route: its handler is checked against the route's `output`,
34
+ * `errors`, `auth`, and `rate_limit` (`TypedRouteHandler`), and the spec is
35
+ * returned as it is, typed as a `RouteSpec`.
36
+ *
37
+ * A literal `errors` list is read as given; a list typed
38
+ * `Array<RestErrorDef>` is refused (`KnownRouteErrors`).
39
+ *
40
+ * @param spec - the route, its handler returning `route_ok`, `route_fail`, or `route_raw`
41
+ * @returns `spec`
42
+ */
43
+ // @__NO_SIDE_EFFECTS__
44
+ export const define_route = (spec) => spec;
45
+ /**
46
+ * Define a route minus its handler, keeping the types `attach_route_handler`
47
+ * checks its handler against.
48
+ *
49
+ * @param shape - the route without `handler`
50
+ * @returns `shape`
51
+ */
52
+ // @__NO_SIDE_EFFECTS__
53
+ export const define_route_shape = (shape) => shape;
54
+ /**
55
+ * Attach a handler to a route shape (`define_route_shape`), checked as
56
+ * `define_route` checks one.
57
+ *
58
+ * @param shape - the route without `handler`
59
+ * @param handler - the handler, returning `route_ok`, `route_fail`, or `route_raw`
60
+ * @returns a new spec, `shape` with `handler`
61
+ */
62
+ // @__NO_SIDE_EFFECTS__
63
+ export const attach_route_handler = (shape, handler) => ({ ...shape, handler });
64
+ /**
65
+ * Build the response for a handler's result: a success as JSON at 200, a
66
+ * failure as its body at its definition's status with the headers the
67
+ * definition derives (`Retry-After`), a raw result as it is. Headers and
68
+ * cookies set on `c` before carry over, as Hono builds the response from `c`.
69
+ *
70
+ * @param c - the Hono context
71
+ * @param result - the handler's result
72
+ * @throws TypeError when `result` is not a result `route_ok`, `route_fail`, or `route_raw` made: a `Response`, a success without a value, a failure without its status or definition, a raw result without a response, `undefined` or `null`
73
+ */
74
+ export const to_route_response = (c, result) => {
75
+ // each branch checks the field it reads, so a malformed or nullish result
76
+ // falls through to the throw — a `Response` has its own `ok` and `status`,
77
+ // but no `value` or `def`
78
+ if (result?.ok === true) {
79
+ if (result.value !== undefined)
80
+ return c.json(result.value);
81
+ }
82
+ else if (result?.ok === 'raw') {
83
+ if (result.response instanceof Response)
84
+ return result.response;
85
+ }
86
+ else if (!result?.ok && result?.def !== undefined && typeof result.status === 'number') {
87
+ const body = result.body;
88
+ return c.json(body, result.status, result.def.headers?.(body));
89
+ }
90
+ throw new TypeError(`${c.req.method} ${c.req.path}: a route handler returned ${result instanceof Response ? 'a Response' : 'a malformed result'} — return \`route_ok\`, \`route_fail\`, or \`route_raw\``);
91
+ };
29
92
  export function get_route_input(c, _schema) {
30
93
  return c.get('validated_input');
31
94
  }
@@ -213,13 +276,13 @@ export const apply_middleware_specs = (app, specs) => {
213
276
  * spine's `db_unavailable_response`.
214
277
  * Catches anything else, a foreign error class carrying a JSON-RPC `code`
215
278
  * included, and maps to `{error: 'internal_error', message?}`
216
- * at 500 (`message` populated only in DEV). Existing handlers that return
217
- * `c.json()` directly are unaffected — the catch layer only activates when
218
- * something is thrown.
279
+ * at 500 (`message` populated only in DEV). A handler's returned result is
280
+ * unaffected — the catch layer only activates when something is thrown.
219
281
  *
220
- * The flat shape matches what middleware and direct handler emissions
221
- * produce (e.g. `c.json({error: ERROR_FOO}, status)`,
222
- * `c.json(failure.body, status)` from the dispatcher's authorization phase),
282
+ * The flat shape matches what middleware and handler failures produce
283
+ * (`c.json({error: ERROR_FOO}, status)` in a middleware, `route_fail(def)` in a
284
+ * handler, `c.json(failure.body, status)` from the dispatcher's authorization
285
+ * phase),
223
286
  * so REST callers see one error envelope across every emit site. The
224
287
  * `<reason>` string comes from `err.data.reason` when set (consumer-supplied
225
288
  * canonical reason code) or from `jsonrpc_error_code_to_name(err.code)`
@@ -305,7 +368,8 @@ const build_rest_error_body = (err) => {
305
368
  * adds input validation middleware (for routes with non-null input schemas),
306
369
  * runs the optional authorization phase to resolve the acting actor + build
307
370
  * the request context, wraps handler with DEV-only output
308
- * validation, wraps with error catch layer (a thrown JSON-RPC error,
371
+ * validation, builds each response from its handler's result
372
+ * (`to_route_response`), wraps with error catch layer (a thrown JSON-RPC error,
309
373
  * recognized via `to_thrown_jsonrpc_error`, maps to its status; any other
310
374
  * throw to a 500), and registers the route.
311
375
  *
@@ -380,7 +444,8 @@ export const apply_route_specs = (app, specs, resolve_auth_guards, log, db, auth
380
444
  }
381
445
  ]
382
446
  : [];
383
- // Step 1: adapt RouteHandler → Handler (construct RouteContext, call spec.handler)
447
+ // Step 1: adapt RouteHandler → Handler (construct RouteContext, call
448
+ // spec.handler, build the response from its result)
384
449
  const use_transaction = spec.transaction ?? spec.method !== 'GET';
385
450
  const inner = spec.handler;
386
451
  // Discard post-commit effects a handler queued (`emit_after_commit`) if it
@@ -388,15 +453,18 @@ export const apply_route_specs = (app, specs, resolve_auth_guards, log, db, auth
388
453
  // those effects would announce state that never committed. The eager
389
454
  // `pending_effects` queue (attempt audits, run outside the transaction) is
390
455
  // untouched. Shared with the action dispatcher (actions/perform_action.ts)
391
- // via `dispatch_with_post_commit_rollback`.
392
- let handler = (c) => {
456
+ // via `dispatch_with_post_commit_rollback`. The response is built inside
457
+ // the dispatch, so a result that can't become one (a bare `Response`, a
458
+ // malformed result, a body `JSON.stringify` refuses) throws before the
459
+ // commit and rolls back.
460
+ let handler = async (c) => {
393
461
  const route_context = {
394
462
  pending_effects: c.var.pending_effects,
395
463
  post_commit_effects: c.var.post_commit_effects
396
464
  };
397
- return dispatch_with_post_commit_rollback(c.var.post_commit_effects, () => use_transaction
398
- ? db.transaction(async (tx) => inner(c, { db: tx, ...route_context }))
399
- : inner(c, { db, ...route_context }));
465
+ return dispatch_with_post_commit_rollback(c.var.post_commit_effects, async () => use_transaction
466
+ ? db.transaction(async (tx) => to_route_response(c, await inner(c, { db: tx, ...route_context })))
467
+ : to_route_response(c, await inner(c, { db, ...route_context })));
400
468
  };
401
469
  // Step 2: error catch layer — a thrown error becomes its REST body here
402
470
  handler = wrap_error_catch(handler, log);
@@ -23,7 +23,6 @@
23
23
  *
24
24
  * @module
25
25
  */
26
- import type { Context } from 'hono';
27
26
  import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
28
27
  /**
29
28
  * Rate limit key type — declares what a route or RPC action's rate limiter
@@ -395,12 +394,4 @@ export declare const reserve_optional: (limiter: RateLimiter | null, key: string
395
394
  * @param options - override individual options; unset fields use `default_login_ip_rate_limit`
396
395
  */
397
396
  export declare const create_rate_limiter: (options?: Partial<RateLimiterOptions>) => RateLimiter;
398
- /**
399
- * Build a 429 rate-limit-exceeded JSON response with `Retry-After` header.
400
- *
401
- * @param c - Hono context
402
- * @param retry_after - seconds until the client should retry
403
- * @returns a 429 Response
404
- */
405
- export declare const rate_limit_exceeded_response: (c: Context, retry_after: number) => Response;
406
397
  //# sourceMappingURL=rate_limiter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rate_limiter.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/rate_limiter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EAAU,KAAK,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAKlE;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,mJAAoC,CAAC;AAC9D,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,SAAU,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC;;;;O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25,6 @@
25
25
  */
26
26
  import { LruMap } from '@fuzdev/fuz_util/lru_map.ts';
27
27
  import { one_of } from '@fuzdev/fuz_schema/schema.ts';
28
- import { REST_RATE_LIMIT_EXCEEDED } from './http/error_schemas.js';
29
28
  import { PERIODIC_INTERVAL_MS_MAX } from './periodic.js';
30
29
  /**
31
30
  * Rate limit key type — declares what a route or RPC action's rate limiter
@@ -598,17 +597,3 @@ export const reserve_optional = async (limiter, key, options) => {
598
597
  export const create_rate_limiter = (options) => {
599
598
  return new RateLimiter({ ...default_login_ip_rate_limit, ...options });
600
599
  };
601
- /**
602
- * Build a 429 rate-limit-exceeded JSON response with `Retry-After` header.
603
- *
604
- * @param c - Hono context
605
- * @param retry_after - seconds until the client should retry
606
- * @returns a 429 Response
607
- */
608
- export const rate_limit_exceeded_response = (c, retry_after) => {
609
- const body = { error: REST_RATE_LIMIT_EXCEEDED.code, retry_after };
610
- return c.json(body, {
611
- status: REST_RATE_LIMIT_EXCEEDED.status,
612
- headers: REST_RATE_LIMIT_EXCEEDED.headers(body)
613
- });
614
- };
@@ -1 +1 @@
1
- {"version":3,"file":"serve_fact_route.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/serve_fact_route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmIG;AAMH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AActD,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAQ5F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAkBjD,MAAM,WAAW,+BAA+B;IAC/C,kFAAkF;IAClF,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;CACZ;AAkJD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iCAAiC,GAC7C,SAAS,+BAA+B,KACtC,SAyDF,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,4BAA4B,GACxC,SAAS,+BAA+B,KACtC,SA8CF,CAAC"}
1
+ {"version":3,"file":"serve_fact_route.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/serve_fact_route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmIG;AAMH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AActD,OAAO,EAIN,KAAK,SAAS,EACd,MAAM,uBAAuB,CAAC;AAU/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAkBjD,MAAM,WAAW,+BAA+B;IAC/C,kFAAkF;IAClF,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;CACZ;AAsJD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iCAAiC,GAC7C,SAAS,+BAA+B,KACtC,SAyDF,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,4BAA4B,GACxC,SAAS,+BAA+B,KACtC,SA8CF,CAAC"}
@@ -138,7 +138,9 @@ import { literal, object } from '@fuzdev/fuz_schema/schema.ts';
138
138
  import { build_request_context, get_public_account_id, get_request_context, has_scoped_role } from '../auth/request_context.js';
139
139
  import { ROLE_ADMIN } from '../auth/role_schema.js';
140
140
  import { query_active_actors_by_account } from '../auth/account_queries.js';
141
- import { get_route_params } from '../http/route_spec.js';
141
+ import { define_route, get_route_params } from '../http/route_spec.js';
142
+ import { route_fail, route_raw } from '../http/route_result.js';
143
+ import { REST_INTERNAL_ERROR } from '../http/error_schemas.js';
142
144
  import { query_get_fact, query_get_fact_meta } from '../db/fact_queries.js';
143
145
  import { to_uint8 } from '../db/fact_store.js';
144
146
  import { query_cell_get } from '../db/cell_queries.js';
@@ -179,7 +181,7 @@ const serve_fact_bytes = async (c, route, hash, config) => {
179
181
  const { facts_dir, x_accel, log } = config;
180
182
  const meta = await query_get_fact_meta({ db: route.db }, hash);
181
183
  if (!meta) {
182
- return c.body(null, 404);
184
+ return route_raw(c.body(null, 404));
183
185
  }
184
186
  const content_type = meta.content_type ?? 'application/octet-stream';
185
187
  const size = String(meta.size);
@@ -189,39 +191,39 @@ const serve_fact_bytes = async (c, route, hash, config) => {
189
191
  if (!row || row.bytes === null) {
190
192
  // Race: meta said embedded but bytes vanished. Treat as not-found.
191
193
  log.warn(`serve_fact: embedded bytes missing for ${hash} (meta said embedded, row=${row ? 'present' : 'null'})`);
192
- return c.body(null, 404);
194
+ return route_raw(c.body(null, 404));
193
195
  }
194
196
  const bytes = to_uint8(row.bytes);
195
- return c.body(bytes, 200, {
197
+ return route_raw(c.body(bytes, 200, {
196
198
  'Content-Type': content_type,
197
199
  'Content-Length': size,
198
200
  'Cache-Control': FACT_CACHE_CONTROL,
199
201
  ...FACT_SECURITY_HEADERS
200
- });
202
+ }));
201
203
  }
202
204
  // External — defense-in-depth re-validate the URL before trusting it
203
205
  // to address the filesystem: its shape, then that it is this hash's file
204
206
  const parsed = parse_file_fact_url(meta.external_url);
205
207
  if (!parsed) {
206
208
  log.error(`serve_fact: external_url for ${hash} is not a file:<shard>/<rest> URL; answering 404`);
207
- return c.body(null, 404);
209
+ return route_raw(c.body(null, 404));
208
210
  }
209
211
  if (!file_fact_url_addresses(parsed, hash)) {
210
212
  log.error(`serve_fact: external_url for ${hash} addresses another fact's file; answering 404`);
211
- return c.body(null, 404);
213
+ return route_raw(c.body(null, 404));
212
214
  }
213
215
  const { shard, rest } = parsed;
214
216
  if (x_accel !== undefined) {
215
217
  // Production: hand off to nginx via the validated `internal;` facts location.
216
218
  // nginx answers with that location's own `add_header` set, not these
217
219
  // headers, which is why the validator requires the fact pair there.
218
- return c.body(null, 200, {
220
+ return route_raw(c.body(null, 200, {
219
221
  'Content-Type': content_type,
220
222
  'Content-Length': size,
221
223
  'Cache-Control': FACT_CACHE_CONTROL,
222
224
  'X-Accel-Redirect': `${x_accel.redirect_prefix}${shard}/${rest}`,
223
225
  ...FACT_SECURITY_HEADERS
224
- });
226
+ }));
225
227
  }
226
228
  // Dev / tests: stream from disk. Open before committing the 200 so a
227
229
  // missing file answers 404 and any other open failure a logged 500, as the
@@ -234,10 +236,10 @@ const serve_fact_bytes = async (c, route, hash, config) => {
234
236
  catch (err) {
235
237
  if (err.code === 'ENOENT') {
236
238
  log.warn(`serve_fact: disk file for ${hash} is missing; answering 404`);
237
- return c.body(null, 404);
239
+ return route_raw(c.body(null, 404));
238
240
  }
239
241
  log.error(`serve_fact: disk open for ${hash} failed`, err);
240
- return c.json({ error: 'internal_error' }, 500);
242
+ return route_fail(REST_INTERNAL_ERROR);
241
243
  }
242
244
  const headers = {
243
245
  'Content-Type': content_type,
@@ -249,10 +251,10 @@ const serve_fact_bytes = async (c, route, hash, config) => {
249
251
  // unread, so a stream built here would hold the handle open until GC
250
252
  if (c.req.method === 'HEAD') {
251
253
  await handle.close();
252
- return c.body(null, 200, headers);
254
+ return route_raw(c.body(null, 200, headers));
253
255
  }
254
256
  const web_stream = Readable.toWeb(handle.createReadStream());
255
- return c.body(web_stream, 200, headers);
257
+ return route_raw(c.body(web_stream, 200, headers));
256
258
  };
257
259
  /**
258
260
  * Resolve the caller's `RequestContext` on a pure-public route from the
@@ -297,7 +299,7 @@ const build_public_request_context = async (c, route) => {
297
299
  export const create_serve_cell_fact_route_spec = (options) => {
298
300
  const { facts_dir, x_accel, log } = options;
299
301
  const config = { facts_dir, x_accel, log };
300
- return {
302
+ return define_route({
301
303
  method: 'GET',
302
304
  path: '/api/cells/:cell_id/facts/:hash',
303
305
  auth: { account: 'none', actor: 'none' },
@@ -312,7 +314,7 @@ export const create_serve_cell_fact_route_spec = (options) => {
312
314
  // Resolve the named cell. Missing / soft-deleted → 404 (masked).
313
315
  const cell = await query_cell_get({ db: route.db }, cell_id);
314
316
  if (!cell) {
315
- return c.body(null, 404);
317
+ return route_raw(c.body(null, 404));
316
318
  }
317
319
  // Per-reference view check — scoped to *this* cell only. It runs
318
320
  // before the edge check, so a cell the caller can't view does the
@@ -332,18 +334,18 @@ export const create_serve_cell_fact_route_spec = (options) => {
332
334
  if (!can_view_cell(req_ctx, cell, grants) &&
333
335
  !(await cell_steward_admits({ db: route.db }, req_ctx, cell))) {
334
336
  // 404 (not 403) so an unviewable cell→fact edge doesn't leak.
335
- return c.body(null, 404);
337
+ return route_raw(c.body(null, 404));
336
338
  }
337
339
  // The cell→fact edge: the cell must actually reference the hash.
338
340
  // `cell.refs` is auto-derived from `data` on every write, so this is
339
341
  // the authoritative "does this cell reference these bytes" check.
340
342
  // Missing edge → 404 (masked), never "exists elsewhere".
341
343
  if (!cell.refs?.includes(hash)) {
342
- return c.body(null, 404);
344
+ return route_raw(c.body(null, 404));
343
345
  }
344
346
  return serve_fact_bytes(c, route, hash, config);
345
347
  }
346
- };
348
+ });
347
349
  };
348
350
  /**
349
351
  * Build the admin-only bare-hash `GET /api/facts/:hash` `RouteSpec`.
@@ -366,7 +368,7 @@ export const create_serve_cell_fact_route_spec = (options) => {
366
368
  export const create_serve_fact_route_spec = (options) => {
367
369
  const { facts_dir, x_accel, log } = options;
368
370
  const config = { facts_dir, x_accel, log };
369
- return {
371
+ return define_route({
370
372
  method: 'GET',
371
373
  path: '/api/facts/:hash',
372
374
  auth: {
@@ -399,9 +401,9 @@ export const create_serve_fact_route_spec = (options) => {
399
401
  // fires only on such a regression, so it fails loud as well.
400
402
  if (!has_scoped_role(get_request_context(c), ROLE_ADMIN, null)) {
401
403
  log.error('bare-hash fact read reached the handler without a global admin grant — the auth gate did not run');
402
- return c.body(null, 404);
404
+ return route_raw(c.body(null, 404));
403
405
  }
404
406
  return serve_fact_bytes(c, route, hash, config);
405
407
  }
406
- };
408
+ });
407
409
  };
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * @module
9
9
  */
10
- import type { RouteSpec } from '../http/route_spec.js';
10
+ import { type RouteSpec } from '../http/route_spec.js';
11
11
  import type { AppSurface } from '../http/surface.js';
12
12
  /** Options for the surface explorer route. */
13
13
  export interface SurfaceRouteOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"surface_route.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/surface_route.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD,8CAA8C;AAC9C,MAAM,WAAW,mBAAmB;IACnC,2GAA2G;IAC3G,OAAO,EAAE,UAAU,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,mBAAmB,KAAG,SAmBvE,CAAC"}
1
+ {"version":3,"file":"surface_route.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/surface_route.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD,8CAA8C;AAC9C,MAAM,WAAW,mBAAmB;IACnC,2GAA2G;IAC3G,OAAO,EAAE,UAAU,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,mBAAmB,KAAG,SAoBtE,CAAC"}
@@ -8,6 +8,8 @@
8
8
  * @module
9
9
  */
10
10
  import { array, literal, loose_object, object } from '@fuzdev/fuz_schema/schema.ts';
11
+ import { define_route } from '../http/route_spec.js';
12
+ import { route_ok } from '../http/route_result.js';
11
13
  import { ActingActor } from '../primitive_schemas_fuz.js';
12
14
  import { ROLE_ADMIN } from '../auth/role_schema.js';
13
15
  /**
@@ -24,7 +26,7 @@ import { ROLE_ADMIN } from '../auth/role_schema.js';
24
26
  * @param options - the surface to serve
25
27
  * @returns the `GET /api/surface` route spec
26
28
  */
27
- export const create_surface_route_spec = (options) => ({
29
+ export const create_surface_route_spec = (options) => define_route({
28
30
  method: 'GET',
29
31
  path: '/api/surface',
30
32
  auth: {
@@ -35,7 +37,7 @@ export const create_surface_route_spec = (options) => ({
35
37
  // gets none of it
36
38
  required_scope: 'surface:app_surface'
37
39
  },
38
- handler: (c) => c.json(options.surface),
40
+ handler: () => route_ok(options.surface),
39
41
  description: 'Application surface (routes, middleware, schemas) — admin only',
40
42
  query: object({ acting: ActingActor }),
41
43
  input: literal(null),
@@ -30,7 +30,8 @@ time (never runtime), where a throwing guard would break `vite build`.
30
30
  - `create_noop_stub<T>(label, overrides?)` — Proxy whose every method returns `async () => undefined`; `overrides` pins specific props.
31
31
  - `stub` — pre-built throwing stub labelled `'stub'`.
32
32
  - `create_stub_db()` — real `Db` whose `client.query` yields `{rows: []}` and `transaction(fn)` synchronously calls `fn(inner_stub_db)`. Safe for `apply_route_specs`'s declarative transaction wrapper.
33
- - `stub_handler()` — fresh `Response('stub')`.
33
+ - `stub_handler()` — a fresh `Response('stub')` as a `route_raw` result, a handler that fits any route (`attach_route_handler(shape, stub_handler)`).
34
+ - `stub_route_spec(shape)` — a spec for a surface that is described and never served: `shape` with a handler that throws when run (the spine routes of `create_rust_spine_consumer_surface_spec`).
34
35
  - `stub_mw` — pass-through middleware (`async (_c, next) => next()`).
35
36
  - `create_stub_app_deps()` — factory: fresh `AppDeps` with no-op keyring/password/`delete_file`, a `read_secure_file` that throws ENOENT (the no-token-file state), a `create_noop_stub` DB, silent `Logger`, no-op `audit`, an empty `connection_closer`.
36
37
  - `create_test_audit_emitter()` — no-op `AuditEmitter`; `emit` / `emit_role_grant_target` / `emit_pool` resolve immediately, `notify` no-op, `add_listener` throws (use `create_recording_audit_emitter` for a listener-accepting emitter), `listener_count` returns 0, `drain_inflight` resolves immediately, `is_tracking_inflight` returns `false`.
@@ -2808,8 +2809,9 @@ over real HTTP on both spines:
2808
2809
  - **per-IP limit fires** — `default_login_ip_rate_limit.max_attempts` (5, the
2809
2810
  shared cap on both impls) failed logins from one forwarded IP → 401, the next →
2810
2811
  `429` with the canonical `{error: "rate_limit_exceeded", retry_after}` body +
2811
- `Retry-After: ceil(retry_after)` header (TS `rate_limit_exceeded_response` ↔
2812
- Rust `route_response::rate_limit_exceeded`).
2812
+ `Retry-After: ceil(retry_after)` header (TS
2813
+ `route_fail(REST_RATE_LIMIT_EXCEEDED, {retry_after})` ↔ Rust
2814
+ `route_response::rate_limit_exceeded`).
2813
2815
  - **XFF keying** — exhaust one forwarded IP to 429, then a _distinct_ forwarded IP
2814
2816
  → 401 (not 429), proving the limiter keys on the resolved `X-Forwarded-For` IP,
2815
2817
  not the loopback TCP peer (a backend ignoring XFF would 429 the fresh IP too).
@@ -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;AAqB7B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAOlE;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,GAAI,SAAS,sBAAsB,KAAG,IA8E1E,CAAC"}
1
+ {"version":3,"file":"adversarial_404.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/adversarial_404.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAuB7B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAOlE;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,GAAI,SAAS,sBAAsB,KAAG,IAkF1E,CAAC"}
@@ -11,6 +11,7 @@ import './assert_dev_env.js';
11
11
  * @module
12
12
  */
13
13
  import { test, assert, describe } from 'vitest';
14
+ import { route_fail } from '../http/route_result.js';
14
15
  import { format_route_key } from '../http/surface_query.js';
15
16
  import { is_null_schema } from '../http/schema_helpers.js';
16
17
  import { assert_error_schema_valid } from './assertions.js';
@@ -51,27 +52,31 @@ export const describe_adversarial_404 = (options) => {
51
52
  const not_found = spec.errors?.find((def) => def.status === 404);
52
53
  if (!not_found)
53
54
  continue;
54
- testable.push({ key, error_code: not_found.code, spec });
55
+ testable.push({ key, not_found, spec });
55
56
  }
56
57
  if (testable.length === 0)
57
58
  return;
58
59
  describe('adversarial 404 response validation', () => {
59
60
  // Create stub specs: replace handlers for testable routes with 404 stubs
60
- const error_code_by_key = new Map();
61
+ const not_found_by_key = new Map();
61
62
  for (const entry of testable) {
62
- error_code_by_key.set(entry.key, entry.error_code);
63
+ not_found_by_key.set(entry.key, entry.not_found);
63
64
  }
64
65
  const stub_specs = route_specs.map((spec) => {
65
- const error_code = error_code_by_key.get(format_route_key(spec));
66
- if (!error_code)
66
+ const not_found = not_found_by_key.get(format_route_key(spec));
67
+ if (!not_found)
67
68
  return spec;
68
69
  return {
69
70
  ...spec,
70
- handler: (c) => c.json({ error: error_code }, 404)
71
+ // the code alone, `{error}` at 404: a stub has no fields to give
72
+ handler: () =>
73
+ // eslint-disable-next-line @typescript-eslint/no-generated-empty-object-type
74
+ route_fail(not_found)
71
75
  };
72
76
  });
73
77
  const apps = create_auth_test_apps(stub_specs, roles);
74
- for (const { key, error_code, spec } of testable) {
78
+ for (const { key, not_found, spec } of testable) {
79
+ const error_code = not_found.code;
75
80
  test(key, async () => {
76
81
  const route = surface.routes.find((r) => format_route_key(r) === key);
77
82
  const app = select_auth_app(apps, route.auth);
@@ -1 +1 @@
1
- {"version":3,"file":"login_security.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/login_security.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAsF9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAO5C,mDAAmD;AACnD,MAAM,WAAW,6BAA6B;IAC7C,2EAA2E;IAC3E,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,kFAAkF;IAClF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,wEAAwE;IACxE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;;;;OAMG;IACH,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAmDD,eAAO,MAAM,mCAAmC,GAC/C,SAAS,6BAA6B,KACpC,IA4VF,CAAC"}
1
+ {"version":3,"file":"login_security.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/login_security.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAuF9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAO5C,mDAAmD;AACnD,MAAM,WAAW,6BAA6B;IAC7C,2EAA2E;IAC3E,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,kFAAkF;IAClF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,wEAAwE;IACxE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;;;;OAMG;IACH,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAmDD,eAAO,MAAM,mCAAmC,GAC/C,SAAS,6BAA6B,KACpC,IA4VF,CAAC"}
@@ -16,8 +16,9 @@ import '../assert_dev_env.js';
16
16
  * failed logins from one forwarded IP each return `401`, and the next
17
17
  * returns `429` with the canonical `{error: "rate_limit_exceeded",
18
18
  * retry_after}` body **and** a `Retry-After: ceil(retry_after)` header. The
19
- * 429 wire shape is the cross-impl contract — TS `rate_limit_exceeded_response`
20
- * and Rust `route_response::rate_limit_exceeded` must agree.
19
+ * 429 wire shape is the cross-impl contract — TS
20
+ * `route_fail(REST_RATE_LIMIT_EXCEEDED, {retry_after})` and Rust
21
+ * `route_response::rate_limit_exceeded` must agree.
21
22
  * - **trusted-proxy / XFF resolution is honored** — distinct
22
23
  * `X-Forwarded-For` IPs get independent buckets: after exhausting one
23
24
  * forwarded IP to `429`, a *different* forwarded IP is unaffected (`401`,
@@ -1 +1 @@
1
- {"version":3,"file":"rust_spine_consumer_surface.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/rust_spine_consumer_surface.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAA6B,MAAM,8BAA8B,CAAC;AAM/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAOnE,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAI3E;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,wDAAyD,CAAC;AAU3F,8DAA8D;AAC9D,MAAM,WAAW,oCAAoC;IACpD;;;;OAIG;IACH,QAAQ,CAAC,mBAAmB,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IAC7D;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IACzE,yFAAyF;IACzF,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjD,yDAAyD;IACzD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,6DAA6D;AAC7D,MAAM,WAAW,mCAAoC,SAAQ,oCAAoC;IAChG,gEAAgE;IAChE,QAAQ,CAAC,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACjD;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,wCAAwC,GACpD,SAAS,oCAAoC,KAC3C,CAAC,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,eAAe,CAAC,CA+BpD,CAAC;AAiCF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uCAAuC,GACnD,SAAS,mCAAmC,KAC1C,cAoBA,CAAC"}
1
+ {"version":3,"file":"rust_spine_consumer_surface.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/rust_spine_consumer_surface.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAA6B,MAAM,8BAA8B,CAAC;AAM/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAOnE,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAI3E;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,wDAAyD,CAAC;AAK3F,8DAA8D;AAC9D,MAAM,WAAW,oCAAoC;IACpD;;;;OAIG;IACH,QAAQ,CAAC,mBAAmB,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IAC7D;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IACzE,yFAAyF;IACzF,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjD,yDAAyD;IACzD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,6DAA6D;AAC7D,MAAM,WAAW,mCAAoC,SAAQ,oCAAoC;IAChG,gEAAgE;IAChE,QAAQ,CAAC,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACjD;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,wCAAwC,GACpD,SAAS,oCAAoC,KAC3C,CAAC,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,eAAe,CAAC,CA+BpD,CAAC;AAiCF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uCAAuC,GACnD,SAAS,mCAAmC,KAC1C,cAoBA,CAAC"}
@@ -6,7 +6,7 @@ import { create_standard_rpc_actions } from '../../auth/standard_rpc_actions.js'
6
6
  import { create_health_route_spec } from '../../http/common_routes.js';
7
7
  import { REST_FORBIDDEN_HOST } from '../../http/error_schemas.js';
8
8
  import { prefix_route_specs } from '../../http/route_spec.js';
9
- import { create_test_app_surface_spec, stub_handler, stub_mw } from '../stubs.js';
9
+ import { create_test_app_surface_spec, stub_mw, stub_route_spec } from '../stubs.js';
10
10
  import { SPINE_ACCOUNT_PATH_PREFIX, SPINE_RPC_PATH } from './spine_surface_constants.js';
11
11
  /**
12
12
  * The routes `fuz_auth::account_router` mounts, relative to `/api/account`. An
@@ -19,10 +19,6 @@ import { SPINE_ACCOUNT_PATH_PREFIX, SPINE_RPC_PATH } from './spine_surface_const
19
19
  export const ACCOUNT_ROUTER_PATHS = ['/status', '/login', '/logout', '/password'];
20
20
  /** Surface generation never invokes handlers — see the module doc. */
21
21
  const noop_action_handler = (async () => undefined);
22
- const to_route_spec = (shape) => ({
23
- ...shape,
24
- handler: stub_handler
25
- });
26
22
  /**
27
23
  * The RPC endpoints a Rust spine consumer mounts: the standard admin /
28
24
  * role-grant-offer / account actions, the extra families, then the domain
@@ -81,7 +77,7 @@ const create_spine_consumer_route_specs = (ctx) => {
81
77
  create_signup_route_shape({
82
78
  signup_account_rate_limited: ctx.signup_account_rate_limiter !== null
83
79
  })
84
- ].map(to_route_spec))
80
+ ].map((shape) => stub_route_spec(shape)))
85
81
  ];
86
82
  };
87
83
  /**
@@ -8,7 +8,8 @@ import type { BootstrapServerOptions } from '../server/app_server.js';
8
8
  import type { AppServerContext } from '../server/app_server_context.js';
9
9
  import type { AppBackend } from '../server/app_backend.js';
10
10
  import { Db } from '../db/db.js';
11
- import { type RouteSpec } from '../http/route_spec.js';
11
+ import { type RouteShape, type RouteSpec } from '../http/route_spec.js';
12
+ import { type RouteRaw } from '../http/route_result.js';
12
13
  import { type AppSurfaceSpec, type RpcEndpointSpec } from '../http/surface.js';
13
14
  import { type WsEndpointSpec } from '../actions/ws_endpoint_spec.js';
14
15
  import type { EventSpec } from '../realtime/sse.js';
@@ -52,8 +53,18 @@ export declare const stub: any;
52
53
  * - `transaction(fn)` calls `fn(db)` synchronously (no real transaction)
53
54
  */
54
55
  export declare const create_stub_db: () => Db;
55
- /** Stub handler that returns a 200 response. */
56
- export declare const stub_handler: () => Response;
56
+ /** Stub handler that answers a 200 `stub` text response, as a raw result. */
57
+ export declare const stub_handler: () => RouteRaw;
58
+ /**
59
+ * A route spec for a surface that is described and never served — a
60
+ * backend's routes declared from their shapes: `shape` with a handler that
61
+ * throws when it is run. Its handler is checked against nothing, as it
62
+ * returns nothing.
63
+ *
64
+ * @param shape - the route minus its handler (`define_route_shape`)
65
+ * @returns the spec, for surface generation
66
+ */
67
+ export declare const stub_route_spec: (shape: RouteShape) => RouteSpec;
57
68
  /** Stub middleware that passes through. */
58
69
  export declare const stub_mw: (_c: any, next: any) => Promise<void>;
59
70
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"stubs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/stubs.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAa7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGrF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAI3E,OAAO,EAEN,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAwB,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