kizunajs 2.0.0-beta.1 → 2.0.0-beta.11

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 (74) hide show
  1. package/README.md +1 -1
  2. package/dist/{adapter-BGfMqEkM.d.cts → adapter-B8Y7l1sn.d.cts} +29 -14
  3. package/dist/{adapter-Ci3cfcoT.d.mts → adapter-CtsBIW5I.d.mts} +29 -14
  4. package/dist/{adapter-DDR_yo9L.cjs → adapter-DnrCMECA.cjs} +504 -145
  5. package/dist/{adapter-CZW-unqX.mjs → adapter-HCLp4Tex.mjs} +404 -63
  6. package/dist/adapter.cjs +35 -27
  7. package/dist/adapter.d.cts +5 -5
  8. package/dist/adapter.d.mts +5 -5
  9. package/dist/adapter.mjs +5 -5
  10. package/dist/{security-scheme-BrszwGD5.d.cts → error-response-D2bAIpNd.d.mts} +139 -8
  11. package/dist/{security-scheme-D3nb4XKj.d.mts → error-response-Da3XXloD.d.cts} +139 -8
  12. package/dist/{error-response-C8Ragjcd.cjs → error-response-Dn5Ci5UP.cjs} +12 -5
  13. package/dist/{error-response-C839d8By.mjs → error-response-rsiMhmJP.mjs} +12 -5
  14. package/dist/generator-utils-B-w1XLHL.d.mts +72 -0
  15. package/dist/generator-utils-DurTZzBI.d.cts +72 -0
  16. package/dist/generator.cjs +188 -94
  17. package/dist/generator.d.cts +180 -27
  18. package/dist/generator.d.mts +180 -27
  19. package/dist/generator.mjs +150 -59
  20. package/dist/index.cjs +94 -77
  21. package/dist/index.d.cts +36 -83
  22. package/dist/index.d.mts +36 -83
  23. package/dist/index.mjs +48 -31
  24. package/dist/jobs-entry.cjs +11 -11
  25. package/dist/jobs-entry.d.cts +1 -2
  26. package/dist/jobs-entry.d.mts +1 -2
  27. package/dist/jobs-entry.mjs +2 -2
  28. package/dist/plugin-BjOqJV5R.cjs +234 -0
  29. package/dist/plugin-BlCGyWyE.d.cts +1929 -0
  30. package/dist/plugin-CBt_5Jd1.d.mts +1929 -0
  31. package/dist/plugin-DZuHi-id.mjs +139 -0
  32. package/dist/{cache-BgohRj0i.cjs → plugin-server-PQK30p1W.cjs} +192 -89
  33. package/dist/{cache-CLN5y0Xp.mjs → plugin-server-ryuKqraG.mjs} +145 -42
  34. package/dist/plugin.cjs +8 -72
  35. package/dist/plugin.d.cts +3 -3
  36. package/dist/plugin.d.mts +3 -3
  37. package/dist/plugin.mjs +2 -68
  38. package/dist/{protected-resource-metadata-CA0v5cjg.d.mts → protected-resource-metadata-BMLoE0bq.d.mts} +1 -1
  39. package/dist/{protected-resource-metadata-Cprrv0mt.d.cts → protected-resource-metadata-CptRW7RG.d.cts} +1 -1
  40. package/dist/{schemas-C56no6bv.cjs → schemas-CpMb2KEw.cjs} +28 -1
  41. package/dist/{schemas-CJQcc97N.mjs → schemas-DttyKxw1.mjs} +23 -2
  42. package/dist/schemas.cjs +3 -2
  43. package/dist/schemas.d.cts +24 -3
  44. package/dist/schemas.d.mts +24 -3
  45. package/dist/schemas.mjs +3 -3
  46. package/package.json +1 -1
  47. package/src/adapter.ts +223 -21
  48. package/src/api.ts +5 -1
  49. package/src/config.ts +51 -10
  50. package/src/define-config.ts +57 -13
  51. package/src/generator.ts +358 -45
  52. package/src/handler-pipeline.ts +40 -12
  53. package/src/index.ts +9 -4
  54. package/src/job-runner.ts +5 -0
  55. package/src/job-transport.ts +3 -3
  56. package/src/job.ts +8 -6
  57. package/src/jobs.ts +3 -2
  58. package/src/kizuna.ts +14 -3
  59. package/src/plugin-server.ts +90 -17
  60. package/src/plugin.ts +223 -127
  61. package/src/schemas.ts +1 -0
  62. package/src/tool-answer.ts +21 -0
  63. package/src/tool-definitions.ts +163 -0
  64. package/src/tool-events.ts +90 -18
  65. package/src/tool-records.ts +11 -3
  66. package/src/tool-runner.ts +298 -0
  67. package/src/types.ts +77 -7
  68. package/src/zod-internals.ts +12 -5
  69. package/dist/api-definition-BHnh15zD.d.mts +0 -803
  70. package/dist/api-definition-DQj-ewHy.d.cts +0 -803
  71. package/dist/error-response-BBGSdgYw.d.mts +0 -67
  72. package/dist/error-response-Do38sr-9.d.cts +0 -67
  73. package/dist/plugin-Cz0kn6Lk.d.mts +0 -830
  74. package/dist/plugin-DhKvx_T0.d.cts +0 -830
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  A spec-driven framework for building fully typed REST APIs in TypeScript, where your route declarations produce the validation, the documentation, the clients, and the AI tools.
6
6
 
