nitro 3.0.260429-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 (75) hide show
  1. package/dist/THIRD-PARTY-LICENSES.md.gz +0 -0
  2. package/dist/_build/common.mjs +119 -21
  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 +239 -12
  9. package/dist/_chunks/nitro2.mjs +117 -90
  10. package/dist/_chunks/utils.mjs +4 -4
  11. package/dist/_common.mjs +1 -1
  12. package/dist/_dev.d.mts +1 -1
  13. package/dist/_dev.mjs +5 -5
  14. package/dist/_libs/c12+rc9.mjs +11 -10
  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 +15 -15
  24. package/dist/_libs/httpxy.d.mts +1 -1
  25. package/dist/_libs/httpxy.mjs +8 -4
  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 +92 -99
  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 +1 -1
  34. package/dist/_libs/plugin-alias.mjs +2 -2
  35. package/dist/_libs/plugin-inject.mjs +3 -3
  36. package/dist/_libs/plugin-json.mjs +2 -2
  37. package/dist/_libs/pluginutils.mjs +16 -5
  38. package/dist/_libs/readdirp+chokidar.mjs +2 -2
  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+oxc-parser.mjs → unimport+unplugin.mjs} +18 -8
  47. package/dist/_libs/unplugin+unimport.d.mts +3 -3
  48. package/dist/_libs/unwasm.d.mts +1 -1
  49. package/dist/_presets.mjs +117 -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/1.deploy/2.providers/2.aws-amplify.md +3 -3
  64. package/dist/docs/1.deploy/2.providers/21.vercel.md +6 -0
  65. package/dist/docs/3.examples/27.vite-ssr-tsr-react.md +1 -1
  66. package/dist/presets/vercel/runtime/queue.dev.mjs +41 -0
  67. package/dist/runtime/internal/app.mjs +4 -111
  68. package/dist/runtime/virtual/app.d.mts +4 -0
  69. package/dist/runtime/virtual/app.mjs +32 -0
  70. package/dist/types/index.d.mts +21 -1756
  71. package/dist/vite.mjs +23 -337
  72. package/package.json +37 -39
  73. package/dist/THIRD-PARTY-LICENSES.md +0 -1676
  74. package/dist/_chunks/nitro3.mjs +0 -136
  75. package/dist/_chunks/nitro4.mjs +0 -127
