nitro 3.0.260415-beta → 3.0.260522-beta

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 (91) hide show
  1. package/dist/THIRD-PARTY-LICENSES.md.gz +0 -0
  2. package/dist/_build/common.mjs +157 -45
  3. package/dist/_build/rolldown.mjs +6 -6
  4. package/dist/_build/rollup.mjs +11 -11
  5. package/dist/_build/vite.build.mjs +3 -3
  6. package/dist/_build/vite.dev.mjs +149 -0
  7. package/dist/_build/vite.env.mjs +177 -0
  8. package/dist/_chunks/nitro.mjs +241 -14
  9. package/dist/_chunks/nitro2.mjs +117 -90
  10. package/dist/_chunks/utils.mjs +4 -4
  11. package/dist/_common.mjs +2 -2
  12. package/dist/_dev.d.mts +1 -1
  13. package/dist/_dev.mjs +7 -6
  14. package/dist/_libs/c12+rc9.mjs +24 -11
  15. package/dist/_libs/c12+readdirp+chokidar.d.mts +7 -8
  16. package/dist/_libs/citty.mjs +1 -1
  17. package/dist/_libs/common.d.mts +37 -0
  18. package/dist/_libs/commondir+is-reference.mjs +3 -3
  19. package/dist/_libs/compatx.d.mts +1 -1
  20. package/dist/_libs/compatx.mjs +1 -1
  21. package/dist/_libs/estree+pluginutils.d.mts +1 -1
  22. package/dist/_libs/estree-walker.mjs +1 -1
  23. package/dist/_libs/hasown+resolve+deepmerge.mjs +62 -49
  24. package/dist/_libs/httpxy.d.mts +2 -4
  25. package/dist/_libs/httpxy.mjs +13 -9
  26. package/dist/_libs/jsonc-parser+workers-utils.d.mts +1579 -0
  27. package/dist/_libs/klona.mjs +1 -1
  28. package/dist/_libs/magic-string.d.mts +1 -1
  29. package/dist/_libs/mlly.d.mts +1 -1
  30. package/dist/_libs/nypm+tinyexec.mjs +137 -113
  31. package/dist/_libs/openapi-types.d.mts +730 -0
  32. package/dist/_libs/perfect-debounce.mjs +1 -1
  33. package/dist/_libs/pkg-types.d.mts +8 -5
  34. package/dist/_libs/plugin-alias.mjs +2 -2
  35. package/dist/_libs/plugin-inject.mjs +4 -2
  36. package/dist/_libs/plugin-json.mjs +2 -2
  37. package/dist/_libs/pluginutils.mjs +18 -5
  38. package/dist/_libs/readdirp+chokidar.mjs +4 -3
  39. package/dist/_libs/remapping.mjs +2 -2
  40. package/dist/_libs/resolve-uri+gen-mapping.mjs +2 -5
  41. package/dist/_libs/rou3.d.mts +1 -1
  42. package/dist/_libs/rou3.mjs +1 -1
  43. package/dist/_libs/std-env.d.mts +1 -1
  44. package/dist/_libs/tsconfck.mjs +1 -1
  45. package/dist/_libs/ultrahtml.mjs +1 -1
  46. package/dist/_libs/unimport+unplugin.mjs +61 -39
  47. package/dist/_libs/unplugin+unimport.d.mts +4 -4
  48. package/dist/_libs/unwasm.d.mts +1 -1
  49. package/dist/_presets.mjs +118 -91
  50. package/dist/builder.d.mts +1 -1
  51. package/dist/builder.mjs +3 -3
  52. package/dist/cli/_chunks/build.mjs +3 -3
  53. package/dist/cli/_chunks/common.mjs +1 -1
  54. package/dist/cli/_chunks/deploy.mjs +2 -2
  55. package/dist/cli/_chunks/dev.mjs +4 -4
  56. package/dist/cli/_chunks/docs.mjs +1 -1
  57. package/dist/cli/_chunks/list.mjs +2 -2
  58. package/dist/cli/_chunks/prepare.mjs +3 -3
  59. package/dist/cli/_chunks/preview.mjs +4 -4
  60. package/dist/cli/_chunks/run.mjs +2 -2
  61. package/dist/cli/_chunks/task.mjs +1 -1
  62. package/dist/cli/index.mjs +1 -1
  63. package/dist/docs/0.docs/5.cache.md +53 -9
  64. package/dist/docs/1.deploy/2.providers/2.aws-amplify.md +3 -3
  65. package/dist/docs/1.deploy/2.providers/21.vercel.md +6 -0
  66. package/dist/docs/3.examples/27.vite-ssr-tsr-react.md +1 -1
  67. package/dist/node_modules/ufo/dist/index.mjs +2 -2
  68. package/dist/node_modules/ufo/package.json +9 -9
  69. package/dist/presets/azure/runtime/azure-swa.mjs +2 -0
  70. package/dist/presets/vercel/runtime/queue.dev.mjs +41 -0
  71. package/dist/runtime/internal/app.mjs +4 -111
  72. package/dist/runtime/internal/route-rules.d.mts +1 -0
  73. package/dist/runtime/internal/route-rules.mjs +29 -1
  74. package/dist/runtime/internal/routes/scalar.mjs +1 -0
  75. package/dist/runtime/virtual/app.d.mts +4 -0
  76. package/dist/runtime/virtual/app.mjs +32 -0
  77. package/dist/types/index.d.mts +959 -1836
  78. package/dist/vite.d.mts +1 -1
  79. package/dist/vite.mjs +23 -331
  80. package/package.json +43 -44
  81. package/dist/THIRD-PARTY-LICENSES.md +0 -1646
  82. package/dist/_chunks/nitro3.mjs +0 -136
  83. package/dist/_chunks/nitro4.mjs +0 -127
  84. package/dist/_libs/_.mjs +0 -2
  85. package/dist/_libs/_2.mjs +0 -2
  86. package/dist/_libs/_3.mjs +0 -2
  87. package/dist/_libs/_4.mjs +0 -2
  88. package/dist/_libs/_5.mjs +0 -2
  89. package/dist/_libs/_6.mjs +0 -2
  90. package/dist/_libs/_7.mjs +0 -2
  91. package/dist/_libs/escape-string-regexp.mjs +0 -5
@@ -1,12 +1,15 @@
1
- import { t as commonjs } from "../_libs/estree+pluginutils.mjs";
2
- import { a as WatchConfigOptions, i as ResolvedConfig, n as ConfigWatcher, o as ChokidarOptions, r as DotenvOptions, t as C12InputConfig } from "../_libs/c12+readdirp+chokidar.mjs";
3
- import { n as CompatibilityDates, r as DateString, t as CompatibilityDateSpec } from "../_libs/compatx.mjs";
4
- import { t as ProxyServerOptions } from "../_libs/httpxy.mjs";
5
- import { t as TSConfig } from "../_libs/pkg-types.mjs";
6
- import { n as Unimport, t as UnimportPluginOptions } from "../_libs/unplugin+unimport.mjs";
7
- import { t as UnwasmPluginOptions } from "../_libs/unwasm.mjs";
8
- import { n as RouterContext, t as RouterCompilerOptions } from "../_libs/rou3.mjs";
9
- import { t as ProviderName } from "../_libs/std-env.mjs";
1
+ import { commonjs } from "../_libs/estree+pluginutils.mjs";
2
+ import { C12InputConfig, ChokidarOptions, ConfigWatcher, DotenvOptions, ResolvedConfig, WatchConfigOptions } from "../_libs/c12+readdirp+chokidar.mjs";
3
+ import { CompatibilityDateSpec, CompatibilityDates, DateString } from "../_libs/compatx.mjs";
4
+ import { ProxyServerOptions } from "../_libs/httpxy.mjs";
5
+ import { RawConfig } from "../_libs/jsonc-parser+workers-utils.mjs";
6
+ import { OutputBundleConfig } from "../_libs/common.mjs";
7
+ import { TSConfig } from "../_libs/pkg-types.mjs";
8
+ import { Unimport, UnimportPluginOptions } from "../_libs/unplugin+unimport.mjs";
9
+ import { UnwasmPluginOptions } from "../_libs/unwasm.mjs";
10
+ import { OpenAPIV3_1 } from "../_libs/openapi-types.mjs";
11
+ import { RouterCompilerOptions, RouterContext } from "../_libs/rou3.mjs";
12
+ import { ProviderName } from "../_libs/std-env.mjs";
10
13
  import { ConsolaInstance, LogLevel } from "consola";
11
14
  import { Hookable, HookableCore, NestedHooks } from "hookable";
12
15
  import { version } from "nitro/meta";
@@ -20,11 +23,9 @@ import { Nitro as Nitro$1 } from "nitro/types";
20
23
  import { InputOptions, MinifyOptions, OutputOptions, TransformOptions } from "rolldown";
21
24
  import { InputOptions as InputOptions$1, OutputOptions as OutputOptions$1 } from "rollup";
22
25
  import { FetchOptions, FetchRequest, FetchResponse } from "ofetch";
23
- import * as _$ocache from "ocache";
24
26
  import { CacheEntry, CacheOptions, ResponseCacheEntry } from "ocache";
25
27
  import { ExecutionContext, ForwardableEmailMessage, MessageBatch, ScheduledController, TraceItem } from "@cloudflare/workers-types";
26
28
  import { DurableObject } from "cloudflare:workers";
27
- import * as _$_vercel_queue0 from "@vercel/queue";
28
29
  import { send } from "@vercel/queue";
29
30
  import { ExternalsTraceOptions } from "nf3";
30
31
  interface InternalApi {}
@@ -99,13 +100,31 @@ interface AssetMeta {
99
100
  etag?: string;
100
101
  mtime?: string;
101
102
  }
102
- interface CachedEventHandlerOptions extends Omit<_$ocache.CachedEventHandlerOptions<HTTPEvent & _$ocache.HTTPEvent>, "toResponse" | "createResponse" | "handleCacheHeaders"> {}
103
+ /**
104
+ * Options for `defineCachedHandler`.
105
+ *
106
+ * @see https://nitro.build/docs/cache
107
+ */
108
+ interface CachedEventHandlerOptions extends Omit<import("ocache").CachedEventHandlerOptions<HTTPEvent & import("ocache").HTTPEvent>, "toResponse" | "createResponse" | "handleCacheHeaders"> {}
109
+ /**
110
+ * The runtime Nitro application instance accessible via `useNitroApp()`.
111
+ *
112
+ * @see https://nitro.build/docs/plugins
113
+ */
103
114
  interface NitroApp {
104
115
  fetch: (req: Request) => Response | Promise<Response>;
105
116
  h3?: H3Core;
106
117
  hooks?: HookableCore<NitroRuntimeHooks>;
107
118
  captureError?: CaptureError;
108
119
  }