7
- [![npm](https://img.shields.io/npm/v/kizunajs?color=blue&label=npm)](https://www.npmjs.com/package/kizunajs)
7
+ [![npm](https://img.shields.io/npm/v/kizunajs/beta?color=blue&label=npm)](https://www.npmjs.com/package/kizunajs/v/2.0.0-beta.11)
8
8
  ![license](https://img.shields.io/badge/license-MIT-blue)
9
9
 
10
10
  [Documentation](https://kizunajs.com)
@@ -1,6 +1,5 @@
1
- import { H as ResponseHeaders, J as Routes, L as Method, W as RouteDefinition, a as SecurityScheme, nt as ProblemDetails, z as RequiredPermissions } from "./security-scheme-BrszwGD5.cjs";
2
- import { $ as PathParamsCheck, B as Router, F as HandlersFromRoutes, Kt as NoCredential, L as RequestContextValues, P as HandlerReturn, Rt as Credential, W as ValidationStage, a as PluginArgs, at as EncodeStreamOptions, n as ApiPlugins, z as RouteHandler } from "./plugin-DhKvx_T0.cjs";
3
- import { Q as JobsConfig, X as Jobs, Z as JobsArg, a as RequestContextOf, dt as JobRunner, ft as JobRunnerOptions, h as TagSet, i as JobsOf, it as JobErrorHandler, n as ApiPluginsOf, o as RoutesOf, p as TagKeysOf, s as SchemesOf, t as ApiDefinition, vt as JobTransport } from "./api-definition-DQj-ewHy.cjs";
1
+ import { K as RouteDefinition, V as RequiredPermissions, W as ResponseHeaders, Z as Routes, at as ProblemDetails, s as SecurityScheme, z as Method } from "./error-response-Da3XXloD.cjs";
2
+ import { A as ApiPluginsOf, Bn as PathParamsCheck, Bt as TagKeysOf, F as SchemesOf, Ht as TagSet, Kn as EncodeStreamOptions, M as JobsOf, N as RequestContextOf, Nr as NoCredential, P as RoutesOf, Tr as Credential, X as JobsArg, Y as Jobs, Z as JobsConfig, _t as JobTransport, a as PluginApi, dn as RouteHandler, dt as JobRunnerOptions, fn as Router, gn as ValidationStage, k as ApiDefinition, ln as RequestContextValues, o as PluginArgs, on as HandlerReturn, rt as JobErrorHandler, s as PluginDeclaration, sn as HandlersFromRoutes, ut as JobRunner, y as ResolvedPlugin } from "./plugin-BlCGyWyE.cjs";
4
3
  import { z } from "zod";
5
4
 
6
5
  //#region src/access-check.d.ts
@@ -65,13 +64,19 @@ declare const pluginRouterOf: (api: unknown) => Record<string, unknown>;
65
64
  */
66
65
  declare const pluginExportsOf: (api: unknown) => Record<string, unknown>;
67
66
  /**
68
- * Run every plugin's `serve`. Deferred until the api object exists, because
69
- * `serve` receives it.
67
+ * Resolve every installed plugin, keyed by slug. Two plugins on one slug throw,
68
+ * naming both, since handlers could only reach one of them.
70
69
  */
71
- declare const resolvePluginServers: (plugins: ApiPlugins | undefined, api: unknown) => Record<string, {
72
- router: Record<string, unknown>;
73
- exports?: unknown;
74
- }>;
70
+ declare const resolvePlugins: (declarations: readonly PluginDeclaration[] | undefined, api: PluginApi) => Record<string, ResolvedPlugin>;
71
+ /**
72
+ * A stand-in for the api that plugins receive in `setup`, before it exists.
73
+ * Reading it inside a handler works once `bind` has run; reading it during
74
+ * `setup` throws, since the api is still being assembled.
75
+ */
76
+ declare const createApiReference: () => {
77
+ api: PluginApi;
78
+ bind: (target: object) => void;
79
+ };
75
80
  //#endregion
76
81
  //#region src/routes.d.ts
77
82
  /**
@@ -210,7 +215,7 @@ declare const contractOf: <C = unknown>(api: unknown) => C;
210
215
  /**
211
216
  * What kizuna puts in handler args. Must agree with the spread in `runPipeline`.
212
217
  */
213
- declare const HANDLER_ARG_KEYS: readonly ["params", "query", "body", "headers", "throwError", "auth", "requestContext", "plugins"];
218
+ declare const HANDLER_ARG_KEYS: readonly ["params", "query", "body", "headers", "throwError", "auth", "requestContext", "plugins", "tools", "rawBody"];
214
219
  /**
215
220
  * The adapter's own context, with kizuna's arguments removed.
216
221
  */
@@ -231,7 +236,7 @@ declare const assembleApi: <const R extends Routes>(contract: {
231
236
  routes: R;
232
237
  securitySchemes?: Record<string, SecurityScheme>;
233
238
  guardSchema?: z.ZodType;
234
- plugins?: ApiPlugins;
239
+ plugins?: Record<string, ResolvedPlugin>;
235
240
  }, parts: ApiParts) => ApiWithRouter<R>;
236
241
  /**
237
242
  * The endpoints jobs are served on, in the {@link Routes} shape the request
@@ -365,6 +370,11 @@ interface AdapterRequest<NativeRequest> {
365
370
  query: unknown;
366
371
  headers: unknown;
367
372
  readBody: (route: RouteDefinition) => Promise<unknown> | unknown;
373
+ /**
374
+ * The body as it was sent, for a route with `rawBody: true`, or `undefined`
375
+ * when it was already consumed.
376
+ */
377
+ readRawBody?: (route: RouteDefinition) => Promise<string | undefined> | string | undefined;
368
378
  }
369
379
  /**
370
380
  * Outcome of `runPipeline`. The adapter's `respond` translates this to a native response.
@@ -483,7 +493,7 @@ declare const getHeaderValue: (value: unknown) => string | undefined;
483
493
  */
484
494
  declare const extractCredential: (scheme: SecurityScheme, request: AdapterRequest<unknown>) => Credential | NoCredential;
485
495
  /**
486
- * The request pipeline `createAdapter` builds: what matches a request to a
496
+ * The request pipeline `defineAdapter` builds: what matches a request to a
487
497
  * route, runs the guards and the handler, and hands the result back to the
488
498
  * framework.
489
499
  */
@@ -500,7 +510,7 @@ interface RequestPipeline<NativeRequest, NativeResponse, HandlerContext, Respons
500
510
  * everything that walks a router by dotted key finds the route's own handler.
501
511
  */
502
512
  declare const routerFromRoutes: (routes: Routes) => Record<string, unknown>;
503
- declare const createAdapter: <NativeRequest, NativeResponse, HandlerContext, ResponseContext = Record<string, never>>(definition: AdapterDefinition<NativeRequest, NativeResponse, HandlerContext, ResponseContext>) => RequestPipeline<NativeRequest, NativeResponse, HandlerContext, ResponseContext>;
513
+ declare const defineAdapter: <NativeRequest, NativeResponse, HandlerContext, ResponseContext = Record<string, never>>(definition: AdapterDefinition<NativeRequest, NativeResponse, HandlerContext, ResponseContext>) => RequestPipeline<NativeRequest, NativeResponse, HandlerContext, ResponseContext>;
504
514
  /**
505
515
  * Decides the bytes that go on the wire for an error (status >= 400). The default emits the
506
516
  * canonical RFC 9457 Problem Details as `application/problem+json`.
@@ -551,6 +561,11 @@ interface RenderedResult {
551
561
  declare const renderJsonResult: (result: Exclude<AdapterResult, {
552
562
  kind: "raw-response";
553
563
  }>, formatError?: ErrorFormatter, request?: unknown, requestMethod?: string) => RenderedResult;
564
+ /**
565
+ * Parse a body from its text, the way {@link parseFetchBody} would, for a route
566
+ * whose text core already read.
567
+ */
568
+ declare const parseBodyText: (text: string, route: RouteDefinition) => unknown;
554
569
  /**
555
570
  * Content-type-aware body parser for Web Fetch `Request`.
556
571
  *
@@ -560,4 +575,4 @@ declare const renderJsonResult: (result: Exclude<AdapterResult, {
560
575
  declare const parseFetchBody: (request: Request, route: RouteDefinition) => Promise<unknown>;
561
576
  declare const headersToObject: (headers: Headers) => ResponseHeaders;
562
577
  //#endregion
563
- export { jobRunnerFrom as $, RenderedResult as A, bearerChallenge as B, JOBS_META as C, REQUEST_CONTEXT_META as D, MountedOf as E, RouteMatcher as F, dispatchRoute as G, contractOf as H, SCHEMES_META as I, guardDenyFor as J, extractCredential as K, ServerOptions as L, RequestContextRun as M, RequestPipeline as N, ROUTER_META as O, ResponseValidationError as P, jobRoutes as Q, adapterContextOf as R, HandlerContextOf as S, MountArgsOf as T, createAdapter as U, boundJobKeys as V, dispatchHandler as W, isGuardDenial as X, headersToObject as Y, jobRouter as Z, GuardDeny as _, AccessCheckInput as _t, AdapterRequest as a, warnUnsupportedJobOptions as at, HANDLER_ARG_KEYS as b, withPermissions as bt, ApiBrand as c, tagRoutes as ct, DISPATCH_ROUTE_KEY as d, pluginRoutesOf as dt, parseFetchBody as et, ErrorFormatter as f, resolvePluginServers as ft, GuardDenialBody as g, sortFlattenedRoutes as gt, GuardDenial as h, matchRoute as ht, AdapterDefinition as i, runRoute as it, RequestContextMap as j, RUN_ROUTE_KEY as k, ApiParts as l, pluginExportsOf as lt, GUARD_SCHEMA_META as m, RouteMatch as mt, API_META as n, routerFromRoutes as nt, AdapterResult as o, ApiRouter as ot, GUARDS_META as p, MatchResult as pt, getHeaderValue as q, Adapter as r, runHandler as rt, AnyAdapter as s, ResponseError as st, ADAPTER_CONTEXT as t, renderJsonResult as tt, ApiWithRouter as u, pluginRouterOf as ut, GuardMap as v, insufficientScope as vt, JobsMeta as w, HandleArgs as x, GuardRun as y, requiresDenial as yt, assembleApi as z };
578
+ export { jobRunnerFrom as $, RenderedResult as A, bearerChallenge as B, JOBS_META as C, REQUEST_CONTEXT_META as D, MountedOf as E, RouteMatcher as F, dispatchRoute as G, contractOf as H, SCHEMES_META as I, guardDenyFor as J, extractCredential as K, ServerOptions as L, RequestContextRun as M, RequestPipeline as N, ROUTER_META as O, ResponseValidationError as P, jobRoutes as Q, adapterContextOf as R, HandlerContextOf as S, withPermissions as St, MountArgsOf as T, defineAdapter as U, boundJobKeys as V, dispatchHandler as W, isGuardDenial as X, headersToObject as Y, jobRouter as Z, GuardDeny as _, matchRoute as _t, AdapterRequest as a, runRoute as at, HANDLER_ARG_KEYS as b, insufficientScope as bt, ApiBrand as c, ResponseError as ct, DISPATCH_ROUTE_KEY as d, pluginExportsOf as dt, parseBodyText as et, ErrorFormatter as f, pluginRouterOf as ft, GuardDenialBody as g, RouteMatch as gt, GuardDenial as h, MatchResult as ht, AdapterDefinition as i, runHandler as it, RequestContextMap as j, RUN_ROUTE_KEY as k, ApiParts as l, tagRoutes as lt, GUARD_SCHEMA_META as m, resolvePlugins as mt, API_META as n, renderJsonResult as nt, AdapterResult as o, warnUnsupportedJobOptions as ot, GUARDS_META as p, pluginRoutesOf as pt, getHeaderValue as q, Adapter as r, routerFromRoutes as rt, AnyAdapter as s, ApiRouter as st, ADAPTER_CONTEXT as t, parseFetchBody as tt, ApiWithRouter as u, createApiReference as ut, GuardMap as v, sortFlattenedRoutes as vt, JobsMeta as w, HandleArgs as x, requiresDenial as xt, GuardRun as y, AccessCheckInput as yt, assembleApi as z };
@@ -1,6 +1,5 @@
1
- import { H as ResponseHeaders, J as Routes, L as Method, W as RouteDefinition, a as SecurityScheme, nt as ProblemDetails, z as RequiredPermissions } from "./security-scheme-D3nb4XKj.mjs";
2
- import { $ as PathParamsCheck, B as Router, F as HandlersFromRoutes, Kt as NoCredential, L as RequestContextValues, P as HandlerReturn, Rt as Credential, W as ValidationStage, a as PluginArgs, at as EncodeStreamOptions, n as ApiPlugins, z as RouteHandler } from "./plugin-Cz0kn6Lk.mjs";
3
- import { Q as JobsConfig, X as Jobs, Z as JobsArg, a as RequestContextOf, dt as JobRunner, ft as JobRunnerOptions, h as TagSet, i as JobsOf, it as JobErrorHandler, n as ApiPluginsOf, o as RoutesOf, p as TagKeysOf, s as SchemesOf, t as ApiDefinition, vt as JobTransport } from "./api-definition-BHnh15zD.mjs";
1
+ import { K as RouteDefinition, V as RequiredPermissions, W as ResponseHeaders, Z as Routes, at as ProblemDetails, s as SecurityScheme, z as Method } from "./error-response-D2bAIpNd.mjs";
2
+ import { A as ApiPluginsOf, Bn as PathParamsCheck, Bt as TagKeysOf, F as SchemesOf, Ht as TagSet, Kn as EncodeStreamOptions, M as JobsOf, N as RequestContextOf, Nr as NoCredential, P as RoutesOf, Tr as Credential, X as JobsArg, Y as Jobs, Z as JobsConfig, _t as JobTransport, a as PluginApi, dn as RouteHandler, dt as JobRunnerOptions, fn as Router, gn as ValidationStage, k as ApiDefinition, ln as RequestContextValues, o as PluginArgs, on as HandlerReturn, rt as JobErrorHandler, s as PluginDeclaration, sn as HandlersFromRoutes, ut as JobRunner, y as ResolvedPlugin } from "./plugin-CBt_5Jd1.mjs";
4
3
  import { z } from "zod";
5
4
 
6
5
  //#region src/access-check.d.ts
@@ -65,13 +64,19 @@ declare const pluginRouterOf: (api: unknown) => Record<string, unknown>;
65
64
  */
66
65
  declare const pluginExportsOf: (api: unknown) => Record<string, unknown>;
67
66
  /**
68
- * Run every plugin's `serve`. Deferred until the api object exists, because
69
- * `serve` receives it.
67
+ * Resolve every installed plugin, keyed by slug. Two plugins on one slug throw,
68
+ * naming both, since handlers could only reach one of them.
70
69
  */
71
- declare const resolvePluginServers: (plugins: ApiPlugins | undefined, api: unknown) => Record<string, {
72
- router: Record<string, unknown>;
73
- exports?: unknown;
74
- }>;
70
+ declare const resolvePlugins: (declarations: readonly PluginDeclaration[] | undefined, api: PluginApi) => Record<string, ResolvedPlugin>;
71
+ /**
72
+ * A stand-in for the api that plugins receive in `setup`, before it exists.
73
+ * Reading it inside a handler works once `bind` has run; reading it during
74
+ * `setup` throws, since the api is still being assembled.
75
+ */
76
+ declare const createApiReference: () => {
77
+ api: PluginApi;
78
+ bind: (target: object) => void;
79
+ };
75
80
  //#endregion
76
81
  //#region src/routes.d.ts
77
82
  /**
@@ -210,7 +215,7 @@ declare const contractOf: <C = unknown>(api: unknown) => C;
210
215
  /**
211
216
  * What kizuna puts in handler args. Must agree with the spread in `runPipeline`.
212
217
  */
213
- declare const HANDLER_ARG_KEYS: readonly ["params", "query", "body", "headers", "throwError", "auth", "requestContext", "plugins"];
218
+ declare const HANDLER_ARG_KEYS: readonly ["params", "query", "body", "headers", "throwError", "auth", "requestContext", "plugins", "tools", "rawBody"];
214
219
  /**
215
220
  * The adapter's own context, with kizuna's arguments removed.
216
221
  */
@@ -231,7 +236,7 @@ declare const assembleApi: <const R extends Routes>(contract: {
231
236
  routes: R;
232
237
  securitySchemes?: Record<string, SecurityScheme>;
233
238
  guardSchema?: z.ZodType;
234
- plugins?: ApiPlugins;
239
+ plugins?: Record<string, ResolvedPlugin>;
235
240
  }, parts: ApiParts) => ApiWithRouter<R>;
236
241
  /**
237
242
  * The endpoints jobs are served on, in the {@link Routes} shape the request
@@ -365,6 +370,11 @@ interface AdapterRequest<NativeRequest> {
365
370
  query: unknown;
366
371
  headers: unknown;
367
372
  readBody: (route: RouteDefinition) => Promise<unknown> | unknown;
373
+ /**
374
+ * The body as it was sent, for a route with `rawBody: true`, or `undefined`
375
+ * when it was already consumed.
376
+ */
377
+ readRawBody?: (route: RouteDefinition) => Promise<string | undefined> | string | undefined;
368
378
  }
369
379
  /**
370
380
  * Outcome of `runPipeline`. The adapter's `respond` translates this to a native response.
@@ -483,7 +493,7 @@ declare const getHeaderValue: (value: unknown) => string | undefined;
483
493
  */
484
494
  declare const extractCredential: (scheme: SecurityScheme, request: AdapterRequest<unknown>) => Credential | NoCredential;
485
495
  /**
486
- * The request pipeline `createAdapter` builds: what matches a request to a
496
+ * The request pipeline `defineAdapter` builds: what matches a request to a
487
497
  * route, runs the guards and the handler, and hands the result back to the
488
498
  * framework.
489
499
  */
@@ -500,7 +510,7 @@ interface RequestPipeline<NativeRequest, NativeResponse, HandlerContext, Respons
500
510
  * everything that walks a router by dotted key finds the route's own handler.
501
511
  */
502
512
  declare const routerFromRoutes: (routes: Routes) => Record<string, unknown>;
503
- declare const createAdapter: <NativeRequest, NativeResponse, HandlerContext, ResponseContext = Record<string, never>>(definition: AdapterDefinition<NativeRequest, NativeResponse, HandlerContext, ResponseContext>) => RequestPipeline<NativeRequest, NativeResponse, HandlerContext, ResponseContext>;
513
+ declare const defineAdapter: <NativeRequest, NativeResponse, HandlerContext, ResponseContext = Record<string, never>>(definition: AdapterDefinition<NativeRequest, NativeResponse, HandlerContext, ResponseContext>) => RequestPipeline<NativeRequest, NativeResponse, HandlerContext, ResponseContext>;
504
514
  /**
505
515
  * Decides the bytes that go on the wire for an error (status >= 400). The default emits the
506
516
  * canonical RFC 9457 Problem Details as `application/problem+json`.
@@ -551,6 +561,11 @@ interface RenderedResult {
551
561
  declare const renderJsonResult: (result: Exclude<AdapterResult, {
552
562
  kind: "raw-response";
553
563
  }>, formatError?: ErrorFormatter, request?: unknown, requestMethod?: string) => RenderedResult;
564
+ /**
565
+ * Parse a body from its text, the way {@link parseFetchBody} would, for a route
566
+ * whose text core already read.
567
+ */
568
+ declare const parseBodyText: (text: string, route: RouteDefinition) => unknown;
554
569
  /**
555
570
  * Content-type-aware body parser for Web Fetch `Request`.
556
571
  *
@@ -560,4 +575,4 @@ declare const renderJsonResult: (result: Exclude<AdapterResult, {
560
575
  declare const parseFetchBody: (request: Request, route: RouteDefinition) => Promise<unknown>;
561
576
  declare const headersToObject: (headers: Headers) => ResponseHeaders;
562
577
  //#endregion
563
- export { jobRunnerFrom as $, RenderedResult as A, bearerChallenge as B, JOBS_META as C, REQUEST_CONTEXT_META as D, MountedOf as E, RouteMatcher as F, dispatchRoute as G, contractOf as H, SCHEMES_META as I, guardDenyFor as J, extractCredential as K, ServerOptions as L, RequestContextRun as M, RequestPipeline as N, ROUTER_META as O, ResponseValidationError as P, jobRoutes as Q, adapterContextOf as R, HandlerContextOf as S, MountArgsOf as T, createAdapter as U, boundJobKeys as V, dispatchHandler as W, isGuardDenial as X, headersToObject as Y, jobRouter as Z, GuardDeny as _, AccessCheckInput as _t, AdapterRequest as a, warnUnsupportedJobOptions as at, HANDLER_ARG_KEYS as b, withPermissions as bt, ApiBrand as c, tagRoutes as ct, DISPATCH_ROUTE_KEY as d, pluginRoutesOf as dt, parseFetchBody as et, ErrorFormatter as f, resolvePluginServers as ft, GuardDenialBody as g, sortFlattenedRoutes as gt, GuardDenial as h, matchRoute as ht, AdapterDefinition as i, runRoute as it, RequestContextMap as j, RUN_ROUTE_KEY as k, ApiParts as l, pluginExportsOf as lt, GUARD_SCHEMA_META as m, RouteMatch as mt, API_META as n, routerFromRoutes as nt, AdapterResult as o, ApiRouter as ot, GUARDS_META as p, MatchResult as pt, getHeaderValue as q, Adapter as r, runHandler as rt, AnyAdapter as s, ResponseError as st, ADAPTER_CONTEXT as t, renderJsonResult as tt, ApiWithRouter as u, pluginRouterOf as ut, GuardMap as v, insufficientScope as vt, JobsMeta as w, HandleArgs as x, GuardRun as y, requiresDenial as yt, assembleApi as z };
578
+ export { jobRunnerFrom as $, RenderedResult as A, bearerChallenge as B, JOBS_META as C, REQUEST_CONTEXT_META as D, MountedOf as E, RouteMatcher as F, dispatchRoute as G, contractOf as H, SCHEMES_META as I, guardDenyFor as J, extractCredential as K, ServerOptions as L, RequestContextRun as M, RequestPipeline as N, ROUTER_META as O, ResponseValidationError as P, jobRoutes as Q, adapterContextOf as R, HandlerContextOf as S, withPermissions as St, MountArgsOf as T, defineAdapter as U, boundJobKeys as V, dispatchHandler as W, isGuardDenial as X, headersToObject as Y, jobRouter as Z, GuardDeny as _, matchRoute as _t, AdapterRequest as a, runRoute as at, HANDLER_ARG_KEYS as b, insufficientScope as bt, ApiBrand as c, ResponseError as ct, DISPATCH_ROUTE_KEY as d, pluginExportsOf as dt, parseBodyText as et, ErrorFormatter as f, pluginRouterOf as ft, GuardDenialBody as g, RouteMatch as gt, GuardDenial as h, MatchResult as ht, AdapterDefinition as i, runHandler as it, RequestContextMap as j, RUN_ROUTE_KEY as k, ApiParts as l, tagRoutes as lt, GUARD_SCHEMA_META as m, resolvePlugins as mt, API_META as n, renderJsonResult as nt, AdapterResult as o, warnUnsupportedJobOptions as ot, GUARDS_META as p, pluginRoutesOf as pt, getHeaderValue as q, Adapter as r, routerFromRoutes as rt, AnyAdapter as s, ApiRouter as st, ADAPTER_CONTEXT as t, parseFetchBody as tt, ApiWithRouter as u, createApiReference as ut, GuardMap as v, sortFlattenedRoutes as vt, JobsMeta as w, HandleArgs as x, requiresDenial as xt, GuardRun as y, AccessCheckInput as yt, assembleApi as z };