@@ -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 {}
@@ -104,7 +105,7 @@ interface AssetMeta {
104
105
  *
105
106
  * @see https://nitro.build/docs/cache
106
107
  */
107
- interface CachedEventHandlerOptions extends Omit<_$ocache.CachedEventHandlerOptions<HTTPEvent & _$ocache.HTTPEvent>, "toResponse" | "createResponse" | "handleCacheHeaders"> {}
108
+ interface CachedEventHandlerOptions extends Omit<import("ocache").CachedEventHandlerOptions<HTTPEvent & import("ocache").HTTPEvent>, "toResponse" | "createResponse" | "handleCacheHeaders"> {}
108
109
  /**
109
110
  * The runtime Nitro application instance accessible via `useNitroApp()`.
110
111
  *
@@ -231,7 +232,7 @@ interface AWSAmplifyOptions {
231
232
  cacheControl?: string;
232
233
  };
233
234
  imageSettings?: AmplifyImageSettings;
234
- runtime?: "nodejs20.x" | "nodejs22.x";
235
+ runtime?: "nodejs20.x" | "nodejs22.x" | "nodejs24.x";
235
236
  }
236
237
  interface AwsLambdaOptions {
237
238
  streaming?: boolean;
@@ -249,1143 +250,7 @@ interface AzureOptions {
249
250
  [key: string]: unknown;
250
251
  };
251
252
  }
252
- /**
253
- * Copyright (c) 2020 Cloudflare, Inc. <wrangler@cloudflare.com>
254
- * https://github.com/cloudflare/workers-sdk/blob/main/LICENSE-MIT
255
- * https://github.com/cloudflare/workers-sdk/blob/main/LICENSE-APACHE
256
- *
257
- * Source: https://github.com/cloudflare/workers-sdk/blob/main/packages/wrangler/src/config/environment.ts
258
- */
259
- /**
260
- * The `Environment` interface declares all the configuration fields that
261
- * can be specified for an environment.
262
- *
263
- * This could be the top-level default environment, or a specific named environment.
264
- */
265
- interface Environment extends EnvironmentInheritable, EnvironmentNonInheritable {}
266
- type SimpleRoute = string;
267
- type ZoneIdRoute = {
268
- pattern: string;
269
- zone_id: string;
270
- custom_domain?: boolean;
271
- };
272
- type ZoneNameRoute = {
273
- pattern: string;
274
- zone_name: string;
275
- custom_domain?: boolean;
276
- };
277
- type CustomDomainRoute = {
278
- pattern: string;
279
- custom_domain: boolean;
280
- };
281
- type Route$1 = SimpleRoute | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
282
- /**
283
- * Configuration in wrangler for Cloudchamber
284
- */
285
- type CloudchamberConfig = {
286
- image?: string;
287
- location?: string;
288
- instance_type?: "dev" | "basic" | "standard";
289
- vcpu?: number;
290
- memory?: string;
291
- ipv4?: boolean;
292
- };
293
- /**
294
- * Configuration for a container application
295
- */
296
- type ContainerApp = {
297
- /**
298
- * Name of the application
299
- * @optional Defaults to `worker_name-class_name` if not specified.
300
- */
301
- name?: string;
302
- /**
303
- * Number of application instances
304
- * @deprecated
305
- * @hidden
306
- */
307
- instances?: number;
308
- /**
309
- * Number of maximum application instances.
310
- * @optional
311
- */
312
- max_instances?: number;
313
- /**
314
- * The path to a Dockerfile, or an image URI for the Cloudflare registry.
315
- */
316
- image: string;
317
- /**
318
- * Build context of the application.
319
- * @optional - defaults to the directory of `image`.
320
- */
321
- image_build_context?: string;
322
- /**
323
- * Image variables to be passed along the image at build time.
324
- * @optional
325
- */
326
- image_vars?: Record<string, string>;
327
- /**
328
- * The class name of the Durable Object the container is connected to.
329
- */
330
- class_name: string;
331
- /**
332
- * The scheduling policy of the application
333
- * @optional
334
- * @default "default"
335
- */
336
- scheduling_policy?: "regional" | "moon" | "default";
337
- /**
338
- * The instance type to be used for the container. This sets preconfigured options for vcpu and memory
339
- * @optional
340
- */
341
- instance_type?: "dev" | "basic" | "standard";
342
- /**
343
- * @deprecated Use top level `containers` fields instead.
344
- * `configuration.image` should be `image`
345
- * `configuration.disk` should be set via `instance_type`
346
- * @hidden
347
- */
348
- configuration?: {
349
- image?: string;
350
- labels?: {
351
- name: string;
352
- value: string;
353
- }[];
354
- secrets?: {
355
- name: string;
356
- type: "env";
357
- secret: string;
358
- }[];
359
- disk?: {
360
- size: string;
361
- };
362
- };
363
- /**
364
- * Scheduling constraints
365
- * @hidden
366
- */
367
- constraints?: {
368
- regions?: string[];
369
- cities?: string[];
370
- tier?: number;
371
- };
372
- /**
373
- * @deprecated use the `class_name` field instead.
374
- * @hidden
375
- */
376
- durable_objects?: {
377
- namespace_id: string;
378
- };
379
- /**
380
- * How a rollout should be done, defining the size of it
381
- * @optional
382
- * @default 25
383
- * */
384
- rollout_step_percentage?: number;
385
- /**
386
- * How a rollout should be created. It supports the following modes:
387
- * - full_auto: The container application will be rolled out fully automatically.
388
- * - none: The container application won't have a roll out or update.
389
- * - manual: The container application will be rollout fully by manually actioning progress steps.
390
- * @optional
391
- * @default "full_auto"
392
- */
393
- rollout_kind?: "full_auto" | "none" | "full_manual";
394
- };
395
- /**
396
- * Configuration in wrangler for Durable Object Migrations
397
- */
398
- type DurableObjectMigration = {
399
- /** A unique identifier for this migration. */tag: string; /** The new Durable Objects being defined. */
400
- new_classes?: string[]; /** The new SQLite Durable Objects being defined. */
401
- new_sqlite_classes?: string[]; /** The Durable Objects being renamed. */
402
- renamed_classes?: {
403
- from: string;
404
- to: string;
405
- }[]; /** The Durable Objects being removed. */
406
- deleted_classes?: string[];
407
- };
408
- /**
409
- * The `EnvironmentInheritable` interface declares all the configuration fields for an environment
410
- * that can be inherited (and overridden) from the top-level environment.
411
- */
412
- interface EnvironmentInheritable {
413
- /**
414
- * The name of your Worker. Alphanumeric + dashes only.
415
- *
416
- * @inheritable
417
- */
418
- name: string | undefined;
419
- /**
420
- * This is the ID of the account associated with your zone.
421
- * You might have more than one account, so make sure to use
422
- * the ID of the account associated with the zone/route you
423
- * provide, if you provide one. It can also be specified through
424
- * the CLOUDFLARE_ACCOUNT_ID environment variable.
425
- *
426
- * @inheritable
427
- */
428
- account_id: string | undefined;
429
- /**
430
- * A date in the form yyyy-mm-dd, which will be used to determine
431
- * which version of the Workers runtime is used.
432
- *
433
- * More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
434
- *
435
- * @inheritable
436
- */
437
- compatibility_date: string | undefined;
438
- /**
439
- * A list of flags that enable features from upcoming features of
440
- * the Workers runtime, usually used together with compatibility_date.
441
- *
442
- * More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
443
- *
444
- * @default []
445
- * @inheritable
446
- */
447
- compatibility_flags: string[];
448
- /**
449
- * The entrypoint/path to the JavaScript file that will be executed.
450
- *
451
- * @inheritable
452
- */
453
- main: string | undefined;
454
- /**
455
- * If true then Wrangler will traverse the file tree below `base_dir`;
456
- * Any files that match `rules` will be included in the deployed Worker.
457
- * Defaults to true if `no_bundle` is true, otherwise false.
458
- *
459
- * @inheritable
460
- */
461
- find_additional_modules: boolean | undefined;
462
- /**
463
- * Determines whether Wrangler will preserve bundled file names.
464
- * Defaults to false.
465
- * If left unset, files will be named using the pattern ${fileHash}-${basename},
466
- * for example, `34de60b44167af5c5a709e62a4e20c4f18c9e3b6-favicon.ico`.
467
- *
468
- * @inheritable
469
- */
470
- preserve_file_names: boolean | undefined;
471
- /**
472
- * The directory in which module rules should be evaluated when including additional files into a Worker deployment.
473
- * This defaults to the directory containing the `main` entry point of the Worker if not specified.
474
- *
475
- * @inheritable
476
- */
477
- base_dir: string | undefined;
478
- /**
479
- * Whether we use <name>.<subdomain>.workers.dev to
480
- * test and deploy your Worker.
481
- *
482
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
483
- *
484
- * @default true
485
- * @breaking
486
- * @inheritable
487
- */
488
- workers_dev: boolean | undefined;
489
- /**
490
- * Whether we use <version>-<name>.<subdomain>.workers.dev to
491
- * serve Preview URLs for your Worker.
492
- *
493
- * @default true
494
- * @inheritable
495
- */
496
- preview_urls: boolean | undefined;
497
- /**
498
- * A list of routes that your Worker should be published to.
499
- * Only one of `routes` or `route` is required.
500
- *
501
- * Only required when workers_dev is false, and there's no scheduled Worker (see `triggers`)
502
- *
503
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
504
- *
505
- * @inheritable
506
- */
507
- routes: Route$1[] | undefined;
508
- /**
509
- * A route that your Worker should be published to. Literally
510
- * the same as routes, but only one.
511
- * Only one of `routes` or `route` is required.
512
- *
513
- * Only required when workers_dev is false, and there's no scheduled Worker
514
- *
515
- * @inheritable
516
- */
517
- route: Route$1 | undefined;
518
- /**
519
- * Path to a custom tsconfig
520
- *
521
- * @inheritable
522
- */
523
- tsconfig: string | undefined;
524
- /**
525
- * The function to use to replace jsx syntax.
526
- *
527
- * @default "React.createElement"
528
- * @inheritable
529
- */
530
- jsx_factory: string;
531
- /**
532
- * The function to use to replace jsx fragment syntax.
533
- *
534
- * @default "React.Fragment"
535
- * @inheritable
536
- */
537
- jsx_fragment: string;
538
- /**
539
- * A list of migrations that should be uploaded with your Worker.
540
- *
541
- * These define changes in your Durable Object declarations.
542
- *
543
- * More details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations
544
- *
545
- * @default []
546
- * @inheritable
547
- */
548
- migrations: DurableObjectMigration[];
549
- /**
550
- * "Cron" definitions to trigger a Worker's "scheduled" function.
551
- *
552
- * Lets you call Workers periodically, much like a cron job.
553
- *
554
- * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
555
- *
556
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
557
- *
558
- * @default {crons: undefined}
559
- * @inheritable
560
- */
561
- triggers: {
562
- crons: string[] | undefined;
563
- };
564
- /**
565
- * Specify limits for runtime behavior.
566
- * Only supported for the "standard" Usage Model
567
- *
568
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#limits
569
- *
570
- * @inheritable
571
- */
572
- limits: UserLimits | undefined;
573
- /**
574
- * An ordered list of rules that define which modules to import,
575
- * and what type to import them as. You will need to specify rules
576
- * to use Text, Data, and CompiledWasm modules, or when you wish to
577
- * have a .js file be treated as an ESModule instead of CommonJS.
578
- *
579
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#bundling
580
- *
581
- * @inheritable
582
- */
583
- rules: Rule[];
584
- /**
585
- * Configures a custom build step to be run by Wrangler when building your Worker.
586
- *
587
- * Refer to the [custom builds documentation](https://developers.cloudflare.com/workers/cli-wrangler/configuration#build)
588
- * for more details.
589
- *
590
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#custom-builds
591
- *
592
- * @default {watch_dir:"./src"}
593
- */
594
- build: {
595
- /** 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. */
596
- cwd?: string; /** The directory to watch for changes while using wrangler dev, defaults to the current working directory */
597
- watch_dir?: string | string[];
598
- };
599
- /**
600
- * Skip internal build steps and directly deploy script
601
- * @inheritable
602
- */
603
- no_bundle: boolean | undefined;
604
- /**
605
- * Minify the script before uploading.
606
- * @inheritable
607
- */
608
- minify: boolean | undefined;
609
- /**
610
- * Set the `name` property to the original name for functions and classes renamed during minification.
611
- *
612
- * See https://esbuild.github.io/api/#keep-names
613
- *
614
- * @default true
615
- * @inheritable
616
- */
617
- keep_names: boolean | undefined;
618
- /**
619
- * Designates this Worker as an internal-only "first-party" Worker.
620
- *
621
- * @inheritable
622
- */
623
- first_party_worker: boolean | undefined;
624
- /**
625
- * List of bindings that you will send to logfwdr
626
- *
627
- * @default {bindings:[]}
628
- * @inheritable
629
- */
630
- logfwdr: {
631
- bindings: {
632
- /** The binding name used to refer to logfwdr */name: string; /** The destination for this logged message */
633
- destination: string;
634
- }[];
635
- };
636
- /**
637
- * Send Trace Events from this Worker to Workers Logpush.
638
- *
639
- * This will not configure a corresponding Logpush job automatically.
640
- *
641
- * For more information about Workers Logpush, see:
642
- * https://blog.cloudflare.com/logpush-for-workers/
643
- *
644
- * @inheritable
645
- */
646
- logpush: boolean | undefined;
647
- /**
648
- * Include source maps when uploading this worker.
649
- *
650
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#source-maps
651
- *
652
- * @inheritable
653
- */
654
- upload_source_maps: boolean | undefined;
655
- /**
656
- * Specify how the Worker should be located to minimize round-trip time.
657
- *
658
- * More details: https://developers.cloudflare.com/workers/platform/smart-placement/
659
- *
660
- * @inheritable
661
- */
662
- placement: {
663
- mode: "off" | "smart";
664
- hint?: string;
665
- } | undefined;
666
- /**
667
- * Specify the directory of static assets to deploy/serve
668
- *
669
- * More details at https://developers.cloudflare.com/workers/frameworks/
670
- *
671
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
672
- *
673
- * @inheritable
674
- */
675
- assets: Assets | undefined;
676
- /**
677
- * Specify the observability behavior of the Worker.
678
- *
679
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
680
- *
681
- * @inheritable
682
- */
683
- observability: Observability | undefined;
684
- /**
685
- * Specify the compliance region mode of the Worker.
686
- *
687
- * Although if the user does not specify a compliance region, the default is `public`,
688
- * it can be set to `undefined` in configuration to delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable.
689
- */
690
- compliance_region: "public" | "fedramp_high" | undefined;
691
- }
692
- type DurableObjectBindings = {
693
- /** The name of the binding used to refer to the Durable Object */name: string; /** The exported class name of the Durable Object */
694
- class_name: string; /** The script where the Durable Object is defined (if it's external to this Worker) */
695
- script_name?: string; /** The service environment of the script_name to bind to */
696
- environment?: string;
697
- }[];
698
- type WorkflowBinding = {
699
- /** The name of the binding used to refer to the Workflow */binding: string; /** The name of the Workflow */
700
- name: string; /** The exported class name of the Workflow */
701
- class_name: string; /** The script where the Workflow is defined (if it's external to this Worker) */
702
- script_name?: string; /** Whether the Workflow should be remote or not (only available under `--x-remote-bindings`) */
703
- experimental_remote?: boolean;
704
- };
705
- /**
706
- * The `EnvironmentNonInheritable` interface declares all the configuration fields for an environment
707
- * that cannot be inherited from the top-level environment, and must be defined specifically.
708
- *
709
- * If any of these fields are defined at the top-level then they should also be specifically defined
710
- * for each named environment.
711
- */
712
- interface EnvironmentNonInheritable {
713
- /**
714
- * A map of values to substitute when deploying your Worker.
715
- *
716
- * NOTE: This field is not automatically inherited from the top level environment,
717
- * and so must be specified in every named environment.
718
- *
719
- * @default {}
720
- * @nonInheritable
721
- */
722
- define: Record<string, string>;
723
- /**
724
- * A map of environment variables to set when deploying your Worker.
725
- *
726
- * NOTE: This field is not automatically inherited from the top level environment,
727
- * and so must be specified in every named environment.
728
- *
729
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
730
- *
731
- * @default {}
732
- * @nonInheritable
733
- */
734
- vars: Record<string, unknown>;
735
- /**
736
- * A list of durable objects that your Worker should be bound to.
737
- *
738
- * For more information about Durable Objects, see the documentation at
739
- * https://developers.cloudflare.com/workers/learning/using-durable-objects
740
- *
741
- * NOTE: This field is not automatically inherited from the top level environment,
742
- * and so must be specified in every named environment.
743
- *
744
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
745
- *
746
- * @default {bindings:[]}
747
- * @nonInheritable
748
- */
749
- durable_objects: {
750
- bindings: DurableObjectBindings;
751
- };
752
- /**
753
- * A list of workflows that your Worker should be bound to.
754
- *
755
- * NOTE: This field is not automatically inherited from the top level environment,
756
- * and so must be specified in every named environment.
757
- *
758
- * @default []
759
- * @nonInheritable
760
- */
761
- workflows: WorkflowBinding[];
762
- /**
763
- * Cloudchamber configuration
764
- *
765
- * NOTE: This field is not automatically inherited from the top level environment,
766
- * and so must be specified in every named environment.
767
- *
768
- * @default {}
769
- * @nonInheritable
770
- */
771
- cloudchamber: CloudchamberConfig;
772
- /**
773
- * Container related configuration
774
- *
775
- * NOTE: This field is not automatically inherited from the top level environment,
776
- * and so must be specified in every named environment.
777
- *
778
- * @default []
779
- * @nonInheritable
780
- */
781
- containers?: ContainerApp[];
782
- /**
783
- * These specify any Workers KV Namespaces you want to
784
- * access from inside your Worker.
785
- *
786
- * To learn more about KV Namespaces,
787
- * see the documentation at https://developers.cloudflare.com/workers/learning/how-kv-works
788
- *
789
- * NOTE: This field is not automatically inherited from the top level environment,
790
- * and so must be specified in every named environment.
791
- *
792
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
793
- *
794
- * @default []
795
- * @nonInheritable
796
- */
797
- kv_namespaces: {
798
- /** The binding name used to refer to the KV Namespace */binding: string; /** The ID of the KV namespace */
799
- id?: string; /** The ID of the KV namespace used during `wrangler dev` */
800
- preview_id?: string; /** Whether the KV namespace should be remote or not (only available under `--x-remote-bindings`) */
801
- experimental_remote?: boolean;
802
- }[];
803
- /**
804
- * These specify bindings to send email from inside your Worker.
805
- *
806
- * NOTE: This field is not automatically inherited from the top level environment,
807
- * and so must be specified in every named environment.
808
- *
809
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
810
- *
811
- * @default []
812
- * @nonInheritable
813
- */
814
- send_email: {
815
- /** The binding name used to refer to the this binding */name: string; /** If this binding should be restricted to a specific verified address */
816
- destination_address?: string; /** If this binding should be restricted to a set of verified addresses */
817
- allowed_destination_addresses?: string[];
818
- }[];
819
- /**
820
- * Specifies Queues that are bound to this Worker environment.
821
- *
822
- * NOTE: This field is not automatically inherited from the top level environment,
823
- * and so must be specified in every named environment.
824
- *
825
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
826
- *
827
- * @default {consumers:[],producers:[]}
828
- * @nonInheritable
829
- */
830
- queues: {
831
- /** Producer bindings */producers?: {
832
- /** The binding name used to refer to the Queue in the Worker. */binding: string; /** The name of this Queue. */
833
- queue: string; /** The number of seconds to wait before delivering a message */
834
- delivery_delay?: number; /** Whether the Queue producer should be remote or not (only available under `--x-remote-bindings`) */
835
- experimental_remote?: boolean;
836
- }[]; /** Consumer configuration */
837
- consumers?: {
838
- /** 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. */
839
- type?: string; /** The maximum number of messages per batch */
840
- max_batch_size?: number; /** The maximum number of seconds to wait to fill a batch with messages. */
841
- max_batch_timeout?: number; /** The maximum number of retries for each message. */
842
- max_retries?: number; /** The queue to send messages that failed to be consumed. */
843
- 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. */
844
- max_concurrency?: number | null; /** The number of milliseconds to wait for pulled messages to become visible again */
845
- visibility_timeout_ms?: number; /** The number of seconds to wait before retrying a message */
846
- retry_delay?: number;
847
- }[];
848
- };
849
- /**
850
- * Specifies R2 buckets that are bound to this Worker environment.
851
- *
852
- * NOTE: This field is not automatically inherited from the top level environment,
853
- * and so must be specified in every named environment.
854
- *
855
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
856
- *
857
- * @default []
858
- * @nonInheritable
859
- */
860
- r2_buckets: {
861
- /** The binding name used to refer to the R2 bucket in the Worker. */binding: string; /** The name of this R2 bucket at the edge. */
862
- bucket_name?: string; /** The preview name of this R2 bucket at the edge. */
863
- preview_bucket_name?: string; /** The jurisdiction that the bucket exists in. Default if not present. */
864
- jurisdiction?: string; /** Whether the R2 bucket should be remote or not (only available under `--x-remote-bindings`) */
865
- experimental_remote?: boolean;
866
- }[];
867
- /**
868
- * Specifies D1 databases that are bound to this Worker environment.
869
- *
870
- * NOTE: This field is not automatically inherited from the top level environment,
871
- * and so must be specified in every named environment.
872
- *
873
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
874
- *
875
- * @default []
876
- * @nonInheritable
877
- */
878
- d1_databases: {
879
- /** The binding name used to refer to the D1 database in the Worker. */binding: string; /** The name of this D1 database. */
880
- database_name?: string; /** The UUID of this D1 database (not required). */
881
- database_id?: string; /** The UUID of this D1 database for Wrangler Dev (if specified). */
882
- preview_database_id?: string; /** The name of the migrations table for this D1 database (defaults to 'd1_migrations'). */
883
- migrations_table?: string; /** The path to the directory of migrations for this D1 database (defaults to './migrations'). */
884
- migrations_dir?: string; /** Internal use only. */
885
- database_internal_env?: string; /** Whether the D1 database should be remote or not (only available under `--x-remote-bindings`) */
886
- experimental_remote?: boolean;
887
- }[];
888
- /**
889
- * Specifies Vectorize indexes that are bound to this Worker environment.
890
- *
891
- * NOTE: This field is not automatically inherited from the top level environment,
892
- * and so must be specified in every named environment.
893
- *
894
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
895
- *
896
- * @default []
897
- * @nonInheritable
898
- */
899
- vectorize: {
900
- /** The binding name used to refer to the Vectorize index in the Worker. */binding: string; /** The name of the index. */
901
- index_name: string; /** Whether the Vectorize index should be remote or not (only available under `--x-remote-bindings`) */
902
- experimental_remote?: boolean;
903
- }[];
904
- /**
905
- * Specifies Hyperdrive configs that are bound to this Worker environment.
906
- *
907
- * NOTE: This field is not automatically inherited from the top level environment,
908
- * and so must be specified in every named environment.
909
- *
910
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
911
- *
912
- * @default []
913
- * @nonInheritable
914
- */
915
- hyperdrive: {
916
- /** The binding name used to refer to the project in the Worker. */binding: string; /** The id of the database. */
917
- id: string; /** The local database connection string for `wrangler dev` */
918
- localConnectionString?: string;
919
- }[];
920
- /**
921
- * Specifies service bindings (Worker-to-Worker) that are bound to this Worker environment.
922
- *
923
- * NOTE: This field is not automatically inherited from the top level environment,
924
- * and so must be specified in every named environment.
925
- *
926
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
927
- *
928
- * @default []
929
- * @nonInheritable
930
- */
931
- services: {
932
- /** The binding name used to refer to the bound service. */binding: string; /** The name of the service. */
933
- service: string; /** The environment of the service (e.g. production, staging, etc). */
934
- environment?: string; /** Optionally, the entrypoint (named export) of the service to bind to. */
935
- entrypoint?: string; /** Optional properties that will be made available to the service via ctx.props. */
936
- props?: Record<string, unknown>; /** Whether the service binding should be remote or not (only available under `--x-remote-bindings`) */
937
- experimental_remote?: boolean;
938
- }[] | undefined;
939
- /**
940
- * Specifies analytics engine datasets that are bound to this Worker environment.
941
- *
942
- * NOTE: This field is not automatically inherited from the top level environment,
943
- * and so must be specified in every named environment.
944
- *
945
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
946
- *
947
- * @default []
948
- * @nonInheritable
949
- */
950
- analytics_engine_datasets: {
951
- /** The binding name used to refer to the dataset in the Worker. */binding: string; /** The name of this dataset to write to. */
952
- dataset?: string;
953
- }[];
954
- /**
955
- * A browser that will be usable from the Worker.
956
- *
957
- * NOTE: This field is not automatically inherited from the top level environment,
958
- * and so must be specified in every named environment.
959
- *
960
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
961
- *
962
- * @default {}
963
- * @nonInheritable
964
- */
965
- browser: {
966
- binding: string; /** Whether the Browser binding should be remote or not (only available under `--x-remote-bindings`) */
967
- experimental_remote?: boolean;
968
- } | undefined;
969
- /**
970
- * Binding to the AI project.
971
- *
972
- * NOTE: This field is not automatically inherited from the top level environment,
973
- * and so must be specified in every named environment.
974
- *
975
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
976
- *
977
- * @default {}
978
- * @nonInheritable
979
- */
980
- ai: {
981
- binding: string;
982
- staging?: boolean; /** Whether the AI binding should be remote or not (only available under `--x-remote-bindings`) */
983
- experimental_remote?: boolean;
984
- } | undefined;
985
- /**
986
- * Binding to Cloudflare Images
987
- *
988
- * NOTE: This field is not automatically inherited from the top level environment,
989
- * and so must be specified in every named environment.
990
- *
991
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
992
- *
993
- * @default {}
994
- * @nonInheritable
995
- */
996
- images: {
997
- binding: string; /** Whether the Images binding should be remote or not (only available under `--x-remote-bindings`) */
998
- experimental_remote?: boolean;
999
- } | undefined;
1000
- /**
1001
- * Binding to the Worker Version's metadata
1002
- */
1003
- version_metadata: {
1004
- binding: string;
1005
- } | undefined;
1006
- /**
1007
- * "Unsafe" tables for features that aren't directly supported by wrangler.
1008
- *
1009
- * NOTE: This field is not automatically inherited from the top level environment,
1010
- * and so must be specified in every named environment.
1011
- *
1012
- * @default {}
1013
- * @nonInheritable
1014
- */
1015
- unsafe: {
1016
- /**
1017
- * A set of bindings that should be put into a Worker's upload metadata without changes. These
1018
- * can be used to implement bindings for features that haven't released and aren't supported
1019
- * directly by wrangler or miniflare.
1020
- */
1021
- bindings?: {
1022
- name: string;
1023
- type: string;
1024
- [key: string]: unknown;
1025
- }[];
1026
- /**
1027
- * Arbitrary key/value pairs that will be included in the uploaded metadata. Values specified
1028
- * here will always be applied to metadata last, so can add new or override existing fields.
1029
- */
1030
- metadata?: {
1031
- [key: string]: unknown;
1032
- };
1033
- /**
1034
- * Used for internal capnp uploads for the Workers runtime
1035
- */
1036
- capnp?: {
1037
- base_path: string;
1038
- source_schemas: string[];
1039
- compiled_schema?: never;
1040
- } | {
1041
- base_path?: never;
1042
- source_schemas?: never;
1043
- compiled_schema: string;
1044
- };
1045
- };
1046
- /**
1047
- * Specifies a list of mTLS certificates 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/#mtls-certificates
1053
- *
1054
- * @default []
1055
- * @nonInheritable
1056
- */
1057
- mtls_certificates: {
1058
- /** The binding name used to refer to the certificate in the Worker */binding: string; /** The uuid of the uploaded mTLS certificate */
1059
- certificate_id: string; /** Whether the mtls fetcher should be remote or not (only available under `--x-remote-bindings`) */
1060
- experimental_remote?: boolean;
1061
- }[];
1062
- /**
1063
- * Specifies a list of Tail Workers that are bound to this Worker environment
1064
- *
1065
- * NOTE: This field is not automatically inherited from the top level environment,
1066
- * and so must be specified in every named environment.
1067
- *
1068
- * @default []
1069
- * @nonInheritable
1070
- */
1071
- tail_consumers?: TailConsumer[];
1072
- /**
1073
- * Specifies namespace bindings that are bound to this Worker environment.
1074
- *
1075
- * NOTE: This field is not automatically inherited from the top level environment,
1076
- * and so must be specified in every named environment.
1077
- *
1078
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
1079
- *
1080
- * @default []
1081
- * @nonInheritable
1082
- */
1083
- dispatch_namespaces: {
1084
- /** The binding name used to refer to the bound service. */binding: string; /** The namespace to bind to. */
1085
- namespace: string; /** Details about the outbound Worker which will handle outbound requests from your namespace */
1086
- outbound?: DispatchNamespaceOutbound; /** Whether the Dispatch Namespace should be remote or not (only available under `--x-remote-bindings`) */
1087
- experimental_remote?: boolean;
1088
- }[];
1089
- /**
1090
- * Specifies list of Pipelines bound to this Worker environment
1091
- *
1092
- * NOTE: This field is not automatically inherited from the top level environment,
1093
- * and so must be specified in every named environment.
1094
- *
1095
- * @default []
1096
- * @nonInheritable
1097
- */
1098
- pipelines: {
1099
- /** The binding name used to refer to the bound service. */binding: string; /** Name of the Pipeline to bind */
1100
- pipeline: string;
1101
- }[];
1102
- /**
1103
- * Specifies Secret Store bindings that are bound to this Worker environment.
1104
- *
1105
- * NOTE: This field is not automatically inherited from the top level environment,
1106
- * and so must be specified in every named environment.
1107
- *
1108
- * @default []
1109
- * @nonInheritable
1110
- */
1111
- secrets_store_secrets: {
1112
- /** The binding name used to refer to the bound service. */binding: string; /** Id of the secret store */
1113
- store_id: string; /** Name of the secret */
1114
- secret_name: string;
1115
- }[];
1116
- /**
1117
- * **DO NOT USE**. Hello World Binding Config to serve as an explanatory example.
1118
- *
1119
- * NOTE: This field is not automatically inherited from the top level environment,
1120
- * and so must be specified in every named environment.
1121
- *
1122
- * @default []
1123
- * @nonInheritable
1124
- */
1125
- unsafe_hello_world: {
1126
- /** The binding name used to refer to the bound service. */binding: string; /** Whether the timer is enabled */
1127
- enable_timer?: boolean;
1128
- }[];
1129
- }
1130
- /**
1131
- * A bundling resolver rule, defining the modules type for paths that match the specified globs.
1132
- */
1133
- type Rule = {
1134
- type: ConfigModuleRuleType;
1135
- globs: string[];
1136
- fallthrough?: boolean;
1137
- };
1138
- /**
1139
- * The possible types for a `Rule`.
1140
- */
1141
- type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data" | "PythonModule" | "PythonRequirement";
1142
- type TailConsumer = {
1143
- /** The name of the service tail events will be forwarded to. */service: string; /** (Optional) The environment of the service. */
1144
- environment?: string;
1145
- };
1146
- interface DispatchNamespaceOutbound {
1147
- /** Name of the service handling the outbound requests */
1148
- service: string;
1149
- /** (Optional) Name of the environment handling the outbound requests. */
1150
- environment?: string;
1151
- /** (Optional) List of parameter names, for sending context from your dispatch Worker to the outbound handler */
1152
- parameters?: string[];
1153
- }
1154
- interface UserLimits {
1155
- /** Maximum allowed CPU time for a Worker's invocation in milliseconds */
1156
- cpu_ms: number;
1157
- }
1158
- type Assets = {
1159
- /** Absolute path to assets directory */directory?: string; /** Name of `env` binding property in the User Worker. */
1160
- binding?: string; /** How to handle HTML requests. */
1161
- html_handling?: "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | "none"; /** How to handle requests that do not match an asset. */
1162
- not_found_handling?: "single-page-application" | "404-page" | "none";
1163
- /**
1164
- * Matches will be routed to the User Worker, and matches to negative rules will go to the Asset Worker.
1165
- *
1166
- * Can also be `true`, indicating that every request should be routed to the User Worker.
1167
- */
1168
- run_worker_first?: string[] | boolean;
1169
- };
1170
- interface Observability {
1171
- /** If observability is enabled for this Worker */
1172
- enabled?: boolean;
1173
- /** The sampling rate */
1174
- head_sampling_rate?: number;
1175
- logs?: {
1176
- enabled?: boolean; /** The sampling rate */
1177
- head_sampling_rate?: number; /** Set to false to disable invocation logs */
1178
- invocation_logs?: boolean;
1179
- };
1180
- traces?: {
1181
- enabled?: boolean; /** The sampling rate */
1182
- head_sampling_rate?: number;
1183
- };
1184
- }
1185
- /**
1186
- * This is the static type definition for the configuration object.
1187
- *
1188
- * It reflects a normalized and validated version of the configuration that you can write in a Wrangler configuration file,
1189
- * and optionally augment with arguments passed directly to wrangler.
1190
- *
1191
- * For more information about the configuration object, see the
1192
- * documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration
1193
- *
1194
- * Notes:
1195
- *
1196
- * - Fields that are only specified in `ConfigFields` and not `Environment` can only appear
1197
- * in the top level config and should not appear in any environments.
1198
- * - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects
1199
- * - All top level fields in config and environments are optional in the Wrangler configuration file.
1200
- *
1201
- * Legend for the annotations:
1202
- *
1203
- * - `@breaking`: the deprecation/optionality is a breaking change from Wrangler v1.
1204
- * - `@todo`: there's more work to be done (with details attached).
1205
- */
1206
- type Config = ComputedFields & ConfigFields<DevConfig> & PagesConfigFields & Environment;
1207
- interface ComputedFields {
1208
- /** The path to the Wrangler configuration file (if any, and possibly redirected from the user Wrangler configuration) used to create this configuration. */
1209
- configPath: string | undefined;
1210
- /** 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. */
1211
- userConfigPath: string | undefined;
1212
- /**
1213
- * The original top level name for the Worker in the raw configuration.
1214
- *
1215
- * When a raw configuration has been flattened to a single environment the worker name may have been replaced or transformed.
1216
- * It can be useful to know what the top-level name was before the flattening.
1217
- */
1218
- topLevelName: string | undefined;
1219
- }
1220
- interface ConfigFields<Dev extends RawDevConfig> {
1221
- /**
1222
- * A boolean to enable "legacy" style wrangler environments (from Wrangler v1).
1223
- * These have been superseded by Services, but there may be projects that won't
1224
- * (or can't) use them. If you're using a legacy environment, you can set this
1225
- * to `true` to enable it.
1226
- */
1227
- legacy_env: boolean;
1228
- /**
1229
- * Whether Wrangler should send usage metrics to Cloudflare for this project.
1230
- *
1231
- * When defined this will override any user settings.
1232
- * Otherwise, Wrangler will use the user's preference.
1233
- */
1234
- send_metrics: boolean | undefined;
1235
- /**
1236
- * Options to configure the development server that your worker will use.
1237
- */
1238
- dev: Dev;
1239
- /**
1240
- * The definition of a Worker Site, a feature that lets you upload
1241
- * static assets with your Worker.
1242
- *
1243
- * More details at https://developers.cloudflare.com/workers/platform/sites
1244
- */
1245
- site: {
1246
- /**
1247
- * The directory containing your static assets.
1248
- *
1249
- * It must be a path relative to your Wrangler configuration file.
1250
- * Example: bucket = "./public"
1251
- *
1252
- * If there is a `site` field then it must contain this `bucket` field.
1253
- */
1254
- bucket: string;
1255
- /**
1256
- * The location of your Worker script.
1257
- *
1258
- * @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.
1259
- * @breaking
1260
- */
1261
- "entry-point"?: string;
1262
- /**
1263
- * An exclusive list of .gitignore-style patterns that match file
1264
- * or directory names from your bucket location. Only matched
1265
- * items will be uploaded. Example: include = ["upload_dir"]
1266
- *
1267
- * @optional
1268
- * @default []
1269
- */
1270
- include?: string[];
1271
- /**
1272
- * A list of .gitignore-style patterns that match files or
1273
- * directories in your bucket that should be excluded from
1274
- * uploads. Example: exclude = ["ignore_dir"]
1275
- *
1276
- * @optional
1277
- * @default []
1278
- */
1279
- exclude?: string[];
1280
- } | undefined;
1281
- /**
1282
- * Old behaviour of serving a folder of static assets with your Worker,
1283
- * without any additional code.
1284
- * This can either be a string, or an object with additional config
1285
- * fields.
1286
- * Will be deprecated in the near future in favor of `assets`.
1287
- */
1288
- legacy_assets: {
1289
- bucket: string;
1290
- include: string[];
1291
- exclude: string[];
1292
- browser_TTL: number | undefined;
1293
- serve_single_page_app: boolean;
1294
- } | string | undefined;
1295
- /**
1296
- * A list of wasm modules that your worker should be bound to. This is
1297
- * the "legacy" way of binding to a wasm module. ES module workers should
1298
- * do proper module imports.
1299
- */
1300
- wasm_modules: {
1301
- [key: string]: string;
1302
- } | undefined;
1303
- /**
1304
- * A list of text files that your worker should be bound to. This is
1305
- * the "legacy" way of binding to a text file. ES module workers should
1306
- * do proper module imports.
1307
- */
1308
- text_blobs: {
1309
- [key: string]: string;
1310
- } | undefined;
1311
- /**
1312
- * A list of data files that your worker should be bound to. This is
1313
- * the "legacy" way of binding to a data file. ES module workers should
1314
- * do proper module imports.
1315
- */
1316
- data_blobs: {
1317
- [key: string]: string;
1318
- } | undefined;
1319
- /**
1320
- * A map of module aliases. Lets you swap out a module for any others.
1321
- * Corresponds with esbuild's `alias` config
1322
- */
1323
- alias: {
1324
- [key: string]: string;
1325
- } | undefined;
1326
- /**
1327
- * By default, the Wrangler configuration file is the source of truth for your environment configuration, like a terraform file.
1328
- *
1329
- * If you change your vars in the dashboard, wrangler *will* override/delete them on its next deploy.
1330
- *
1331
- * If you want to keep your dashboard vars when wrangler deploys, set this field to true.
1332
- *
1333
- * @default false
1334
- * @nonInheritable
1335
- */
1336
- keep_vars?: boolean;
1337
- }
1338
- interface PagesConfigFields {
1339
- /**
1340
- * The directory of static assets to serve.
1341
- *
1342
- * The presence of this field in a Wrangler configuration file indicates a Pages project,
1343
- * and will prompt the handling of the configuration file according to the
1344
- * Pages-specific validation rules.
1345
- */
1346
- pages_build_output_dir?: string;
1347
- }
1348
- interface DevConfig {
1349
- /**
1350
- * IP address for the local dev server to listen on,
1351
- *
1352
- * @default localhost
1353
- */
1354
- ip: string;
1355
- /**
1356
- * Port for the local dev server to listen on
1357
- *
1358
- * @default 8787
1359
- */
1360
- port: number | undefined;
1361
- /**
1362
- * Port for the local dev server's inspector to listen on
1363
- *
1364
- * @default 9229
1365
- */
1366
- inspector_port: number | undefined;
1367
- /**
1368
- * Protocol that local wrangler dev server listens to requests on.
1369
- *
1370
- * @default http
1371
- */
1372
- local_protocol: "http" | "https";
1373
- /**
1374
- * Protocol that wrangler dev forwards requests on
1375
- *
1376
- * Setting this to `http` is not currently implemented for remote mode.
1377
- * See https://github.com/cloudflare/workers-sdk/issues/583
1378
- *
1379
- * @default https
1380
- */
1381
- upstream_protocol: "https" | "http";
1382
- /**
1383
- * Host to forward requests to, defaults to the host of the first route of project
1384
- */
1385
- host: string | undefined;
1386
- }
1387
- type RawDevConfig = Partial<DevConfig>;
1388
- type WranglerConfig = Partial<Omit<Config, keyof ComputedFields>>;
253
+ type WranglerConfig = Partial<RawConfig>;
1389
254
  /**
1390
255
  * https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes
1391
256
  */
@@ -1499,36 +364,10 @@ declare module "nitro/types" {
1499
364
  "cloudflare:durable:alarm": (durable: DurableObject) => void;
1500
365
  }
1501
366
  }
