nitro-nightly 4.0.0-20251010-091516-7cafddba → 4.0.0-20251030-091344-d4418b98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{_chunks/build2.mjs → _build/build.mjs} +108 -58
- package/dist/_build/build2.mjs +556 -0
- package/dist/_build/info.mjs +1002 -0
- package/dist/_build/prepare.mjs +1511 -0
- package/dist/_build/snapshot.mjs +185 -0
- package/dist/{_chunks/plugin.mjs → _build/vite.mjs} +295 -296
- package/dist/_build/vite2.mjs +149 -0
- package/dist/_chunks/_deps/@jridgewell/gen-mapping.mjs +189 -0
- package/dist/_chunks/_deps/@jridgewell/remapping.mjs +137 -0
- package/dist/_chunks/_deps/@jridgewell/resolve-uri.mjs +231 -0
- package/dist/_chunks/_deps/@jridgewell/sourcemap-codec.mjs +173 -0
- package/dist/_chunks/_deps/@jridgewell/trace-mapping.mjs +170 -0
- package/dist/_chunks/_deps/@pi0/vite-plugin-fullstack.mjs +575 -0
- package/dist/_chunks/_deps/@rollup/plugin-alias.mjs +89 -0
- package/dist/_chunks/_deps/@rollup/plugin-commonjs.mjs +2376 -0
- package/dist/_chunks/{index2.mjs → _deps/@rollup/plugin-inject.mjs} +5 -90
- package/dist/_chunks/_deps/@rollup/plugin-json.mjs +37 -0
- package/dist/_chunks/_deps/@rollup/plugin-node-resolve.mjs +1386 -0
- package/dist/_chunks/_deps/@rollup/plugin-replace.mjs +133 -0
- package/dist/_chunks/_deps/@rollup/pluginutils.mjs +346 -0
- package/dist/_chunks/_deps/acorn.mjs +6225 -0
- package/dist/_chunks/_deps/c12.mjs +510 -0
- package/dist/_chunks/_deps/chokidar.mjs +1428 -0
- package/dist/_chunks/_deps/citty.mjs +460 -0
- package/dist/_chunks/_deps/commondir.mjs +77 -0
- package/dist/_chunks/_deps/compatx.mjs +76 -0
- package/dist/_chunks/_deps/confbox.mjs +300 -0
- package/dist/_chunks/_deps/debug.mjs +885 -0
- package/dist/_chunks/_deps/deepmerge.mjs +147 -0
- package/dist/_chunks/_deps/depd.mjs +550 -0
- package/dist/_chunks/_deps/dot-prop.mjs +282 -0
- package/dist/_chunks/_deps/dotenv.mjs +555 -0
- package/dist/_chunks/_deps/duplexer.mjs +1 -0
- package/dist/_chunks/_deps/ee-first.mjs +104 -0
- package/dist/_chunks/_deps/encodeurl.mjs +69 -0
- package/dist/_chunks/_deps/escape-html.mjs +87 -0
- package/dist/_chunks/_deps/escape-string-regexp.mjs +13 -0
- package/dist/_chunks/_deps/estree-walker.mjs +433 -0
- package/dist/_chunks/_deps/etag.mjs +147 -0
- package/dist/_chunks/_deps/exsolve.mjs +1416 -0
- package/dist/_chunks/_deps/fdir.mjs +569 -0
- package/dist/_chunks/_deps/fresh.mjs +145 -0
- package/dist/_chunks/_deps/function-bind.mjs +106 -0
- package/dist/_chunks/{index4.mjs → _deps/giget.mjs} +21 -776
- package/dist/_chunks/_deps/gzip-size.mjs +19 -0
- package/dist/_chunks/_deps/hasown.mjs +19 -0
- package/dist/_chunks/_deps/http-errors.mjs +307 -0
- package/dist/_chunks/_deps/httpxy.mjs +580 -0
- package/dist/_chunks/_deps/inherits.mjs +57 -0
- package/dist/_chunks/_deps/is-core-module.mjs +596 -0
- package/dist/_chunks/_deps/is-module.mjs +25 -0
- package/dist/_chunks/_deps/is-reference.mjs +31 -0
- package/dist/_chunks/_deps/js-tokens.mjs +411 -0
- package/dist/_chunks/_deps/klona.mjs +137 -0
- package/dist/_chunks/_deps/knitwork.mjs +172 -0
- package/dist/_chunks/_deps/local-pkg.mjs +163 -0
- package/dist/_chunks/_deps/magic-string.mjs +1296 -0
- package/dist/_chunks/_deps/mime-db.mjs +11685 -0
- package/dist/_chunks/_deps/mime-types.mjs +287 -0
- package/dist/_chunks/_deps/mime.mjs +1172 -0
- package/dist/_chunks/_deps/mlly.mjs +2413 -0
- package/dist/_chunks/_deps/ms.mjs +172 -0
- package/dist/_chunks/_deps/node-fetch-native.mjs +3 -0
- package/dist/_chunks/_deps/nypm.mjs +219 -0
- package/dist/_chunks/_deps/on-finished.mjs +246 -0
- package/dist/_chunks/_deps/parseurl.mjs +168 -0
- package/dist/_chunks/_deps/path-parse.mjs +85 -0
- package/dist/_chunks/{pathe.M-eThtNZ.mjs → _deps/pathe.mjs} +48 -1
- package/dist/_chunks/_deps/perfect-debounce.mjs +88 -0
- package/dist/_chunks/_deps/picomatch.mjs +2144 -0
- package/dist/_chunks/_deps/pkg-types.mjs +247 -0
- package/dist/_chunks/{snapshot.mjs → _deps/pretty-bytes.mjs} +1 -105
- package/dist/_chunks/_deps/quansync.mjs +99 -0
- package/dist/_chunks/_deps/range-parser.mjs +171 -0
- package/dist/_chunks/_deps/rc9.mjs +219 -0
- package/dist/_chunks/_deps/readdirp.mjs +245 -0
- package/dist/_chunks/_deps/resolve.mjs +1260 -0
- package/dist/_chunks/_deps/rou3.mjs +326 -0
- package/dist/_chunks/_deps/send.mjs +1022 -0
- package/dist/_chunks/_deps/serve-static.mjs +228 -0
- package/dist/_chunks/_deps/setprototypeof.mjs +26 -0
- package/dist/_chunks/_deps/statuses.mjs +457 -0
- package/dist/_chunks/_deps/std-env.mjs +3 -0
- package/dist/_chunks/_deps/strip-literal.mjs +67 -0
- package/dist/_chunks/_deps/supports-color.mjs +44 -0
- package/dist/_chunks/_deps/tinyexec.mjs +552 -0
- package/dist/_chunks/_deps/tinyglobby.mjs +293 -0
- package/dist/_chunks/_deps/toidentifier.mjs +41 -0
- package/dist/_chunks/_deps/ultrahtml.mjs +3 -0
- package/dist/_chunks/_deps/unimport.mjs +2267 -0
- package/dist/_chunks/_deps/unplugin-utils.mjs +65 -0
- package/dist/_chunks/_deps/unplugin.mjs +1294 -0
- package/dist/_chunks/_deps/untyped.mjs +375 -0
- package/dist/_chunks/{info.mjs → _deps/unwasm.mjs} +8 -4206
- package/dist/_chunks/_deps/webpack-virtual-modules.mjs +360 -0
- package/dist/_chunks/_presets/_all.mjs +59 -0
- package/dist/_chunks/_presets/_nitro.mjs +74 -0
- package/dist/_chunks/_presets/_resolve.mjs +64 -0
- package/dist/_chunks/_presets/_static.mjs +69 -0
- package/dist/_chunks/_presets/_types.mjs +3 -0
- package/dist/_chunks/_presets/_utils.mjs +31 -0
- package/dist/_chunks/_presets/alwaysdata.mjs +17 -0
- package/dist/_chunks/_presets/aws-amplify.mjs +111 -0
- package/dist/_chunks/_presets/aws-lambda.mjs +23 -0
- package/dist/_chunks/_presets/azure.mjs +162 -0
- package/dist/_chunks/_presets/bun.mjs +19 -0
- package/dist/_chunks/_presets/cleavr.mjs +15 -0
- package/dist/_chunks/_presets/cloudflare.mjs +608 -0
- package/dist/_chunks/_presets/deno.mjs +196 -0
- package/dist/_chunks/_presets/digitalocean.mjs +14 -0
- package/dist/_chunks/_presets/firebase.mjs +47 -0
- package/dist/_chunks/_presets/flightcontrol.mjs +14 -0
- package/dist/_chunks/_presets/genezio.mjs +13 -0
- package/dist/_chunks/_presets/heroku.mjs +14 -0
- package/dist/_chunks/_presets/iis.mjs +194 -0
- package/dist/_chunks/_presets/index.mjs +62 -0
- package/dist/_chunks/_presets/koyeb.mjs +14 -0
- package/dist/_chunks/_presets/netlify.mjs +241 -0
- package/dist/_chunks/_presets/node.mjs +54 -0
- package/dist/_chunks/_presets/platform.mjs +14 -0
- package/dist/_chunks/_presets/render.mjs +14 -0
- package/dist/_chunks/_presets/standard.mjs +23 -0
- package/dist/_chunks/_presets/stormkit.mjs +18 -0
- package/dist/_chunks/_presets/vercel.mjs +375 -0
- package/dist/_chunks/_presets/winterjs.mjs +22 -0
- package/dist/_chunks/_presets/zeabur.mjs +69 -0
- package/dist/_chunks/_presets/zerops.mjs +27 -0
- package/dist/_chunks/app.mjs +9 -19206
- package/dist/_chunks/{index3.mjs → builder.mjs} +560 -970
- package/dist/_chunks/server.mjs +6 -4
- package/dist/{cli → _cli}/build.mjs +3 -8
- package/dist/{cli → _cli}/dev.mjs +38 -12
- package/dist/{cli/index2.mjs → _cli/index.mjs} +1 -2
- package/dist/{cli → _cli}/list.mjs +3 -4
- package/dist/{cli → _cli}/prepare.mjs +3 -4
- package/dist/{cli → _cli}/run.mjs +3 -4
- package/dist/{index.d.mts → builder.d.mts} +11 -11
- package/dist/builder.mjs +117 -0
- package/dist/cli/index.mjs +7 -464
- package/dist/node_modules/@speed-highlight/core/dist/index.js +1 -1
- package/dist/node_modules/@speed-highlight/core/dist/terminal.js +1 -1
- package/dist/node_modules/@speed-highlight/core/package.json +7 -3
- package/dist/node_modules/cookie-es/dist/index.mjs +262 -0
- package/dist/node_modules/cookie-es/package.json +37 -0
- package/dist/node_modules/hookable/dist/index.mjs +243 -266
- package/dist/node_modules/hookable/package.json +29 -26
- package/dist/node_modules/rendu/dist/index.mjs +380 -0
- package/dist/node_modules/rendu/package.json +47 -0
- package/dist/presets/_nitro/runtime/nitro-dev.mjs +4 -7
- package/dist/presets/_nitro/runtime/nitro-prerenderer.mjs +5 -4
- package/dist/presets/azure/runtime/azure-swa.mjs +1 -1
- package/dist/presets/cloudflare/runtime/_module-handler.mjs +7 -6
- package/dist/presets/cloudflare/runtime/cloudflare-durable.mjs +4 -5
- package/dist/presets/cloudflare/runtime/plugin.dev.mjs +7 -10
- package/dist/presets/cloudflare/runtime/shims/workers.dev.d.mts +21 -0
- package/dist/presets/cloudflare/runtime/shims/workers.dev.mjs +27 -0
- package/dist/presets/node/runtime/node-server.mjs +1 -1
- package/dist/runtime/index.d.mts +1 -1
- package/dist/runtime/index.mjs +1 -1
- package/dist/runtime/internal/app.d.mts +3 -1
- package/dist/runtime/internal/app.mjs +90 -64
- package/dist/runtime/internal/error/prod.d.mts +3 -2
- package/dist/runtime/internal/error/prod.mjs +9 -13
- package/dist/runtime/internal/renderer.mjs +4 -4
- package/dist/runtime/internal/routes/dev-tasks.d.mts +30 -2
- package/dist/runtime/internal/shutdown.d.mts +1 -2
- package/dist/runtime/internal/shutdown.mjs +3 -2
- package/dist/runtime/internal/task.mjs +1 -2
- package/dist/types/index.d.mts +1603 -10
- package/dist/vite.d.mts +5 -0
- package/dist/vite.mjs +94 -30
- package/lib/index.mjs +1 -0
- package/lib/indexd.mts +1 -0
- package/lib/runtime/meta.mjs +35 -0
- package/package.json +40 -41
- package/dist/_chunks/build.mjs +0 -84
- package/dist/_chunks/build3.mjs +0 -6452
- package/dist/_chunks/detect-acorn.mjs +0 -503
- package/dist/_chunks/index.mjs +0 -22242
- package/dist/_chunks/json5.mjs +0 -68
- package/dist/_chunks/jsonc.mjs +0 -51
- package/dist/_chunks/toml.mjs +0 -259
- package/dist/_chunks/yaml.mjs +0 -86
- package/dist/index.mjs +0 -55
- package/dist/node_modules/klona/dist/index.mjs +0 -81
- package/dist/node_modules/klona/full/index.mjs +0 -53
- package/dist/node_modules/klona/package.json +0 -74
- package/dist/node_modules/std-env/dist/index.mjs +0 -1
- package/dist/node_modules/std-env/package.json +0 -46
- package/dist/presets.mjs +0 -2460
- package/dist/runtime/internal/debug.d.mts +0 -2
- package/dist/runtime/internal/debug.mjs +0 -5
- package/lib/runtime-meta.mjs +0 -38
- /package/dist/{cli → _cli}/common.mjs +0 -0
- /package/lib/{runtime-meta.d.mts → runtime/meta.d.mts} +0 -0
package/dist/types/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HTTPMethod, HTTPEvent,
|
|
1
|
+
import { HTTPMethod, HTTPEvent, H3EventContext, H3Core, HTTPHandler, HTTPError, ProxyOptions, Middleware } from 'h3';
|
|
2
2
|
import { FetchRequest, FetchOptions, FetchResponse } from 'ofetch';
|
|
3
|
-
import { Hookable, NestedHooks } from 'hookable';
|
|
3
|
+
import { HookableCore, Hookable, NestedHooks } from 'hookable';
|
|
4
4
|
import { ServerRequestContext, ServerRequest } from 'srvx';
|
|
5
5
|
import { Jiti, JitiOptions } from 'jiti';
|
|
6
6
|
import { Stats } from 'fs';
|
|
@@ -9,14 +9,14 @@ import { ConsolaInstance, LogLevel } from 'consola';
|
|
|
9
9
|
import { ConnectorName } from 'db0';
|
|
10
10
|
import * as stream from 'node:stream';
|
|
11
11
|
import { Duplex } from 'node:stream';
|
|
12
|
-
import {
|
|
12
|
+
import { ScheduledController, ExecutionContext, ForwardableEmailMessage, MessageBatch, TraceItem } from '@cloudflare/workers-types';
|
|
13
|
+
import { DurableObject } from 'cloudflare:workers';
|
|
13
14
|
import { CompilerOptions, TypeAcquisition } from 'typescript';
|
|
14
15
|
import { Preset as Preset$1 } from 'unenv';
|
|
15
16
|
import { Storage, BuiltinDriverName } from 'unstorage';
|
|
16
17
|
import { IncomingMessage, OutgoingMessage } from 'node:http';
|
|
17
18
|
import { TransformOptions, Loader } from 'esbuild';
|
|
18
19
|
import { InputOptions, OutputOptions } from 'rollup';
|
|
19
|
-
import { ProviderName } from 'std-env';
|
|
20
20
|
import { ExternalsPluginOptions } from 'nf3';
|
|
21
21
|
export { ExternalsPluginOptions as NodeExternalsOptions } from 'nf3';
|
|
22
22
|
|
|
@@ -145,13 +145,16 @@ interface CachedEventHandlerOptions extends Omit<CacheOptions<ResponseCacheEntry
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
interface NitroApp {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
fetch: (req: Request) => Response | Promise<Response>;
|
|
149
|
+
request: (req: string | URL | Request, init?: RequestInit, context?: ServerRequestContext | H3EventContext) => Promise<Response>;
|
|
150
|
+
h3?: H3Core;
|
|
151
|
+
hooks?: HookableCore<NitroRuntimeHooks>;
|
|
151
152
|
captureError: CaptureError;
|
|
152
153
|
}
|
|
153
154
|
interface NitroAppPlugin {
|
|
154
|
-
(nitro: NitroApp
|
|
155
|
+
(nitro: NitroApp & {
|
|
156
|
+
hooks: NonNullable<NitroApp["hooks"]>;
|
|
157
|
+
}): void;
|
|
155
158
|
}
|
|
156
159
|
interface NitroAsyncContext {
|
|
157
160
|
request: ServerRequest;
|
|
@@ -766,6 +769,1587 @@ interface ProxyServerOptions {
|
|
|
766
769
|
buffer?: stream.Stream;
|
|
767
770
|
}
|
|
768
771
|
|
|
772
|
+
type AmplifyImageSettings = {
|
|
773
|
+
/** Array of supported image widths */
|
|
774
|
+
sizes: number[];
|
|
775
|
+
/**
|
|
776
|
+
* Array of allowed external domains that can use Image Optimization.
|
|
777
|
+
* Leave empty for only allowing the deployment domain to use Image Optimization.
|
|
778
|
+
*/
|
|
779
|
+
domains: string[];
|
|
780
|
+
/**
|
|
781
|
+
* Array of allowed external patterns that can use Image Optimization.
|
|
782
|
+
* Similar to `domains` but provides more control with RegExp.
|
|
783
|
+
*/
|
|
784
|
+
remotePatterns: {
|
|
785
|
+
/** The protocol of the allowed remote pattern. Can be `http` or `https`. */
|
|
786
|
+
protocol?: "http" | "https";
|
|
787
|
+
/**
|
|
788
|
+
* The hostname of the allowed remote pattern.
|
|
789
|
+
* Can be literal or wildcard. Single `*` matches a single subdomain.
|
|
790
|
+
* Double `**` matches any number of subdomains.
|
|
791
|
+
* We will disallow blanket wildcards of `**` with nothing else.
|
|
792
|
+
*/
|
|
793
|
+
hostname: string;
|
|
794
|
+
/** The port of the allowed remote pattern. */
|
|
795
|
+
port?: string;
|
|
796
|
+
/** The pathname of the allowed remote pattern. */
|
|
797
|
+
pathname?: string;
|
|
798
|
+
}[];
|
|
799
|
+
/** Array of allowed output image formats. */
|
|
800
|
+
formats: ("image/avif" | "image/webp" | "image/gif" | "image/png" | "image/jpeg")[];
|
|
801
|
+
/** Cache duration (in seconds) for the optimized images. */
|
|
802
|
+
minimumCacheTTL: number;
|
|
803
|
+
/** Allow SVG input image URLs. This is disabled by default for security purposes. */
|
|
804
|
+
dangerouslyAllowSVG: boolean;
|
|
805
|
+
};
|
|
806
|
+
interface AWSAmplifyOptions {
|
|
807
|
+
catchAllStaticFallback?: boolean;
|
|
808
|
+
imageOptimization?: {
|
|
809
|
+
path?: string;
|
|
810
|
+
cacheControl?: string;
|
|
811
|
+
};
|
|
812
|
+
imageSettings?: AmplifyImageSettings;
|
|
813
|
+
runtime?: "nodejs20.x" | "nodejs22.x";
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
interface AwsLambdaOptions {
|
|
817
|
+
streaming?: boolean;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
interface AzureOptions {
|
|
821
|
+
config?: {
|
|
822
|
+
platform?: {
|
|
823
|
+
apiRuntime?: string;
|
|
824
|
+
[key: string]: unknown;
|
|
825
|
+
};
|
|
826
|
+
navigationFallback?: {
|
|
827
|
+
rewrite?: string;
|
|
828
|
+
[key: string]: unknown;
|
|
829
|
+
};
|
|
830
|
+
[key: string]: unknown;
|
|
831
|
+
};
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Copyright (c) 2020 Cloudflare, Inc. <wrangler@cloudflare.com>
|
|
836
|
+
* https://github.com/cloudflare/workers-sdk/blob/main/LICENSE-MIT
|
|
837
|
+
* https://github.com/cloudflare/workers-sdk/blob/main/LICENSE-APACHE
|
|
838
|
+
*
|
|
839
|
+
* Source: https://github.com/cloudflare/workers-sdk/blob/main/packages/wrangler/src/config/environment.ts
|
|
840
|
+
*/
|
|
841
|
+
/**
|
|
842
|
+
* The `Environment` interface declares all the configuration fields that
|
|
843
|
+
* can be specified for an environment.
|
|
844
|
+
*
|
|
845
|
+
* This could be the top-level default environment, or a specific named environment.
|
|
846
|
+
*/
|
|
847
|
+
interface Environment extends EnvironmentInheritable, EnvironmentNonInheritable {
|
|
848
|
+
}
|
|
849
|
+
type SimpleRoute = string;
|
|
850
|
+
type ZoneIdRoute = {
|
|
851
|
+
pattern: string;
|
|
852
|
+
zone_id: string;
|
|
853
|
+
custom_domain?: boolean;
|
|
854
|
+
};
|
|
855
|
+
type ZoneNameRoute = {
|
|
856
|
+
pattern: string;
|
|
857
|
+
zone_name: string;
|
|
858
|
+
custom_domain?: boolean;
|
|
859
|
+
};
|
|
860
|
+
type CustomDomainRoute = {
|
|
861
|
+
pattern: string;
|
|
862
|
+
custom_domain: boolean;
|
|
863
|
+
};
|
|
864
|
+
type Route$1 = SimpleRoute | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
|
|
865
|
+
/**
|
|
866
|
+
* Configuration in wrangler for Cloudchamber
|
|
867
|
+
*/
|
|
868
|
+
type CloudchamberConfig = {
|
|
869
|
+
image?: string;
|
|
870
|
+
location?: string;
|
|
871
|
+
instance_type?: "dev" | "basic" | "standard";
|
|
872
|
+
vcpu?: number;
|
|
873
|
+
memory?: string;
|
|
874
|
+
ipv4?: boolean;
|
|
875
|
+
};
|
|
876
|
+
/**
|
|
877
|
+
* Configuration for a container application
|
|
878
|
+
*/
|
|
879
|
+
type ContainerApp = {
|
|
880
|
+
/**
|
|
881
|
+
* Name of the application
|
|
882
|
+
* @optional Defaults to `worker_name-class_name` if not specified.
|
|
883
|
+
*/
|
|
884
|
+
name?: string;
|
|
885
|
+
/**
|
|
886
|
+
* Number of application instances
|
|
887
|
+
* @deprecated
|
|
888
|
+
* @hidden
|
|
889
|
+
*/
|
|
890
|
+
instances?: number;
|
|
891
|
+
/**
|
|
892
|
+
* Number of maximum application instances.
|
|
893
|
+
* @optional
|
|
894
|
+
*/
|
|
895
|
+
max_instances?: number;
|
|
896
|
+
/**
|
|
897
|
+
* The path to a Dockerfile, or an image URI for the Cloudflare registry.
|
|
898
|
+
*/
|
|
899
|
+
image: string;
|
|
900
|
+
/**
|
|
901
|
+
* Build context of the application.
|
|
902
|
+
* @optional - defaults to the directory of `image`.
|
|
903
|
+
*/
|
|
904
|
+
image_build_context?: string;
|
|
905
|
+
/**
|
|
906
|
+
* Image variables to be passed along the image at build time.
|
|
907
|
+
* @optional
|
|
908
|
+
*/
|
|
909
|
+
image_vars?: Record<string, string>;
|
|
910
|
+
/**
|
|
911
|
+
* The class name of the Durable Object the container is connected to.
|
|
912
|
+
*/
|
|
913
|
+
class_name: string;
|
|
914
|
+
/**
|
|
915
|
+
* The scheduling policy of the application
|
|
916
|
+
* @optional
|
|
917
|
+
* @default "default"
|
|
918
|
+
*/
|
|
919
|
+
scheduling_policy?: "regional" | "moon" | "default";
|
|
920
|
+
/**
|
|
921
|
+
* The instance type to be used for the container. This sets preconfigured options for vcpu and memory
|
|
922
|
+
* @optional
|
|
923
|
+
*/
|
|
924
|
+
instance_type?: "dev" | "basic" | "standard";
|
|
925
|
+
/**
|
|
926
|
+
* @deprecated Use top level `containers` fields instead.
|
|
927
|
+
* `configuration.image` should be `image`
|
|
928
|
+
* `configuration.disk` should be set via `instance_type`
|
|
929
|
+
* @hidden
|
|
930
|
+
*/
|
|
931
|
+
configuration?: {
|
|
932
|
+
image?: string;
|
|
933
|
+
labels?: {
|
|
934
|
+
name: string;
|
|
935
|
+
value: string;
|
|
936
|
+
}[];
|
|
937
|
+
secrets?: {
|
|
938
|
+
name: string;
|
|
939
|
+
type: "env";
|
|
940
|
+
secret: string;
|
|
941
|
+
}[];
|
|
942
|
+
disk?: {
|
|
943
|
+
size: string;
|
|
944
|
+
};
|
|
945
|
+
};
|
|
946
|
+
/**
|
|
947
|
+
* Scheduling constraints
|
|
948
|
+
* @hidden
|
|
949
|
+
*/
|
|
950
|
+
constraints?: {
|
|
951
|
+
regions?: string[];
|
|
952
|
+
cities?: string[];
|
|
953
|
+
tier?: number;
|
|
954
|
+
};
|
|
955
|
+
/**
|
|
956
|
+
* @deprecated use the `class_name` field instead.
|
|
957
|
+
* @hidden
|
|
958
|
+
*/
|
|
959
|
+
durable_objects?: {
|
|
960
|
+
namespace_id: string;
|
|
961
|
+
};
|
|
962
|
+
/**
|
|
963
|
+
* How a rollout should be done, defining the size of it
|
|
964
|
+
* @optional
|
|
965
|
+
* @default 25
|
|
966
|
+
* */
|
|
967
|
+
rollout_step_percentage?: number;
|
|
968
|
+
/**
|
|
969
|
+
* How a rollout should be created. It supports the following modes:
|
|
970
|
+
* - full_auto: The container application will be rolled out fully automatically.
|
|
971
|
+
* - none: The container application won't have a roll out or update.
|
|
972
|
+
* - manual: The container application will be rollout fully by manually actioning progress steps.
|
|
973
|
+
* @optional
|
|
974
|
+
* @default "full_auto"
|
|
975
|
+
*/
|
|
976
|
+
rollout_kind?: "full_auto" | "none" | "full_manual";
|
|
977
|
+
};
|
|
978
|
+
/**
|
|
979
|
+
* Configuration in wrangler for Durable Object Migrations
|
|
980
|
+
*/
|
|
981
|
+
type DurableObjectMigration = {
|
|
982
|
+
/** A unique identifier for this migration. */
|
|
983
|
+
tag: string;
|
|
984
|
+
/** The new Durable Objects being defined. */
|
|
985
|
+
new_classes?: string[];
|
|
986
|
+
/** The new SQLite Durable Objects being defined. */
|
|
987
|
+
new_sqlite_classes?: string[];
|
|
988
|
+
/** The Durable Objects being renamed. */
|
|
989
|
+
renamed_classes?: {
|
|
990
|
+
from: string;
|
|
991
|
+
to: string;
|
|
992
|
+
}[];
|
|
993
|
+
/** The Durable Objects being removed. */
|
|
994
|
+
deleted_classes?: string[];
|
|
995
|
+
};
|
|
996
|
+
/**
|
|
997
|
+
* The `EnvironmentInheritable` interface declares all the configuration fields for an environment
|
|
998
|
+
* that can be inherited (and overridden) from the top-level environment.
|
|
999
|
+
*/
|
|
1000
|
+
interface EnvironmentInheritable {
|
|
1001
|
+
/**
|
|
1002
|
+
* The name of your Worker. Alphanumeric + dashes only.
|
|
1003
|
+
*
|
|
1004
|
+
* @inheritable
|
|
1005
|
+
*/
|
|
1006
|
+
name: string | undefined;
|
|
1007
|
+
/**
|
|
1008
|
+
* This is the ID of the account associated with your zone.
|
|
1009
|
+
* You might have more than one account, so make sure to use
|
|
1010
|
+
* the ID of the account associated with the zone/route you
|
|
1011
|
+
* provide, if you provide one. It can also be specified through
|
|
1012
|
+
* the CLOUDFLARE_ACCOUNT_ID environment variable.
|
|
1013
|
+
*
|
|
1014
|
+
* @inheritable
|
|
1015
|
+
*/
|
|
1016
|
+
account_id: string | undefined;
|
|
1017
|
+
/**
|
|
1018
|
+
* A date in the form yyyy-mm-dd, which will be used to determine
|
|
1019
|
+
* which version of the Workers runtime is used.
|
|
1020
|
+
*
|
|
1021
|
+
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
|
|
1022
|
+
*
|
|
1023
|
+
* @inheritable
|
|
1024
|
+
*/
|
|
1025
|
+
compatibility_date: string | undefined;
|
|
1026
|
+
/**
|
|
1027
|
+
* A list of flags that enable features from upcoming features of
|
|
1028
|
+
* the Workers runtime, usually used together with compatibility_date.
|
|
1029
|
+
*
|
|
1030
|
+
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
|
|
1031
|
+
*
|
|
1032
|
+
* @default []
|
|
1033
|
+
* @inheritable
|
|
1034
|
+
*/
|
|
1035
|
+
compatibility_flags: string[];
|
|
1036
|
+
/**
|
|
1037
|
+
* The entrypoint/path to the JavaScript file that will be executed.
|
|
1038
|
+
*
|
|
1039
|
+
* @inheritable
|
|
1040
|
+
*/
|
|
1041
|
+
main: string | undefined;
|
|
1042
|
+
/**
|
|
1043
|
+
* If true then Wrangler will traverse the file tree below `base_dir`;
|
|
1044
|
+
* Any files that match `rules` will be included in the deployed Worker.
|
|
1045
|
+
* Defaults to true if `no_bundle` is true, otherwise false.
|
|
1046
|
+
*
|
|
1047
|
+
* @inheritable
|
|
1048
|
+
*/
|
|
1049
|
+
find_additional_modules: boolean | undefined;
|
|
1050
|
+
/**
|
|
1051
|
+
* Determines whether Wrangler will preserve bundled file names.
|
|
1052
|
+
* Defaults to false.
|
|
1053
|
+
* If left unset, files will be named using the pattern ${fileHash}-${basename},
|
|
1054
|
+
* for example, `34de60b44167af5c5a709e62a4e20c4f18c9e3b6-favicon.ico`.
|
|
1055
|
+
*
|
|
1056
|
+
* @inheritable
|
|
1057
|
+
*/
|
|
1058
|
+
preserve_file_names: boolean | undefined;
|
|
1059
|
+
/**
|
|
1060
|
+
* The directory in which module rules should be evaluated when including additional files into a Worker deployment.
|
|
1061
|
+
* This defaults to the directory containing the `main` entry point of the Worker if not specified.
|
|
1062
|
+
*
|
|
1063
|
+
* @inheritable
|
|
1064
|
+
*/
|
|
1065
|
+
base_dir: string | undefined;
|
|
1066
|
+
/**
|
|
1067
|
+
* Whether we use <name>.<subdomain>.workers.dev to
|
|
1068
|
+
* test and deploy your Worker.
|
|
1069
|
+
*
|
|
1070
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
|
|
1071
|
+
*
|
|
1072
|
+
* @default true
|
|
1073
|
+
* @breaking
|
|
1074
|
+
* @inheritable
|
|
1075
|
+
*/
|
|
1076
|
+
workers_dev: boolean | undefined;
|
|
1077
|
+
/**
|
|
1078
|
+
* Whether we use <version>-<name>.<subdomain>.workers.dev to
|
|
1079
|
+
* serve Preview URLs for your Worker.
|
|
1080
|
+
*
|
|
1081
|
+
* @default true
|
|
1082
|
+
* @inheritable
|
|
1083
|
+
*/
|
|
1084
|
+
preview_urls: boolean | undefined;
|
|
1085
|
+
/**
|
|
1086
|
+
* A list of routes that your Worker should be published to.
|
|
1087
|
+
* Only one of `routes` or `route` is required.
|
|
1088
|
+
*
|
|
1089
|
+
* Only required when workers_dev is false, and there's no scheduled Worker (see `triggers`)
|
|
1090
|
+
*
|
|
1091
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
|
|
1092
|
+
*
|
|
1093
|
+
* @inheritable
|
|
1094
|
+
*/
|
|
1095
|
+
routes: Route$1[] | undefined;
|
|
1096
|
+
/**
|
|
1097
|
+
* A route that your Worker should be published to. Literally
|
|
1098
|
+
* the same as routes, but only one.
|
|
1099
|
+
* Only one of `routes` or `route` is required.
|
|
1100
|
+
*
|
|
1101
|
+
* Only required when workers_dev is false, and there's no scheduled Worker
|
|
1102
|
+
*
|
|
1103
|
+
* @inheritable
|
|
1104
|
+
*/
|
|
1105
|
+
route: Route$1 | undefined;
|
|
1106
|
+
/**
|
|
1107
|
+
* Path to a custom tsconfig
|
|
1108
|
+
*
|
|
1109
|
+
* @inheritable
|
|
1110
|
+
*/
|
|
1111
|
+
tsconfig: string | undefined;
|
|
1112
|
+
/**
|
|
1113
|
+
* The function to use to replace jsx syntax.
|
|
1114
|
+
*
|
|
1115
|
+
* @default "React.createElement"
|
|
1116
|
+
* @inheritable
|
|
1117
|
+
*/
|
|
1118
|
+
jsx_factory: string;
|
|
1119
|
+
/**
|
|
1120
|
+
* The function to use to replace jsx fragment syntax.
|
|
1121
|
+
*
|
|
1122
|
+
* @default "React.Fragment"
|
|
1123
|
+
* @inheritable
|
|
1124
|
+
*/
|
|
1125
|
+
jsx_fragment: string;
|
|
1126
|
+
/**
|
|
1127
|
+
* A list of migrations that should be uploaded with your Worker.
|
|
1128
|
+
*
|
|
1129
|
+
* These define changes in your Durable Object declarations.
|
|
1130
|
+
*
|
|
1131
|
+
* More details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations
|
|
1132
|
+
*
|
|
1133
|
+
* @default []
|
|
1134
|
+
* @inheritable
|
|
1135
|
+
*/
|
|
1136
|
+
migrations: DurableObjectMigration[];
|
|
1137
|
+
/**
|
|
1138
|
+
* "Cron" definitions to trigger a Worker's "scheduled" function.
|
|
1139
|
+
*
|
|
1140
|
+
* Lets you call Workers periodically, much like a cron job.
|
|
1141
|
+
*
|
|
1142
|
+
* More details here https://developers.cloudflare.com/workers/platform/cron-triggers
|
|
1143
|
+
*
|
|
1144
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
|
|
1145
|
+
*
|
|
1146
|
+
* @default {crons: undefined}
|
|
1147
|
+
* @inheritable
|
|
1148
|
+
*/
|
|
1149
|
+
triggers: {
|
|
1150
|
+
crons: string[] | undefined;
|
|
1151
|
+
};
|
|
1152
|
+
/**
|
|
1153
|
+
* Specify limits for runtime behavior.
|
|
1154
|
+
* Only supported for the "standard" Usage Model
|
|
1155
|
+
*
|
|
1156
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#limits
|
|
1157
|
+
*
|
|
1158
|
+
* @inheritable
|
|
1159
|
+
*/
|
|
1160
|
+
limits: UserLimits | undefined;
|
|
1161
|
+
/**
|
|
1162
|
+
* An ordered list of rules that define which modules to import,
|
|
1163
|
+
* and what type to import them as. You will need to specify rules
|
|
1164
|
+
* to use Text, Data, and CompiledWasm modules, or when you wish to
|
|
1165
|
+
* have a .js file be treated as an ESModule instead of CommonJS.
|
|
1166
|
+
*
|
|
1167
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#bundling
|
|
1168
|
+
*
|
|
1169
|
+
* @inheritable
|
|
1170
|
+
*/
|
|
1171
|
+
rules: Rule[];
|
|
1172
|
+
/**
|
|
1173
|
+
* Configures a custom build step to be run by Wrangler when building your Worker.
|
|
1174
|
+
*
|
|
1175
|
+
* Refer to the [custom builds documentation](https://developers.cloudflare.com/workers/cli-wrangler/configuration#build)
|
|
1176
|
+
* for more details.
|
|
1177
|
+
*
|
|
1178
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#custom-builds
|
|
1179
|
+
*
|
|
1180
|
+
* @default {watch_dir:"./src"}
|
|
1181
|
+
*/
|
|
1182
|
+
build: {
|
|
1183
|
+
/** 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. */
|
|
1184
|
+
command?: string;
|
|
1185
|
+
/** The directory in which the command is executed. */
|
|
1186
|
+
cwd?: string;
|
|
1187
|
+
/** The directory to watch for changes while using wrangler dev, defaults to the current working directory */
|
|
1188
|
+
watch_dir?: string | string[];
|
|
1189
|
+
};
|
|
1190
|
+
/**
|
|
1191
|
+
* Skip internal build steps and directly deploy script
|
|
1192
|
+
* @inheritable
|
|
1193
|
+
*/
|
|
1194
|
+
no_bundle: boolean | undefined;
|
|
1195
|
+
/**
|
|
1196
|
+
* Minify the script before uploading.
|
|
1197
|
+
* @inheritable
|
|
1198
|
+
*/
|
|
1199
|
+
minify: boolean | undefined;
|
|
1200
|
+
/**
|
|
1201
|
+
* Set the `name` property to the original name for functions and classes renamed during minification.
|
|
1202
|
+
*
|
|
1203
|
+
* See https://esbuild.github.io/api/#keep-names
|
|
1204
|
+
*
|
|
1205
|
+
* @default true
|
|
1206
|
+
* @inheritable
|
|
1207
|
+
*/
|
|
1208
|
+
keep_names: boolean | undefined;
|
|
1209
|
+
/**
|
|
1210
|
+
* Designates this Worker as an internal-only "first-party" Worker.
|
|
1211
|
+
*
|
|
1212
|
+
* @inheritable
|
|
1213
|
+
*/
|
|
1214
|
+
first_party_worker: boolean | undefined;
|
|
1215
|
+
/**
|
|
1216
|
+
* List of bindings that you will send to logfwdr
|
|
1217
|
+
*
|
|
1218
|
+
* @default {bindings:[]}
|
|
1219
|
+
* @inheritable
|
|
1220
|
+
*/
|
|
1221
|
+
logfwdr: {
|
|
1222
|
+
bindings: {
|
|
1223
|
+
/** The binding name used to refer to logfwdr */
|
|
1224
|
+
name: string;
|
|
1225
|
+
/** The destination for this logged message */
|
|
1226
|
+
destination: string;
|
|
1227
|
+
}[];
|
|
1228
|
+
};
|
|
1229
|
+
/**
|
|
1230
|
+
* Send Trace Events from this Worker to Workers Logpush.
|
|
1231
|
+
*
|
|
1232
|
+
* This will not configure a corresponding Logpush job automatically.
|
|
1233
|
+
*
|
|
1234
|
+
* For more information about Workers Logpush, see:
|
|
1235
|
+
* https://blog.cloudflare.com/logpush-for-workers/
|
|
1236
|
+
*
|
|
1237
|
+
* @inheritable
|
|
1238
|
+
*/
|
|
1239
|
+
logpush: boolean | undefined;
|
|
1240
|
+
/**
|
|
1241
|
+
* Include source maps when uploading this worker.
|
|
1242
|
+
*
|
|
1243
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#source-maps
|
|
1244
|
+
*
|
|
1245
|
+
* @inheritable
|
|
1246
|
+
*/
|
|
1247
|
+
upload_source_maps: boolean | undefined;
|
|
1248
|
+
/**
|
|
1249
|
+
* Specify how the Worker should be located to minimize round-trip time.
|
|
1250
|
+
*
|
|
1251
|
+
* More details: https://developers.cloudflare.com/workers/platform/smart-placement/
|
|
1252
|
+
*
|
|
1253
|
+
* @inheritable
|
|
1254
|
+
*/
|
|
1255
|
+
placement: {
|
|
1256
|
+
mode: "off" | "smart";
|
|
1257
|
+
hint?: string;
|
|
1258
|
+
} | undefined;
|
|
1259
|
+
/**
|
|
1260
|
+
* Specify the directory of static assets to deploy/serve
|
|
1261
|
+
*
|
|
1262
|
+
* More details at https://developers.cloudflare.com/workers/frameworks/
|
|
1263
|
+
*
|
|
1264
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
|
|
1265
|
+
*
|
|
1266
|
+
* @inheritable
|
|
1267
|
+
*/
|
|
1268
|
+
assets: Assets | undefined;
|
|
1269
|
+
/**
|
|
1270
|
+
* Specify the observability behavior of the Worker.
|
|
1271
|
+
*
|
|
1272
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
|
|
1273
|
+
*
|
|
1274
|
+
* @inheritable
|
|
1275
|
+
*/
|
|
1276
|
+
observability: Observability | undefined;
|
|
1277
|
+
/**
|
|
1278
|
+
* Specify the compliance region mode of the Worker.
|
|
1279
|
+
*
|
|
1280
|
+
* Although if the user does not specify a compliance region, the default is `public`,
|
|
1281
|
+
* it can be set to `undefined` in configuration to delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable.
|
|
1282
|
+
*/
|
|
1283
|
+
compliance_region: "public" | "fedramp_high" | undefined;
|
|
1284
|
+
}
|
|
1285
|
+
type DurableObjectBindings = {
|
|
1286
|
+
/** The name of the binding used to refer to the Durable Object */
|
|
1287
|
+
name: string;
|
|
1288
|
+
/** The exported class name of the Durable Object */
|
|
1289
|
+
class_name: string;
|
|
1290
|
+
/** The script where the Durable Object is defined (if it's external to this Worker) */
|
|
1291
|
+
script_name?: string;
|
|
1292
|
+
/** The service environment of the script_name to bind to */
|
|
1293
|
+
environment?: string;
|
|
1294
|
+
}[];
|
|
1295
|
+
type WorkflowBinding = {
|
|
1296
|
+
/** The name of the binding used to refer to the Workflow */
|
|
1297
|
+
binding: string;
|
|
1298
|
+
/** The name of the Workflow */
|
|
1299
|
+
name: string;
|
|
1300
|
+
/** The exported class name of the Workflow */
|
|
1301
|
+
class_name: string;
|
|
1302
|
+
/** The script where the Workflow is defined (if it's external to this Worker) */
|
|
1303
|
+
script_name?: string;
|
|
1304
|
+
/** Whether the Workflow should be remote or not (only available under `--x-remote-bindings`) */
|
|
1305
|
+
experimental_remote?: boolean;
|
|
1306
|
+
};
|
|
1307
|
+
/**
|
|
1308
|
+
* The `EnvironmentNonInheritable` interface declares all the configuration fields for an environment
|
|
1309
|
+
* that cannot be inherited from the top-level environment, and must be defined specifically.
|
|
1310
|
+
*
|
|
1311
|
+
* If any of these fields are defined at the top-level then they should also be specifically defined
|
|
1312
|
+
* for each named environment.
|
|
1313
|
+
*/
|
|
1314
|
+
interface EnvironmentNonInheritable {
|
|
1315
|
+
/**
|
|
1316
|
+
* A map of values to substitute when deploying your Worker.
|
|
1317
|
+
*
|
|
1318
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1319
|
+
* and so must be specified in every named environment.
|
|
1320
|
+
*
|
|
1321
|
+
* @default {}
|
|
1322
|
+
* @nonInheritable
|
|
1323
|
+
*/
|
|
1324
|
+
define: Record<string, string>;
|
|
1325
|
+
/**
|
|
1326
|
+
* A map of environment variables to set when deploying your Worker.
|
|
1327
|
+
*
|
|
1328
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1329
|
+
* and so must be specified in every named environment.
|
|
1330
|
+
*
|
|
1331
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
|
|
1332
|
+
*
|
|
1333
|
+
* @default {}
|
|
1334
|
+
* @nonInheritable
|
|
1335
|
+
*/
|
|
1336
|
+
vars: Record<string, unknown>;
|
|
1337
|
+
/**
|
|
1338
|
+
* A list of durable objects that your Worker should be bound to.
|
|
1339
|
+
*
|
|
1340
|
+
* For more information about Durable Objects, see the documentation at
|
|
1341
|
+
* https://developers.cloudflare.com/workers/learning/using-durable-objects
|
|
1342
|
+
*
|
|
1343
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1344
|
+
* and so must be specified in every named environment.
|
|
1345
|
+
*
|
|
1346
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
1347
|
+
*
|
|
1348
|
+
* @default {bindings:[]}
|
|
1349
|
+
* @nonInheritable
|
|
1350
|
+
*/
|
|
1351
|
+
durable_objects: {
|
|
1352
|
+
bindings: DurableObjectBindings;
|
|
1353
|
+
};
|
|
1354
|
+
/**
|
|
1355
|
+
* A list of workflows that your Worker should be bound to.
|
|
1356
|
+
*
|
|
1357
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1358
|
+
* and so must be specified in every named environment.
|
|
1359
|
+
*
|
|
1360
|
+
* @default []
|
|
1361
|
+
* @nonInheritable
|
|
1362
|
+
*/
|
|
1363
|
+
workflows: WorkflowBinding[];
|
|
1364
|
+
/**
|
|
1365
|
+
* Cloudchamber configuration
|
|
1366
|
+
*
|
|
1367
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1368
|
+
* and so must be specified in every named environment.
|
|
1369
|
+
*
|
|
1370
|
+
* @default {}
|
|
1371
|
+
* @nonInheritable
|
|
1372
|
+
*/
|
|
1373
|
+
cloudchamber: CloudchamberConfig;
|
|
1374
|
+
/**
|
|
1375
|
+
* Container related configuration
|
|
1376
|
+
*
|
|
1377
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1378
|
+
* and so must be specified in every named environment.
|
|
1379
|
+
*
|
|
1380
|
+
* @default []
|
|
1381
|
+
* @nonInheritable
|
|
1382
|
+
*/
|
|
1383
|
+
containers?: ContainerApp[];
|
|
1384
|
+
/**
|
|
1385
|
+
* These specify any Workers KV Namespaces you want to
|
|
1386
|
+
* access from inside your Worker.
|
|
1387
|
+
*
|
|
1388
|
+
* To learn more about KV Namespaces,
|
|
1389
|
+
* see the documentation at https://developers.cloudflare.com/workers/learning/how-kv-works
|
|
1390
|
+
*
|
|
1391
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1392
|
+
* and so must be specified in every named environment.
|
|
1393
|
+
*
|
|
1394
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
|
|
1395
|
+
*
|
|
1396
|
+
* @default []
|
|
1397
|
+
* @nonInheritable
|
|
1398
|
+
*/
|
|
1399
|
+
kv_namespaces: {
|
|
1400
|
+
/** The binding name used to refer to the KV Namespace */
|
|
1401
|
+
binding: string;
|
|
1402
|
+
/** The ID of the KV namespace */
|
|
1403
|
+
id?: string;
|
|
1404
|
+
/** The ID of the KV namespace used during `wrangler dev` */
|
|
1405
|
+
preview_id?: string;
|
|
1406
|
+
/** Whether the KV namespace should be remote or not (only available under `--x-remote-bindings`) */
|
|
1407
|
+
experimental_remote?: boolean;
|
|
1408
|
+
}[];
|
|
1409
|
+
/**
|
|
1410
|
+
* These specify bindings to send email from inside your Worker.
|
|
1411
|
+
*
|
|
1412
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1413
|
+
* and so must be specified in every named environment.
|
|
1414
|
+
*
|
|
1415
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
|
|
1416
|
+
*
|
|
1417
|
+
* @default []
|
|
1418
|
+
* @nonInheritable
|
|
1419
|
+
*/
|
|
1420
|
+
send_email: {
|
|
1421
|
+
/** The binding name used to refer to the this binding */
|
|
1422
|
+
name: string;
|
|
1423
|
+
/** If this binding should be restricted to a specific verified address */
|
|
1424
|
+
destination_address?: string;
|
|
1425
|
+
/** If this binding should be restricted to a set of verified addresses */
|
|
1426
|
+
allowed_destination_addresses?: string[];
|
|
1427
|
+
}[];
|
|
1428
|
+
/**
|
|
1429
|
+
* Specifies Queues that are bound to this Worker environment.
|
|
1430
|
+
*
|
|
1431
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1432
|
+
* and so must be specified in every named environment.
|
|
1433
|
+
*
|
|
1434
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
1435
|
+
*
|
|
1436
|
+
* @default {consumers:[],producers:[]}
|
|
1437
|
+
* @nonInheritable
|
|
1438
|
+
*/
|
|
1439
|
+
queues: {
|
|
1440
|
+
/** Producer bindings */
|
|
1441
|
+
producers?: {
|
|
1442
|
+
/** The binding name used to refer to the Queue in the Worker. */
|
|
1443
|
+
binding: string;
|
|
1444
|
+
/** The name of this Queue. */
|
|
1445
|
+
queue: string;
|
|
1446
|
+
/** The number of seconds to wait before delivering a message */
|
|
1447
|
+
delivery_delay?: number;
|
|
1448
|
+
/** Whether the Queue producer should be remote or not (only available under `--x-remote-bindings`) */
|
|
1449
|
+
experimental_remote?: boolean;
|
|
1450
|
+
}[];
|
|
1451
|
+
/** Consumer configuration */
|
|
1452
|
+
consumers?: {
|
|
1453
|
+
/** The name of the queue from which this consumer should consume. */
|
|
1454
|
+
queue: string;
|
|
1455
|
+
/** The consumer type, e.g., worker, http-pull, r2-bucket, etc. Default is worker. */
|
|
1456
|
+
type?: string;
|
|
1457
|
+
/** The maximum number of messages per batch */
|
|
1458
|
+
max_batch_size?: number;
|
|
1459
|
+
/** The maximum number of seconds to wait to fill a batch with messages. */
|
|
1460
|
+
max_batch_timeout?: number;
|
|
1461
|
+
/** The maximum number of retries for each message. */
|
|
1462
|
+
max_retries?: number;
|
|
1463
|
+
/** The queue to send messages that failed to be consumed. */
|
|
1464
|
+
dead_letter_queue?: string;
|
|
1465
|
+
/** 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. */
|
|
1466
|
+
max_concurrency?: number | null;
|
|
1467
|
+
/** The number of milliseconds to wait for pulled messages to become visible again */
|
|
1468
|
+
visibility_timeout_ms?: number;
|
|
1469
|
+
/** The number of seconds to wait before retrying a message */
|
|
1470
|
+
retry_delay?: number;
|
|
1471
|
+
}[];
|
|
1472
|
+
};
|
|
1473
|
+
/**
|
|
1474
|
+
* Specifies R2 buckets that are bound to this Worker environment.
|
|
1475
|
+
*
|
|
1476
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1477
|
+
* and so must be specified in every named environment.
|
|
1478
|
+
*
|
|
1479
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
|
|
1480
|
+
*
|
|
1481
|
+
* @default []
|
|
1482
|
+
* @nonInheritable
|
|
1483
|
+
*/
|
|
1484
|
+
r2_buckets: {
|
|
1485
|
+
/** The binding name used to refer to the R2 bucket in the Worker. */
|
|
1486
|
+
binding: string;
|
|
1487
|
+
/** The name of this R2 bucket at the edge. */
|
|
1488
|
+
bucket_name?: string;
|
|
1489
|
+
/** The preview name of this R2 bucket at the edge. */
|
|
1490
|
+
preview_bucket_name?: string;
|
|
1491
|
+
/** The jurisdiction that the bucket exists in. Default if not present. */
|
|
1492
|
+
jurisdiction?: string;
|
|
1493
|
+
/** Whether the R2 bucket should be remote or not (only available under `--x-remote-bindings`) */
|
|
1494
|
+
experimental_remote?: boolean;
|
|
1495
|
+
}[];
|
|
1496
|
+
/**
|
|
1497
|
+
* Specifies D1 databases that are bound to this Worker environment.
|
|
1498
|
+
*
|
|
1499
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1500
|
+
* and so must be specified in every named environment.
|
|
1501
|
+
*
|
|
1502
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
|
|
1503
|
+
*
|
|
1504
|
+
* @default []
|
|
1505
|
+
* @nonInheritable
|
|
1506
|
+
*/
|
|
1507
|
+
d1_databases: {
|
|
1508
|
+
/** The binding name used to refer to the D1 database in the Worker. */
|
|
1509
|
+
binding: string;
|
|
1510
|
+
/** The name of this D1 database. */
|
|
1511
|
+
database_name?: string;
|
|
1512
|
+
/** The UUID of this D1 database (not required). */
|
|
1513
|
+
database_id?: string;
|
|
1514
|
+
/** The UUID of this D1 database for Wrangler Dev (if specified). */
|
|
1515
|
+
preview_database_id?: string;
|
|
1516
|
+
/** The name of the migrations table for this D1 database (defaults to 'd1_migrations'). */
|
|
1517
|
+
migrations_table?: string;
|
|
1518
|
+
/** The path to the directory of migrations for this D1 database (defaults to './migrations'). */
|
|
1519
|
+
migrations_dir?: string;
|
|
1520
|
+
/** Internal use only. */
|
|
1521
|
+
database_internal_env?: string;
|
|
1522
|
+
/** Whether the D1 database should be remote or not (only available under `--x-remote-bindings`) */
|
|
1523
|
+
experimental_remote?: boolean;
|
|
1524
|
+
}[];
|
|
1525
|
+
/**
|
|
1526
|
+
* Specifies Vectorize indexes that are bound to this Worker environment.
|
|
1527
|
+
*
|
|
1528
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1529
|
+
* and so must be specified in every named environment.
|
|
1530
|
+
*
|
|
1531
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
|
|
1532
|
+
*
|
|
1533
|
+
* @default []
|
|
1534
|
+
* @nonInheritable
|
|
1535
|
+
*/
|
|
1536
|
+
vectorize: {
|
|
1537
|
+
/** The binding name used to refer to the Vectorize index in the Worker. */
|
|
1538
|
+
binding: string;
|
|
1539
|
+
/** The name of the index. */
|
|
1540
|
+
index_name: string;
|
|
1541
|
+
/** Whether the Vectorize index should be remote or not (only available under `--x-remote-bindings`) */
|
|
1542
|
+
experimental_remote?: boolean;
|
|
1543
|
+
}[];
|
|
1544
|
+
/**
|
|
1545
|
+
* Specifies Hyperdrive configs that are bound to this Worker environment.
|
|
1546
|
+
*
|
|
1547
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1548
|
+
* and so must be specified in every named environment.
|
|
1549
|
+
*
|
|
1550
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
|
|
1551
|
+
*
|
|
1552
|
+
* @default []
|
|
1553
|
+
* @nonInheritable
|
|
1554
|
+
*/
|
|
1555
|
+
hyperdrive: {
|
|
1556
|
+
/** The binding name used to refer to the project in the Worker. */
|
|
1557
|
+
binding: string;
|
|
1558
|
+
/** The id of the database. */
|
|
1559
|
+
id: string;
|
|
1560
|
+
/** The local database connection string for `wrangler dev` */
|
|
1561
|
+
localConnectionString?: string;
|
|
1562
|
+
}[];
|
|
1563
|
+
/**
|
|
1564
|
+
* Specifies service bindings (Worker-to-Worker) that are bound to this Worker environment.
|
|
1565
|
+
*
|
|
1566
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1567
|
+
* and so must be specified in every named environment.
|
|
1568
|
+
*
|
|
1569
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
|
|
1570
|
+
*
|
|
1571
|
+
* @default []
|
|
1572
|
+
* @nonInheritable
|
|
1573
|
+
*/
|
|
1574
|
+
services: {
|
|
1575
|
+
/** The binding name used to refer to the bound service. */
|
|
1576
|
+
binding: string;
|
|
1577
|
+
/** The name of the service. */
|
|
1578
|
+
service: string;
|
|
1579
|
+
/** The environment of the service (e.g. production, staging, etc). */
|
|
1580
|
+
environment?: string;
|
|
1581
|
+
/** Optionally, the entrypoint (named export) of the service to bind to. */
|
|
1582
|
+
entrypoint?: string;
|
|
1583
|
+
/** Optional properties that will be made available to the service via ctx.props. */
|
|
1584
|
+
props?: Record<string, unknown>;
|
|
1585
|
+
/** Whether the service binding should be remote or not (only available under `--x-remote-bindings`) */
|
|
1586
|
+
experimental_remote?: boolean;
|
|
1587
|
+
}[] | undefined;
|
|
1588
|
+
/**
|
|
1589
|
+
* Specifies analytics engine datasets that are bound to this Worker environment.
|
|
1590
|
+
*
|
|
1591
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1592
|
+
* and so must be specified in every named environment.
|
|
1593
|
+
*
|
|
1594
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
|
|
1595
|
+
*
|
|
1596
|
+
* @default []
|
|
1597
|
+
* @nonInheritable
|
|
1598
|
+
*/
|
|
1599
|
+
analytics_engine_datasets: {
|
|
1600
|
+
/** The binding name used to refer to the dataset in the Worker. */
|
|
1601
|
+
binding: string;
|
|
1602
|
+
/** The name of this dataset to write to. */
|
|
1603
|
+
dataset?: string;
|
|
1604
|
+
}[];
|
|
1605
|
+
/**
|
|
1606
|
+
* A browser that will be usable from the Worker.
|
|
1607
|
+
*
|
|
1608
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1609
|
+
* and so must be specified in every named environment.
|
|
1610
|
+
*
|
|
1611
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
|
|
1612
|
+
*
|
|
1613
|
+
* @default {}
|
|
1614
|
+
* @nonInheritable
|
|
1615
|
+
*/
|
|
1616
|
+
browser: {
|
|
1617
|
+
binding: string;
|
|
1618
|
+
/** Whether the Browser binding should be remote or not (only available under `--x-remote-bindings`) */
|
|
1619
|
+
experimental_remote?: boolean;
|
|
1620
|
+
} | undefined;
|
|
1621
|
+
/**
|
|
1622
|
+
* Binding to the AI project.
|
|
1623
|
+
*
|
|
1624
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1625
|
+
* and so must be specified in every named environment.
|
|
1626
|
+
*
|
|
1627
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
|
|
1628
|
+
*
|
|
1629
|
+
* @default {}
|
|
1630
|
+
* @nonInheritable
|
|
1631
|
+
*/
|
|
1632
|
+
ai: {
|
|
1633
|
+
binding: string;
|
|
1634
|
+
staging?: boolean;
|
|
1635
|
+
/** Whether the AI binding should be remote or not (only available under `--x-remote-bindings`) */
|
|
1636
|
+
experimental_remote?: boolean;
|
|
1637
|
+
} | undefined;
|
|
1638
|
+
/**
|
|
1639
|
+
* Binding to Cloudflare Images
|
|
1640
|
+
*
|
|
1641
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1642
|
+
* and so must be specified in every named environment.
|
|
1643
|
+
*
|
|
1644
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
|
|
1645
|
+
*
|
|
1646
|
+
* @default {}
|
|
1647
|
+
* @nonInheritable
|
|
1648
|
+
*/
|
|
1649
|
+
images: {
|
|
1650
|
+
binding: string;
|
|
1651
|
+
/** Whether the Images binding should be remote or not (only available under `--x-remote-bindings`) */
|
|
1652
|
+
experimental_remote?: boolean;
|
|
1653
|
+
} | undefined;
|
|
1654
|
+
/**
|
|
1655
|
+
* Binding to the Worker Version's metadata
|
|
1656
|
+
*/
|
|
1657
|
+
version_metadata: {
|
|
1658
|
+
binding: string;
|
|
1659
|
+
} | undefined;
|
|
1660
|
+
/**
|
|
1661
|
+
* "Unsafe" tables for features that aren't directly supported by wrangler.
|
|
1662
|
+
*
|
|
1663
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1664
|
+
* and so must be specified in every named environment.
|
|
1665
|
+
*
|
|
1666
|
+
* @default {}
|
|
1667
|
+
* @nonInheritable
|
|
1668
|
+
*/
|
|
1669
|
+
unsafe: {
|
|
1670
|
+
/**
|
|
1671
|
+
* A set of bindings that should be put into a Worker's upload metadata without changes. These
|
|
1672
|
+
* can be used to implement bindings for features that haven't released and aren't supported
|
|
1673
|
+
* directly by wrangler or miniflare.
|
|
1674
|
+
*/
|
|
1675
|
+
bindings?: {
|
|
1676
|
+
name: string;
|
|
1677
|
+
type: string;
|
|
1678
|
+
[key: string]: unknown;
|
|
1679
|
+
}[];
|
|
1680
|
+
/**
|
|
1681
|
+
* Arbitrary key/value pairs that will be included in the uploaded metadata. Values specified
|
|
1682
|
+
* here will always be applied to metadata last, so can add new or override existing fields.
|
|
1683
|
+
*/
|
|
1684
|
+
metadata?: {
|
|
1685
|
+
[key: string]: unknown;
|
|
1686
|
+
};
|
|
1687
|
+
/**
|
|
1688
|
+
* Used for internal capnp uploads for the Workers runtime
|
|
1689
|
+
*/
|
|
1690
|
+
capnp?: {
|
|
1691
|
+
base_path: string;
|
|
1692
|
+
source_schemas: string[];
|
|
1693
|
+
compiled_schema?: never;
|
|
1694
|
+
} | {
|
|
1695
|
+
base_path?: never;
|
|
1696
|
+
source_schemas?: never;
|
|
1697
|
+
compiled_schema: string;
|
|
1698
|
+
};
|
|
1699
|
+
};
|
|
1700
|
+
/**
|
|
1701
|
+
* Specifies a list of mTLS certificates that are bound to this Worker environment.
|
|
1702
|
+
*
|
|
1703
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1704
|
+
* and so must be specified in every named environment.
|
|
1705
|
+
*
|
|
1706
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
|
|
1707
|
+
*
|
|
1708
|
+
* @default []
|
|
1709
|
+
* @nonInheritable
|
|
1710
|
+
*/
|
|
1711
|
+
mtls_certificates: {
|
|
1712
|
+
/** The binding name used to refer to the certificate in the Worker */
|
|
1713
|
+
binding: string;
|
|
1714
|
+
/** The uuid of the uploaded mTLS certificate */
|
|
1715
|
+
certificate_id: string;
|
|
1716
|
+
/** Whether the mtls fetcher should be remote or not (only available under `--x-remote-bindings`) */
|
|
1717
|
+
experimental_remote?: boolean;
|
|
1718
|
+
}[];
|
|
1719
|
+
/**
|
|
1720
|
+
* Specifies a list of Tail Workers that are bound to this Worker environment
|
|
1721
|
+
*
|
|
1722
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1723
|
+
* and so must be specified in every named environment.
|
|
1724
|
+
*
|
|
1725
|
+
* @default []
|
|
1726
|
+
* @nonInheritable
|
|
1727
|
+
*/
|
|
1728
|
+
tail_consumers?: TailConsumer[];
|
|
1729
|
+
/**
|
|
1730
|
+
* Specifies namespace bindings that are bound to this Worker environment.
|
|
1731
|
+
*
|
|
1732
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1733
|
+
* and so must be specified in every named environment.
|
|
1734
|
+
*
|
|
1735
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
|
|
1736
|
+
*
|
|
1737
|
+
* @default []
|
|
1738
|
+
* @nonInheritable
|
|
1739
|
+
*/
|
|
1740
|
+
dispatch_namespaces: {
|
|
1741
|
+
/** The binding name used to refer to the bound service. */
|
|
1742
|
+
binding: string;
|
|
1743
|
+
/** The namespace to bind to. */
|
|
1744
|
+
namespace: string;
|
|
1745
|
+
/** Details about the outbound Worker which will handle outbound requests from your namespace */
|
|
1746
|
+
outbound?: DispatchNamespaceOutbound;
|
|
1747
|
+
/** Whether the Dispatch Namespace should be remote or not (only available under `--x-remote-bindings`) */
|
|
1748
|
+
experimental_remote?: boolean;
|
|
1749
|
+
}[];
|
|
1750
|
+
/**
|
|
1751
|
+
* Specifies list of Pipelines bound to this Worker environment
|
|
1752
|
+
*
|
|
1753
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1754
|
+
* and so must be specified in every named environment.
|
|
1755
|
+
*
|
|
1756
|
+
* @default []
|
|
1757
|
+
* @nonInheritable
|
|
1758
|
+
*/
|
|
1759
|
+
pipelines: {
|
|
1760
|
+
/** The binding name used to refer to the bound service. */
|
|
1761
|
+
binding: string;
|
|
1762
|
+
/** Name of the Pipeline to bind */
|
|
1763
|
+
pipeline: string;
|
|
1764
|
+
}[];
|
|
1765
|
+
/**
|
|
1766
|
+
* Specifies Secret Store bindings that are bound to this Worker environment.
|
|
1767
|
+
*
|
|
1768
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1769
|
+
* and so must be specified in every named environment.
|
|
1770
|
+
*
|
|
1771
|
+
* @default []
|
|
1772
|
+
* @nonInheritable
|
|
1773
|
+
*/
|
|
1774
|
+
secrets_store_secrets: {
|
|
1775
|
+
/** The binding name used to refer to the bound service. */
|
|
1776
|
+
binding: string;
|
|
1777
|
+
/** Id of the secret store */
|
|
1778
|
+
store_id: string;
|
|
1779
|
+
/** Name of the secret */
|
|
1780
|
+
secret_name: string;
|
|
1781
|
+
}[];
|
|
1782
|
+
/**
|
|
1783
|
+
* **DO NOT USE**. Hello World Binding Config to serve as an explanatory example.
|
|
1784
|
+
*
|
|
1785
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1786
|
+
* and so must be specified in every named environment.
|
|
1787
|
+
*
|
|
1788
|
+
* @default []
|
|
1789
|
+
* @nonInheritable
|
|
1790
|
+
*/
|
|
1791
|
+
unsafe_hello_world: {
|
|
1792
|
+
/** The binding name used to refer to the bound service. */
|
|
1793
|
+
binding: string;
|
|
1794
|
+
/** Whether the timer is enabled */
|
|
1795
|
+
enable_timer?: boolean;
|
|
1796
|
+
}[];
|
|
1797
|
+
}
|
|
1798
|
+
/**
|
|
1799
|
+
* A bundling resolver rule, defining the modules type for paths that match the specified globs.
|
|
1800
|
+
*/
|
|
1801
|
+
type Rule = {
|
|
1802
|
+
type: ConfigModuleRuleType;
|
|
1803
|
+
globs: string[];
|
|
1804
|
+
fallthrough?: boolean;
|
|
1805
|
+
};
|
|
1806
|
+
/**
|
|
1807
|
+
* The possible types for a `Rule`.
|
|
1808
|
+
*/
|
|
1809
|
+
type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data" | "PythonModule" | "PythonRequirement";
|
|
1810
|
+
type TailConsumer = {
|
|
1811
|
+
/** The name of the service tail events will be forwarded to. */
|
|
1812
|
+
service: string;
|
|
1813
|
+
/** (Optional) The environment of the service. */
|
|
1814
|
+
environment?: string;
|
|
1815
|
+
};
|
|
1816
|
+
interface DispatchNamespaceOutbound {
|
|
1817
|
+
/** Name of the service handling the outbound requests */
|
|
1818
|
+
service: string;
|
|
1819
|
+
/** (Optional) Name of the environment handling the outbound requests. */
|
|
1820
|
+
environment?: string;
|
|
1821
|
+
/** (Optional) List of parameter names, for sending context from your dispatch Worker to the outbound handler */
|
|
1822
|
+
parameters?: string[];
|
|
1823
|
+
}
|
|
1824
|
+
interface UserLimits {
|
|
1825
|
+
/** Maximum allowed CPU time for a Worker's invocation in milliseconds */
|
|
1826
|
+
cpu_ms: number;
|
|
1827
|
+
}
|
|
1828
|
+
type Assets = {
|
|
1829
|
+
/** Absolute path to assets directory */
|
|
1830
|
+
directory?: string;
|
|
1831
|
+
/** Name of `env` binding property in the User Worker. */
|
|
1832
|
+
binding?: string;
|
|
1833
|
+
/** How to handle HTML requests. */
|
|
1834
|
+
html_handling?: "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | "none";
|
|
1835
|
+
/** How to handle requests that do not match an asset. */
|
|
1836
|
+
not_found_handling?: "single-page-application" | "404-page" | "none";
|
|
1837
|
+
/**
|
|
1838
|
+
* Matches will be routed to the User Worker, and matches to negative rules will go to the Asset Worker.
|
|
1839
|
+
*
|
|
1840
|
+
* Can also be `true`, indicating that every request should be routed to the User Worker.
|
|
1841
|
+
*/
|
|
1842
|
+
run_worker_first?: string[] | boolean;
|
|
1843
|
+
};
|
|
1844
|
+
interface Observability {
|
|
1845
|
+
/** If observability is enabled for this Worker */
|
|
1846
|
+
enabled?: boolean;
|
|
1847
|
+
/** The sampling rate */
|
|
1848
|
+
head_sampling_rate?: number;
|
|
1849
|
+
logs?: {
|
|
1850
|
+
enabled?: boolean;
|
|
1851
|
+
/** The sampling rate */
|
|
1852
|
+
head_sampling_rate?: number;
|
|
1853
|
+
/** Set to false to disable invocation logs */
|
|
1854
|
+
invocation_logs?: boolean;
|
|
1855
|
+
};
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
/**
|
|
1859
|
+
* Copyright (c) 2020 Cloudflare, Inc. <wrangler@cloudflare.com>
|
|
1860
|
+
* https://github.com/cloudflare/workers-sdk/blob/main/LICENSE-MIT
|
|
1861
|
+
* https://github.com/cloudflare/workers-sdk/blob/main/LICENSE-APACHE
|
|
1862
|
+
*
|
|
1863
|
+
* Source: https://github.com/cloudflare/workers-sdk/blob/main/packages/wrangler/src/config/config.ts
|
|
1864
|
+
*/
|
|
1865
|
+
|
|
1866
|
+
/**
|
|
1867
|
+
* This is the static type definition for the configuration object.
|
|
1868
|
+
*
|
|
1869
|
+
* It reflects a normalized and validated version of the configuration that you can write in a Wrangler configuration file,
|
|
1870
|
+
* and optionally augment with arguments passed directly to wrangler.
|
|
1871
|
+
*
|
|
1872
|
+
* For more information about the configuration object, see the
|
|
1873
|
+
* documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration
|
|
1874
|
+
*
|
|
1875
|
+
* Notes:
|
|
1876
|
+
*
|
|
1877
|
+
* - Fields that are only specified in `ConfigFields` and not `Environment` can only appear
|
|
1878
|
+
* in the top level config and should not appear in any environments.
|
|
1879
|
+
* - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects
|
|
1880
|
+
* - All top level fields in config and environments are optional in the Wrangler configuration file.
|
|
1881
|
+
*
|
|
1882
|
+
* Legend for the annotations:
|
|
1883
|
+
*
|
|
1884
|
+
* - `@breaking`: the deprecation/optionality is a breaking change from Wrangler v1.
|
|
1885
|
+
* - `@todo`: there's more work to be done (with details attached).
|
|
1886
|
+
*/
|
|
1887
|
+
type Config = ComputedFields & ConfigFields<DevConfig> & PagesConfigFields & Environment;
|
|
1888
|
+
interface ComputedFields {
|
|
1889
|
+
/** The path to the Wrangler configuration file (if any, and possibly redirected from the user Wrangler configuration) used to create this configuration. */
|
|
1890
|
+
configPath: string | undefined;
|
|
1891
|
+
/** 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. */
|
|
1892
|
+
userConfigPath: string | undefined;
|
|
1893
|
+
/**
|
|
1894
|
+
* The original top level name for the Worker in the raw configuration.
|
|
1895
|
+
*
|
|
1896
|
+
* When a raw configuration has been flattened to a single environment the worker name may have been replaced or transformed.
|
|
1897
|
+
* It can be useful to know what the top-level name was before the flattening.
|
|
1898
|
+
*/
|
|
1899
|
+
topLevelName: string | undefined;
|
|
1900
|
+
}
|
|
1901
|
+
interface ConfigFields<Dev extends RawDevConfig> {
|
|
1902
|
+
/**
|
|
1903
|
+
* A boolean to enable "legacy" style wrangler environments (from Wrangler v1).
|
|
1904
|
+
* These have been superseded by Services, but there may be projects that won't
|
|
1905
|
+
* (or can't) use them. If you're using a legacy environment, you can set this
|
|
1906
|
+
* to `true` to enable it.
|
|
1907
|
+
*/
|
|
1908
|
+
legacy_env: boolean;
|
|
1909
|
+
/**
|
|
1910
|
+
* Whether Wrangler should send usage metrics to Cloudflare for this project.
|
|
1911
|
+
*
|
|
1912
|
+
* When defined this will override any user settings.
|
|
1913
|
+
* Otherwise, Wrangler will use the user's preference.
|
|
1914
|
+
*/
|
|
1915
|
+
send_metrics: boolean | undefined;
|
|
1916
|
+
/**
|
|
1917
|
+
* Options to configure the development server that your worker will use.
|
|
1918
|
+
*/
|
|
1919
|
+
dev: Dev;
|
|
1920
|
+
/**
|
|
1921
|
+
* The definition of a Worker Site, a feature that lets you upload
|
|
1922
|
+
* static assets with your Worker.
|
|
1923
|
+
*
|
|
1924
|
+
* More details at https://developers.cloudflare.com/workers/platform/sites
|
|
1925
|
+
*/
|
|
1926
|
+
site: {
|
|
1927
|
+
/**
|
|
1928
|
+
* The directory containing your static assets.
|
|
1929
|
+
*
|
|
1930
|
+
* It must be a path relative to your Wrangler configuration file.
|
|
1931
|
+
* Example: bucket = "./public"
|
|
1932
|
+
*
|
|
1933
|
+
* If there is a `site` field then it must contain this `bucket` field.
|
|
1934
|
+
*/
|
|
1935
|
+
bucket: string;
|
|
1936
|
+
/**
|
|
1937
|
+
* The location of your Worker script.
|
|
1938
|
+
*
|
|
1939
|
+
* @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.
|
|
1940
|
+
* @breaking
|
|
1941
|
+
*/
|
|
1942
|
+
"entry-point"?: string;
|
|
1943
|
+
/**
|
|
1944
|
+
* An exclusive list of .gitignore-style patterns that match file
|
|
1945
|
+
* or directory names from your bucket location. Only matched
|
|
1946
|
+
* items will be uploaded. Example: include = ["upload_dir"]
|
|
1947
|
+
*
|
|
1948
|
+
* @optional
|
|
1949
|
+
* @default []
|
|
1950
|
+
*/
|
|
1951
|
+
include?: string[];
|
|
1952
|
+
/**
|
|
1953
|
+
* A list of .gitignore-style patterns that match files or
|
|
1954
|
+
* directories in your bucket that should be excluded from
|
|
1955
|
+
* uploads. Example: exclude = ["ignore_dir"]
|
|
1956
|
+
*
|
|
1957
|
+
* @optional
|
|
1958
|
+
* @default []
|
|
1959
|
+
*/
|
|
1960
|
+
exclude?: string[];
|
|
1961
|
+
} | undefined;
|
|
1962
|
+
/**
|
|
1963
|
+
* Old behaviour of serving a folder of static assets with your Worker,
|
|
1964
|
+
* without any additional code.
|
|
1965
|
+
* This can either be a string, or an object with additional config
|
|
1966
|
+
* fields.
|
|
1967
|
+
* Will be deprecated in the near future in favor of `assets`.
|
|
1968
|
+
*/
|
|
1969
|
+
legacy_assets: {
|
|
1970
|
+
bucket: string;
|
|
1971
|
+
include: string[];
|
|
1972
|
+
exclude: string[];
|
|
1973
|
+
browser_TTL: number | undefined;
|
|
1974
|
+
serve_single_page_app: boolean;
|
|
1975
|
+
} | string | undefined;
|
|
1976
|
+
/**
|
|
1977
|
+
* A list of wasm modules that your worker should be bound to. This is
|
|
1978
|
+
* the "legacy" way of binding to a wasm module. ES module workers should
|
|
1979
|
+
* do proper module imports.
|
|
1980
|
+
*/
|
|
1981
|
+
wasm_modules: {
|
|
1982
|
+
[key: string]: string;
|
|
1983
|
+
} | undefined;
|
|
1984
|
+
/**
|
|
1985
|
+
* A list of text files that your worker should be bound to. This is
|
|
1986
|
+
* the "legacy" way of binding to a text file. ES module workers should
|
|
1987
|
+
* do proper module imports.
|
|
1988
|
+
*/
|
|
1989
|
+
text_blobs: {
|
|
1990
|
+
[key: string]: string;
|
|
1991
|
+
} | undefined;
|
|
1992
|
+
/**
|
|
1993
|
+
* A list of data files that your worker should be bound to. This is
|
|
1994
|
+
* the "legacy" way of binding to a data file. ES module workers should
|
|
1995
|
+
* do proper module imports.
|
|
1996
|
+
*/
|
|
1997
|
+
data_blobs: {
|
|
1998
|
+
[key: string]: string;
|
|
1999
|
+
} | undefined;
|
|
2000
|
+
/**
|
|
2001
|
+
* A map of module aliases. Lets you swap out a module for any others.
|
|
2002
|
+
* Corresponds with esbuild's `alias` config
|
|
2003
|
+
*/
|
|
2004
|
+
alias: {
|
|
2005
|
+
[key: string]: string;
|
|
2006
|
+
} | undefined;
|
|
2007
|
+
/**
|
|
2008
|
+
* By default, the Wrangler configuration file is the source of truth for your environment configuration, like a terraform file.
|
|
2009
|
+
*
|
|
2010
|
+
* If you change your vars in the dashboard, wrangler *will* override/delete them on its next deploy.
|
|
2011
|
+
*
|
|
2012
|
+
* If you want to keep your dashboard vars when wrangler deploys, set this field to true.
|
|
2013
|
+
*
|
|
2014
|
+
* @default false
|
|
2015
|
+
* @nonInheritable
|
|
2016
|
+
*/
|
|
2017
|
+
keep_vars?: boolean;
|
|
2018
|
+
}
|
|
2019
|
+
interface PagesConfigFields {
|
|
2020
|
+
/**
|
|
2021
|
+
* The directory of static assets to serve.
|
|
2022
|
+
*
|
|
2023
|
+
* The presence of this field in a Wrangler configuration file indicates a Pages project,
|
|
2024
|
+
* and will prompt the handling of the configuration file according to the
|
|
2025
|
+
* Pages-specific validation rules.
|
|
2026
|
+
*/
|
|
2027
|
+
pages_build_output_dir?: string;
|
|
2028
|
+
}
|
|
2029
|
+
interface DevConfig {
|
|
2030
|
+
/**
|
|
2031
|
+
* IP address for the local dev server to listen on,
|
|
2032
|
+
*
|
|
2033
|
+
* @default localhost
|
|
2034
|
+
*/
|
|
2035
|
+
ip: string;
|
|
2036
|
+
/**
|
|
2037
|
+
* Port for the local dev server to listen on
|
|
2038
|
+
*
|
|
2039
|
+
* @default 8787
|
|
2040
|
+
*/
|
|
2041
|
+
port: number | undefined;
|
|
2042
|
+
/**
|
|
2043
|
+
* Port for the local dev server's inspector to listen on
|
|
2044
|
+
*
|
|
2045
|
+
* @default 9229
|
|
2046
|
+
*/
|
|
2047
|
+
inspector_port: number | undefined;
|
|
2048
|
+
/**
|
|
2049
|
+
* Protocol that local wrangler dev server listens to requests on.
|
|
2050
|
+
*
|
|
2051
|
+
* @default http
|
|
2052
|
+
*/
|
|
2053
|
+
local_protocol: "http" | "https";
|
|
2054
|
+
/**
|
|
2055
|
+
* Protocol that wrangler dev forwards requests on
|
|
2056
|
+
*
|
|
2057
|
+
* Setting this to `http` is not currently implemented for remote mode.
|
|
2058
|
+
* See https://github.com/cloudflare/workers-sdk/issues/583
|
|
2059
|
+
*
|
|
2060
|
+
* @default https
|
|
2061
|
+
*/
|
|
2062
|
+
upstream_protocol: "https" | "http";
|
|
2063
|
+
/**
|
|
2064
|
+
* Host to forward requests to, defaults to the host of the first route of project
|
|
2065
|
+
*/
|
|
2066
|
+
host: string | undefined;
|
|
2067
|
+
}
|
|
2068
|
+
type RawDevConfig = Partial<DevConfig>;
|
|
2069
|
+
|
|
2070
|
+
type WranglerConfig = Partial<Omit<Config, keyof ComputedFields>>;
|
|
2071
|
+
/**
|
|
2072
|
+
* https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes
|
|
2073
|
+
*/
|
|
2074
|
+
interface CloudflarePagesRoutes {
|
|
2075
|
+
/** Defines the version of the schema. Currently there is only one version of the schema (version 1), however, we may add more in the future and aim to be backwards compatible. */
|
|
2076
|
+
version?: 1;
|
|
2077
|
+
/** Defines routes that will be invoked by Functions. Accepts wildcard behavior. */
|
|
2078
|
+
include?: string[];
|
|
2079
|
+
/** Defines routes that will not be invoked by Functions. Accepts wildcard behavior. `exclude` always take priority over `include`. */
|
|
2080
|
+
exclude?: string[];
|
|
2081
|
+
}
|
|
2082
|
+
interface CloudflareOptions {
|
|
2083
|
+
/**
|
|
2084
|
+
* Configuration for the Cloudflare Deployments.
|
|
2085
|
+
*
|
|
2086
|
+
* **NOTE:** This option is only effective if `deployConfig` is enabled.
|
|
2087
|
+
*/
|
|
2088
|
+
wrangler?: WranglerConfig;
|
|
2089
|
+
/**
|
|
2090
|
+
* Enable automatic generation of `.wrangler/deploy/config.json`.
|
|
2091
|
+
*
|
|
2092
|
+
* **IMPORTANT:** Enabling this option will cause settings from cloudflare dashboard (including environment variables) to be disabled and discarded.
|
|
2093
|
+
*
|
|
2094
|
+
* More info: https://developers.cloudflare.com/workers/wrangler/configuration#generated-wrangler-configuration
|
|
2095
|
+
*/
|
|
2096
|
+
deployConfig?: boolean;
|
|
2097
|
+
/**
|
|
2098
|
+
* Enable native Node.js compatibility support.
|
|
2099
|
+
*
|
|
2100
|
+
* If this option disabled, pure unenv polyfills will be used instead.
|
|
2101
|
+
*
|
|
2102
|
+
* If not set, will be auto enabled if `nodejs_compat` or `nodejs_compat_v2` is detected in `wrangler.toml` or `wrangler.json`.
|
|
2103
|
+
*/
|
|
2104
|
+
nodeCompat?: boolean;
|
|
2105
|
+
/**
|
|
2106
|
+
* Options for dev emulation.
|
|
2107
|
+
*/
|
|
2108
|
+
dev?: {
|
|
2109
|
+
configPath?: string;
|
|
2110
|
+
environment?: string;
|
|
2111
|
+
persistDir?: string;
|
|
2112
|
+
};
|
|
2113
|
+
pages?: {
|
|
2114
|
+
/**
|
|
2115
|
+
* Nitro will automatically generate a `_routes.json` that controls which files get served statically and
|
|
2116
|
+
* which get served by the Worker. Using this config will override the automatic `_routes.json`. Or, if the
|
|
2117
|
+
* `merge` options is set, it will merge the user-set routes with the auto-generated ones, giving priority
|
|
2118
|
+
* to the user routes.
|
|
2119
|
+
*
|
|
2120
|
+
* @see https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes
|
|
2121
|
+
*
|
|
2122
|
+
* There are a maximum of 100 rules, and you must have at least one include rule. Wildcards are accepted.
|
|
2123
|
+
*
|
|
2124
|
+
* If any fields are unset, they default to:
|
|
2125
|
+
*
|
|
2126
|
+
* ```json
|
|
2127
|
+
* {
|
|
2128
|
+
* "version": 1,
|
|
2129
|
+
* "include": ["/*"],
|
|
2130
|
+
* "exclude": []
|
|
2131
|
+
* }
|
|
2132
|
+
* ```
|
|
2133
|
+
*/
|
|
2134
|
+
routes?: CloudflarePagesRoutes;
|
|
2135
|
+
/**
|
|
2136
|
+
* If set to `false`, nitro will disable the automatically generated `_routes.json` and instead use the user-set only ones.
|
|
2137
|
+
*
|
|
2138
|
+
* @default true
|
|
2139
|
+
*/
|
|
2140
|
+
defaultRoutes?: boolean;
|
|
2141
|
+
};
|
|
2142
|
+
}
|
|
2143
|
+
type DurableObjectState = ConstructorParameters<typeof DurableObject>[0];
|
|
2144
|
+
declare module "nitro/types" {
|
|
2145
|
+
interface NitroRuntimeHooks {
|
|
2146
|
+
"cloudflare:scheduled": (_: {
|
|
2147
|
+
controller: ScheduledController;
|
|
2148
|
+
env: unknown;
|
|
2149
|
+
context: ExecutionContext;
|
|
2150
|
+
}) => void;
|
|
2151
|
+
"cloudflare:email": (_: {
|
|
2152
|
+
message: ForwardableEmailMessage;
|
|
2153
|
+
/** @deprecated please use `message` */
|
|
2154
|
+
event: ForwardableEmailMessage;
|
|
2155
|
+
env: unknown;
|
|
2156
|
+
context: ExecutionContext;
|
|
2157
|
+
}) => void;
|
|
2158
|
+
"cloudflare:queue": (_: {
|
|
2159
|
+
batch: MessageBatch;
|
|
2160
|
+
/** @deprecated please use `batch` */
|
|
2161
|
+
event: MessageBatch;
|
|
2162
|
+
env: unknown;
|
|
2163
|
+
context: ExecutionContext;
|
|
2164
|
+
}) => void;
|
|
2165
|
+
"cloudflare:tail": (_: {
|
|
2166
|
+
traces: TraceItem[];
|
|
2167
|
+
env: unknown;
|
|
2168
|
+
context: ExecutionContext;
|
|
2169
|
+
}) => void;
|
|
2170
|
+
"cloudflare:trace": (_: {
|
|
2171
|
+
traces: TraceItem[];
|
|
2172
|
+
env: unknown;
|
|
2173
|
+
context: ExecutionContext;
|
|
2174
|
+
}) => void;
|
|
2175
|
+
"cloudflare:durable:init": (durable: DurableObject, _: {
|
|
2176
|
+
state: DurableObjectState;
|
|
2177
|
+
env: unknown;
|
|
2178
|
+
}) => void;
|
|
2179
|
+
"cloudflare:durable:alarm": (durable: DurableObject) => void;
|
|
2180
|
+
}
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
interface FirebaseOptions {
|
|
2184
|
+
appHosting: Partial<AppHostingOutputBundleConfig["runConfig"]>;
|
|
2185
|
+
}
|
|
2186
|
+
interface AppHostingOutputBundleConfig {
|
|
2187
|
+
version: "v1";
|
|
2188
|
+
runConfig: {
|
|
2189
|
+
/** Command to start the server (e.g. "node dist/index.js"). Assume this command is run from the root dir of the workspace. */
|
|
2190
|
+
runCommand: string;
|
|
2191
|
+
/** Environment variables set when the app is run. */
|
|
2192
|
+
environmentVariables?: Array<{
|
|
2193
|
+
/** Name of the variable. */
|
|
2194
|
+
variable: string;
|
|
2195
|
+
/** Value associated with the variable. */
|
|
2196
|
+
value: string;
|
|
2197
|
+
/** Where the variable will be available, for now only RUNTIME is supported. */
|
|
2198
|
+
availability: "RUNTIME"[];
|
|
2199
|
+
}>;
|
|
2200
|
+
/** The maximum number of concurrent requests that each server instance can receive. */
|
|
2201
|
+
concurrency?: number;
|
|
2202
|
+
/** The number of CPUs used in a single server instance. */
|
|
2203
|
+
cpu?: number;
|
|
2204
|
+
/** The amount of memory available for a server instance. */
|
|
2205
|
+
memoryMiB?: number;
|
|
2206
|
+
/** The limit on the minimum number of function instances that may coexist at a given time. */
|
|
2207
|
+
minInstances?: number;
|
|
2208
|
+
/** The limit on the maximum number of function instances that may coexist at a given time. */
|
|
2209
|
+
maxInstances?: number;
|
|
2210
|
+
};
|
|
2211
|
+
metadata: {
|
|
2212
|
+
adapterPackageName: string;
|
|
2213
|
+
adapterVersion: string;
|
|
2214
|
+
framework: string;
|
|
2215
|
+
frameworkVersion?: string;
|
|
2216
|
+
};
|
|
2217
|
+
outputFiles?: {
|
|
2218
|
+
/** serverApp holds a list of directories + files relative to the app root dir that frameworks need to deploy to the App Hosting server. */
|
|
2219
|
+
serverApp: {
|
|
2220
|
+
include: string[];
|
|
2221
|
+
};
|
|
2222
|
+
};
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
/**
|
|
2226
|
+
* Netlify options
|
|
2227
|
+
*/
|
|
2228
|
+
interface NetlifyOptions {
|
|
2229
|
+
images?: {
|
|
2230
|
+
/**
|
|
2231
|
+
* Permitted remote image sources. Array of regex strings.
|
|
2232
|
+
* @see https://docs.netlify.com/image-cdn/overview/#remote-path
|
|
2233
|
+
*/
|
|
2234
|
+
remote_images?: string[];
|
|
2235
|
+
};
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2238
|
+
/**
|
|
2239
|
+
* Vercel Build Output Configuration
|
|
2240
|
+
* @see https://vercel.com/docs/build-output-api/v3
|
|
2241
|
+
*/
|
|
2242
|
+
interface VercelBuildConfigV3 {
|
|
2243
|
+
version: 3;
|
|
2244
|
+
routes?: ({
|
|
2245
|
+
src: string;
|
|
2246
|
+
headers: {
|
|
2247
|
+
"cache-control": string;
|
|
2248
|
+
};
|
|
2249
|
+
continue: boolean;
|
|
2250
|
+
} | {
|
|
2251
|
+
handle: string;
|
|
2252
|
+
} | {
|
|
2253
|
+
src: string;
|
|
2254
|
+
dest: string;
|
|
2255
|
+
})[];
|
|
2256
|
+
images?: {
|
|
2257
|
+
sizes: number[];
|
|
2258
|
+
domains: string[];
|
|
2259
|
+
remotePatterns?: {
|
|
2260
|
+
protocol?: "http" | "https";
|
|
2261
|
+
hostname: string;
|
|
2262
|
+
port?: string;
|
|
2263
|
+
pathname?: string;
|
|
2264
|
+
}[];
|
|
2265
|
+
minimumCacheTTL?: number;
|
|
2266
|
+
formats?: ("image/avif" | "image/webp")[];
|
|
2267
|
+
dangerouslyAllowSVG?: boolean;
|
|
2268
|
+
contentSecurityPolicy?: string;
|
|
2269
|
+
};
|
|
2270
|
+
wildcard?: Array<{
|
|
2271
|
+
domain: string;
|
|
2272
|
+
value: string;
|
|
2273
|
+
}>;
|
|
2274
|
+
overrides?: Record<string, {
|
|
2275
|
+
path?: string;
|
|
2276
|
+
contentType?: string;
|
|
2277
|
+
}>;
|
|
2278
|
+
cache?: string[];
|
|
2279
|
+
bypassToken?: string;
|
|
2280
|
+
crons?: {
|
|
2281
|
+
path: string;
|
|
2282
|
+
schedule: string;
|
|
2283
|
+
}[];
|
|
2284
|
+
}
|
|
2285
|
+
/**
|
|
2286
|
+
* https://vercel.com/docs/build-output-api/primitives#serverless-function-configuration
|
|
2287
|
+
* https://vercel.com/docs/build-output-api/primitives#node.js-config
|
|
2288
|
+
*/
|
|
2289
|
+
interface VercelServerlessFunctionConfig {
|
|
2290
|
+
/**
|
|
2291
|
+
* Amount of memory (RAM in MB) that will be allocated to the Serverless Function.
|
|
2292
|
+
*/
|
|
2293
|
+
memory?: number;
|
|
2294
|
+
/**
|
|
2295
|
+
* Specifies the instruction set "architecture" the Vercel Function supports.
|
|
2296
|
+
*
|
|
2297
|
+
* Either `x86_64` or `arm64`. The default value is `x86_64`
|
|
2298
|
+
*/
|
|
2299
|
+
architecture?: "x86_64" | "arm64";
|
|
2300
|
+
/**
|
|
2301
|
+
* Maximum execution duration (in seconds) that will be allowed for the Serverless Function.
|
|
2302
|
+
*/
|
|
2303
|
+
maxDuration?: number;
|
|
2304
|
+
/**
|
|
2305
|
+
* Map of additional environment variables that will be available to the Vercel Function,
|
|
2306
|
+
* in addition to the env vars specified in the Project Settings.
|
|
2307
|
+
*/
|
|
2308
|
+
environment?: Record<string, string>;
|
|
2309
|
+
/**
|
|
2310
|
+
* List of Vercel Regions where the Vercel Function will be deployed to.
|
|
2311
|
+
*/
|
|
2312
|
+
regions?: string[];
|
|
2313
|
+
/**
|
|
2314
|
+
* True if a custom runtime has support for Lambda runtime wrappers.
|
|
2315
|
+
*/
|
|
2316
|
+
supportsWrapper?: boolean;
|
|
2317
|
+
/**
|
|
2318
|
+
* When true, the Serverless Function will stream the response to the client.
|
|
2319
|
+
*/
|
|
2320
|
+
supportsResponseStreaming?: boolean;
|
|
2321
|
+
/**
|
|
2322
|
+
* Enables source map generation.
|
|
2323
|
+
*/
|
|
2324
|
+
shouldAddSourcemapSupport?: boolean;
|
|
2325
|
+
/**
|
|
2326
|
+
* The runtime to use. Defaults to the auto-detected Node.js version.
|
|
2327
|
+
*/
|
|
2328
|
+
runtime?: "nodejs20.x" | "nodejs22.x" | "bun1.x" | (string & {});
|
|
2329
|
+
[key: string]: unknown;
|
|
2330
|
+
}
|
|
2331
|
+
interface VercelOptions {
|
|
2332
|
+
config: VercelBuildConfigV3;
|
|
2333
|
+
/**
|
|
2334
|
+
* If you are using `vercel-edge`, you can specify the region(s) for your edge function.
|
|
2335
|
+
* @see https://vercel.com/docs/concepts/functions/edge-functions#edge-function-regions
|
|
2336
|
+
*/
|
|
2337
|
+
regions?: string[];
|
|
2338
|
+
functions?: VercelServerlessFunctionConfig;
|
|
2339
|
+
}
|
|
2340
|
+
|
|
2341
|
+
interface PresetOptions {
|
|
2342
|
+
awsAmplify?: AWSAmplifyOptions;
|
|
2343
|
+
awsLambda?: AwsLambdaOptions;
|
|
2344
|
+
azure?: AzureOptions;
|
|
2345
|
+
cloudflare?: CloudflareOptions;
|
|
2346
|
+
firebase?: FirebaseOptions;
|
|
2347
|
+
netlify?: NetlifyOptions;
|
|
2348
|
+
vercel?: VercelOptions;
|
|
2349
|
+
}
|
|
2350
|
+
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-deploy" | "deno-server" | "digital-ocean" | "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-cluster" | "node-middleware" | "node-server" | "platform-sh" | "render-com" | "standard" | "static" | "stormkit" | "vercel" | "vercel-static" | "winterjs" | "zeabur" | "zeabur-static" | "zerops" | "zerops-static";
|
|
2351
|
+
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-deploy" | "denoDeploy" | "deno_deploy" | "deno-server" | "denoServer" | "deno_server" | "digital-ocean" | "digitalOcean" | "digital_ocean" | "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-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" | "zerops" | "zerops-static" | "zeropsStatic" | "zerops_static" | (string & {});
|
|
2352
|
+
|
|
769
2353
|
type StripEnums<T extends Record<string, any>> = {
|
|
770
2354
|
[K in keyof T]: T[K] extends boolean ? T[K] : T[K] extends string ? T[K] : T[K] extends object ? T[K] : T[K] extends Array<any> ? T[K] : T[K] extends undefined ? undefined : any;
|
|
771
2355
|
};
|
|
@@ -2222,8 +3806,6 @@ interface PrerenderRoute {
|
|
|
2222
3806
|
/** @deprecated Internal type will be removed in future versions */
|
|
2223
3807
|
type PrerenderGenerateRoute = PrerenderRoute;
|
|
2224
3808
|
|
|
2225
|
-
//#endregion
|
|
2226
|
-
//#region src/compiler.d.ts
|
|
2227
3809
|
interface RouterCompilerOptions<T = any> {
|
|
2228
3810
|
matchAll?: boolean;
|
|
2229
3811
|
serialize?: (data: T) => string;
|
|
@@ -2239,6 +3821,7 @@ declare class Router<T> {
|
|
|
2239
3821
|
constructor(matchAll?: boolean);
|
|
2240
3822
|
get routes(): Route<T>[];
|
|
2241
3823
|
_update(routes: Route<T>[]): void;
|
|
3824
|
+
hasRoutes(): boolean;
|
|
2242
3825
|
compileToString(opts?: RouterCompilerOptions): string;
|
|
2243
3826
|
match(method: string, path: string): undefined | T;
|
|
2244
3827
|
matchAll(method: string, path: string): T[];
|
|
@@ -2487,6 +4070,8 @@ interface NitroOpenAPIConfig {
|
|
|
2487
4070
|
};
|
|
2488
4071
|
}
|
|
2489
4072
|
|
|
4073
|
+
type ProviderName = "" | "appveyor" | "aws_amplify" | "azure_pipelines" | "azure_static" | "appcircle" | "bamboo" | "bitbucket" | "bitrise" | "buddy" | "buildkite" | "circle" | "cirrus" | "cloudflare_pages" | "cloudflare_workers" | "codebuild" | "codefresh" | "drone" | "drone" | "dsari" | "github_actions" | "gitlab" | "gocd" | "layerci" | "hudson" | "jenkins" | "magnum" | "netlify" | "nevercode" | "render" | "sail" | "semaphore" | "screwdriver" | "shippable" | "solano" | "strider" | "teamcity" | "travis" | "vercel" | "appcenter" | "codesandbox" | "stackblitz" | "stormkit" | "cleavr" | "zeabur" | "codesphere" | "railway" | "deno-deploy" | "firebase_app_hosting";
|
|
4074
|
+
|
|
2490
4075
|
type NitroPreset = NitroConfig | (() => NitroConfig);
|
|
2491
4076
|
interface NitroPresetMeta {
|
|
2492
4077
|
name: string;
|
|
@@ -2536,6 +4121,14 @@ interface NitroOptions extends PresetOptions {
|
|
|
2536
4121
|
ssrRoutes: string[];
|
|
2537
4122
|
serveStatic: boolean | "node" | "deno" | "inline";
|
|
2538
4123
|
noPublicDir: boolean;
|
|
4124
|
+
features: {
|
|
4125
|
+
/**
|
|
4126
|
+
* Enable runtime hooks for request and response.
|
|
4127
|
+
*
|
|
4128
|
+
* By default this feature will be enabled if there is at least one nitro plugin.
|
|
4129
|
+
*/
|
|
4130
|
+
runtimeHooks: boolean;
|
|
4131
|
+
};
|
|
2539
4132
|
/**
|
|
2540
4133
|
* @experimental Requires `experimental.wasm` to work
|
|
2541
4134
|
*
|