120
+ /**
121
+ * A Nitro runtime plugin function.
122
+ *
123
+ * Receives the {@link NitroApp} instance (with `hooks` guaranteed to exist)
124
+ * and can register runtime hooks or modify the app.
125
+ *
126
+ * @see https://nitro.build/docs/plugins
127
+ */
109
128
  interface NitroAppPlugin {
110
129
  (nitro: NitroApp & {
111
130
  hooks: NonNullable<NitroApp["hooks"]>;
@@ -126,11 +145,19 @@ interface RenderContext {
126
145
  render: RenderHandler;
127
146
  response?: Partial<RenderResponse>;
128
147
  }
148
+ /** Context provided when an error is captured at runtime. */
129
149
  interface CapturedErrorContext {
130
150
  event?: HTTPEvent;
131
151
  tags?: string[];
132
152
  }
153
+ /** Error capture callback used by `nitroApp.captureError`. */
133
154
  type CaptureError = (error: Error, context: CapturedErrorContext) => void;
155
+ /**
156
+ * Runtime hooks available in Nitro plugins.
157
+ *
158
+ * @see https://nitro.build/docs/plugins
159
+ * @see https://nitro.build/docs/lifecycle
160
+ */
134
161
  interface NitroRuntimeHooks {
135
162
  close: () => void;
136
163
  error: CaptureError;
@@ -205,7 +232,7 @@ interface AWSAmplifyOptions {
205
232
  cacheControl?: string;
206
233
  };
207
234
  imageSettings?: AmplifyImageSettings;
208
- runtime?: "nodejs20.x" | "nodejs22.x";
235
+ runtime?: "nodejs20.x" | "nodejs22.x" | "nodejs24.x";
209
236
  }
210
237
  interface AwsLambdaOptions {
211
238
  streaming?: boolean;
@@ -223,1139 +250,7 @@ interface AzureOptions {
223
250
  [key: string]: unknown;
224
251
  };
225
252
  }
226
- /**
227
- * Copyright (c) 2020 Cloudflare, Inc. <wrangler@cloudflare.com>
228
- * https://github.com/cloudflare/workers-sdk/blob/main/LICENSE-MIT
229
- * https://github.com/cloudflare/workers-sdk/blob/main/LICENSE-APACHE
230
- *
231
- * Source: https://github.com/cloudflare/workers-sdk/blob/main/packages/wrangler/src/config/environment.ts
232
- */
233
- /**
234
- * The `Environment` interface declares all the configuration fields that
235
- * can be specified for an environment.
236
- *
237
- * This could be the top-level default environment, or a specific named environment.
238
- */
239
- interface Environment extends EnvironmentInheritable, EnvironmentNonInheritable {}
240
- type SimpleRoute = string;
241
- type ZoneIdRoute = {
242
- pattern: string;
243
- zone_id: string;
244
- custom_domain?: boolean;
245
- };
246
- type ZoneNameRoute = {
247
- pattern: string;
248
- zone_name: string;
249
- custom_domain?: boolean;
250
- };
251
- type CustomDomainRoute = {
252
- pattern: string;
253
- custom_domain: boolean;
254
- };
255
- type Route$1 = SimpleRoute | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
256
- /**
257
- * Configuration in wrangler for Cloudchamber
258
- */
259
- type CloudchamberConfig = {
260
- image?: string;
261
- location?: string;
262
- instance_type?: "dev" | "basic" | "standard";
263
- vcpu?: number;
264
- memory?: string;
265
- ipv4?: boolean;
266
- };
267
- /**
268
- * Configuration for a container application
269
- */
270
- type ContainerApp = {
271
- /**
272
- * Name of the application
273
- * @optional Defaults to `worker_name-class_name` if not specified.
274
- */
275
- name?: string;
276
- /**
277
- * Number of application instances
278
- * @deprecated
279
- * @hidden
280
- */
281
- instances?: number;
282
- /**
283
- * Number of maximum application instances.
284
- * @optional
285
- */
286
- max_instances?: number;
287
- /**
288
- * The path to a Dockerfile, or an image URI for the Cloudflare registry.
289
- */
290
- image: string;
291
- /**
292
- * Build context of the application.
293
- * @optional - defaults to the directory of `image`.
294
- */
295
- image_build_context?: string;
296
- /**
297
- * Image variables to be passed along the image at build time.
298
- * @optional
299
- */
300
- image_vars?: Record<string, string>;
301
- /**
302
- * The class name of the Durable Object the container is connected to.
303
- */
304
- class_name: string;
305
- /**
306
- * The scheduling policy of the application
307
- * @optional
308
- * @default "default"
309
- */
310
- scheduling_policy?: "regional" | "moon" | "default";
311
- /**
312
- * The instance type to be used for the container. This sets preconfigured options for vcpu and memory
313
- * @optional
314
- */
315
- instance_type?: "dev" | "basic" | "standard";
316
- /**
317
- * @deprecated Use top level `containers` fields instead.
318
- * `configuration.image` should be `image`
319
- * `configuration.disk` should be set via `instance_type`
320
- * @hidden
321
- */
322
- configuration?: {
323
- image?: string;
324
- labels?: {
325
- name: string;
326
- value: string;
327
- }[];
328
- secrets?: {
329
- name: string;
330
- type: "env";
331
- secret: string;
332
- }[];
333
- disk?: {
334
- size: string;
335
- };
336
- };
337
- /**
338
- * Scheduling constraints
339
- * @hidden
340
- */
341
- constraints?: {
342
- regions?: string[];
343
- cities?: string[];
344
- tier?: number;
345
- };
346
- /**
347
- * @deprecated use the `class_name` field instead.
348
- * @hidden
349
- */
350
- durable_objects?: {
351
- namespace_id: string;
352
- };
353
- /**
354
- * How a rollout should be done, defining the size of it
355
- * @optional
356
- * @default 25
357
- * */
358
- rollout_step_percentage?: number;
359
- /**
360
- * How a rollout should be created. It supports the following modes:
361
- * - full_auto: The container application will be rolled out fully automatically.
362
- * - none: The container application won't have a roll out or update.
363
- * - manual: The container application will be rollout fully by manually actioning progress steps.
364
- * @optional
365
- * @default "full_auto"
366
- */
367
- rollout_kind?: "full_auto" | "none" | "full_manual";
368
- };
369
- /**
370
- * Configuration in wrangler for Durable Object Migrations
371
- */
372
- type DurableObjectMigration = {
373
- /** A unique identifier for this migration. */tag: string; /** The new Durable Objects being defined. */
374
- new_classes?: string[]; /** The new SQLite Durable Objects being defined. */
375
- new_sqlite_classes?: string[]; /** The Durable Objects being renamed. */
376
- renamed_classes?: {
377
- from: string;
378
- to: string;
379
- }[]; /** The Durable Objects being removed. */
380
- deleted_classes?: string[];
381
- };
382
- /**
383
- * The `EnvironmentInheritable` interface declares all the configuration fields for an environment
384
- * that can be inherited (and overridden) from the top-level environment.
385
- */
386
- interface EnvironmentInheritable {
387
- /**
388
- * The name of your Worker. Alphanumeric + dashes only.
389
- *
390
- * @inheritable
391
- */
392
- name: string | undefined;
393
- /**
394
- * This is the ID of the account associated with your zone.
395
- * You might have more than one account, so make sure to use
396
- * the ID of the account associated with the zone/route you
397
- * provide, if you provide one. It can also be specified through
398
- * the CLOUDFLARE_ACCOUNT_ID environment variable.
399
- *
400
- * @inheritable
401
- */
402
- account_id: string | undefined;
403
- /**
404
- * A date in the form yyyy-mm-dd, which will be used to determine
405
- * which version of the Workers runtime is used.
406
- *
407
- * More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
408
- *
409
- * @inheritable
410
- */
411
- compatibility_date: string | undefined;
412
- /**
413
- * A list of flags that enable features from upcoming features of
414
- * the Workers runtime, usually used together with compatibility_date.
415
- *
416
- * More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
417
- *
418
- * @default []
419
- * @inheritable
420
- */
421
- compatibility_flags: string[];
422
- /**
423
- * The entrypoint/path to the JavaScript file that will be executed.
424
- *
425
- * @inheritable
426
- */
427
- main: string | undefined;
428
- /**
429
- * If true then Wrangler will traverse the file tree below `base_dir`;
430
- * Any files that match `rules` will be included in the deployed Worker.
431
- * Defaults to true if `no_bundle` is true, otherwise false.
432
- *
433
- * @inheritable
434
- */
435
- find_additional_modules: boolean | undefined;
436
- /**
437
- * Determines whether Wrangler will preserve bundled file names.
438
- * Defaults to false.
439
- * If left unset, files will be named using the pattern ${fileHash}-${basename},
440
- * for example, `34de60b44167af5c5a709e62a4e20c4f18c9e3b6-favicon.ico`.
441
- *
442
- * @inheritable
443
- */
444
- preserve_file_names: boolean | undefined;
445
- /**
446
- * The directory in which module rules should be evaluated when including additional files into a Worker deployment.
447
- * This defaults to the directory containing the `main` entry point of the Worker if not specified.
448
- *
449
- * @inheritable
450
- */
451
- base_dir: string | undefined;
452
- /**
453
- * Whether we use <name>.<subdomain>.workers.dev to
454
- * test and deploy your Worker.
455
- *
456
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
457
- *
458
- * @default true
459
- * @breaking
460
- * @inheritable
461
- */
462
- workers_dev: boolean | undefined;
463
- /**
464
- * Whether we use <version>-<name>.<subdomain>.workers.dev to
465
- * serve Preview URLs for your Worker.
466
- *
467
- * @default true
468
- * @inheritable
469
- */
470
- preview_urls: boolean | undefined;
471
- /**
472
- * A list of routes that your Worker should be published to.
473
- * Only one of `routes` or `route` is required.
474
- *
475
- * Only required when workers_dev is false, and there's no scheduled Worker (see `triggers`)
476
- *
477
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
478
- *
479
- * @inheritable
480
- */
481
- routes: Route$1[] | undefined;
482
- /**
483
- * A route that your Worker should be published to. Literally
484
- * the same as routes, but only one.
485
- * Only one of `routes` or `route` is required.
486
- *
487
- * Only required when workers_dev is false, and there's no scheduled Worker
488
- *
489
- * @inheritable
490
- */
491
- route: Route$1 | undefined;
492
- /**
493
- * Path to a custom tsconfig
494
- *
495
- * @inheritable
496
- */
497
- tsconfig: string | undefined;
498
- /**
499
- * The function to use to replace jsx syntax.
500
- *
501
- * @default "React.createElement"
502
- * @inheritable
503
- */
504
- jsx_factory: string;
505
- /**
506
- * The function to use to replace jsx fragment syntax.
507
- *
508
- * @default "React.Fragment"
509
- * @inheritable
510
- */
511
- jsx_fragment: string;
512
- /**
513
- * A list of migrations that should be uploaded with your Worker.
514
- *
515
- * These define changes in your Durable Object declarations.
516
- *
517
- * More details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations
518
- *
519
- * @default []
520
- * @inheritable
521
- */
522
- migrations: DurableObjectMigration[];
523
- /**
524
- * "Cron" definitions to trigger a Worker's "scheduled" function.
525
- *
526
- * Lets you call Workers periodically, much like a cron job.
527
- *
528
- * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
529
- *
530
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
531
- *
532
- * @default {crons: undefined}
533
- * @inheritable
534
- */
535
- triggers: {
536
- crons: string[] | undefined;
537
- };
538
- /**
539
- * Specify limits for runtime behavior.
540
- * Only supported for the "standard" Usage Model
541
- *
542
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#limits
543
- *
544
- * @inheritable
545
- */
546
- limits: UserLimits | undefined;
547
- /**
548
- * An ordered list of rules that define which modules to import,
549
- * and what type to import them as. You will need to specify rules
550
- * to use Text, Data, and CompiledWasm modules, or when you wish to
551
- * have a .js file be treated as an ESModule instead of CommonJS.
552
- *
553
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#bundling
554
- *
555
- * @inheritable
556
- */
557
- rules: Rule[];
558
- /**
559
- * Configures a custom build step to be run by Wrangler when building your Worker.
560
- *
561
- * Refer to the [custom builds documentation](https://developers.cloudflare.com/workers/cli-wrangler/configuration#build)
562
- * for more details.
563
- *
564
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#custom-builds
565
- *
566
- * @default {watch_dir:"./src"}
567
- */
568
- build: {
569
- /** The command used to build your Worker. On Linux and macOS, the command is executed in the `sh` shell and the `cmd` shell for Windows. The `&&` and `||` shell operators may be used. */command?: string; /** The directory in which the command is executed. */
570
- cwd?: string; /** The directory to watch for changes while using wrangler dev, defaults to the current working directory */
571
- watch_dir?: string | string[];
572
- };
573
- /**
574
- * Skip internal build steps and directly deploy script
575
- * @inheritable
576
- */
577
- no_bundle: boolean | undefined;
578
- /**
579
- * Minify the script before uploading.
580
- * @inheritable
581
- */
582
- minify: boolean | undefined;
583
- /**
584
- * Set the `name` property to the original name for functions and classes renamed during minification.
585
- *
586
- * See https://esbuild.github.io/api/#keep-names
587
- *
588
- * @default true
589
- * @inheritable
590
- */
591
- keep_names: boolean | undefined;
592
- /**
593
- * Designates this Worker as an internal-only "first-party" Worker.
594
- *
595
- * @inheritable
596
- */
597
- first_party_worker: boolean | undefined;
598
- /**
599
- * List of bindings that you will send to logfwdr
600
- *
601
- * @default {bindings:[]}
602
- * @inheritable
603
- */
604
- logfwdr: {
605
- bindings: {
606
- /** The binding name used to refer to logfwdr */name: string; /** The destination for this logged message */
607
- destination: string;
608
- }[];
609
- };
610
- /**
611
- * Send Trace Events from this Worker to Workers Logpush.
612
- *
613
- * This will not configure a corresponding Logpush job automatically.
614
- *
615
- * For more information about Workers Logpush, see:
616
- * https://blog.cloudflare.com/logpush-for-workers/
617
- *
618
- * @inheritable
619
- */
620
- logpush: boolean | undefined;
621
- /**
622
- * Include source maps when uploading this worker.
623
- *
624
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#source-maps
625
- *
626
- * @inheritable
627
- */
628
- upload_source_maps: boolean | undefined;
629
- /**
630
- * Specify how the Worker should be located to minimize round-trip time.
631
- *
632
- * More details: https://developers.cloudflare.com/workers/platform/smart-placement/
633
- *
634
- * @inheritable
635
- */
636
- placement: {
637
- mode: "off" | "smart";
638
- hint?: string;
639
- } | undefined;
640
- /**
641
- * Specify the directory of static assets to deploy/serve
642
- *
643
- * More details at https://developers.cloudflare.com/workers/frameworks/
644
- *
645
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
646
- *
647
- * @inheritable
648
- */
649
- assets: Assets | undefined;
650
- /**
651
- * Specify the observability behavior of the Worker.
652
- *
653
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
654
- *
655
- * @inheritable
656
- */
657
- observability: Observability | undefined;
658
- /**
659
- * Specify the compliance region mode of the Worker.
660
- *
661
- * Although if the user does not specify a compliance region, the default is `public`,
662
- * it can be set to `undefined` in configuration to delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable.
663
- */
664
- compliance_region: "public" | "fedramp_high" | undefined;
665
- }
666
- type DurableObjectBindings = {
667
- /** The name of the binding used to refer to the Durable Object */name: string; /** The exported class name of the Durable Object */
668
- class_name: string; /** The script where the Durable Object is defined (if it's external to this Worker) */
669
- script_name?: string; /** The service environment of the script_name to bind to */
670
- environment?: string;
671
- }[];
672
- type WorkflowBinding = {
673
- /** The name of the binding used to refer to the Workflow */binding: string; /** The name of the Workflow */
674
- name: string; /** The exported class name of the Workflow */
675
- class_name: string; /** The script where the Workflow is defined (if it's external to this Worker) */
676
- script_name?: string; /** Whether the Workflow should be remote or not (only available under `--x-remote-bindings`) */
677
- experimental_remote?: boolean;
678
- };
679
- /**
680
- * The `EnvironmentNonInheritable` interface declares all the configuration fields for an environment
681
- * that cannot be inherited from the top-level environment, and must be defined specifically.
682
- *
683
- * If any of these fields are defined at the top-level then they should also be specifically defined
684
- * for each named environment.
685
- */
686
- interface EnvironmentNonInheritable {
687
- /**
688
- * A map of values to substitute when deploying your Worker.
689
- *
690
- * NOTE: This field is not automatically inherited from the top level environment,
691
- * and so must be specified in every named environment.
692
- *
693
- * @default {}
694
- * @nonInheritable
695
- */
696
- define: Record<string, string>;
697
- /**
698
- * A map of environment variables to set when deploying your Worker.
699
- *
700
- * NOTE: This field is not automatically inherited from the top level environment,
701
- * and so must be specified in every named environment.
702
- *
703
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
704
- *
705
- * @default {}
706
- * @nonInheritable
707
- */
708
- vars: Record<string, unknown>;
709
- /**
710
- * A list of durable objects that your Worker should be bound to.
711
- *
712
- * For more information about Durable Objects, see the documentation at
713
- * https://developers.cloudflare.com/workers/learning/using-durable-objects
714
- *
715
- * NOTE: This field is not automatically inherited from the top level environment,
716
- * and so must be specified in every named environment.
717
- *
718
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
719
- *
720
- * @default {bindings:[]}
721
- * @nonInheritable
722
- */
723
- durable_objects: {
724
- bindings: DurableObjectBindings;
725
- };
726
- /**
727
- * A list of workflows that your Worker should be bound to.
728
- *
729
- * NOTE: This field is not automatically inherited from the top level environment,
730
- * and so must be specified in every named environment.
731
- *
732
- * @default []
733
- * @nonInheritable
734
- */
735
- workflows: WorkflowBinding[];
736
- /**
737
- * Cloudchamber configuration
738
- *
739
- * NOTE: This field is not automatically inherited from the top level environment,
740
- * and so must be specified in every named environment.
741
- *
742
- * @default {}
743
- * @nonInheritable
744
- */
745
- cloudchamber: CloudchamberConfig;
746
- /**
747
- * Container related configuration
748
- *
749
- * NOTE: This field is not automatically inherited from the top level environment,
750
- * and so must be specified in every named environment.
751
- *
752
- * @default []
753
- * @nonInheritable
754
- */
755
- containers?: ContainerApp[];
756
- /**
757
- * These specify any Workers KV Namespaces you want to
758
- * access from inside your Worker.
759
- *
760
- * To learn more about KV Namespaces,
761
- * see the documentation at https://developers.cloudflare.com/workers/learning/how-kv-works
762
- *
763
- * NOTE: This field is not automatically inherited from the top level environment,
764
- * and so must be specified in every named environment.
765
- *
766
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
767
- *
768
- * @default []
769
- * @nonInheritable
770
- */
771
- kv_namespaces: {
772
- /** The binding name used to refer to the KV Namespace */binding: string; /** The ID of the KV namespace */
773
- id?: string; /** The ID of the KV namespace used during `wrangler dev` */
774
- preview_id?: string; /** Whether the KV namespace should be remote or not (only available under `--x-remote-bindings`) */
775
- experimental_remote?: boolean;
776
- }[];
777
- /**
778
- * These specify bindings to send email from inside your Worker.
779
- *
780
- * NOTE: This field is not automatically inherited from the top level environment,
781
- * and so must be specified in every named environment.
782
- *
783
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
784
- *
785
- * @default []
786
- * @nonInheritable
787
- */
788
- send_email: {
789
- /** The binding name used to refer to the this binding */name: string; /** If this binding should be restricted to a specific verified address */
790
- destination_address?: string; /** If this binding should be restricted to a set of verified addresses */
791
- allowed_destination_addresses?: string[];
792
- }[];
793
- /**
794
- * Specifies Queues that are bound to this Worker environment.
795
- *
796
- * NOTE: This field is not automatically inherited from the top level environment,
797
- * and so must be specified in every named environment.
798
- *
799
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
800
- *
801
- * @default {consumers:[],producers:[]}
802
- * @nonInheritable
803
- */
804
- queues: {
805
- /** Producer bindings */producers?: {
806
- /** The binding name used to refer to the Queue in the Worker. */binding: string; /** The name of this Queue. */
807
- queue: string; /** The number of seconds to wait before delivering a message */
808
- delivery_delay?: number; /** Whether the Queue producer should be remote or not (only available under `--x-remote-bindings`) */
809
- experimental_remote?: boolean;
810
- }[]; /** Consumer configuration */
811
- consumers?: {
812
- /** The name of the queue from which this consumer should consume. */queue: string; /** The consumer type, e.g., worker, http-pull, r2-bucket, etc. Default is worker. */
813
- type?: string; /** The maximum number of messages per batch */
814
- max_batch_size?: number; /** The maximum number of seconds to wait to fill a batch with messages. */
815
- max_batch_timeout?: number; /** The maximum number of retries for each message. */
816
- max_retries?: number; /** The queue to send messages that failed to be consumed. */
817
- dead_letter_queue?: string; /** The maximum number of concurrent consumer Worker invocations. Leaving this unset will allow your consumer to scale to the maximum concurrency needed to keep up with the message backlog. */
818
- max_concurrency?: number | null; /** The number of milliseconds to wait for pulled messages to become visible again */
819
- visibility_timeout_ms?: number; /** The number of seconds to wait before retrying a message */
820
- retry_delay?: number;
821
- }[];
822
- };
823
- /**
824
- * Specifies R2 buckets that are bound to this Worker environment.
825
- *
826
- * NOTE: This field is not automatically inherited from the top level environment,
827
- * and so must be specified in every named environment.
828
- *
829
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
830
- *
831
- * @default []
832
- * @nonInheritable
833
- */
834
- r2_buckets: {
835
- /** The binding name used to refer to the R2 bucket in the Worker. */binding: string; /** The name of this R2 bucket at the edge. */
836
- bucket_name?: string; /** The preview name of this R2 bucket at the edge. */
837
- preview_bucket_name?: string; /** The jurisdiction that the bucket exists in. Default if not present. */
838
- jurisdiction?: string; /** Whether the R2 bucket should be remote or not (only available under `--x-remote-bindings`) */
839
- experimental_remote?: boolean;
840
- }[];
841
- /**
842
- * Specifies D1 databases that are bound to this Worker environment.
843
- *
844
- * NOTE: This field is not automatically inherited from the top level environment,
845
- * and so must be specified in every named environment.
846
- *
847
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
848
- *
849
- * @default []
850
- * @nonInheritable
851
- */
852
- d1_databases: {
853
- /** The binding name used to refer to the D1 database in the Worker. */binding: string; /** The name of this D1 database. */
854
- database_name?: string; /** The UUID of this D1 database (not required). */
855
- database_id?: string; /** The UUID of this D1 database for Wrangler Dev (if specified). */
856
- preview_database_id?: string; /** The name of the migrations table for this D1 database (defaults to 'd1_migrations'). */
857
- migrations_table?: string; /** The path to the directory of migrations for this D1 database (defaults to './migrations'). */
858
- migrations_dir?: string; /** Internal use only. */
859
- database_internal_env?: string; /** Whether the D1 database should be remote or not (only available under `--x-remote-bindings`) */
860
- experimental_remote?: boolean;
861
- }[];
862
- /**
863
- * Specifies Vectorize indexes that are bound to this Worker environment.
864
- *
865
- * NOTE: This field is not automatically inherited from the top level environment,
866
- * and so must be specified in every named environment.
867
- *
868
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
869
- *
870
- * @default []
871
- * @nonInheritable
872
- */
873
- vectorize: {
874
- /** The binding name used to refer to the Vectorize index in the Worker. */binding: string; /** The name of the index. */
875
- index_name: string; /** Whether the Vectorize index should be remote or not (only available under `--x-remote-bindings`) */
876
- experimental_remote?: boolean;
877
- }[];
878
- /**
879
- * Specifies Hyperdrive configs that are bound to this Worker environment.
880
- *
881
- * NOTE: This field is not automatically inherited from the top level environment,
882
- * and so must be specified in every named environment.
883
- *
884
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
885
- *
886
- * @default []
887
- * @nonInheritable
888
- */
889
- hyperdrive: {
890
- /** The binding name used to refer to the project in the Worker. */binding: string; /** The id of the database. */
891
- id: string; /** The local database connection string for `wrangler dev` */
892
- localConnectionString?: string;
893
- }[];
894
- /**
895
- * Specifies service bindings (Worker-to-Worker) that are bound to this Worker environment.
896
- *
897
- * NOTE: This field is not automatically inherited from the top level environment,
898
- * and so must be specified in every named environment.
899
- *
900
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
901
- *
902
- * @default []
903
- * @nonInheritable
904
- */
905
- services: {
906
- /** The binding name used to refer to the bound service. */binding: string; /** The name of the service. */
907
- service: string; /** The environment of the service (e.g. production, staging, etc). */
908
- environment?: string; /** Optionally, the entrypoint (named export) of the service to bind to. */
909
- entrypoint?: string; /** Optional properties that will be made available to the service via ctx.props. */
910
- props?: Record<string, unknown>; /** Whether the service binding should be remote or not (only available under `--x-remote-bindings`) */
911
- experimental_remote?: boolean;
912
- }[] | undefined;
913
- /**
914
- * Specifies analytics engine datasets that are bound to this Worker environment.
915
- *
916
- * NOTE: This field is not automatically inherited from the top level environment,
917
- * and so must be specified in every named environment.
918
- *
919
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
920
- *
921
- * @default []
922
- * @nonInheritable
923
- */
924
- analytics_engine_datasets: {
925
- /** The binding name used to refer to the dataset in the Worker. */binding: string; /** The name of this dataset to write to. */
926
- dataset?: string;
927
- }[];
928
- /**
929
- * A browser that will be usable from the Worker.
930
- *
931
- * NOTE: This field is not automatically inherited from the top level environment,
932
- * and so must be specified in every named environment.
933
- *
934
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
935
- *
936
- * @default {}
937
- * @nonInheritable
938
- */
939
- browser: {
940
- binding: string; /** Whether the Browser binding should be remote or not (only available under `--x-remote-bindings`) */
941
- experimental_remote?: boolean;
942
- } | undefined;
943
- /**
944
- * Binding to the AI project.
945
- *
946
- * NOTE: This field is not automatically inherited from the top level environment,
947
- * and so must be specified in every named environment.
948
- *
949
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
950
- *
951
- * @default {}
952
- * @nonInheritable
953
- */
954
- ai: {
955
- binding: string;
956
- staging?: boolean; /** Whether the AI binding should be remote or not (only available under `--x-remote-bindings`) */
957
- experimental_remote?: boolean;
958
- } | undefined;
959
- /**
960
- * Binding to Cloudflare Images
961
- *
962
- * NOTE: This field is not automatically inherited from the top level environment,
963
- * and so must be specified in every named environment.
964
- *
965
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
966
- *
967
- * @default {}
968
- * @nonInheritable
969
- */
970
- images: {
971
- binding: string; /** Whether the Images binding should be remote or not (only available under `--x-remote-bindings`) */
972
- experimental_remote?: boolean;
973
- } | undefined;
974
- /**
975
- * Binding to the Worker Version's metadata
976
- */
977
- version_metadata: {
978
- binding: string;
979
- } | undefined;
980
- /**
981
- * "Unsafe" tables for features that aren't directly supported by wrangler.
982
- *
983
- * NOTE: This field is not automatically inherited from the top level environment,
984
- * and so must be specified in every named environment.
985
- *
986
- * @default {}
987
- * @nonInheritable
988
- */
989
- unsafe: {
990
- /**
991
- * A set of bindings that should be put into a Worker's upload metadata without changes. These
992
- * can be used to implement bindings for features that haven't released and aren't supported
993
- * directly by wrangler or miniflare.
994
- */
995
- bindings?: {
996
- name: string;
997
- type: string;
998
- [key: string]: unknown;
999
- }[];
1000
- /**
1001
- * Arbitrary key/value pairs that will be included in the uploaded metadata. Values specified
1002
- * here will always be applied to metadata last, so can add new or override existing fields.
1003
- */
1004
- metadata?: {
1005
- [key: string]: unknown;
1006
- };
1007
- /**
1008
- * Used for internal capnp uploads for the Workers runtime
1009
- */
1010
- capnp?: {
1011
- base_path: string;
1012
- source_schemas: string[];
1013
- compiled_schema?: never;
1014
- } | {
1015
- base_path?: never;
1016
- source_schemas?: never;
1017
- compiled_schema: string;
1018
- };
1019
- };
1020
- /**
1021
- * Specifies a list of mTLS certificates that are bound to this Worker environment.
1022
- *
1023
- * NOTE: This field is not automatically inherited from the top level environment,
1024
- * and so must be specified in every named environment.
1025
- *
1026
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
1027
- *
1028
- * @default []
1029
- * @nonInheritable
1030
- */
1031
- mtls_certificates: {
1032
- /** The binding name used to refer to the certificate in the Worker */binding: string; /** The uuid of the uploaded mTLS certificate */
1033
- certificate_id: string; /** Whether the mtls fetcher should be remote or not (only available under `--x-remote-bindings`) */
1034
- experimental_remote?: boolean;
1035
- }[];
1036
- /**
1037
- * Specifies a list of Tail Workers that are bound to this Worker environment
1038
- *
1039
- * NOTE: This field is not automatically inherited from the top level environment,
1040
- * and so must be specified in every named environment.
1041
- *
1042
- * @default []
1043
- * @nonInheritable
1044
- */
1045
- tail_consumers?: TailConsumer[];
1046
- /**
1047
- * Specifies namespace bindings that are bound to this Worker environment.
1048
- *
1049
- * NOTE: This field is not automatically inherited from the top level environment,
1050
- * and so must be specified in every named environment.
1051
- *
1052
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
1053
- *
1054
- * @default []
1055
- * @nonInheritable
1056
- */
1057
- dispatch_namespaces: {
1058
- /** The binding name used to refer to the bound service. */binding: string; /** The namespace to bind to. */
1059
- namespace: string; /** Details about the outbound Worker which will handle outbound requests from your namespace */
1060
- outbound?: DispatchNamespaceOutbound; /** Whether the Dispatch Namespace should be remote or not (only available under `--x-remote-bindings`) */
1061
- experimental_remote?: boolean;
1062
- }[];
1063
- /**
1064
- * Specifies list of Pipelines bound to this Worker environment
1065
- *
1066
- * NOTE: This field is not automatically inherited from the top level environment,
1067
- * and so must be specified in every named environment.
1068
- *
1069
- * @default []
1070
- * @nonInheritable
1071
- */
1072
- pipelines: {
1073
- /** The binding name used to refer to the bound service. */binding: string; /** Name of the Pipeline to bind */
1074
- pipeline: string;
1075
- }[];
1076
- /**
1077
- * Specifies Secret Store bindings that are bound to this Worker environment.
1078
- *
1079
- * NOTE: This field is not automatically inherited from the top level environment,
1080
- * and so must be specified in every named environment.
1081
- *
1082
- * @default []
1083
- * @nonInheritable
1084
- */
1085
- secrets_store_secrets: {
1086
- /** The binding name used to refer to the bound service. */binding: string; /** Id of the secret store */
1087
- store_id: string; /** Name of the secret */
1088
- secret_name: string;
1089
- }[];
1090
- /**
1091
- * **DO NOT USE**. Hello World Binding Config to serve as an explanatory example.
1092
- *
1093
- * NOTE: This field is not automatically inherited from the top level environment,
1094
- * and so must be specified in every named environment.
1095
- *
1096
- * @default []
1097
- * @nonInheritable
1098
- */
1099
- unsafe_hello_world: {
1100
- /** The binding name used to refer to the bound service. */binding: string; /** Whether the timer is enabled */
1101
- enable_timer?: boolean;
1102
- }[];
1103
- }
1104
- /**
1105
- * A bundling resolver rule, defining the modules type for paths that match the specified globs.
1106
- */
1107
- type Rule = {
1108
- type: ConfigModuleRuleType;
1109
- globs: string[];
1110
- fallthrough?: boolean;
1111
- };
1112
- /**
1113
- * The possible types for a `Rule`.
1114
- */
1115
- type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data" | "PythonModule" | "PythonRequirement";
1116
- type TailConsumer = {
1117
- /** The name of the service tail events will be forwarded to. */service: string; /** (Optional) The environment of the service. */
1118
- environment?: string;
1119
- };
1120
- interface DispatchNamespaceOutbound {
1121
- /** Name of the service handling the outbound requests */
1122
- service: string;
1123
- /** (Optional) Name of the environment handling the outbound requests. */
1124
- environment?: string;
1125
- /** (Optional) List of parameter names, for sending context from your dispatch Worker to the outbound handler */
1126
- parameters?: string[];
1127
- }
1128
- interface UserLimits {
1129
- /** Maximum allowed CPU time for a Worker's invocation in milliseconds */
1130
- cpu_ms: number;
1131
- }
1132
- type Assets = {
1133
- /** Absolute path to assets directory */directory?: string; /** Name of `env` binding property in the User Worker. */
1134
- binding?: string; /** How to handle HTML requests. */
1135
- html_handling?: "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | "none"; /** How to handle requests that do not match an asset. */
1136
- not_found_handling?: "single-page-application" | "404-page" | "none";
1137
- /**
1138
- * Matches will be routed to the User Worker, and matches to negative rules will go to the Asset Worker.
1139
- *
1140
- * Can also be `true`, indicating that every request should be routed to the User Worker.
1141
- */
1142
- run_worker_first?: string[] | boolean;
1143
- };
1144
- interface Observability {
1145
- /** If observability is enabled for this Worker */
1146
- enabled?: boolean;
1147
- /** The sampling rate */
1148
- head_sampling_rate?: number;
1149
- logs?: {
1150
- enabled?: boolean; /** The sampling rate */
1151
- head_sampling_rate?: number; /** Set to false to disable invocation logs */
1152
- invocation_logs?: boolean;
1153
- };
1154
- }
1155
- /**
1156
- * This is the static type definition for the configuration object.
1157
- *
1158
- * It reflects a normalized and validated version of the configuration that you can write in a Wrangler configuration file,
1159
- * and optionally augment with arguments passed directly to wrangler.
1160
- *
1161
- * For more information about the configuration object, see the
1162
- * documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration
1163
- *
1164
- * Notes:
1165
- *
1166
- * - Fields that are only specified in `ConfigFields` and not `Environment` can only appear
1167
- * in the top level config and should not appear in any environments.
1168
- * - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects
1169
- * - All top level fields in config and environments are optional in the Wrangler configuration file.
1170
- *
1171
- * Legend for the annotations:
1172
- *
1173
- * - `@breaking`: the deprecation/optionality is a breaking change from Wrangler v1.
1174
- * - `@todo`: there's more work to be done (with details attached).
1175
- */
1176
- type Config = ComputedFields & ConfigFields<DevConfig> & PagesConfigFields & Environment;
1177
- interface ComputedFields {
1178
- /** The path to the Wrangler configuration file (if any, and possibly redirected from the user Wrangler configuration) used to create this configuration. */
1179
- configPath: string | undefined;
1180
- /** The path to the user's Wrangler configuration file (if any), which may have been redirected to another file that used to create this configuration. */
1181
- userConfigPath: string | undefined;
1182
- /**
1183
- * The original top level name for the Worker in the raw configuration.
1184
- *
1185
- * When a raw configuration has been flattened to a single environment the worker name may have been replaced or transformed.
1186
- * It can be useful to know what the top-level name was before the flattening.
1187
- */
1188
- topLevelName: string | undefined;
1189
- }
1190
- interface ConfigFields<Dev extends RawDevConfig> {
1191
- /**
1192
- * A boolean to enable "legacy" style wrangler environments (from Wrangler v1).
1193
- * These have been superseded by Services, but there may be projects that won't
1194
- * (or can't) use them. If you're using a legacy environment, you can set this
1195
- * to `true` to enable it.
1196
- */
1197
- legacy_env: boolean;
1198
- /**
1199
- * Whether Wrangler should send usage metrics to Cloudflare for this project.
1200
- *
1201
- * When defined this will override any user settings.
1202
- * Otherwise, Wrangler will use the user's preference.
1203
- */
1204
- send_metrics: boolean | undefined;
1205
- /**
1206
- * Options to configure the development server that your worker will use.
1207
- */
1208
- dev: Dev;
1209
- /**
1210
- * The definition of a Worker Site, a feature that lets you upload
1211
- * static assets with your Worker.
1212
- *
1213
- * More details at https://developers.cloudflare.com/workers/platform/sites
1214
- */
1215
- site: {
1216
- /**
1217
- * The directory containing your static assets.
1218
- *
1219
- * It must be a path relative to your Wrangler configuration file.
1220
- * Example: bucket = "./public"
1221
- *
1222
- * If there is a `site` field then it must contain this `bucket` field.
1223
- */
1224
- bucket: string;
1225
- /**
1226
- * The location of your Worker script.
1227
- *
1228
- * @deprecated DO NOT use this (it's a holdover from Wrangler v1.x). Either use the top level `main` field, or pass the path to your entry file as a command line argument.
1229
- * @breaking
1230
- */
1231
- "entry-point"?: string;
1232
- /**
1233
- * An exclusive list of .gitignore-style patterns that match file
1234
- * or directory names from your bucket location. Only matched
1235
- * items will be uploaded. Example: include = ["upload_dir"]
1236
- *
1237
- * @optional
1238
- * @default []
1239
- */
1240
- include?: string[];
1241
- /**
1242
- * A list of .gitignore-style patterns that match files or
1243
- * directories in your bucket that should be excluded from
1244
- * uploads. Example: exclude = ["ignore_dir"]
1245
- *
1246
- * @optional
1247
- * @default []
1248
- */
1249
- exclude?: string[];
1250
- } | undefined;
1251
- /**
1252
- * Old behaviour of serving a folder of static assets with your Worker,
1253
- * without any additional code.
1254
- * This can either be a string, or an object with additional config
1255
- * fields.
1256
- * Will be deprecated in the near future in favor of `assets`.
1257
- */
1258
- legacy_assets: {
1259
- bucket: string;
1260
- include: string[];
1261
- exclude: string[];
1262
- browser_TTL: number | undefined;
1263
- serve_single_page_app: boolean;
1264
- } | string | undefined;
1265
- /**
1266
- * A list of wasm modules that your worker should be bound to. This is
1267
- * the "legacy" way of binding to a wasm module. ES module workers should
1268
- * do proper module imports.
1269
- */
1270
- wasm_modules: {
1271
- [key: string]: string;
1272
- } | undefined;
1273
- /**
1274
- * A list of text files that your worker should be bound to. This is
1275
- * the "legacy" way of binding to a text file. ES module workers should
1276
- * do proper module imports.
1277
- */
1278
- text_blobs: {
1279
- [key: string]: string;
1280
- } | undefined;
1281
- /**
1282
- * A list of data files that your worker should be bound to. This is
1283
- * the "legacy" way of binding to a data file. ES module workers should
1284
- * do proper module imports.
1285
- */
1286
- data_blobs: {
1287
- [key: string]: string;
1288
- } | undefined;
1289
- /**
1290
- * A map of module aliases. Lets you swap out a module for any others.
1291
- * Corresponds with esbuild's `alias` config
1292
- */
1293
- alias: {
1294
- [key: string]: string;
1295
- } | undefined;
1296
- /**
1297
- * By default, the Wrangler configuration file is the source of truth for your environment configuration, like a terraform file.
1298
- *
1299
- * If you change your vars in the dashboard, wrangler *will* override/delete them on its next deploy.
1300
- *
1301
- * If you want to keep your dashboard vars when wrangler deploys, set this field to true.
1302
- *
1303
- * @default false
1304
- * @nonInheritable
1305
- */
1306
- keep_vars?: boolean;
1307
- }
1308
- interface PagesConfigFields {
1309
- /**
1310
- * The directory of static assets to serve.
1311
- *
1312
- * The presence of this field in a Wrangler configuration file indicates a Pages project,
1313
- * and will prompt the handling of the configuration file according to the
1314
- * Pages-specific validation rules.
1315
- */
1316
- pages_build_output_dir?: string;
1317
- }
1318
- interface DevConfig {
1319
- /**
1320
- * IP address for the local dev server to listen on,
1321
- *
1322
- * @default localhost
1323
- */
1324
- ip: string;
1325
- /**
1326
- * Port for the local dev server to listen on
1327
- *
1328
- * @default 8787
1329
- */
1330
- port: number | undefined;
1331
- /**
1332
- * Port for the local dev server's inspector to listen on
1333
- *
1334
- * @default 9229
1335
- */
1336
- inspector_port: number | undefined;
1337
- /**
1338
- * Protocol that local wrangler dev server listens to requests on.
1339
- *
1340
- * @default http
1341
- */
1342
- local_protocol: "http" | "https";
1343
- /**
1344
- * Protocol that wrangler dev forwards requests on
1345
- *
1346
- * Setting this to `http` is not currently implemented for remote mode.
1347
- * See https://github.com/cloudflare/workers-sdk/issues/583
1348
- *
1349
- * @default https
1350
- */
1351
- upstream_protocol: "https" | "http";
1352
- /**
1353
- * Host to forward requests to, defaults to the host of the first route of project
1354
- */
1355
- host: string | undefined;
1356
- }
1357
- type RawDevConfig = Partial<DevConfig>;
1358
- type WranglerConfig = Partial<Omit<Config, keyof ComputedFields>>;
253
+ type WranglerConfig = Partial<RawConfig>;
1359
254
  /**
1360
255
  * https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes
1361
256
  */
@@ -1469,36 +364,10 @@ declare module "nitro/types" {
1469
364
  "cloudflare:durable:alarm": (durable: DurableObject) => void;
1470
365
  }
1471
366
  }
367
+ type AppHostingOutputBundleConfig = OutputBundleConfig;
1472
368
  interface FirebaseOptions {
1473
369
  appHosting: Partial<AppHostingOutputBundleConfig["runConfig"]>;
1474
370
  }
1475
- interface AppHostingOutputBundleConfig {
1476
- version: "v1";
1477
- runConfig: {
1478
- /** Command to start the server (e.g. "node dist/index.js"). Assume this command is run from the root dir of the workspace. */runCommand: string; /** Environment variables set when the app is run. */
1479
- environmentVariables?: Array<{
1480
- /** Name of the variable. */variable: string; /** Value associated with the variable. */
1481
- value: string; /** Where the variable will be available, for now only RUNTIME is supported. */
1482
- availability: "RUNTIME"[];
1483
- }>; /** The maximum number of concurrent requests that each server instance can receive. */
1484
- concurrency?: number; /** The number of CPUs used in a single server instance. */
1485
- cpu?: number; /** The amount of memory available for a server instance. */
1486
- memoryMiB?: number; /** The limit on the minimum number of function instances that may coexist at a given time. */
1487
- minInstances?: number; /** The limit on the maximum number of function instances that may coexist at a given time. */
1488
- maxInstances?: number;
1489
- };
1490
- metadata: {
1491
- adapterPackageName: string;
1492
- adapterVersion: string;
1493
- framework: string;
1494
- frameworkVersion?: string;
1495
- };
1496
- outputFiles?: {
1497
- /** serverApp holds a list of directories + files relative to the app root dir that frameworks need to deploy to the App Hosting server. */serverApp: {
1498
- include: string[];
1499
- };
1500
- };
1501
- }
1502
371
  interface NetlifyOptions {
1503
372
  /** @deprecated Use `config.images` */
1504
373
  images?: NetlifyImagesConfig;
@@ -1743,616 +612,47 @@ interface VercelOptions {
1743
612
  */
1744
613
  functionRules?: Record<string, VercelServerlessFunctionConfig>;
1745
614
  }
1746
- declare module "nitro/types" {
1747
- interface NitroRuntimeHooks {
1748
- "vercel:queue": (_: {
1749
- message: unknown;
1750
- metadata: _$_vercel_queue0.MessageMetadata;
1751
- send: typeof send;
1752
- }) => void;
1753
- }
1754
- }
1755
- interface ZephyrOptions {
1756
- /**
1757
- * Deploy to Zephyr during `nitro build` when using the `zephyr` preset.
1758
- *
1759
- * @default false
1760
- */
1761
- deployOnBuild?: boolean;
1762
- }
1763
- interface PresetOptions {
1764
- awsAmplify?: AWSAmplifyOptions;
1765
- awsLambda?: AwsLambdaOptions;
1766
- azure?: AzureOptions;
1767
- cloudflare?: CloudflareOptions;
1768
- firebase?: FirebaseOptions;
1769
- netlify?: NetlifyOptions;
1770
- vercel?: VercelOptions;
1771
- zephyr?: ZephyrOptions;
1772
- }
1773
- type PresetName = "alwaysdata" | "aws-amplify" | "aws-lambda" | "azure-swa" | "base-worker" | "bun" | "cleavr" | "cloudflare-dev" | "cloudflare-durable" | "cloudflare-module" | "cloudflare-pages" | "cloudflare-pages-static" | "deno" | "deno-deploy" | "deno-server" | "digital-ocean" | "edgeone" | "edgeone-pages" | "firebase-app-hosting" | "flight-control" | "genezio" | "github-pages" | "gitlab-pages" | "heroku" | "iis-handler" | "iis-node" | "koyeb" | "netlify" | "netlify-edge" | "netlify-static" | "nitro-dev" | "nitro-prerender" | "node" | "node-cluster" | "node-middleware" | "node-server" | "platform-sh" | "render-com" | "standard" | "static" | "stormkit" | "vercel" | "vercel-static" | "winterjs" | "zeabur" | "zeabur-static" | "zephyr" | "zerops" | "zerops-static";
1774
- type PresetNameInput = "alwaysdata" | "aws-amplify" | "awsAmplify" | "aws_amplify" | "aws-lambda" | "awsLambda" | "aws_lambda" | "azure-swa" | "azureSwa" | "azure_swa" | "base-worker" | "baseWorker" | "base_worker" | "bun" | "cleavr" | "cloudflare-dev" | "cloudflareDev" | "cloudflare_dev" | "cloudflare-durable" | "cloudflareDurable" | "cloudflare_durable" | "cloudflare-module" | "cloudflareModule" | "cloudflare_module" | "cloudflare-pages" | "cloudflarePages" | "cloudflare_pages" | "cloudflare-pages-static" | "cloudflarePagesStatic" | "cloudflare_pages_static" | "deno" | "deno-deploy" | "denoDeploy" | "deno_deploy" | "deno-server" | "denoServer" | "deno_server" | "digital-ocean" | "digitalOcean" | "digital_ocean" | "edgeone" | "edgeone-pages" | "edgeonePages" | "edgeone_pages" | "firebase-app-hosting" | "firebaseAppHosting" | "firebase_app_hosting" | "flight-control" | "flightControl" | "flight_control" | "genezio" | "github-pages" | "githubPages" | "github_pages" | "gitlab-pages" | "gitlabPages" | "gitlab_pages" | "heroku" | "iis-handler" | "iisHandler" | "iis_handler" | "iis-node" | "iisNode" | "iis_node" | "koyeb" | "netlify" | "netlify-edge" | "netlifyEdge" | "netlify_edge" | "netlify-static" | "netlifyStatic" | "netlify_static" | "nitro-dev" | "nitroDev" | "nitro_dev" | "nitro-prerender" | "nitroPrerender" | "nitro_prerender" | "node" | "node-cluster" | "nodeCluster" | "node_cluster" | "node-middleware" | "nodeMiddleware" | "node_middleware" | "node-server" | "nodeServer" | "node_server" | "platform-sh" | "platformSh" | "platform_sh" | "render-com" | "renderCom" | "render_com" | "standard" | "static" | "stormkit" | "vercel" | "vercel-static" | "vercelStatic" | "vercel_static" | "winterjs" | "zeabur" | "zeabur-static" | "zeaburStatic" | "zeabur_static" | "zephyr" | "zerops" | "zerops-static" | "zeropsStatic" | "zerops_static" | (string & {});
1775
- /**
1776
- Source: (inlined because of install size concernes)
1777
-
1778
- https://github.com/openapi-ts/openapi-typescript/blob/fc3f7/packages/openapi-typescript/src/types.ts
1779
-
1780
- MIT License
1781
-
1782
- Copyright (c) 2020 Drew Powers
1783
-
1784
- Permission is hereby granted, free of charge, to any person obtaining a copy
1785
- of this software and associated documentation files (the "Software"), to deal
1786
- in the Software without restriction, including without limitation the rights
1787
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1788
- copies of the Software, and to permit persons to whom the Software is
1789
- furnished to do so, subject to the following conditions:
1790
-
1791
- The above copyright notice and this permission notice shall be included in all
1792
- copies or substantial portions of the Software.
1793
-
1794
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1795
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1796
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1797
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1798
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1799
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1800
- SOFTWARE.
1801
- */
1802
- interface Extensable {
1803
- [key: `x-${string}`]: any;
1804
- }
1805
- /**
1806
- * [4.8] Schema
1807
- * @see https://spec.openapis.org/oas/v3.1.0#schema
1808
- */
1809
- interface OpenAPI3 extends Extensable {
1810
- /** REQUIRED. This string MUST be the version number of the OpenAPI Specification that the OpenAPI document uses. The openapi field SHOULD be used by tooling to interpret the OpenAPI document. This is not related to the API info.version string. */
1811
- openapi: string;
1812
- /** REQUIRED. Provides metadata about the API. The metadata MAY be used by tooling as required. */
1813
- info: InfoObject;
1814
- /** The default value for the $schema keyword within Schema Objects contained within this OAS document. This MUST be in the form of a URI. */
1815
- jsonSchemaDialect?: string;
1816
- /** An array of Server Objects, which provide connectivity information to a target server. If the servers property is not provided, or is an empty array, the default value would be a Server Object with a url value of /. */
1817
- servers?: ServerObject[];
1818
- /** The available paths and operations for the API. */
1819
- paths?: PathsObject;
1820
- /** The incoming webhooks that MAY be received as part of this API and that the API consumer MAY choose to implement. Closely related to the callbacks feature, this section describes requests initiated other than by an API call, for example by an out of band registration. The key name is a unique string to refer to each webhook, while the (optionally referenced) Path Item Object describes a request that may be initiated by the API provider and the expected responses. An example is available. */
1821
- webhooks?: {
1822
- [id: string]: PathItemObject | ReferenceObject;
1823
- };
1824
- /** An element to hold various schemas for the document. */
1825
- components?: ComponentsObject;
1826
- /** A declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition. To make security optional, an empty security requirement ({}) can be included in the array. */
1827
- security?: SecurityRequirementObject[];
1828
- /** A list of tags used by the document with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the Operation Object must be declared. The tags that are not declared MAY be organized randomly or based on the tools’ logic. Each tag name in the list MUST be unique. */
1829
- tags?: TagObject[];
1830
- /** Additional external documentation. */
1831
- externalDocs?: ExternalDocumentationObject;
1832
- $defs?: $defs;
1833
- }
1834
- /**
1835
- * [4.8.2] Info Object
1836
- * The object provides metadata about the API.
1837
- */
1838
- interface InfoObject extends Extensable {
1839
- /** REQUIRED. The title of the API. */
1840
- title: string;
1841
- /** A short summary of the API. */
1842
- summary?: string;
1843
- /** A description of the API. CommonMark syntax MAY be used for rich text representation. */
1844
- description?: string;
1845
- /** A URL to the Terms of Service for the API. This MUST be in the form of a URL. */
1846
- termsOfService?: string;
1847
- /** The contact information for the exposed API. */
1848
- contact?: ContactObject;
1849
- /** The license information for the exposed API. */
1850
- license?: LicenseObject;
1851
- /** REQUIRED. The version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API implementation version). */
1852
- version: string;
1853
- }
1854
- /**
1855
- * [4.8.3] Contact Object
1856
- * Contact information for the exposed API.
1857
- */
1858
- interface ContactObject extends Extensable {
1859
- /** The identifying name of the contact person/organization. */
1860
- name?: string;
1861
- /** The URL pointing to the contact information. This MUST be in the form of a URL. */
1862
- url?: string;
1863
- /** The email address of the contact person/organization. This MUST be in the form of an email address. */
1864
- email?: string;
1865
- }
1866
- /**
1867
- * [4.8.4] License object
1868
- * License information for the exposed API.
1869
- */
1870
- interface LicenseObject extends Extensable {
1871
- /** REQUIRED. The license name used for the API. */
1872
- name: string;
1873
- /** An SPDX license expression for the API. The identifier field is mutually exclusive of the url field. */
1874
- identifier: string;
1875
- /** A URL to the license used for the API. This MUST be in the form of a URL. The url field is mutually exclusive of the identifier field. */
1876
- url: string;
1877
- }
1878
- /**
1879
- * [4.8.5] Server Object
1880
- * An object representing a Server.
1881
- */
1882
- interface ServerObject extends Extensable {
1883
- /** REQUIRED. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI document is being served. Variable substitutions will be made when a variable is named in {brackets}. */
1884
- url: string;
1885
- /** An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation. */
1886
- description: string;
1887
- /** A map between a variable name and its value. The value is used for substitution in the server’s URL template. */
1888
- variables: {
1889
- [name: string]: ServerVariableObject;
1890
- };
1891
- }
1892
- /**
1893
- * [4.8.6] Server Variable Object
1894
- * An object representing a Server Variable for server URL template substitution.
1895
- */
1896
- interface ServerVariableObject extends Extensable {
1897
- /** An enumeration of string values to be used if the substitution options are from a limited set. The array MUST NOT be empty. */
1898
- enum?: string[];
1899
- /** REQUIRED. The default value to use for substitution, which SHALL be sent if an alternate value is not supplied. Note this behavior is different than the Schema Object’s treatment of default values, because in those cases parameter values are optional. If the enum is defined, the value MUST exist in the enum’s values. */
1900
- default: string;
1901
- /** An optional description for the server variable. CommonMark syntax MAY be used for rich text representation. */
1902
- description?: string;
1903
- }
1904
- /**
1905
- * [4.8.7] Components Object
1906
- * Holds a set of reusable objects for different aspects of the OAS.
1907
- */
1908
- interface ComponentsObject extends Extensable {
1909
- /** An object to hold reusable Schema Objects.*/
1910
- schemas?: Record<string, SchemaObject>;
1911
- /** An object to hold reusable Response Objects. */
1912
- responses?: Record<string, ResponseObject | ReferenceObject>;
1913
- /** An object to hold reusable Parameter Objects. */
1914
- parameters?: Record<string, ParameterObject | ReferenceObject>;
1915
- /** An object to hold reusable Example Objects. */
1916
- examples?: Record<string, ExampleObject | ReferenceObject>;
1917
- /** An object to hold reusable Request Body Objects. */
1918
- requestBodies?: Record<string, RequestBodyObject | ReferenceObject>;
1919
- /** An object to hold reusable Header Objects. */
1920
- headers?: Record<string, HeaderObject | ReferenceObject>;
1921
- /** An object to hold reusable Security Scheme Objects. */
1922
- securitySchemes?: Record<string, SecuritySchemeObject | ReferenceObject>;
1923
- /** An object to hold reusable Link Objects. */
1924
- links?: Record<string, LinkObject | ReferenceObject>;
1925
- /** An object to hold reusable Callback Objects. */
1926
- callbacks?: Record<string, CallbackObject | ReferenceObject>;
1927
- /** An object to hold reusable Path Item Objects. */
1928
- pathItems?: Record<string, PathItemObject | ReferenceObject>;
1929
- }
1930
- /**
1931
- * [4.8.8] Paths Object
1932
- * Holds the relative paths to the individual endpoints and their operations. The path is appended to the URL from the Server Object in order to construct the full URL. The Paths MAY be empty, due to Access Control List (ACL) constraints.
1933
- */
1934
- interface PathsObject {
1935
- [pathname: string]: PathItemObject | ReferenceObject;
1936
- }
1937
- /**
1938
- * [4.8.9] Path Item Object
1939
- * Describes the operations available on a single path. A Path Item MAY be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.
1940
- */
1941
- interface PathItemObject extends Extensable {
1942
- /** A definition of a GET operation on this path. */
1943
- get?: OperationObject | ReferenceObject;
1944
- /** A definition of a PUT operation on this path. */
1945
- put?: OperationObject | ReferenceObject;
1946
- /** A definition of a POST operation on this path. */
1947
- post?: OperationObject | ReferenceObject;
1948
- /** A definition of a DELETE operation on this path. */
1949
- delete?: OperationObject | ReferenceObject;
1950
- /** A definition of a OPTIONS operation on this path. */
1951
- options?: OperationObject | ReferenceObject;
1952
- /** A definition of a HEAD operation on this path. */
1953
- head?: OperationObject | ReferenceObject;
1954
- /** A definition of a PATCH operation on this path. */
1955
- patch?: OperationObject | ReferenceObject;
1956
- /** A definition of a TRACE operation on this path. */
1957
- trace?: OperationObject | ReferenceObject;
1958
- /** An alternative server array to service all operations in this path. */
1959
- servers?: ServerObject[];
1960
- /** A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object’s components/parameters. */
1961
- parameters?: (ParameterObject | ReferenceObject)[];
1962
- }
1963
- /**
1964
- * [4.8.10] Operation Object
1965
- * Describes a single API operation on a path.
1966
- */
1967
- interface OperationObject extends Extensable {
1968
- /** A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier. */
1969
- tags?: string[];
1970
- /** A short summary of what the operation does. */
1971
- summary?: string;
1972
- /** A verbose explanation of the operation behavior. CommonMark syntax MAY be used for rich text representation. */
1973
- description?: string;
1974
- /** Additional external documentation for this operation. */
1975
- externalDocs?: ExternalDocumentationObject;
1976
- /** Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is case-sensitive. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions. */
1977
- operationId?: string;
1978
- /** A list of parameters that are applicable for this operation. If a parameter is already defined at the Path Item, the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object’s components/parameters. */
1979
- parameters?: (ParameterObject | ReferenceObject)[];
1980
- /** The request body applicable for this operation. The requestBody is fully supported in HTTP methods where the HTTP 1.1 specification [RFC7231] has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague (such as GET, HEAD and DELETE), requestBody is permitted but does not have well-defined semantics and SHOULD be avoided if possible. */
1981
- requestBody?: RequestBodyObject | ReferenceObject;
1982
- /** The list of possible responses as they are returned from executing this operation. */
1983
- responses?: ResponsesObject;
1984
- /** A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a Callback Object that describes a request that may be initiated by the API provider and the expected responses. */
1985
- callbacks?: Record<string, CallbackObject | ReferenceObject>;
1986
- /** Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation. Default value is false. */
1987
- deprecated?: boolean;
1988
- /** A declaration of which security mechanisms can be used for this operation. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. To make security optional, an empty security requirement ({}) can be included in the array. This definition overrides any declared top-level security. To remove a top-level security declaration, an empty array can be used. */
1989
- security?: SecurityRequirementObject[];
1990
- /** An alternative server array to service this operation. If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by this value. */
1991
- servers?: ServerObject[];
1992
- }
1993
- /**
1994
- * [4.8.11] External Documentation Object
1995
- * Allows referencing an external resource for extended documentation.
1996
- */
1997
- interface ExternalDocumentationObject extends Extensable {
1998
- /** A description of the target documentation. CommonMark syntax MAY be used for rich text representation. */
1999
- description?: string;
2000
- /** REQUIRED. The URL for the target documentation. This MUST be in the form of a URL. */
2001
- url: string;
615
+ declare module "nitro/types" {
616
+ interface NitroRuntimeHooks {
617
+ "vercel:queue": (_: {
618
+ message: unknown;
619
+ metadata: import("@vercel/queue").MessageMetadata;
620
+ send: typeof send;
621
+ }) => void;
622
+ }
2002
623
  }
2003
- /**
2004
- * [4.8.12] Parameter Object
2005
- * Describes a single operation parameter.
2006
- * A unique parameter is defined by a combination of a name and location.
2007
- */
2008
- interface ParameterObject extends Extensable {
624
+ interface ZephyrOptions {
2009
625
  /**
2010
- * REQUIRED. The name of the parameter. Parameter names are case sensitive.
626
+ * Deploy to Zephyr during `nitro build` when using the `zephyr` preset.
2011
627
  *
2012
- * - If `in` is `"path"`, the `name` field MUST correspond to a template expression occurring within the path field in the Paths Object. See Path Templating for further information.
2013
- * - If `in` is `"header"` and the `name` field is `"Accept"`, `"Content-Type"` or `"Authorization"`, the parameter definition SHALL be ignored.
2014
- * - For all other cases, the `name` corresponds to the parameter name used by the `in` property.
628
+ * @default false
2015
629
  */
2016
- name: string;
2017
- /** REQUIRED. The location of the parameter. Possible values are "query", "header", "path" or "cookie".*/
2018
- in: "query" | "header" | "path" | "cookie";
2019
- /** A brief description of the parameter. This could contain examples of use. CommonMark syntax MAY be used for rich text representation. */
2020
- description?: string;
2021
- /** Determines whether this parameter is mandatory. If the parameter location is "path", this property is REQUIRED and its value MUST be true. Otherwise, the property MAY be included and its default value is false. */
2022
- required?: boolean;
2023
- /** Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. Default value is false. */
2024
- deprecated?: boolean;
2025
- /** Sets the ability to pass empty-valued parameters. This is valid only for query parameters and allows sending a parameter with an empty value. Default value is false. If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue SHALL be ignored. Use of this property is NOT RECOMMENDED, as it is likely to be removed in a later revision. */
2026
- allowEmptyValue?: boolean;
2027
- /** Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form. */
2028
- style?: string;
2029
- /** When this is true, parameter values of type `array` or `object` generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters this property has no effect. When `style` is `form`, the default value is `true`. For all other styles, the default value is `false`. */
2030
- explode?: boolean;
2031
- /** Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986] `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. This property only applies to parameters with an `in` value of `query`. The default value is `false`. */
2032
- allowReserved?: boolean;
2033
- /** The schema defining the type used for the parameter. */
2034
- schema?: SchemaObject;
2035
- /** Example of the parameter’s potential value. */
2036
- example?: any;
2037
- /** Examples of the parameter’s potential value. */
2038
- examples?: {
2039
- [name: string]: ExampleObject | ReferenceObject;
2040
- };
2041
- /** A map containing the representations for the parameter. */
2042
- content?: {
2043
- [contentType: string]: MediaTypeObject | ReferenceObject;
2044
- };
2045
- }
2046
- /**
2047
- * [4.8.13] Request Body Object
2048
- * Describes a single request body.
2049
- */
2050
- interface RequestBodyObject extends Extensable {
2051
- /** A brief description of the request body. This could contain examples of use. CommonMark syntax MAY be used for rich text representation. */
2052
- description?: string;
2053
- /** REQUIRED. The content of the request body. The key is a media type or media type range and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text */
2054
- content: {
2055
- [contentType: string]: MediaTypeObject | ReferenceObject;
2056
- };
2057
- /** Determines if the request body is required in the request. Defaults to false. */
2058
- required?: boolean;
2059
- }
2060
- /**
2061
- * [4.8.14] Media Type Object
2062
- */
2063
- interface MediaTypeObject extends Extensable {
2064
- /** The schema defining the content of the request, response, or parameter. */
2065
- schema?: SchemaObject | ReferenceObject;
2066
- /** Example of the media type. The example object SHOULD be in the correct format as specified by the media type. The example field is mutually exclusive of the examples field. Furthermore, if referencing a schema which contains an example, the example value SHALL override the example provided by the schema. */
2067
- example?: any;
2068
- /** Examples of the media type. Each example object SHOULD match the media type and specified schema if present. The examples field is mutually exclusive of the example field. Furthermore, if referencing a schema which contains an example, the examples value SHALL override the example provided by the schema. */
2069
- examples?: {
2070
- [name: string]: ExampleObject | ReferenceObject;
2071
- };
2072
- /** A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHALL only apply to requestBody objects when the media type is multipart or application/x-www-form-urlencoded. */
2073
- encoding?: {
2074
- [propertyName: string]: EncodingObject;
2075
- };
2076
- }
2077
- /**
2078
- * [4.8.15] Encoding Object
2079
- * A single encoding definition applied to a single schema property.
2080
- */
2081
- interface EncodingObject extends Extensable {
2082
- /** The Content-Type for encoding a specific property. Default value depends on the property type: for object - application/json; for array – the default is defined based on the inner type; for all other cases the default is application/octet-stream. The value can be a specific media type (e.g. application/json), a wildcard media type (e.g. image/*), or a comma-separated list of the two types. */
2083
- contentType?: string;
2084
- /** A map allowing additional information to be provided as headers, for example Content-Disposition. Content-Type is described separately and SHALL be ignored in this section. This property SHALL be ignored if the request body media type is not a multipart. */
2085
- headers?: {
2086
- [name: string]: HeaderObject | ReferenceObject;
2087
- };
2088
- /** Describes how a specific property value will be serialized depending on its type. See Parameter Object for details on the style property. The behavior follows the same values as query parameters, including default values. This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded or multipart/form-data. If a value is explicitly defined, then the value of contentType (implicit or explicit) SHALL be ignored. */
2089
- style?: string;
2090
- /** When this is true, property values of type array or object generate separate parameters for each value of the array, or key-value-pair of the map. For other types of properties this property has no effect. When style is form, the default value is true. For all other styles, the default value is false. This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded or multipart/form-data. If a value is explicitly defined, then the value of contentType (implicit or explicit) SHALL be ignored. */
2091
- explode?: string;
2092
- /** Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986] :/?#[]@!$&'()*+,;= to be included without percent-encoding. The default value is false. This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded or multipart/form-data. If a value is explicitly defined, then the value of contentType (implicit or explicit) SHALL be ignored. */
2093
- allowReserved?: string;
2094
- }
2095
- /**
2096
- * [4.8.16] Responses Object
2097
- * A container for the expected responses of an operation. The container maps a HTTP response code to the expected response.
2098
- */
2099
- type ResponsesObject = {
2100
- [responseCode: string]: ResponseObject | ReferenceObject;
2101
- } & {
2102
- /** The documentation of responses other than the ones declared for specific HTTP response codes. Use this field to cover undeclared responses. */default?: ResponseObject | ReferenceObject;
2103
- };
2104
- /**
2105
- * [4.8.17] Response Object
2106
- * Describes a single response from an API Operation, including design-time, static links to operations based on the response.
2107
- */
2108
- interface ResponseObject extends Extensable {
2109
- /** REQUIRED. A description of the response. CommonMark syntax MAY be used for rich text representation. */
2110
- description: string;
2111
- /** Maps a header name to its definition. [RFC7230] states header names are case insensitive. If a response header is defined with the name "Content-Type", it SHALL be ignored. */
2112
- headers?: {
2113
- [name: string]: HeaderObject | ReferenceObject;
2114
- };
2115
- /** A map containing descriptions of potential response payloads. The key is a media type or media type range and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text */
2116
- content?: {
2117
- [contentType: string]: MediaTypeObject;
2118
- };
2119
- /** A map of operations links that can be followed from the response. The key of the map is a short name for the link, following the naming constraints of the names for Component Objects. */
2120
- links?: {
2121
- [name: string]: LinkObject | ReferenceObject;
2122
- };
2123
- }
2124
- /**
2125
- * [4.8.18] Callback Object
2126
- * A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the path item object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.
2127
- */
2128
- type CallbackObject = Record<string, PathItemObject>;
2129
- /**
2130
- * [4.8.19[ Example Object
2131
- */
2132
- interface ExampleObject extends Extensable {
2133
- /** Short description for the example. */
2134
- summary?: string;
2135
- /** Long description for the example. CommonMark syntax MAY be used for rich text representation. */
2136
- description?: string;
2137
- /** Embedded literal example. The value field and externalValue field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON or YAML, use a string value to contain the example, escaping where necessary. */
2138
- value?: any;
2139
- /** A URI that points to the literal example. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. The value field and externalValue field are mutually exclusive. See the rules for resolving Relative References. */
2140
- externalValue?: string;
2141
- }
2142
- /**
2143
- * [4.8.20] Link Object
2144
- * The Link object represents a possible design-time link for a response. The presence of a link does not guarantee the caller’s ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.
2145
- */
2146
- interface LinkObject extends Extensable {
2147
- /** A relative or absolute URI reference to an OAS operation. This field is mutually exclusive of the operationId field, and MUST point to an Operation Object. Relative operationRef values MAY be used to locate an existing Operation Object in the OpenAPI definition. See the rules for resolving Relative References. */
2148
- operationRef?: string;
2149
- /** The name of an existing, resolvable OAS operation, as defined with a unique operationId. This field is mutually exclusive of the operationRef field. */
2150
- operationId?: string;
2151
- /** A map representing parameters to pass to an operation as specified with operationId or identified via operationRef. The key is the parameter name to be used, whereas the value can be a constant or an expression to be evaluated and passed to the linked operation. The parameter name can be qualified using the parameter location [{in}.]{name} for operations that use the same parameter name in different locations (e.g. path.id). */
2152
- parameters?: {
2153
- [name: string]: `$${string}`;
2154
- };
2155
- /** A literal value or {expression} to use as a request body when calling the target operation. */
2156
- requestBody?: `$${string}`;
2157
- /** A description of the link. CommonMark syntax MAY be used for rich text representation. */
2158
- description?: string;
2159
- /** A server object to be used by the target operation. */
2160
- server?: ServerObject;
2161
- }
2162
- /**
2163
- * [4.8.21] Header Object
2164
- * The Header Object follows the structure of the Parameter Object with the following changes:
2165
- *
2166
- * 1. `name` MUST NOT be specified, it is given in the corresponding `headers` map.
2167
- * 2. `in` MUST NOT be specified, it is implicitly in `header`.
2168
- * 3. All traits that are affected by the location MUST be applicable to a location of `heade`r (for example, `style`).
2169
- */
2170
- type HeaderObject = Omit<ParameterObject, "name" | "in">;
2171
- /**
2172
- * [4.8.22] Tag Object
2173
- * Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag defined in the Operation Object instances.
2174
- */
2175
- interface TagObject extends Extensable {
2176
- /** REQUIRED. The name of the tag. */
2177
- name: string;
2178
- /** A description for the tag. CommonMark syntax MAY be used for rich text representation. */
2179
- description?: string;
2180
- /** Additional external documentation for this tag. */
2181
- externalDocs?: ExternalDocumentationObject;
2182
- }
2183
- /**
2184
- * [4.8.23] Reference Object
2185
- * A simple object to allow referencing other components in the OpenAPI document, internally and externally. The $ref string value contains a URI [RFC3986], which identifies the location of the value being referenced. See the rules for resolving Relative References.
2186
- */
2187
- interface ReferenceObject extends Extensable {
2188
- /** REQUIRED. The reference identifier. This MUST be in the form of a URI. */
2189
- $ref: string;
2190
- /** A short summary which by default SHOULD override that of the referenced component. If the referenced object-type does not allow a summary field, then this field has no effect. */
2191
- summary?: string;
2192
- /** A description which by default SHOULD override that of the referenced component. CommonMark syntax MAY be used for rich text representation. If the referenced object-type does not allow a description field, then this field has no effect. */
2193
- description?: string;
2194
- }
2195
- /**
2196
- * [4.8.24] Schema Object
2197
- * The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 2020-12.
2198
- */
2199
- type SchemaObject = {
2200
- /** The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 2020-12. */discriminator?: DiscriminatorObject; /** MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property. */
2201
- xml?: XMLObject; /** Additional external documentation for this schema. */
2202
- externalDocs?: ExternalDocumentationObject; /** @deprecated */
2203
- example?: any;
2204
- title?: string;
2205
- description?: string;
2206
- $comment?: string;
2207
- deprecated?: boolean;
2208
- readOnly?: boolean;
2209
- writeOnly?: boolean;
2210
- enum?: unknown[]; /** Use of this keyword is functionally equivalent to an "enum" (Section 6.1.2) with a single value. */
2211
- const?: unknown;
2212
- default?: unknown;
2213
- format?: string; /** @deprecated in 3.1 (still valid for 3.0) */
2214
- nullable?: boolean;
2215
- oneOf?: (SchemaObject | ReferenceObject)[];
2216
- allOf?: (SchemaObject | ReferenceObject)[];
2217
- anyOf?: (SchemaObject | ReferenceObject)[];
2218
- required?: string[];
2219
- [key: `x-${string}`]: any;
2220
- } & (StringSubtype | NumberSubtype | IntegerSubtype | ArraySubtype | BooleanSubtype | NullSubtype | ObjectSubtype | {
2221
- type: ("string" | "number" | "integer" | "array" | "boolean" | "null" | "object")[];
2222
- });
2223
- interface StringSubtype {
2224
- type: "string" | ["string", "null"];
2225
- enum?: (string | ReferenceObject)[];
2226
- }
2227
- interface NumberSubtype {
2228
- type: "number" | ["number", "null"];
2229
- minimum?: number;
2230
- maximum?: number;
2231
- enum?: (number | ReferenceObject)[];
2232
- }
2233
- interface IntegerSubtype {
2234
- type: "integer" | ["integer", "null"];
2235
- minimum?: number;
2236
- maximum?: number;
2237
- enum?: (number | ReferenceObject)[];
2238
- }
2239
- interface ArraySubtype {
2240
- type: "array" | ["array", "null"];
2241
- prefixItems?: (SchemaObject | ReferenceObject)[];
2242
- items?: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];
2243
- minItems?: number;
2244
- maxItems?: number;
2245
- enum?: (SchemaObject | ReferenceObject)[];
2246
- }
2247
- interface BooleanSubtype {
2248
- type: "boolean" | ["boolean", "null"];
2249
- enum?: (boolean | ReferenceObject)[];
2250
- }
2251
- interface NullSubtype {
2252
- type: "null";
2253
- }
2254
- interface ObjectSubtype {
2255
- type: "object" | ["object", "null"];
2256
- properties?: {
2257
- [name: string]: SchemaObject | ReferenceObject;
2258
- };
2259
- additionalProperties?: boolean | Record<string, never> | SchemaObject | ReferenceObject;
2260
- required?: string[];
2261
- allOf?: (SchemaObject | ReferenceObject)[];
2262
- anyOf?: (SchemaObject | ReferenceObject)[];
2263
- enum?: (SchemaObject | ReferenceObject)[];
2264
- $defs?: $defs;
2265
- }
2266
- /**
2267
- * [4.8.25] Discriminator Object
2268
- * When request bodies or response payloads may be one of a number of different schemas, a discriminator object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the document of an alternative schema based on the value associated with it.
2269
- */
2270
- interface DiscriminatorObject {
2271
- /** REQUIRED. The name of the property in the payload that will hold the discriminator value. */
2272
- propertyName: string;
2273
- /** An object to hold mappings between payload values and schema names or references. */
2274
- mapping?: Record<string, string>;
2275
- /** If this exists, then a discriminator type should be added to objects matching this path */
2276
- oneOf?: string[];
630
+ deployOnBuild?: boolean;
2277
631
  }
2278
- /**
2279
- * [4.8.26] XML Object
2280
- * A metadata object that allows for more fine-tuned XML model definitions. When using arrays, XML element names are not inferred (for singular/plural forms) and the `name` property SHOULD be used to add that information. See examples for expected behavior.
2281
- */
2282
- interface XMLObject extends Extensable {
2283
- /** Replaces the name of the element/attribute used for the described schema property. When defined within `items`, it will affect the name of the individual XML elements within the list. When defined alongside `type` being `array` (outside the `items`), it will affect the wrapping element and only if `wrapped` is `true`. If `wrapped` is `false`, it will be ignored. */
2284
- name?: string;
2285
- /** The URI of the namespace definition. This MUST be in the form of an absolute URI. */
2286
- namespace?: string;
2287
- /** The prefix to be used for the name. */
2288
- prefix?: string;
2289
- /** Declares whether the property definition translates to an attribute instead of an element. Default value is `false`. */
2290
- attribute?: boolean;
2291
- /** MAY be used only for an array definition. Signifies whether the array is wrapped (for example, `<books><book/><book/></books>`) or unwrapped (`<book/><book/>`). Default value is `false`. The definition takes effect only when defined alongside `type` being `array` (outside the `items`). */
2292
- wrapped?: boolean;
632
+ interface PresetOptions {
633
+ awsAmplify?: AWSAmplifyOptions;
634
+ awsLambda?: AwsLambdaOptions;
635
+ azure?: AzureOptions;
636
+ cloudflare?: CloudflareOptions;
637
+ firebase?: FirebaseOptions;
638
+ netlify?: NetlifyOptions;
639
+ vercel?: VercelOptions;
640
+ zephyr?: ZephyrOptions;
2293
641
  }
2294
- /**
2295
- * [4.8.27] Security Scheme Object
2296
- * Defines a security scheme that can be used by the operations.
2297
- */
2298
- type SecuritySchemeObject = {
2299
- /** A description for security scheme. CommonMark syntax MAY be used for rich text representation. */description?: string;
642
+ type PresetName = "alwaysdata" | "aws-amplify" | "aws-lambda" | "azure-swa" | "base-worker" | "bun" | "cleavr" | "cloudflare-dev" | "cloudflare-durable" | "cloudflare-module" | "cloudflare-pages" | "cloudflare-pages-static" | "deno" | "deno-deploy" | "deno-server" | "digital-ocean" | "edgeone" | "edgeone-pages" | "firebase-app-hosting" | "flight-control" | "genezio" | "github-pages" | "gitlab-pages" | "heroku" | "iis-handler" | "iis-node" | "koyeb" | "netlify" | "netlify-edge" | "netlify-static" | "nitro-dev" | "nitro-prerender" | "node" | "node-cluster" | "node-middleware" | "node-server" | "platform-sh" | "render-com" | "standard" | "static" | "stormkit" | "vercel" | "vercel-dev" | "vercel-static" | "winterjs" | "zeabur" | "zeabur-static" | "zephyr" | "zerops" | "zerops-static";
643
+ type PresetNameInput = "alwaysdata" | "aws-amplify" | "awsAmplify" | "aws_amplify" | "aws-lambda" | "awsLambda" | "aws_lambda" | "azure-swa" | "azureSwa" | "azure_swa" | "base-worker" | "baseWorker" | "base_worker" | "bun" | "cleavr" | "cloudflare-dev" | "cloudflareDev" | "cloudflare_dev" | "cloudflare-durable" | "cloudflareDurable" | "cloudflare_durable" | "cloudflare-module" | "cloudflareModule" | "cloudflare_module" | "cloudflare-pages" | "cloudflarePages" | "cloudflare_pages" | "cloudflare-pages-static" | "cloudflarePagesStatic" | "cloudflare_pages_static" | "deno" | "deno-deploy" | "denoDeploy" | "deno_deploy" | "deno-server" | "denoServer" | "deno_server" | "digital-ocean" | "digitalOcean" | "digital_ocean" | "edgeone" | "edgeone-pages" | "edgeonePages" | "edgeone_pages" | "firebase-app-hosting" | "firebaseAppHosting" | "firebase_app_hosting" | "flight-control" | "flightControl" | "flight_control" | "genezio" | "github-pages" | "githubPages" | "github_pages" | "gitlab-pages" | "gitlabPages" | "gitlab_pages" | "heroku" | "iis-handler" | "iisHandler" | "iis_handler" | "iis-node" | "iisNode" | "iis_node" | "koyeb" | "netlify" | "netlify-edge" | "netlifyEdge" | "netlify_edge" | "netlify-static" | "netlifyStatic" | "netlify_static" | "nitro-dev" | "nitroDev" | "nitro_dev" | "nitro-prerender" | "nitroPrerender" | "nitro_prerender" | "node" | "node-cluster" | "nodeCluster" | "node_cluster" | "node-middleware" | "nodeMiddleware" | "node_middleware" | "node-server" | "nodeServer" | "node_server" | "platform-sh" | "platformSh" | "platform_sh" | "render-com" | "renderCom" | "render_com" | "standard" | "static" | "stormkit" | "vercel" | "vercel-dev" | "vercelDev" | "vercel_dev" | "vercel-static" | "vercelStatic" | "vercel_static" | "winterjs" | "zeabur" | "zeabur-static" | "zeaburStatic" | "zeabur_static" | "zephyr" | "zerops" | "zerops-static" | "zeropsStatic" | "zerops_static" | (string & {});
644
+ interface Extensable {
2300
645
  [key: `x-${string}`]: any;
2301
- } & ({
2302
- /** REQUIRED. The type of the security scheme. */type: "apiKey"; /** REQUIRED. The name of the header, query or cookie parameter to be used. */
2303
- name: string; /** REQUIRED. The location of the API key. */
2304
- in: "query" | "header" | "cookie";
2305
- } | {
2306
- /** REQUIRED. The type of the security scheme. */type: "http"; /** REQUIRED. The name of the HTTP Authorization scheme to be used in the Authorization header as defined in [RFC7235]. The values used SHOULD be registered in the IANA Authentication Scheme registry. */
2307
- scheme: string; /** A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes. */
2308
- bearer?: string;
2309
- } | {
2310
- /** REQUIRED. The type of the security scheme. */type: "mutualTLS";
2311
- } | {
2312
- /** REQUIRED. Tye type of the security scheme. */type: "oauth2"; /** REQUIRED. An object containing configuration information for the flow types supported. */
2313
- flows: OAuthFlowsObject;
2314
- } | {
2315
- /** REQUIRED. Tye type of the security scheme. */type: "openIdConnect"; /** REQUIRED. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL. The OpenID Connect standard requires the use of TLS. */
2316
- openIdConnectUrl: string;
2317
- });
2318
- /**
2319
- * [4.8.26] OAuth Flows Object
2320
- * Allows configuration of the supported OAuth Flows.
2321
- */
2322
- interface OAuthFlowsObject extends Extensable {
2323
- /** Configuration for the OAuth Implicit flow */
2324
- implicit?: OAuthFlowObject;
2325
- /** Configuration for the OAuth Resource Owner Password flow */
2326
- password?: OAuthFlowObject;
2327
- /** Configuration for the OAuth Client Credentials flow. Previously called `application` in OpenAPI 2.0. */
2328
- clientCredentials?: OAuthFlowObject;
2329
- /** Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0. */
2330
- authorizationCode?: OAuthFlowObject;
2331
- }
2332
- /**
2333
- * [4.8.29] OAuth Flow Object
2334
- * Configuration details for a supported OAuth Flow
2335
- */
2336
- interface OAuthFlowObject extends Extensable {
2337
- /** REQUIRED. The authorization URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS. */
2338
- authorizationUrl: string;
2339
- /** REQUIRED. The token URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS. */
2340
- tokenUrl: string;
2341
- /** The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS. */
2342
- refreshUrl: string;
2343
- /** REQUIRED. The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. The map MAY be empty. */
2344
- scopes: {
2345
- [name: string]: string;
2346
- };
2347
646
  }
647
+ type OpenAPI3 = OpenAPIV3_1.Document & Extensable;
648
+ type OperationObject = OpenAPIV3_1.OperationObject;
649
+ type MaybeArray$1<T> = T | T[];
2348
650
  /**
2349
- * [4.8.30] Security Requirements Object
2350
- * Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the Security Schemes under the Components Object.
651
+ * Route-level metadata attached to event handlers.
652
+ *
653
+ * @experimental
654
+ * @see https://nitro.build/docs/routing
2351
655
  */
2352
- type SecurityRequirementObject = { [P in keyof ComponentsObject["securitySchemes"]]?: string[] };
2353
- type $defs = Record<string, SchemaObject>;
2354
- type MaybeArray$1<T> = T | T[];
2355
- /** @experimental */
2356
656
  interface NitroRouteMeta {
2357
657
  openAPI?: OperationObject & {
2358
658
  $global?: Pick<OpenAPI3, "components"> & Extensable;
@@ -2360,32 +660,47 @@ interface NitroRouteMeta {
2360
660
  }
2361
661
  interface NitroHandlerCommon {
2362
662
  /**
2363
- * HTTP pathname pattern to match
663
+ * HTTP pathname pattern to match.
2364
664
  *
2365
- * Examples: `/test`, `/api/:id`, `/blog/**`
665
+ * @example "/test", "/api/:id", "/blog/**"
2366
666
  */
2367
667
  route: string;
2368
668
  /**
2369
- * HTTP method to match
669
+ * HTTP method to match.
2370
670
  */
2371
671
  method?: HTTPMethod;
2372
672
  /**
2373
- * Run handler as a middleware before other route handlings
673
+ * Run handler as a middleware before other route handlers.
2374
674
  */
2375
675
  middleware?: boolean;
2376
676
  /**
2377
- * Extra Meta
677
+ * Route metadata (e.g. OpenAPI operation info).
2378
678
  */
2379
679
  meta?: NitroRouteMeta;
2380
680
  }
681
+ /**
682
+ * Handler module format.
683
+ *
684
+ * - `"web"` — standard Web API handler (default).
685
+ * - `"node"` — Node.js-style handler, automatically converted to web-compatible.
686
+ */
2381
687
  type EventHandlerFormat = "web" | "node";
688
+ /**
689
+ * Event handler registration for build-time bundling.
690
+ *
691
+ * Handlers are file references that the bundler imports and transforms.
692
+ * For runtime-only handlers in development, use {@link NitroDevEventHandler}.
693
+ *
694
+ * @see https://nitro.build/config#handlers
695
+ * @see https://nitro.build/docs/routing
696
+ */
2382
697
  interface NitroEventHandler extends NitroHandlerCommon {
2383
698
  /**
2384
- * Use lazy loading to import handler
699
+ * Use lazy loading to import handler.
2385
700
  */
2386
701
  lazy?: boolean;
2387
702
  /**
2388
- * Path to event handler
703
+ * Path to event handler.
2389
704
  */
2390
705
  handler: string;
2391
706
  /**
@@ -2394,15 +709,40 @@ interface NitroEventHandler extends NitroHandlerCommon {
2394
709
  * Default is `"web"`. If set to `"node"`, the handler will be converted into a web compatible handler.
2395
710
  */
2396
711
  format?: EventHandlerFormat;
712
+ /**
713
+ * Environments to include and bundle this handler.
714
+ *
715
+ * @example
716
+ * ```ts
717
+ * env: ["dev", "prod"]
718
+ * env: "prerender"
719
+ * ```
720
+ */
2397
721
  env?: MaybeArray$1<"dev" | "prod" | "prerender" | PresetName | (string & {})>;
2398
722
  }
723
+ /**
724
+ * Development-only event handler with an inline handler function.
725
+ *
726
+ * These handlers are available only during `nitro dev` and are not
727
+ * included in production builds.
728
+ *
729
+ * @see https://nitro.build/config#devhandlers
730
+ */
2399
731
  interface NitroDevEventHandler extends NitroHandlerCommon {
2400
732
  /**
2401
- * Event handler function
733
+ * Event handler function.
2402
734
  */
2403
735
  handler: HTTPHandler;
2404
736
  }
2405
737
  type MaybePromise<T> = T | Promise<T>;
738
+ /**
739
+ * Custom error handler function signature.
740
+ *
741
+ * Receives the error, the H3 event, and a helper object containing the
742
+ * `defaultHandler` for fallback rendering.
743
+ *
744
+ * @see https://nitro.build/config#errorhandler
745
+ */
2406
746
  type NitroErrorHandler = (error: HTTPError, event: HTTPEvent, _: {
2407
747
  defaultHandler: (error: HTTPError, event: HTTPEvent, opts?: {
2408
748
  silent?: boolean;
@@ -2449,24 +789,128 @@ declare class Router<T> {
2449
789
  type Enumerate<N extends number, Acc extends number[] = []> = Acc["length"] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc["length"]]>;
2450
790
  type IntRange<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;
2451
791
  type ExcludeFunctions<G extends Record<string, any>> = Pick<G, { [P in keyof G]: NonNullable<G[P]> extends Function ? never : P }[keyof G]>;
2452
- type HTTPstatus = IntRange<100, 600>;
792
+ /** Valid HTTP status code range (100–599). */
793
+ type HTTPstatus = IntRange<100, 599>;
794
+ /**
795
+ * Route rule options that can be applied to matching route patterns.
796
+ *
797
+ * Rules are matched against the request path (without query string or
798
+ * `app.baseURL`) using rou3 pattern matching. When multiple patterns match,
799
+ * their options are deep-merged with more-specific patterns taking precedence.
800
+ *
801
+ *
802
+ * @see https://nitro.build/docs/routing#route-rules
803
+ */
2453
804
  interface NitroRouteConfig {
805
+ /**
806
+ * Enables runtime caching.
807
+ *
808
+ * When set to an options object, matching handlers are wrapped with
809
+ * `defineCachedHandler`. Set to `false` to disable caching.
810
+ *
811
+ * @see https://nitro.build/docs/cache
812
+ */
2454
813
  cache?: ExcludeFunctions<CachedEventHandlerOptions> | false;
814
+ /**
815
+ * Response headers to set for matching routes.
816
+ *
817
+ * @example
818
+ * ```ts
819
+ * headers: { 'cache-control': 's-maxage=60' }
820
+ * ```
821
+ *
822
+ * @see https://nitro.build/docs/routing#headers
823
+ */
2455
824
  headers?: Record<string, string>;
825
+ /**
826
+ * Server-side redirect for matching routes.
827
+ *
828
+ * A plain string defaults to status `307`. Use an object to specify a
829
+ * custom status code. When the rule key ends with `/**` and `to` also
830
+ * ends with `/**`, the matched path tail is appended to the destination.
831
+ *
832
+ * @example
833
+ * ```ts
834
+ * redirect: '/new-page'
835
+ * redirect: { to: '/new-page', status: 301 }
836
+ * ```
837
+ *
838
+ * @see https://nitro.build/docs/routing#redirect
839
+ */
2456
840
  redirect?: string | {
2457
841
  to: string;
2458
842
  status?: HTTPstatus;
2459
843
  };
844
+ /**
845
+ * Add this route to the prerender queue at build time.
846
+ *
847
+ * Only exact paths are collected; wildcard rules apply at runtime but are
848
+ * not auto-added to the queue. Set to `false` to explicitly exclude a
849
+ * route from prerendering.
850
+ *
851
+ * @see https://nitro.build/docs/routing#prerender
852
+ */
2460
853
  prerender?: boolean;
854
+ /**
855
+ * Proxy matching requests to another origin or internal path.
856
+ *
857
+ * A plain string specifies the destination. Use an object for additional
858
+ * H3 {@link ProxyOptions}. Wildcard `/**` tail behavior works the same
859
+ * as {@link NitroRouteConfig.redirect | redirect}.
860
+ *
861
+ * **IMPORTANT:** Proxy target should be a trusted and safe origin.
862
+ *
863
+ * @see https://nitro.build/docs/routing#proxy
864
+ */
2461
865
  proxy?: string | ({
2462
866
  to: string;
2463
867
  } & ProxyOptions);
868
+ /**
869
+ * Incremental Static Regeneration on supported platforms.
870
+ *
871
+ * - `number` — revalidation time in seconds.
872
+ * - `true` — never expires until the next deployment.
873
+ * - `false` — disable ISR for this route.
874
+ *
875
+ * Only handled by presets with native support (e.g. Vercel, Netlify).
876
+ * Ignored on platforms without ISR support.
877
+ *
878
+ * @see https://nitro.build/docs/routing#isr-vercel
879
+ */
2464
880
  isr?: number | boolean | VercelISRConfig;
881
+ /**
882
+ * Protect matching routes with HTTP Basic Authentication.
883
+ *
884
+ * **IMPORTANT:** Depending on the deployment platform, this might not apply to public assets.
885
+ *
886
+ * Set to `false` to disable auth inherited from a less-specific pattern.
887
+ *
888
+ * @see https://nitro.build/docs/routing#basic-auth
889
+ */
2465
890
  basicAuth?: Pick<BasicAuthOptions, "password" | "username" | "realm"> | false;
891
+ /**
892
+ * Shortcut to add permissive CORS headers (`access-control-allow-origin: *`,
893
+ * `access-control-allow-methods: *`, `access-control-allow-headers: *`,
894
+ * `access-control-max-age: 0`). Override individual headers via
895
+ * {@link NitroRouteConfig.headers | headers}.
896
+ *
897
+ * @see https://nitro.build/docs/routing#cors
898
+ */
2466
899
  cors?: boolean;
900
+ /**
901
+ * Shortcut for `cache: { swr: true, maxAge?: number }`.
902
+ *
903
+ * - `true` — enable SWR with no explicit `maxAge`.
904
+ * - `number` — enable SWR with the given `maxAge` in seconds.
905
+ *
906
+ * @see https://nitro.build/docs/routing#caching-swr-static
907
+ */
2467
908
  swr?: boolean | number;
2468
909
  static?: boolean | number;
2469
910
  }
911
+ /**
912
+ * Normalized route rules used at runtime after shortcut resolution.
913
+ */
2470
914
  interface NitroRouteRules extends Omit<NitroRouteConfig, "redirect" | "cors" | "swr" | "static"> {
2471
915
  redirect?: {
2472
916
  to: string;
@@ -2525,11 +969,17 @@ interface VercelISRConfig {
2525
969
  exposeErrBody?: boolean;
2526
970
  }
2527
971
  type MaybeArray<T> = T | T[];
972
+ /** Nitro package metadata including version information. */
2528
973
  interface NitroMeta {
2529
974
  version: string;
2530
975
  majorVersion: number;
2531
- [key: string]: unknown;
2532
976
  }
977
+ /**
978
+ * The core Nitro instance available throughout the build lifecycle.
979
+ *
980
+ * Provides access to resolved options, hooks, the virtual file system,
981
+ * scanned handlers, and utility methods.
982
+ */
2533
983
  interface Nitro {
2534
984
  meta: NitroMeta;
2535
985
  options: NitroOptions;
@@ -2563,16 +1013,31 @@ interface Nitro {
2563
1013
  contentType?: string;
2564
1014
  }>;
2565
1015
  }
1016
+ /**
1017
+ * Subset of {@link NitroConfig} that can be updated at runtime via
1018
+ * `nitro.updateConfig()`.
1019
+ */
2566
1020
  type NitroDynamicConfig = Pick<NitroConfig, "runtimeConfig" | "routeRules">;
2567
1021
  type NitroTypes = {
2568
1022
  routes: Record<string, Partial<Record<HTTPMethod | "default", string[]>>>;
2569
1023
  tsConfig?: TSConfig;
2570
1024
  };
1025
+ /**
1026
+ * Metadata about the framework using Nitro.
1027
+ *
1028
+ * @see https://nitro.build/config#framework
1029
+ */
2571
1030
  interface NitroFrameworkInfo {
2572
1031
  name?: "nitro" | (string & {});
2573
1032
  version?: string;
2574
1033
  }
2575
- /** Build info written to `.output/nitro.json` or `.nitro/dev/nitro.json` */
1034
+ /**
1035
+ * Build info written to `<output.dir>/nitro.json` (production, default
1036
+ * `.output/nitro.json`) or `<rootDir>/node_modules/.nitro/nitro.dev.json`
1037
+ * (development).
1038
+ *
1039
+ * Contains preset, framework, version, and command information.
1040
+ */
2576
1041
  interface NitroBuildInfo {
2577
1042
  date: string;
2578
1043
  preset: PresetName;
@@ -2630,15 +1095,45 @@ interface NitroHooks {
2630
1095
  failedRoutes: PrerenderRoute[];
2631
1096
  }) => HookResult;
2632
1097
  }
1098
+ /**
1099
+ * Accepted input formats for Nitro modules.
1100
+ *
1101
+ * Can be a module path string, a {@link NitroModule} object, a bare setup
1102
+ * function, or an object with a `nitro` key containing a {@link NitroModule}.
1103
+ *
1104
+ * @see https://nitro.build/config#modules
1105
+ */
2633
1106
  type NitroModuleInput = string | NitroModule | NitroModule["setup"] | {
2634
1107
  nitro: NitroModule;
2635
1108
  };
1109
+ /**
1110
+ * A Nitro module that extends behavior during initialization.
1111
+ *
1112
+ * Modules receive the {@link Nitro} instance and can register hooks,
1113
+ * add handlers, modify options, or perform other setup tasks.
1114
+ *
1115
+ * @example
1116
+ * ```ts
1117
+ * export default {
1118
+ * name: "my-module",
1119
+ * nitro: {
1120
+ * setup(nitro) {
1121
+ * nitro.hooks.hook("compiled", () => {
1122
+ * console.log("Build complete!");
1123
+ * });
1124
+ * },
1125
+ * },
1126
+ * };
1127
+ * ```
1128
+ *
1129
+ * @see https://nitro.build/config#modules
1130
+ */
2636
1131
  interface NitroModule {
2637
1132
  name?: string;
2638
1133
  setup: (this: void, nitro: Nitro) => void | Promise<void>;
2639
1134
  }
2640
1135
  /**
2641
- * Swagger UI configuration options
1136
+ * Swagger UI configuration options.
2642
1137
  *
2643
1138
  * @see https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/
2644
1139
  */
@@ -2668,13 +1163,14 @@ interface SwaggerUIConfig {
2668
1163
  [key: string]: unknown;
2669
1164
  }
2670
1165
  /**
2671
- * Nitro OpenAPI configuration
1166
+ * Nitro OpenAPI configuration.
2672
1167
  *
1168
+ * @see https://nitro.build/config#openapi
2673
1169
  * @see https://nitro.build/docs/openapi
2674
1170
  */
2675
1171
  interface NitroOpenAPIConfig {
2676
1172
  /**
2677
- * OpenAPI meta information
1173
+ * OpenAPI document metadata.
2678
1174
  */
2679
1175
  meta?: {
2680
1176
  title?: string;
@@ -2682,40 +1178,50 @@ interface NitroOpenAPIConfig {
2682
1178
  version?: string;
2683
1179
  };
2684
1180
  /**
2685
- * OpenAPI json route
1181
+ * Route for the OpenAPI JSON endpoint.
2686
1182
  *
2687
- * Default is `/_openapi.json`
1183
+ * @default "/_openapi.json"
2688
1184
  */
2689
1185
  route?: string;
2690
1186
  /**
2691
- * Enable OpenAPI generation for production builds
1187
+ * Enable OpenAPI generation for production builds.
1188
+ *
1189
+ * - `"runtime"` — generate at runtime (allows middleware usage).
1190
+ * - `"prerender"` — prerender the JSON response at build time (most efficient).
1191
+ * - `false` — disable in production.
1192
+ *
1193
+ * @see https://nitro.build/config#openapi
2692
1194
  */
2693
1195
  production?: false | "runtime" | "prerender";
2694
1196
  /**
2695
- * UI configurations
1197
+ * UI configurations for interactive API documentation.
2696
1198
  */
2697
1199
  ui?: {
2698
1200
  /**
2699
- * Scalar UI configuration
1201
+ * Scalar UI configuration.
1202
+ *
1203
+ * Set to `false` to disable.
2700
1204
  */
2701
1205
  scalar?: false | (Partial<unknown> & {
2702
1206
  /**
2703
- * Scalar UI route
1207
+ * Route for Scalar UI.
2704
1208
  *
2705
- * Default is `/_scalar`
1209
+ * @default "/_scalar"
2706
1210
  */
2707
1211
  route?: string;
2708
1212
  });
2709
1213
  /**
2710
- * Swagger UI configuration
1214
+ * Swagger UI configuration.
1215
+ *
1216
+ * Set to `false` to disable.
2711
1217
  *
2712
1218
  * @see https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/
2713
1219
  */
2714
1220
  swagger?: false | (SwaggerUIConfig & {
2715
1221
  /**
2716
- * Swagger UI route
1222
+ * Route for Swagger UI.
2717
1223
  *
2718
- * Default is `/_swagger`
1224
+ * @default "/_swagger"
2719
1225
  */
2720
1226
  route?: string;
2721
1227
  });
@@ -2732,7 +1238,12 @@ interface NitroPresetMeta$1 {
2732
1238
  }
2733
1239
  type RollupCommonJSOptions = NonNullable<Parameters<typeof commonjs.default>[0]>;
2734
1240
  /**
2735
- * Nitro normalized options (nitro.options)
1241
+ * Fully resolved Nitro options available on `nitro.options`.
1242
+ *
1243
+ * These are the normalized options after preset defaults and user config
1244
+ * have been merged. For the user-facing input type, see {@link NitroConfig}.
1245
+ *
1246
+ * @see https://nitro.build/config
2736
1247
  */
2737
1248
  interface NitroOptions extends PresetOptions {
2738
1249
  _config: NitroConfig;
@@ -2740,42 +1251,226 @@ interface NitroOptions extends PresetOptions {
2740
1251
  _cli?: {
2741
1252
  command?: string;
2742
1253
  };
1254
+ /**
1255
+ * Opt-in date for deployment provider and runtime compatibility features.
1256
+ *
1257
+ * Providers introduce new features that Nitro presets can leverage, but
1258
+ * some need to be explicitly opted into. Set to the latest tested date
1259
+ * in `YYYY-MM-DD` format.
1260
+ *
1261
+ * @default "latest"
1262
+ * @see https://nitro.build/config#compatibilitydate
1263
+ */
2743
1264
  compatibilityDate: CompatibilityDates;
1265
+ /**
1266
+ * Enables debugging nitro (build time) hooks in the console.
1267
+ *
1268
+ * @see https://nitro.build/config#debug
1269
+ */
2744
1270
  debug: boolean;
1271
+ /**
1272
+ * Deployment preset name.
1273
+ *
1274
+ * Determines how the production bundle is built and optimized for a
1275
+ * specific hosting provider or runtime. Auto-detected in known
1276
+ * environments when not set. Use the `NITRO_PRESET` environment
1277
+ * variable as an alternative.
1278
+ *
1279
+ * @see https://nitro.build/config#preset
1280
+ */
2745
1281
  preset: PresetName;
1282
+ /**
1283
+ * Disable the server build and only output prerendered static assets.
1284
+ *
1285
+ * When `true`, the server bundle is skipped entirely and only the public directory is produced.
1286
+ * Typically used by the `static` preset and its derivatives (e.g., `github-pages`, `vercel-static`).
1287
+ *
1288
+ * Note: This does not enable prerendering on its own — configure `prerender` options separately.
1289
+ *
1290
+ * @see https://nitro.build/config#static
1291
+ */
2746
1292
  static: boolean;
1293
+ /**
1294
+ * Log verbosity level.
1295
+ *
1296
+ * Defaults to `3`, or `1` when a testing environment is detected.
1297
+ *
1298
+ * @see https://nitro.build/config#loglevel
1299
+ * @see https://github.com/unjs/consola
1300
+ */
2747
1301
  logLevel: LogLevel;
1302
+ /**
1303
+ * Server runtime configuration accessible via `useRuntimeConfig()`.
1304
+ *
1305
+ * Values can be overridden at runtime using environment variables with
1306
+ * the `NITRO_` prefix. An alternative prefix can be configured via
1307
+ * `runtimeConfig.nitro.envPrefix` or `NITRO_ENV_PREFIX`.
1308
+ *
1309
+ * **Note:** The `nitro` namespace is reserved for internal use.
1310
+ *
1311
+ * @example
1312
+ * ```ts
1313
+ * runtimeConfig: {
1314
+ * apiSecret: "default-secret", // override with NITRO_API_SECRET
1315
+ * }
1316
+ * ```
1317
+ *
1318
+ * @see https://nitro.build/config#runtimeconfig
1319
+ */
2748
1320
  runtimeConfig: NitroRuntimeConfig;
1321
+ /**
1322
+ * Project workspace root directory.
1323
+ *
1324
+ * Auto-detected from the workspace (e.g. pnpm workspace) when not set.
1325
+ *
1326
+ * @see https://nitro.build/config#workspacedir
1327
+ */
2749
1328
  workspaceDir: string;
1329
+ /**
1330
+ * Project main root directory.
1331
+ *
1332
+ * @see https://nitro.build/config#rootdir
1333
+ */
2750
1334
  rootDir: string;
1335
+ /**
1336
+ * Server directory for scanning `api/`, `routes/`, `plugins/`, `utils/`,
1337
+ * `middleware/`, `modules/`, and `tasks/` folders.
1338
+ *
1339
+ * Set to `false` to disable automatic directory scanning, `"./"` to use
1340
+ * the root directory, or `"./server"` to use a `server/` subdirectory.
1341
+ *
1342
+ * @default false
1343
+ * @see https://nitro.build/config#serverdir
1344
+ */
2751
1345
  serverDir: string | false;
1346
+ /**
1347
+ * Additional directories to scan and auto-register files such as API
1348
+ * route handlers.
1349
+ *
1350
+ * @see https://nitro.build/config#scandirs
1351
+ */
2752
1352
  scanDirs: string[];
1353
+ /**
1354
+ * Directory name to scan for API route handlers.
1355
+ *
1356
+ * @default "api"
1357
+ * @see https://nitro.build/config#apidir
1358
+ */
2753
1359
  apiDir: string;
1360
+ /**
1361
+ * Directory name to scan for route handlers.
1362
+ *
1363
+ * @default "routes"
1364
+ * @see https://nitro.build/config#routesdir
1365
+ */
2754
1366
  routesDir: string;
1367
+ /**
1368
+ * Nitro's temporary working directory for build-related files.
1369
+ *
1370
+ * @default "node_modules/.nitro"
1371
+ * @see https://nitro.build/config#builddir
1372
+ */
2755
1373
  buildDir: string;
1374
+ /**
1375
+ * Output directories for the production bundle.
1376
+ *
1377
+ * @see https://nitro.build/config#output
1378
+ */
2756
1379
  output: {
2757
- dir: string;
2758
- serverDir: string;
1380
+ /** Production output root directory. */dir: string; /** Server bundle output directory. */
1381
+ serverDir: string; /** Public/static assets output directory. */
2759
1382
  publicDir: string;
2760
1383
  };
2761
- /** @deprecated migrate to `serverDir` */
1384
+ /** @deprecated Migrate to `serverDir`. */
2762
1385
  srcDir: string;
1386
+ /**
1387
+ * Storage mount configuration.
1388
+ *
1389
+ * Keys are mount-point paths; values specify the unstorage driver and
1390
+ * its options.
1391
+ *
1392
+ * @see https://nitro.build/config#storage
1393
+ * @see https://nitro.build/docs/storage
1394
+ */
2763
1395
  storage: StorageMounts;
1396
+ /**
1397
+ * Storage mount overrides for development mode.
1398
+ *
1399
+ * Useful for swapping production drivers (e.g. Redis) with local
1400
+ * alternatives (e.g. filesystem) during development.
1401
+ *
1402
+ * @see https://nitro.build/config#devstorage
1403
+ * @see https://nitro.build/docs/storage
1404
+ */
2764
1405
  devStorage: StorageMounts;
1406
+ /**
1407
+ * Database connection configurations.
1408
+ *
1409
+ * Requires `experimental.database: true`.
1410
+ *
1411
+ * @see https://nitro.build/config#database
1412
+ * @see https://nitro.build/docs/database
1413
+ */
2765
1414
  database: DatabaseConnectionConfigs;
1415
+ /**
1416
+ * Database connection overrides for development mode.
1417
+ *
1418
+ * @see https://nitro.build/config#devdatabase
1419
+ * @see https://nitro.build/docs/database
1420
+ */
2766
1421
  devDatabase: DatabaseConnectionConfigs;
1422
+ /**
1423
+ * Server-side rendering entry configuration.
1424
+ *
1425
+ * Points to the main render handler (the file should export an event
1426
+ * handler as default). Set to `false` to disable.
1427
+ *
1428
+ * @see https://nitro.build/config#renderer
1429
+ * @see https://nitro.build/docs/renderer
1430
+ */
2767
1431
  renderer?: {
2768
1432
  handler?: string;
2769
1433
  static?: boolean;
2770
1434
  template?: string;
2771
1435
  };
1436
+ /**
1437
+ * Routes that should be server-side rendered.
1438
+ */
2772
1439
  ssrRoutes: string[];
1440
+ /**
1441
+ * Include a static asset handler in the server bundle to serve public assets.
1442
+ *
1443
+ * - `true` or `"node"` — read assets from the filesystem using Node.js `fs`.
1444
+ * - `"deno"` — read assets using Deno file APIs.
1445
+ * - `"inline"` — base64-encode assets directly into the server bundle.
1446
+ * - `false` — do not serve static assets from the server (rely on a CDN or reverse proxy).
1447
+ *
1448
+ * Most self-hosted presets (e.g. `node-server`, `bun`) enable this by default.
1449
+ *
1450
+ * @see https://nitro.build/config#servestatic
1451
+ */
2773
1452
  serveStatic: boolean | "node" | "deno" | "inline";
1453
+ /**
1454
+ * Disable the public output directory entirely.
1455
+ *
1456
+ * Skips preparing the `.output/public` directory, copying public
1457
+ * assets, and prerendering routes.
1458
+ *
1459
+ * @see https://nitro.build/config#nopublicdir
1460
+ */
2774
1461
  noPublicDir: boolean;
2775
1462
  tracingChannel?: undefined | TracingOptions;
1463
+ /**
1464
+ * Build manifest options.
1465
+ */
2776
1466
  manifest?: {
2777
- deploymentId?: string;
1467
+ /** Custom deployment identifier included in the build manifest. */deploymentId?: string;
2778
1468
  };
1469
+ /**
1470
+ * Built-in feature flags.
1471
+ *
1472
+ * @see https://nitro.build/config#features
1473
+ */
2779
1474
  features: {
2780
1475
  /**
2781
1476
  * Enable runtime hooks for request and response.
@@ -2784,21 +1479,33 @@ interface NitroOptions extends PresetOptions {
2784
1479
  */
2785
1480
  runtimeHooks?: boolean;
2786
1481
  /**
2787
- * Enable WebSocket support
1482
+ * Enable WebSocket support.
2788
1483
  */
2789
1484
  websocket?: boolean;
2790
1485
  };
2791
1486
  /**
1487
+ * Native wasm compatibility/bundling support configuration.
1488
+ *
1489
+ * Set to `false` to disable.
2792
1490
  *
1491
+ * @see https://nitro.build/config#wasm
2793
1492
  * @see https://github.com/unjs/unwasm
2794
1493
  */
2795
1494
  wasm?: false | UnwasmPluginOptions;
2796
1495
  /**
2797
- * OpenAPI configuration
1496
+ * OpenAPI specification generation and UI configuration.
2798
1497
  *
1498
+ * @see https://nitro.build/config#openapi
2799
1499
  * @see https://nitro.build/docs/openapi
2800
1500
  */
2801
1501
  openAPI?: NitroOpenAPIConfig;
1502
+ /**
1503
+ * Experimental feature flags.
1504
+ *
1505
+ * These features are not yet stable and may change in future releases.
1506
+ *
1507
+ * @see https://nitro.build/config#experimental
1508
+ */
2802
1509
  experimental: {
2803
1510
  /**
2804
1511
  * Enable experimental OpenAPI support
@@ -2815,7 +1522,9 @@ interface NitroOptions extends PresetOptions {
2815
1522
  */
2816
1523
  asyncContext?: boolean;
2817
1524
  /**
2818
- * Disable Experimental Sourcemap Minification
1525
+ * Set to `false` to disable sourcemap minification in production builds.
1526
+ *
1527
+ * Sourcemap minification is enabled by default when `sourcemap` is on.
2819
1528
  */
2820
1529
  sourcemapMinify?: false;
2821
1530
  /**
@@ -2825,84 +1534,293 @@ interface NitroOptions extends PresetOptions {
2825
1534
  */
2826
1535
  envExpansion?: boolean;
2827
1536
  /**
2828
- * Enable WebSocket support
2829
- *
2830
- * @see https://nitro.build/guide/websocket
1537
+ * Enable WebSocket upgrade support
2831
1538
  *
2832
- * @deprecated use `features.websocket` instead.
1539
+ * @deprecated Use `features.websocket` instead.
2833
1540
  */
2834
1541
  websocket?: boolean;
2835
1542
  /**
2836
1543
  * Enable experimental Database support
2837
1544
  *
2838
- * @see https://nitro.build/guide/database
1545
+ * @see https://nitro.build/docs/database
2839
1546
  */
2840
1547
  database?: boolean;
2841
1548
  /**
2842
1549
  * Enable experimental Tasks support
2843
1550
  *
2844
- * @see https://nitro.build/guide/tasks
1551
+ * @see https://nitro.build/docs/tasks
2845
1552
  */
2846
1553
  tasks?: boolean;
2847
1554
  };
1555
+ /**
1556
+ * Future features pending a major version to avoid breaking changes.
1557
+ *
1558
+ * @see https://nitro.build/config#future
1559
+ */
2848
1560
  future: {
2849
- nativeSWR?: boolean;
1561
+ /** Opt in to Nitro's native `isr` route rule handling on Vercel and suppress backwards-compatibility warnings for legacy `swr`/`static` route options. */nativeSWR?: boolean;
2850
1562
  };
1563
+ /**
1564
+ * Server-side asset directories bundled at build time.
1565
+ *
1566
+ * @see https://nitro.build/config#serverassets
1567
+ * @see https://nitro.build/docs/assets#server-assets
1568
+ */
2851
1569
  serverAssets: ServerAssetDir[];
1570
+ /**
1571
+ * Public asset directories served in development and bundled in production.
1572
+ *
1573
+ * A `public/` directory is added by default when detected.
1574
+ *
1575
+ * @see https://nitro.build/config#publicassets
1576
+ * @see https://nitro.build/docs/assets
1577
+ */
2852
1578
  publicAssets: PublicAssetDir[];
1579
+ /**
1580
+ * Auto-import configuration.
1581
+ *
1582
+ * Set to `false` to disable auto-imports. Pass an object to customize.
1583
+ *
1584
+ * @default false
1585
+ * @see https://nitro.build/config#imports
1586
+ * @see https://github.com/unjs/unimport
1587
+ */
2853
1588
  imports: Partial<UnimportPluginOptions> | false;
1589
+ /**
1590
+ * Nitro modules to extend behavior during initialization.
1591
+ *
1592
+ * Accepts module path strings, {@link NitroModule} objects, or bare setup functions.
1593
+ *
1594
+ * @see https://nitro.build/config#modules
1595
+ */
2854
1596
  modules?: NitroModuleInput[];
1597
+ /**
1598
+ * Paths to Nitro runtime plugins.
1599
+ *
1600
+ * Plugins in the `plugins/` directory are auto-registered.
1601
+ *
1602
+ * @see https://nitro.build/config#plugins
1603
+ * @see https://nitro.build/docs/plugins
1604
+ */
2855
1605
  plugins: string[];
1606
+ /**
1607
+ * Task definitions.
1608
+ *
1609
+ * Each key is a task name with a `handler` path and optional `description`.
1610
+ *
1611
+ * @example
1612
+ * ```ts
1613
+ * tasks: {
1614
+ * "db:migrate": {
1615
+ * handler: "./tasks/db-migrate",
1616
+ * description: "Run database migrations",
1617
+ * },
1618
+ * }
1619
+ * ```
1620
+ *
1621
+ * @see https://nitro.build/config#tasks
1622
+ * @see https://nitro.build/docs/tasks
1623
+ */
2856
1624
  tasks: {
2857
1625
  [name: string]: {
2858
1626
  handler?: string;
2859
1627
  description?: string;
2860
1628
  };
2861
1629
  };
1630
+ /**
1631
+ * Map of cron expressions to task name(s).
1632
+ *
1633
+ * @example
1634
+ * ```ts
1635
+ * scheduledTasks: {
1636
+ * "0 * * * *": "cleanup:temp",
1637
+ * "*​/5 * * * *": ["health:check", "metrics:collect"],
1638
+ * }
1639
+ * ```
1640
+ *
1641
+ * @see https://nitro.build/config#scheduledtasks
1642
+ * @see https://nitro.build/docs/tasks
1643
+ */
2862
1644
  scheduledTasks: {
2863
1645
  [cron: string]: string | string[];
2864
1646
  };
1647
+ /**
1648
+ * Virtual module definitions.
1649
+ *
1650
+ * A map from dynamic virtual import names to their contents or an async
1651
+ * function that returns them.
1652
+ *
1653
+ * @see https://nitro.build/config#virtual
1654
+ */
2865
1655
  virtual: Record<string, string | (() => string | Promise<string>)>;
1656
+ /**
1657
+ * Pre-compress public assets and prerendered routes.
1658
+ *
1659
+ * Generates gzip and brotli (and zstd when available)
1660
+ * variants of compressible assets larger than 1024 bytes. Pass an
1661
+ * object to selectively enable/disable each encoding.
1662
+ *
1663
+ * @see https://nitro.build/config#compresspublicassets
1664
+ */
2866
1665
  compressPublicAssets: boolean | CompressOptions;
1666
+ /**
1667
+ * Glob patterns to ignore when scanning directories.
1668
+ *
1669
+ * @see https://nitro.build/config#ignore
1670
+ */
2867
1671
  ignore: string[];
1672
+ /**
1673
+ * Whether the current build targets development mode.
1674
+ *
1675
+ * Defaults to `true` during development and `false` for production.
1676
+ *
1677
+ * @see https://nitro.build/config#dev
1678
+ */
2868
1679
  dev: boolean;
1680
+ /**
1681
+ * Development server options.
1682
+ *
1683
+ * @see https://nitro.build/config#devserver
1684
+ */
2869
1685
  devServer: {
2870
- port?: number;
2871
- hostname?: string;
2872
- watch?: string[];
1686
+ /** Port number for the dev server. */port?: number; /** Hostname for the dev server. */
1687
+ hostname?: string; /** Additional paths to watch for dev server reloads. */
1688
+ watch?: string[]; /** Runtime runner to use for the dev server. */
2873
1689
  runner?: RunnerName;
2874
1690
  };
1691
+ /**
1692
+ * File watcher options for development mode.
1693
+ *
1694
+ * @see https://nitro.build/config#watchoptions
1695
+ * @see https://github.com/paulmillr/chokidar
1696
+ */
2875
1697
  watchOptions: ChokidarOptions;
1698
+ /**
1699
+ * Proxy configuration for the development server.
1700
+ *
1701
+ * A map of path prefixes to proxy target URLs or options.
1702
+ *
1703
+ * @example
1704
+ * ```ts
1705
+ * devProxy: {
1706
+ * "/proxy/test": "http://localhost:3001",
1707
+ * "/proxy/example": { target: "https://example.com", changeOrigin: true },
1708
+ * }
1709
+ * ```
1710
+ *
1711
+ * @see https://nitro.build/config#devproxy
1712
+ * @see https://github.com/unjs/httpxy
1713
+ */
2876
1714
  devProxy: Record<string, string | ProxyServerOptions>;
1715
+ /**
1716
+ * Build logging behavior.
1717
+ *
1718
+ * @see https://nitro.build/config#logging
1719
+ */
2877
1720
  logging: {
2878
- compressedSizes?: boolean;
1721
+ /** Report compressed bundle sizes after build. */compressedSizes?: boolean; /** Show the build success message. */
2879
1722
  buildSuccess?: boolean;
2880
1723
  };
1724
+ /**
1725
+ * Server's main base URL prefix.
1726
+ *
1727
+ * Can also be set via the `NITRO_APP_BASE_URL` environment variable.
1728
+ *
1729
+ * @default "/"
1730
+ * @see https://nitro.build/config#baseurl
1731
+ */
2881
1732
  baseURL: string;
1733
+ /**
1734
+ * Base URL prefix for API routes.
1735
+ *
1736
+ * @default "/api"
1737
+ * @see https://nitro.build/config#apibaseurl
1738
+ */
2882
1739
  apiBaseURL: string;
1740
+ /**
1741
+ * Custom server entry point configuration.
1742
+ *
1743
+ * Set to `false` to disable the default server entry.
1744
+ *
1745
+ * @see https://nitro.build/docs/server-entry
1746
+ */
2883
1747
  serverEntry: false | {
2884
1748
  handler: string;
2885
1749
  format?: EventHandlerFormat;
2886
1750
  };
1751
+ /**
1752
+ * Server handler registrations.
1753
+ *
1754
+ * Handlers in `routes/`, `api/`, and `middleware/` directories are
1755
+ * auto-registered when {@link NitroOptions.serverDir | serverDir} is set.
1756
+ *
1757
+ * @see https://nitro.build/config#handlers
1758
+ * @see https://nitro.build/docs/routing
1759
+ */
2887
1760
  handlers: NitroEventHandler[];
1761
+ /**
1762
+ * Development-only event handlers with inline handler functions.
1763
+ *
1764
+ * Not included in production builds.
1765
+ *
1766
+ * @see https://nitro.build/config#devhandlers
1767
+ */
2888
1768
  devHandlers: NitroDevEventHandler[];
1769
+ /**
1770
+ * Route rules applied to matching request paths.
1771
+ *
1772
+ * Supports caching, redirects, proxying, headers, CORS, and more.
1773
+ * Rules are matched using rou3 patterns and deep-merged when multiple
1774
+ * patterns match.
1775
+ *
1776
+ * @see https://nitro.build/config#routerules
1777
+ * @see https://nitro.build/docs/routing#route-rules
1778
+ */
2889
1779
  routeRules: {
2890
1780
  [path: string]: NitroRouteRules;
2891
1781
  };
1782
+ /**
1783
+ * Inline route definitions.
1784
+ *
1785
+ * A map from route pattern to handler path or handler options.
1786
+ *
1787
+ * @see https://nitro.build/config#routes
1788
+ */
2892
1789
  routes: Record<string, string | Omit<NitroEventHandler, "route" | "middleware">>;
1790
+ /**
1791
+ * Path(s) to custom runtime error handler(s).
1792
+ *
1793
+ * Custom handlers run before the built-in error handler, which is
1794
+ * always added as a fallback.
1795
+ *
1796
+ * @see https://nitro.build/config#errorhandler
1797
+ */
2893
1798
  errorHandler: string | string[];
1799
+ /**
1800
+ * Custom error handler function for development mode.
1801
+ *
1802
+ * @see https://nitro.build/config#deverrorhandler
1803
+ */
2894
1804
  devErrorHandler: NitroErrorHandler;
1805
+ /**
1806
+ * Prerendering options.
1807
+ *
1808
+ * Routes specified here are fetched during the build and copied to
1809
+ * `.output/public` as static assets.
1810
+ *
1811
+ * @see https://nitro.build/config#prerender
1812
+ */
2895
1813
  prerender: {
2896
1814
  /**
2897
- * Prerender HTML routes within subfolders (`/test` would produce `/test/index.html`)
1815
+ * Prerender HTML routes within subfolders (`/test` produces `/test/index.html`).
2898
1816
  */
2899
- autoSubfolderIndex?: boolean;
2900
- concurrency?: number;
2901
- interval?: number;
2902
- crawlLinks?: boolean;
2903
- failOnError?: boolean;
2904
- ignore?: Array<string | RegExp | ((path: string) => undefined | null | boolean)>;
2905
- ignoreUnprefixedPublicAssets?: boolean;
1817
+ autoSubfolderIndex?: boolean; /** Maximum number of concurrent prerender requests. */
1818
+ concurrency?: number; /** Delay in milliseconds between prerender requests. */
1819
+ interval?: number; /** Crawl `<a>` tags in prerendered HTML to discover additional routes. */
1820
+ crawlLinks?: boolean; /** Fail the build when a route cannot be prerendered. */
1821
+ failOnError?: boolean; /** Patterns (string, RegExp, or function) of routes to skip. */
1822
+ ignore?: Array<string | RegExp | ((path: string) => undefined | null | boolean)>; /** Skip prerendering assets without a base URL prefix. */
1823
+ ignoreUnprefixedPublicAssets?: boolean; /** Explicit list of routes to prerender. */
2906
1824
  routes?: string[];
2907
1825
  /**
2908
1826
  * Amount of retries. Pass Infinity to retry indefinitely.
@@ -2915,54 +1833,201 @@ interface NitroOptions extends PresetOptions {
2915
1833
  */
2916
1834
  retryDelay?: number;
2917
1835
  };
1836
+ /**
1837
+ * Bundler to use for production builds.
1838
+ *
1839
+ * Auto-detected when not set: `"vite"` if a `vite.config` with the
1840
+ * `nitro()` plugin is found, otherwise `"rolldown"` (bundled with Nitro).
1841
+ * Use the `NITRO_BUILDER` environment variable as an alternative.
1842
+ *
1843
+ * @see https://nitro.build/config#builder
1844
+ */
2918
1845
  builder?: "rollup" | "rolldown" | "vite";
1846
+ /**
1847
+ * Additional Rollup configuration.
1848
+ *
1849
+ * @see https://nitro.build/config#rollupconfig
1850
+ */
2919
1851
  rollupConfig?: RollupConfig;
1852
+ /**
1853
+ * Additional Rolldown configuration.
1854
+ *
1855
+ * @see https://nitro.build/config#rolldownconfig
1856
+ */
2920
1857
  rolldownConfig?: RolldownConfig;
1858
+ /**
1859
+ * Bundler entry point path.
1860
+ *
1861
+ * @see https://nitro.build/config#entry
1862
+ */
2921
1863
  entry: string;
1864
+ /**
1865
+ * unenv preset(s) for environment compatibility polyfills.
1866
+ *
1867
+ * @see https://nitro.build/config#unenv
1868
+ * @see https://github.com/unjs/unenv
1869
+ */
2922
1870
  unenv: Preset[];
1871
+ /**
1872
+ * Path aliases for module resolution.
1873
+ *
1874
+ * @example
1875
+ * ```ts
1876
+ * alias: {
1877
+ * "~utils": "./src/utils",
1878
+ * "#shared": "./shared",
1879
+ * }
1880
+ * ```
1881
+ *
1882
+ * @see https://nitro.build/config#alias
1883
+ */
2923
1884
  alias: Record<string, string>;
1885
+ /**
1886
+ * Minify the production bundle.
1887
+ *
1888
+ * @see https://nitro.build/config#minify
1889
+ */
2924
1890
  minify: boolean;
1891
+ /**
1892
+ * Bundle all code into a single file instead of separate chunks.
1893
+ *
1894
+ * When `false`, each route handler becomes a separate chunk loaded
1895
+ * on-demand. Some presets enable this by default.
1896
+ *
1897
+ * @see https://nitro.build/config#inlinedynamicimports
1898
+ */
2925
1899
  inlineDynamicImports: boolean;
1900
+ /**
1901
+ * Enable source map generation.
1902
+ *
1903
+ * @see https://nitro.build/config#sourcemap
1904
+ */
2926
1905
  sourcemap: boolean;
1906
+ /**
1907
+ * Target a Node.js-compatible runtime.
1908
+ *
1909
+ * When `true` (default), the bundler targets the `node` platform, prefers
1910
+ * Node.js built-in modules, and enables dependency externalization.
1911
+ *
1912
+ * When `false`, Nitro prepends the `nodeless` unenv preset to polyfill
1913
+ * Node.js globals and built-ins for non-Node runtimes (workers, edge, Deno).
1914
+ *
1915
+ * @see https://nitro.build/config#node
1916
+ */
2927
1917
  node: boolean;
1918
+ /**
1919
+ * OXC options for Rolldown builds (minification and transforms).
1920
+ *
1921
+ * @see https://nitro.build/config#oxc
1922
+ */
2928
1923
  oxc?: OXCOptions;
1924
+ /**
1925
+ * Build-time string replacements.
1926
+ *
1927
+ * @see https://nitro.build/config#replace
1928
+ */
2929
1929
  replace: Record<string, string | ((id: string) => string)>;
1930
+ /**
1931
+ * Additional configuration for the Rollup CommonJS plugin.
1932
+ *
1933
+ * @see https://nitro.build/config#commonjs
1934
+ */
2930
1935
  commonJS?: RollupCommonJSOptions;
1936
+ /**
1937
+ * Custom export conditions for module resolution.
1938
+ *
1939
+ * @see https://nitro.build/config#exportconditions
1940
+ */
2931
1941
  exportConditions?: string[];
1942
+ /**
1943
+ * Prevent packages from being externalized.
1944
+ *
1945
+ * Set to `true` to bundle all dependencies, or pass an array of
1946
+ * package names or patterns.
1947
+ *
1948
+ * @see https://nitro.build/config#noexternals
1949
+ */
2932
1950
  noExternals?: boolean | (string | RegExp)[];
1951
+ /**
1952
+ * Additional dependencies to trace and include in the build output.
1953
+ *
1954
+ * Supports `!pkg` to exclude and `pkg*` for full package trace.
1955
+ *
1956
+ * @see https://nitro.build/config#tracedeps
1957
+ */
2933
1958
  traceDeps?: (string | RegExp)[];
1959
+ /**
1960
+ * Advanced options for dependency tracing via nf3.
1961
+ *
1962
+ * @see https://nitro.build/config#traceopts
1963
+ * @see https://github.com/nicolo-ribaudo/nf3
1964
+ */
2934
1965
  traceOpts?: Pick<ExternalsTraceOptions, "nft" | "traceAlias" | "chmod" | "transform" | "hooks">;
1966
+ /**
1967
+ * TypeScript configuration options.
1968
+ *
1969
+ * @see https://nitro.build/config#typescript
1970
+ */
2935
1971
  typescript: {
2936
- strict?: boolean;
2937
- generateRuntimeConfigTypes?: boolean;
2938
- generateTsConfig?: boolean;
1972
+ /** Enable strict TypeScript checks. */strict?: boolean; /** Generate types for runtime config. */
1973
+ generateRuntimeConfigTypes?: boolean; /** Generate a `tsconfig.json` in the build directory. */
1974
+ generateTsConfig?: boolean; /** Custom tsconfig overrides. */
2939
1975
  tsConfig?: Partial<TSConfig>;
2940
1976
  /**
2941
1977
  * Path of the generated types directory.
2942
1978
  *
2943
- * Default is `node_modules/.nitro/types`
1979
+ * @default "node_modules/.nitro/types"
2944
1980
  */
2945
1981
  generatedTypesDir?: string;
2946
1982
  /**
2947
- * Path of the generated `tsconfig.json` relative to `typescript.generatedTypesDir`
1983
+ * Path of the generated `tsconfig.json` relative to `typescript.generatedTypesDir`.
2948
1984
  *
2949
- * Default is `tsconfig.json` (`node_modules/.nitro/types/tsconfig.json`)
1985
+ * @default "tsconfig.json"
2950
1986
  */
2951
1987
  tsconfigPath?: string;
2952
1988
  };
1989
+ /**
1990
+ * Nitro lifecycle hooks.
1991
+ *
1992
+ * @see https://nitro.build/config#hooks
1993
+ * @see https://nitro.build/docs/lifecycle
1994
+ * @see https://github.com/unjs/hookable
1995
+ */
2953
1996
  hooks: NestedHooks<NitroHooks>;
1997
+ /**
1998
+ * Preview and deploy command hints (usually filled by deployment presets).
1999
+ *
2000
+ * @see https://nitro.build/config#commands
2001
+ */
2954
2002
  commands: {
2955
- preview?: string;
2003
+ /** Command to preview the production build locally. */preview?: string; /** Command to deploy the production build. */
2956
2004
  deploy?: string;
2957
2005
  };
2006
+ /**
2007
+ * Metadata about the higher-level framework using Nitro (e.g. Nuxt).
2008
+ *
2009
+ * Used by presets and included in build info output.
2010
+ *
2011
+ * @see https://nitro.build/config#framework
2012
+ */
2958
2013
  framework: NitroFrameworkInfo;
2014
+ /**
2015
+ * IIS-specific deployment options.
2016
+ */
2959
2017
  iis?: {
2960
- mergeConfig?: boolean;
2018
+ /** Merge with existing IIS `web.config` instead of replacing. */mergeConfig?: boolean; /** Override existing IIS `web.config` entirely. */
2961
2019
  overrideConfig?: boolean;
2962
2020
  };
2963
2021
  }
2964
2022
  /**
2965
- * Nitro input config (nitro.config)
2023
+ * User-facing Nitro configuration used in `nitro.config.ts` or
2024
+ * `defineNitroConfig()`.
2025
+ *
2026
+ * All properties are optional and will be merged with defaults and preset
2027
+ * values to produce the fully resolved {@link NitroOptions}.
2028
+ *
2029
+ * @see https://nitro.build/config
2030
+ * @see https://nitro.build/docs/configuration
2966
2031
  */
2967
2032
  interface NitroConfig extends Partial<Omit<NitroOptions, "routeRules" | "rollupConfig" | "preset" | "compatibilityDate" | "unenv" | "serverDir" | "_config" | "_c12" | "serverEntry" | "renderer" | "output" | "tracingChannel">>, C12InputConfig<NitroConfig> {
2968
2033
  preset?: PresetNameInput;
@@ -2979,39 +2044,79 @@ interface NitroConfig extends Partial<Omit<NitroOptions, "routeRules" | "rollupC
2979
2044
  output?: Partial<NitroOptions["output"]>;
2980
2045
  tracingChannel?: boolean | TracingOptions;
2981
2046
  }
2047
+ /** Options for loading Nitro configuration via c12. */
2982
2048
  interface LoadConfigOptions {
2983
2049
  watch?: boolean;
2984
2050
  c12?: WatchConfigOptions;
2985
2051
  compatibilityDate?: CompatibilityDateSpec;
2986
2052
  dotenv?: boolean | DotenvOptions;
2987
2053
  }
2054
+ /**
2055
+ * Configuration for a public asset directory served in development and
2056
+ * bundled in production.
2057
+ *
2058
+ * @see https://nitro.build/config#publicassets
2059
+ * @see https://nitro.build/docs/assets
2060
+ */
2988
2061
  interface PublicAssetDir {
2062
+ /** URL prefix under which these assets are served. */
2989
2063
  baseURL?: string;
2064
+ /** Fall through to the next handler when the asset is not found. */
2990
2065
  fallthrough?: boolean;
2066
+ /** `Cache-Control` max-age value in seconds. */
2991
2067
  maxAge: number;
2068
+ /** Filesystem path to the asset directory. */
2992
2069
  dir: string;
2993
2070
  /**
2994
- * Pass false to disable ignore patterns when scanning the directory, or
2995
- * pass an array of glob patterns to ignore (which will override global
2996
- * nitro.ignore patterns).
2071
+ * Pass `false` to disable ignore patterns when scanning the directory,
2072
+ * or pass an array of glob patterns to ignore (overrides global
2073
+ * `nitro.ignore` patterns).
2997
2074
  */
2998
2075
  ignore?: false | string[];
2999
2076
  }
2077
+ /**
2078
+ * Pre-compression options for public assets and prerendered routes.
2079
+ *
2080
+ * @see https://nitro.build/config#compresspublicassets
2081
+ */
3000
2082
  interface CompressOptions {
2083
+ /** Enable gzip pre-compression. */
3001
2084
  gzip?: boolean;
2085
+ /** Enable brotli pre-compression. */
3002
2086
  brotli?: boolean;
2087
+ /** Enable zstd pre-compression. */
3003
2088
  zstd?: boolean;
3004
2089
  }
2090
+ /**
2091
+ * Configuration for a server-side asset directory bundled at build time.
2092
+ *
2093
+ * @see https://nitro.build/config#serverassets
2094
+ * @see https://nitro.build/docs/assets#server-assets
2095
+ */
3005
2096
  interface ServerAssetDir {
2097
+ /** Logical name used to access the asset group at runtime. */
3006
2098
  baseName: string;
2099
+ /** Glob pattern to filter files within the directory. */
3007
2100
  pattern?: string;
2101
+ /** Filesystem path to the asset directory. */
3008
2102
  dir: string;
2103
+ /** Glob patterns to ignore when scanning the directory. */
3009
2104
  ignore?: string[];
3010
2105
  }
3011
2106
  interface TracingOptions {
3012
2107
  srvx?: boolean;
3013
2108
  h3?: boolean;
2109
+ unstorage?: boolean;
3014
2110
  }
2111
+ /**
2112
+ * Storage mount configuration mapping mount points to driver options.
2113
+ *
2114
+ * Keys are storage mount-point paths; values specify the unstorage driver
2115
+ * and its options.
2116
+ *
2117
+ * @see https://nitro.build/config#storage
2118
+ * @see https://nitro.build/docs/storage
2119
+ */
3015
2120
  type CustomDriverName = string & {
3016
2121
  _custom?: any;
3017
2122
  };
@@ -3021,17 +2126,35 @@ interface StorageMounts {
3021
2126
  [option: string]: any;
3022
2127
  };
3023
2128
  }
2129
+ /** Logical database connection name. Defaults to `"default"`. */
3024
2130
  type DatabaseConnectionName = "default" | (string & {});
2131
+ /**
2132
+ * Database connection configuration specifying a db0 connector and options.
2133
+ *
2134
+ * @see https://nitro.build/config#database
2135
+ * @see https://nitro.build/docs/database
2136
+ */
3025
2137
  type DatabaseConnectionConfig = {
3026
2138
  connector: ConnectorName;
3027
2139
  options?: {
3028
2140
  [key: string]: any;
3029
2141
  };
3030
2142
  };
2143
+ /** Map of {@link DatabaseConnectionName} to {@link DatabaseConnectionConfig}. */
3031
2144
  type DatabaseConnectionConfigs = Record<DatabaseConnectionName, DatabaseConnectionConfig>;
2145
+ /** Application-specific runtime configuration. */
3032
2146
  interface NitroRuntimeConfigApp {
3033
2147
  [key: string]: any;
3034
2148
  }
2149
+ /**
2150
+ * Server runtime configuration accessible via `useRuntimeConfig()`.
2151
+ *
2152
+ * Values can be overridden at runtime using environment variables with
2153
+ * the `NITRO_` prefix. An alternative prefix can be configured via
2154
+ * `nitro.envPrefix` or `NITRO_ENV_PREFIX`.
2155
+ *
2156
+ * @see https://nitro.build/config#runtimeconfig
2157
+ */
3035
2158
  interface NitroRuntimeConfig {
3036
2159
  nitro?: {
3037
2160
  envPrefix?: string;