367
+ type AppHostingOutputBundleConfig = OutputBundleConfig;
1502
368
  interface FirebaseOptions {
1503
369
  appHosting: Partial<AppHostingOutputBundleConfig["runConfig"]>;
1504
370
  }
1505
- interface AppHostingOutputBundleConfig {
1506
- version: "v1";
1507
- runConfig: {
1508
- /** 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. */
1509
- environmentVariables?: Array<{
1510
- /** Name of the variable. */variable: string; /** Value associated with the variable. */
1511
- value: string; /** Where the variable will be available, for now only RUNTIME is supported. */
1512
- availability: "RUNTIME"[];
1513
- }>; /** The maximum number of concurrent requests that each server instance can receive. */
1514
- concurrency?: number; /** The number of CPUs used in a single server instance. */
1515
- cpu?: number; /** The amount of memory available for a server instance. */
1516
- memoryMiB?: number; /** The limit on the minimum number of function instances that may coexist at a given time. */
1517
- minInstances?: number; /** The limit on the maximum number of function instances that may coexist at a given time. */
1518
- maxInstances?: number;
1519
- };
1520
- metadata: {
1521
- adapterPackageName: string;
1522
- adapterVersion: string;
1523
- framework: string;
1524
- frameworkVersion?: string;
1525
- };
1526
- outputFiles?: {
1527
- /** serverApp holds a list of directories + files relative to the app root dir that frameworks need to deploy to the App Hosting server. */serverApp: {
1528
- include: string[];
1529
- };
1530
- };
1531
- }
1532
371
  interface NetlifyOptions {
1533
372
  /** @deprecated Use `config.images` */
1534
373
  images?: NetlifyImagesConfig;
@@ -1777,7 +616,7 @@ declare module "nitro/types" {
1777
616
  interface NitroRuntimeHooks {
1778
617
  "vercel:queue": (_: {
1779
618
  message: unknown;
1780
- metadata: _$_vercel_queue0.MessageMetadata;
619
+ metadata: import("@vercel/queue").MessageMetadata;
1781
620
  send: typeof send;
1782
621
  }) => void;
1783
622
  }
@@ -1800,587 +639,13 @@ interface PresetOptions {
1800
639
  vercel?: VercelOptions;
1801
640
  zephyr?: ZephyrOptions;
1802
641
  }
1803
- 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";
1804
- 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 & {});
1805
- /**
1806
- Source: (inlined because of install size concernes)
1807
-
1808
- https://github.com/openapi-ts/openapi-typescript/blob/fc3f7/packages/openapi-typescript/src/types.ts
1809
-
1810
- MIT License
1811
-
1812
- Copyright (c) 2020 Drew Powers
1813
-
1814
- Permission is hereby granted, free of charge, to any person obtaining a copy
1815
- of this software and associated documentation files (the "Software"), to deal
1816
- in the Software without restriction, including without limitation the rights
1817
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1818
- copies of the Software, and to permit persons to whom the Software is
1819
- furnished to do so, subject to the following conditions:
1820
-
1821
- The above copyright notice and this permission notice shall be included in all
1822
- copies or substantial portions of the Software.
1823
-
1824
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1825
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1826
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1827
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1828
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1829
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1830
- SOFTWARE.
1831
- */
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 & {});
1832
644
  interface Extensable {
1833
645
  [key: `x-${string}`]: any;
1834
646
  }
1835
- /**
1836
- * [4.8] Schema
1837
- * @see https://spec.openapis.org/oas/v3.1.0#schema
1838
- */
1839
- interface OpenAPI3 extends Extensable {
1840
- /** 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. */
1841
- openapi: string;
1842
- /** REQUIRED. Provides metadata about the API. The metadata MAY be used by tooling as required. */
1843
- info: InfoObject;
1844
- /** The default value for the $schema keyword within Schema Objects contained within this OAS document. This MUST be in the form of a URI. */
1845
- jsonSchemaDialect?: string;
1846
- /** 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 /. */
1847
- servers?: ServerObject[];
1848
- /** The available paths and operations for the API. */
1849
- paths?: PathsObject;
1850
- /** 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. */
1851
- webhooks?: {
1852
- [id: string]: PathItemObject | ReferenceObject;
1853
- };
1854
- /** An element to hold various schemas for the document. */
1855
- components?: ComponentsObject;
1856
- /** 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. */
1857
- security?: SecurityRequirementObject[];
1858
- /** 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. */
1859
- tags?: TagObject[];
1860
- /** Additional external documentation. */
1861
- externalDocs?: ExternalDocumentationObject;
1862
- $defs?: $defs;
1863
- }
1864
- /**
1865
- * [4.8.2] Info Object
1866
- * The object provides metadata about the API.
1867
- */
1868
- interface InfoObject extends Extensable {
1869
- /** REQUIRED. The title of the API. */
1870
- title: string;
1871
- /** A short summary of the API. */
1872
- summary?: string;
1873
- /** A description of the API. CommonMark syntax MAY be used for rich text representation. */
1874
- description?: string;
1875
- /** A URL to the Terms of Service for the API. This MUST be in the form of a URL. */
1876
- termsOfService?: string;
1877
- /** The contact information for the exposed API. */
1878
- contact?: ContactObject;
1879
- /** The license information for the exposed API. */
1880
- license?: LicenseObject;
1881
- /** REQUIRED. The version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API implementation version). */
1882
- version: string;
1883
- }
1884
- /**
1885
- * [4.8.3] Contact Object
1886
- * Contact information for the exposed API.
1887
- */
1888
- interface ContactObject extends Extensable {
1889
- /** The identifying name of the contact person/organization. */
1890
- name?: string;
1891
- /** The URL pointing to the contact information. This MUST be in the form of a URL. */
1892
- url?: string;
1893
- /** The email address of the contact person/organization. This MUST be in the form of an email address. */
1894
- email?: string;
1895
- }
1896
- /**
1897
- * [4.8.4] License object
1898
- * License information for the exposed API.
1899
- */
1900
- interface LicenseObject extends Extensable {
1901
- /** REQUIRED. The license name used for the API. */
1902
- name: string;
1903
- /** An SPDX license expression for the API. The identifier field is mutually exclusive of the url field. */
1904
- identifier: string;
1905
- /** 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. */
1906
- url: string;
1907
- }
1908
- /**
1909
- * [4.8.5] Server Object
1910
- * An object representing a Server.
1911
- */
1912
- interface ServerObject extends Extensable {
1913
- /** 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}. */
1914
- url: string;
1915
- /** An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation. */
1916
- description: string;
1917
- /** A map between a variable name and its value. The value is used for substitution in the server’s URL template. */
1918
- variables: {
1919
- [name: string]: ServerVariableObject;
1920
- };
1921
- }
1922
- /**
1923
- * [4.8.6] Server Variable Object
1924
- * An object representing a Server Variable for server URL template substitution.
1925
- */
1926
- interface ServerVariableObject extends Extensable {
1927
- /** An enumeration of string values to be used if the substitution options are from a limited set. The array MUST NOT be empty. */
1928
- enum?: string[];
1929
- /** 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. */
1930
- default: string;
1931
- /** An optional description for the server variable. CommonMark syntax MAY be used for rich text representation. */
1932
- description?: string;
1933
- }
1934
- /**
1935
- * [4.8.7] Components Object
1936
- * Holds a set of reusable objects for different aspects of the OAS.
1937
- */
1938
- interface ComponentsObject extends Extensable {
1939
- /** An object to hold reusable Schema Objects.*/
1940
- schemas?: Record<string, SchemaObject>;
1941
- /** An object to hold reusable Response Objects. */
1942
- responses?: Record<string, ResponseObject | ReferenceObject>;
1943
- /** An object to hold reusable Parameter Objects. */
1944
- parameters?: Record<string, ParameterObject | ReferenceObject>;
1945
- /** An object to hold reusable Example Objects. */
1946
- examples?: Record<string, ExampleObject | ReferenceObject>;
1947
- /** An object to hold reusable Request Body Objects. */
1948
- requestBodies?: Record<string, RequestBodyObject | ReferenceObject>;
1949
- /** An object to hold reusable Header Objects. */
1950
- headers?: Record<string, HeaderObject | ReferenceObject>;
1951
- /** An object to hold reusable Security Scheme Objects. */
1952
- securitySchemes?: Record<string, SecuritySchemeObject | ReferenceObject>;
1953
- /** An object to hold reusable Link Objects. */
1954
- links?: Record<string, LinkObject | ReferenceObject>;
1955
- /** An object to hold reusable Callback Objects. */
1956
- callbacks?: Record<string, CallbackObject | ReferenceObject>;
1957
- /** An object to hold reusable Path Item Objects. */
1958
- pathItems?: Record<string, PathItemObject | ReferenceObject>;
1959
- }
1960
- /**
1961
- * [4.8.8] Paths Object
1962
- * 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.
1963
- */
1964
- interface PathsObject {
1965
- [pathname: string]: PathItemObject | ReferenceObject;
1966
- }
1967
- /**
1968
- * [4.8.9] Path Item Object
1969
- * 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.
1970
- */
1971
- interface PathItemObject extends Extensable {
1972
- /** A definition of a GET operation on this path. */
1973
- get?: OperationObject | ReferenceObject;
1974
- /** A definition of a PUT operation on this path. */
1975
- put?: OperationObject | ReferenceObject;
1976
- /** A definition of a POST operation on this path. */
1977
- post?: OperationObject | ReferenceObject;
1978
- /** A definition of a DELETE operation on this path. */
1979
- delete?: OperationObject | ReferenceObject;
1980
- /** A definition of a OPTIONS operation on this path. */
1981
- options?: OperationObject | ReferenceObject;
1982
- /** A definition of a HEAD operation on this path. */
1983
- head?: OperationObject | ReferenceObject;
1984
- /** A definition of a PATCH operation on this path. */
1985
- patch?: OperationObject | ReferenceObject;
1986
- /** A definition of a TRACE operation on this path. */
1987
- trace?: OperationObject | ReferenceObject;
1988
- /** An alternative server array to service all operations in this path. */
1989
- servers?: ServerObject[];
1990
- /** 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. */
1991
- parameters?: (ParameterObject | ReferenceObject)[];
1992
- }
1993
- /**
1994
- * [4.8.10] Operation Object
1995
- * Describes a single API operation on a path.
1996
- */
1997
- interface OperationObject extends Extensable {
1998
- /** A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier. */
1999
- tags?: string[];
2000
- /** A short summary of what the operation does. */
2001
- summary?: string;
2002
- /** A verbose explanation of the operation behavior. CommonMark syntax MAY be used for rich text representation. */
2003
- description?: string;
2004
- /** Additional external documentation for this operation. */
2005
- externalDocs?: ExternalDocumentationObject;
2006
- /** 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. */
2007
- operationId?: string;
2008
- /** 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. */
2009
- parameters?: (ParameterObject | ReferenceObject)[];
2010
- /** 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. */
2011
- requestBody?: RequestBodyObject | ReferenceObject;
2012
- /** The list of possible responses as they are returned from executing this operation. */
2013
- responses?: ResponsesObject;
2014
- /** 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. */
2015
- callbacks?: Record<string, CallbackObject | ReferenceObject>;
2016
- /** Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation. Default value is false. */
2017
- deprecated?: boolean;
2018
- /** 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. */
2019
- security?: SecurityRequirementObject[];
2020
- /** 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. */
2021
- servers?: ServerObject[];
2022
- }
2023
- /**
2024
- * [4.8.11] External Documentation Object
2025
- * Allows referencing an external resource for extended documentation.
2026
- */
2027
- interface ExternalDocumentationObject extends Extensable {
2028
- /** A description of the target documentation. CommonMark syntax MAY be used for rich text representation. */
2029
- description?: string;
2030
- /** REQUIRED. The URL for the target documentation. This MUST be in the form of a URL. */
2031
- url: string;
2032
- }
2033
- /**
2034
- * [4.8.12] Parameter Object
2035
- * Describes a single operation parameter.
2036
- * A unique parameter is defined by a combination of a name and location.
2037
- */
2038
- interface ParameterObject extends Extensable {
2039
- /**
2040
- * REQUIRED. The name of the parameter. Parameter names are case sensitive.
2041
- *
2042
- * - 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.
2043
- * - If `in` is `"header"` and the `name` field is `"Accept"`, `"Content-Type"` or `"Authorization"`, the parameter definition SHALL be ignored.
2044
- * - For all other cases, the `name` corresponds to the parameter name used by the `in` property.
2045
- */
2046
- name: string;
2047
- /** REQUIRED. The location of the parameter. Possible values are "query", "header", "path" or "cookie".*/
2048
- in: "query" | "header" | "path" | "cookie";
2049
- /** A brief description of the parameter. This could contain examples of use. CommonMark syntax MAY be used for rich text representation. */
2050
- description?: string;
2051
- /** 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. */
2052
- required?: boolean;
2053
- /** Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. Default value is false. */
2054
- deprecated?: boolean;
2055
- /** 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. */
2056
- allowEmptyValue?: boolean;
2057
- /** 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. */
2058
- style?: string;
2059
- /** 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`. */
2060
- explode?: boolean;
2061
- /** 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`. */
2062
- allowReserved?: boolean;
2063
- /** The schema defining the type used for the parameter. */
2064
- schema?: SchemaObject;
2065
- /** Example of the parameter’s potential value. */
2066
- example?: any;
2067
- /** Examples of the parameter’s potential value. */
2068
- examples?: {
2069
- [name: string]: ExampleObject | ReferenceObject;
2070
- };
2071
- /** A map containing the representations for the parameter. */
2072
- content?: {
2073
- [contentType: string]: MediaTypeObject | ReferenceObject;
2074
- };
2075
- }
2076
- /**
2077
- * [4.8.13] Request Body Object
2078
- * Describes a single request body.
2079
- */
2080
- interface RequestBodyObject extends Extensable {
2081
- /** A brief description of the request body. This could contain examples of use. CommonMark syntax MAY be used for rich text representation. */
2082
- description?: string;
2083
- /** 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 */
2084
- content: {
2085
- [contentType: string]: MediaTypeObject | ReferenceObject;
2086
- };
2087
- /** Determines if the request body is required in the request. Defaults to false. */
2088
- required?: boolean;
2089
- }
2090
- /**
2091
- * [4.8.14] Media Type Object
2092
- */
2093
- interface MediaTypeObject extends Extensable {
2094
- /** The schema defining the content of the request, response, or parameter. */
2095
- schema?: SchemaObject | ReferenceObject;
2096
- /** 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. */
2097
- example?: any;
2098
- /** 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. */
2099
- examples?: {
2100
- [name: string]: ExampleObject | ReferenceObject;
2101
- };
2102
- /** 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. */
2103
- encoding?: {
2104
- [propertyName: string]: EncodingObject;
2105
- };
2106
- }
2107
- /**
2108
- * [4.8.15] Encoding Object
2109
- * A single encoding definition applied to a single schema property.
2110
- */
2111
- interface EncodingObject extends Extensable {
2112
- /** 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. */
2113
- contentType?: string;
2114
- /** 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. */
2115
- headers?: {
2116
- [name: string]: HeaderObject | ReferenceObject;
2117
- };
2118
- /** 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. */
2119
- style?: string;
2120
- /** 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. */
2121
- explode?: string;
2122
- /** 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. */
2123
- allowReserved?: string;
2124
- }
2125
- /**
2126
- * [4.8.16] Responses Object
2127
- * A container for the expected responses of an operation. The container maps a HTTP response code to the expected response.
2128
- */
2129
- type ResponsesObject = {
2130
- [responseCode: string]: ResponseObject | ReferenceObject;
2131
- } & {
2132
- /** The documentation of responses other than the ones declared for specific HTTP response codes. Use this field to cover undeclared responses. */default?: ResponseObject | ReferenceObject;
2133
- };
2134
- /**
2135
- * [4.8.17] Response Object
2136
- * Describes a single response from an API Operation, including design-time, static links to operations based on the response.
2137
- */
2138
- interface ResponseObject extends Extensable {
2139
- /** REQUIRED. A description of the response. CommonMark syntax MAY be used for rich text representation. */
2140
- description: string;
2141
- /** 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. */
2142
- headers?: {
2143
- [name: string]: HeaderObject | ReferenceObject;
2144
- };
2145
- /** 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 */
2146
- content?: {
2147
- [contentType: string]: MediaTypeObject;
2148
- };
2149
- /** 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. */
2150
- links?: {
2151
- [name: string]: LinkObject | ReferenceObject;
2152
- };
2153
- }
2154
- /**
2155
- * [4.8.18] Callback Object
2156
- * 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.
2157
- */
2158
- type CallbackObject = Record<string, PathItemObject>;
2159
- /**
2160
- * [4.8.19[ Example Object
2161
- */
2162
- interface ExampleObject extends Extensable {
2163
- /** Short description for the example. */
2164
- summary?: string;
2165
- /** Long description for the example. CommonMark syntax MAY be used for rich text representation. */
2166
- description?: string;
2167
- /** 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. */
2168
- value?: any;
2169
- /** 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. */
2170
- externalValue?: string;
2171
- }
2172
- /**
2173
- * [4.8.20] Link Object
2174
- * 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.
2175
- */
2176
- interface LinkObject extends Extensable {
2177
- /** 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. */
2178
- operationRef?: string;
2179
- /** The name of an existing, resolvable OAS operation, as defined with a unique operationId. This field is mutually exclusive of the operationRef field. */
2180
- operationId?: string;
2181
- /** 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). */
2182
- parameters?: {
2183
- [name: string]: `$${string}`;
2184
- };
2185
- /** A literal value or {expression} to use as a request body when calling the target operation. */
2186
- requestBody?: `$${string}`;
2187
- /** A description of the link. CommonMark syntax MAY be used for rich text representation. */
2188
- description?: string;
2189
- /** A server object to be used by the target operation. */
2190
- server?: ServerObject;
2191
- }
2192
- /**
2193
- * [4.8.21] Header Object
2194
- * The Header Object follows the structure of the Parameter Object with the following changes:
2195
- *
2196
- * 1. `name` MUST NOT be specified, it is given in the corresponding `headers` map.
2197
- * 2. `in` MUST NOT be specified, it is implicitly in `header`.
2198
- * 3. All traits that are affected by the location MUST be applicable to a location of `heade`r (for example, `style`).
2199
- */
2200
- type HeaderObject = Omit<ParameterObject, "name" | "in">;
2201
- /**
2202
- * [4.8.22] Tag Object
2203
- * 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.
2204
- */
2205
- interface TagObject extends Extensable {
2206
- /** REQUIRED. The name of the tag. */
2207
- name: string;
2208
- /** A description for the tag. CommonMark syntax MAY be used for rich text representation. */
2209
- description?: string;
2210
- /** Additional external documentation for this tag. */
2211
- externalDocs?: ExternalDocumentationObject;
2212
- }
2213
- /**
2214
- * [4.8.23] Reference Object
2215
- * 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.
2216
- */
2217
- interface ReferenceObject extends Extensable {
2218
- /** REQUIRED. The reference identifier. This MUST be in the form of a URI. */
2219
- $ref: string;
2220
- /** 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. */
2221
- summary?: string;
2222
- /** 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. */
2223
- description?: string;
2224
- }
2225
- /**
2226
- * [4.8.24] Schema Object
2227
- * 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.
2228
- */
2229
- type SchemaObject = {
2230
- /** 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. */
2231
- xml?: XMLObject; /** Additional external documentation for this schema. */
2232
- externalDocs?: ExternalDocumentationObject; /** @deprecated */
2233
- example?: any;
2234
- title?: string;
2235
- description?: string;
2236
- $comment?: string;
2237
- deprecated?: boolean;
2238
- readOnly?: boolean;
2239
- writeOnly?: boolean;
2240
- enum?: unknown[]; /** Use of this keyword is functionally equivalent to an "enum" (Section 6.1.2) with a single value. */
2241
- const?: unknown;
2242
- default?: unknown;
2243
- format?: string; /** @deprecated in 3.1 (still valid for 3.0) */
2244
- nullable?: boolean;
2245
- oneOf?: (SchemaObject | ReferenceObject)[];
2246
- allOf?: (SchemaObject | ReferenceObject)[];
2247
- anyOf?: (SchemaObject | ReferenceObject)[];
2248
- required?: string[];
2249
- [key: `x-${string}`]: any;
2250
- } & (StringSubtype | NumberSubtype | IntegerSubtype | ArraySubtype | BooleanSubtype | NullSubtype | ObjectSubtype | {
2251
- type: ("string" | "number" | "integer" | "array" | "boolean" | "null" | "object")[];
2252
- });
2253
- interface StringSubtype {
2254
- type: "string" | ["string", "null"];
2255
- enum?: (string | ReferenceObject)[];
2256
- }
2257
- interface NumberSubtype {
2258
- type: "number" | ["number", "null"];
2259
- minimum?: number;
2260
- maximum?: number;
2261
- enum?: (number | ReferenceObject)[];
2262
- }
2263
- interface IntegerSubtype {
2264
- type: "integer" | ["integer", "null"];
2265
- minimum?: number;
2266
- maximum?: number;
2267
- enum?: (number | ReferenceObject)[];
2268
- }
2269
- interface ArraySubtype {
2270
- type: "array" | ["array", "null"];
2271
- prefixItems?: (SchemaObject | ReferenceObject)[];
2272
- items?: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];
2273
- minItems?: number;
2274
- maxItems?: number;
2275
- enum?: (SchemaObject | ReferenceObject)[];
2276
- }
2277
- interface BooleanSubtype {
2278
- type: "boolean" | ["boolean", "null"];
2279
- enum?: (boolean | ReferenceObject)[];
2280
- }
2281
- interface NullSubtype {
2282
- type: "null";
2283
- }
2284
- interface ObjectSubtype {
2285
- type: "object" | ["object", "null"];
2286
- properties?: {
2287
- [name: string]: SchemaObject | ReferenceObject;
2288
- };
2289
- additionalProperties?: boolean | Record<string, never> | SchemaObject | ReferenceObject;
2290
- required?: string[];
2291
- allOf?: (SchemaObject | ReferenceObject)[];
2292
- anyOf?: (SchemaObject | ReferenceObject)[];
2293
- enum?: (SchemaObject | ReferenceObject)[];
2294
- $defs?: $defs;
2295
- }
2296
- /**
2297
- * [4.8.25] Discriminator Object
2298
- * 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.
2299
- */
2300
- interface DiscriminatorObject {
2301
- /** REQUIRED. The name of the property in the payload that will hold the discriminator value. */
2302
- propertyName: string;
2303
- /** An object to hold mappings between payload values and schema names or references. */
2304
- mapping?: Record<string, string>;
2305
- /** If this exists, then a discriminator type should be added to objects matching this path */
2306
- oneOf?: string[];
2307
- }
2308
- /**
2309
- * [4.8.26] XML Object
2310
- * 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.
2311
- */
2312
- interface XMLObject extends Extensable {
2313
- /** 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. */
2314
- name?: string;
2315
- /** The URI of the namespace definition. This MUST be in the form of an absolute URI. */
2316
- namespace?: string;
2317
- /** The prefix to be used for the name. */
2318
- prefix?: string;
2319
- /** Declares whether the property definition translates to an attribute instead of an element. Default value is `false`. */
2320
- attribute?: boolean;
2321
- /** 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`). */
2322
- wrapped?: boolean;
2323
- }
2324
- /**
2325
- * [4.8.27] Security Scheme Object
2326
- * Defines a security scheme that can be used by the operations.
2327
- */
2328
- type SecuritySchemeObject = {
2329
- /** A description for security scheme. CommonMark syntax MAY be used for rich text representation. */description?: string;
2330
- [key: `x-${string}`]: any;
2331
- } & ({
2332
- /** REQUIRED. The type of the security scheme. */type: "apiKey"; /** REQUIRED. The name of the header, query or cookie parameter to be used. */
2333
- name: string; /** REQUIRED. The location of the API key. */
2334
- in: "query" | "header" | "cookie";
2335
- } | {
2336
- /** 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. */
2337
- 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. */
2338
- bearer?: string;
2339
- } | {
2340
- /** REQUIRED. The type of the security scheme. */type: "mutualTLS";
2341
- } | {
2342
- /** REQUIRED. Tye type of the security scheme. */type: "oauth2"; /** REQUIRED. An object containing configuration information for the flow types supported. */
2343
- flows: OAuthFlowsObject;
2344
- } | {
2345
- /** 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. */
2346
- openIdConnectUrl: string;
2347
- });
2348
- /**
2349
- * [4.8.26] OAuth Flows Object
2350
- * Allows configuration of the supported OAuth Flows.
2351
- */
2352
- interface OAuthFlowsObject extends Extensable {
2353
- /** Configuration for the OAuth Implicit flow */
2354
- implicit?: OAuthFlowObject;
2355
- /** Configuration for the OAuth Resource Owner Password flow */
2356
- password?: OAuthFlowObject;
2357
- /** Configuration for the OAuth Client Credentials flow. Previously called `application` in OpenAPI 2.0. */
2358
- clientCredentials?: OAuthFlowObject;
2359
- /** Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0. */
2360
- authorizationCode?: OAuthFlowObject;
2361
- }
2362
- /**
2363
- * [4.8.29] OAuth Flow Object
2364
- * Configuration details for a supported OAuth Flow
2365
- */
2366
- interface OAuthFlowObject extends Extensable {
2367
- /** 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. */
2368
- authorizationUrl: string;
2369
- /** 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. */
2370
- tokenUrl: string;
2371
- /** 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. */
2372
- refreshUrl: string;
2373
- /** 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. */
2374
- scopes: {
2375
- [name: string]: string;
2376
- };
2377
- }
2378
- /**
2379
- * [4.8.30] Security Requirements Object
2380
- * 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.
2381
- */
2382
- type SecurityRequirementObject = { [P in keyof ComponentsObject["securitySchemes"]]?: string[] };
2383
- type $defs = Record<string, SchemaObject>;
647
+ type OpenAPI3 = OpenAPIV3_1.Document & Extensable;
648
+ type OperationObject = OpenAPIV3_1.OperationObject;
2384
649
  type MaybeArray$1<T> = T | T[];
2385
650
  /**
2386
651
  * Route-level metadata attached to event handlers.