@nightintelligence/cloudflare-workers-utils 0.35.0-patch1
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/README.md +5 -0
- package/dist/browser.d.mts +47 -0
- package/dist/browser.mjs +4 -0
- package/dist/browser.mjs.map +1 -0
- package/dist/chunk-3D4BXUZX.mjs +54 -0
- package/dist/chunk-3D4BXUZX.mjs.map +1 -0
- package/dist/chunk-4RE36JUD.mjs +3160 -0
- package/dist/chunk-4RE36JUD.mjs.map +1 -0
- package/dist/chunk-6LYDFTTF.mjs +40 -0
- package/dist/chunk-6LYDFTTF.mjs.map +1 -0
- package/dist/chunk-CPLEE7LH.mjs +64 -0
- package/dist/chunk-CPLEE7LH.mjs.map +1 -0
- package/dist/chunk-G5FCNCLK.mjs +47 -0
- package/dist/chunk-G5FCNCLK.mjs.map +1 -0
- package/dist/chunk-IGC3TZGH.mjs +157 -0
- package/dist/chunk-IGC3TZGH.mjs.map +1 -0
- package/dist/chunk-NXPJWJ2B.mjs +180 -0
- package/dist/chunk-NXPJWJ2B.mjs.map +1 -0
- package/dist/chunk-OPAKTV2K.mjs +75 -0
- package/dist/chunk-OPAKTV2K.mjs.map +1 -0
- package/dist/chunk-VKFVZ67V.mjs +35 -0
- package/dist/chunk-VKFVZ67V.mjs.map +1 -0
- package/dist/chunk-W7DIL5J2.mjs +267 -0
- package/dist/chunk-W7DIL5J2.mjs.map +1 -0
- package/dist/chunk-ZLUHKBEC.mjs +44 -0
- package/dist/chunk-ZLUHKBEC.mjs.map +1 -0
- package/dist/chunk-ZQ2EZEOC.mjs +477 -0
- package/dist/chunk-ZQ2EZEOC.mjs.map +1 -0
- package/dist/compatibility-date.d.mts +80 -0
- package/dist/compatibility-date.mjs +4 -0
- package/dist/compatibility-date.mjs.map +1 -0
- package/dist/compliance-j3-tqeao.d.mts +3616 -0
- package/dist/compliance.d.mts +4 -0
- package/dist/compliance.mjs +9 -0
- package/dist/compliance.mjs.map +1 -0
- package/dist/docker-path.d.mts +8 -0
- package/dist/docker-path.mjs +5 -0
- package/dist/docker-path.mjs.map +1 -0
- package/dist/errors.d.mts +55 -0
- package/dist/errors.mjs +4 -0
- package/dist/errors.mjs.map +1 -0
- package/dist/fs-helpers.d.mts +40 -0
- package/dist/fs-helpers.mjs +4 -0
- package/dist/fs-helpers.mjs.map +1 -0
- package/dist/global-wrangler-config-path.d.mts +35 -0
- package/dist/global-wrangler-config-path.mjs +5 -0
- package/dist/global-wrangler-config-path.mjs.map +1 -0
- package/dist/index.d.mts +1263 -0
- package/dist/index.mjs +26282 -0
- package/dist/index.mjs.map +1 -0
- package/dist/local-env.d.mts +54 -0
- package/dist/local-env.mjs +178 -0
- package/dist/local-env.mjs.map +1 -0
- package/dist/metafile-esm.json +1 -0
- package/dist/open-OYMIZX6T.mjs +609 -0
- package/dist/open-OYMIZX6T.mjs.map +1 -0
- package/dist/prometheus-metrics.d.mts +50 -0
- package/dist/prometheus-metrics.mjs +4 -0
- package/dist/prometheus-metrics.mjs.map +1 -0
- package/dist/test-helpers/index.d.mts +46 -0
- package/dist/test-helpers/index.mjs +310 -0
- package/dist/test-helpers/index.mjs.map +1 -0
- package/dist/zod-format.d.mts +6 -0
- package/dist/zod-format.mjs +4 -0
- package/dist/zod-format.mjs.map +1 -0
- package/package.json +126 -0
|
@@ -0,0 +1,3616 @@
|
|
|
1
|
+
import { URLSearchParams } from 'node:url';
|
|
2
|
+
import { RequestInit, Headers, Response as Response$1, MockAgent } from 'undici';
|
|
3
|
+
import { RouterConfig, AssetConfig } from '@cloudflare/workers-shared';
|
|
4
|
+
|
|
5
|
+
interface FetchError {
|
|
6
|
+
code: number;
|
|
7
|
+
documentation_url?: string;
|
|
8
|
+
message: string;
|
|
9
|
+
error_chain?: FetchError[];
|
|
10
|
+
/**
|
|
11
|
+
* Optional structured error metadata returned alongside the message. The
|
|
12
|
+
* Cloudflare v4 envelope permits a `meta` object whose shape varies by
|
|
13
|
+
* endpoint; consumers are expected to validate the shape at use site
|
|
14
|
+
* before relying on any field.
|
|
15
|
+
*
|
|
16
|
+
* Known usage: declarative DO exports reconciliation returns `meta.details`
|
|
17
|
+
* as an array of per-class errors.
|
|
18
|
+
*/
|
|
19
|
+
meta?: {
|
|
20
|
+
details?: unknown;
|
|
21
|
+
} & Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* `WRANGLER_C3_COMMAND` can override the command used by `wrangler init` when delegating to C3.
|
|
26
|
+
*
|
|
27
|
+
* By default this will use `create cloudflare`.
|
|
28
|
+
*
|
|
29
|
+
* To run against the beta release of C3 use:
|
|
30
|
+
*
|
|
31
|
+
* ```sh
|
|
32
|
+
* # Tell Wrangler to use the beta version of create-cloudflare
|
|
33
|
+
* WRANGLER_C3_COMMAND="create cloudflare@beta" npx wrangler init
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* To test the integration between wrangler and C3 locally, use:
|
|
37
|
+
*
|
|
38
|
+
* ```sh
|
|
39
|
+
* # Ensure both Wrangler and C3 are built
|
|
40
|
+
* npm run build
|
|
41
|
+
* # Tell Wrangler to use the local version of create-cloudflare
|
|
42
|
+
* WRANGLER_C3_COMMAND="exec ./packages/create-cloudflare" npx wrangler init temp
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* Note that you cannot use `WRANGLER_C3_COMMAND="create cloudflare@2"` if you are
|
|
46
|
+
* running Wrangler from inside the monorepo as the bin paths get messed up.
|
|
47
|
+
*/
|
|
48
|
+
declare const getC3CommandFromEnv: () => string;
|
|
49
|
+
/** Whether `DO_NOT_TRACK` is set to a supported telemetry opt-out value. */
|
|
50
|
+
declare function isDoNotTrackEnabled(): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* `WRANGLER_SEND_METRICS` controls whether we attempt to send metrics information to Sparrow.
|
|
53
|
+
* `DO_NOT_TRACK` takes precedence when it is set to an opt-out value.
|
|
54
|
+
*/
|
|
55
|
+
declare function getWranglerSendMetricsFromEnv(): boolean | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* `WRANGLER_NO_SKILLS_UPDATE_PROMPTS` suppresses the prompt that offers to
|
|
58
|
+
* update Cloudflare agent skills when they are out of date.
|
|
59
|
+
*
|
|
60
|
+
* Set to `"true"` to never be prompted for skills updates.
|
|
61
|
+
*/
|
|
62
|
+
declare const getNoSkillsUpdatePromptsFromEnv: () => boolean | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* `WRANGLER_SEND_ERROR_REPORTS` controls whether we attempt to send error reports to Sentry.
|
|
65
|
+
*
|
|
66
|
+
* Defaults to `false` to avoid noisy false-positive reports. Users can opt in
|
|
67
|
+
* by setting `WRANGLER_SEND_ERROR_REPORTS=true`.
|
|
68
|
+
*/
|
|
69
|
+
declare const getWranglerSendErrorReportsFromEnv: () => boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Set `WRANGLER_API_ENVIRONMENT` environment variable to "staging" to tell Wrangler to hit the staging APIs rather than production.
|
|
72
|
+
*/
|
|
73
|
+
declare const getCloudflareApiEnvironmentFromEnv: () => "production" | "staging";
|
|
74
|
+
/**
|
|
75
|
+
* The compliance region to use for the API requests.
|
|
76
|
+
*/
|
|
77
|
+
type ComplianceConfig = Partial<Pick<Config, "compliance_region">>;
|
|
78
|
+
/** Used for commands that explicitly do not support compliance regions other than "public" */
|
|
79
|
+
declare const COMPLIANCE_REGION_CONFIG_PUBLIC: ComplianceConfig;
|
|
80
|
+
/**
|
|
81
|
+
* Used for commands where there is no configuration available and
|
|
82
|
+
* we rely upon the CLOUDFLARE_COMPLIANCE_REGION environment variable
|
|
83
|
+
* to determine the compliance region.
|
|
84
|
+
*/
|
|
85
|
+
declare const COMPLIANCE_REGION_CONFIG_UNKNOWN: ComplianceConfig;
|
|
86
|
+
/**
|
|
87
|
+
* Set `CLOUDFLARE_COMPLIANCE_REGION` environment variable to "fedramp_high"
|
|
88
|
+
* or set the `compliance_region` property in the Wrangler configuration
|
|
89
|
+
* to tell Wrangler to run in FedRAMP High compliance region mode, rather than "public" mode.
|
|
90
|
+
*/
|
|
91
|
+
declare const getCloudflareComplianceRegion: (complianceConfig: ComplianceConfig) => "public" | "fedramp_high";
|
|
92
|
+
/**
|
|
93
|
+
* `CLOUDFLARE_API_BASE_URL` specifies the URL to the Cloudflare API.
|
|
94
|
+
*
|
|
95
|
+
* If this environment variable is not set, it will default to a URL computed from the
|
|
96
|
+
* Cloudflare compliance region and the API environment.
|
|
97
|
+
*/
|
|
98
|
+
declare const getCloudflareApiBaseUrl: (complianceConfig: ComplianceConfig) => string;
|
|
99
|
+
/**
|
|
100
|
+
* Compute the subdomain for the compliance region.
|
|
101
|
+
*/
|
|
102
|
+
declare function getComplianceRegionSubdomain(complianceConfig: ComplianceConfig): string;
|
|
103
|
+
/**
|
|
104
|
+
* `WRANGLER_LOG_SANITIZE` specifies whether we sanitize debug logs.
|
|
105
|
+
*
|
|
106
|
+
* By default we do, since debug logs could be added to GitHub issues and shouldn't include sensitive information.
|
|
107
|
+
*/
|
|
108
|
+
declare const getSanitizeLogs: () => boolean;
|
|
109
|
+
/**
|
|
110
|
+
* `WRANGLER_OUTPUT_FILE_DIRECTORY` specifies a directory where we should write a file containing output data in ND-JSON format.
|
|
111
|
+
*
|
|
112
|
+
* If this is set a random file will be created in this directory, and certain Wrangler commands will write entries to this file.
|
|
113
|
+
* This is overridden by the `WRANGLER_OUTPUT_FILE_PATH` environment variable.
|
|
114
|
+
*/
|
|
115
|
+
declare const getOutputFileDirectoryFromEnv: () => string | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* `WRANGLER_OUTPUT_FILE_PATH` specifies a path to a file where we should write output data in ND-JSON format.
|
|
118
|
+
*
|
|
119
|
+
* If this is set certain Wrangler commands will write entries to this file.
|
|
120
|
+
* This overrides the `WRANGLER_OUTPUT_FILE_DIRECTORY` environment variable.
|
|
121
|
+
*/
|
|
122
|
+
declare const getOutputFilePathFromEnv: () => string | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* `WRANGLER_CI_MATCH_TAG` specifies a Worker tag
|
|
125
|
+
*
|
|
126
|
+
* If this is set, Wrangler will ensure the Worker being targeted has this tag
|
|
127
|
+
*/
|
|
128
|
+
declare const getCIMatchTag: () => string | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* `WRANGLER_CI_OVERRIDE_NAME` specifies a Worker name
|
|
131
|
+
*
|
|
132
|
+
* If this is set, Wrangler will override the Worker name with this one
|
|
133
|
+
*/
|
|
134
|
+
declare const getCIOverrideName: () => string | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* `WRANGLER_CI_OVERRIDE_NETWORK_MODE_HOST` specifies whether --network=host should be set
|
|
137
|
+
*
|
|
138
|
+
* If this is set to true, Wrangler will use the --network=host flag when calling out to docker to build container images
|
|
139
|
+
*/
|
|
140
|
+
declare const getCIOverrideNetworkModeHost: () => string | undefined;
|
|
141
|
+
/**
|
|
142
|
+
* `WRANGLER_CI_GENERATE_PREVIEW_ALIAS` specifies whether to generate a preview alias during version upload
|
|
143
|
+
*
|
|
144
|
+
* If this is set to true, Wrangler will attempt to autogenerate the preview alias by using the branch
|
|
145
|
+
* name. If the branch name is too long and an alias cannot be created, a warning will be printed to the console.
|
|
146
|
+
*/
|
|
147
|
+
declare const getCIGeneratePreviewAlias: () => "true" | "false";
|
|
148
|
+
/**
|
|
149
|
+
* `WORKERS_CI_BRANCH` is the branch name exposed by Workers CI
|
|
150
|
+
*
|
|
151
|
+
*/
|
|
152
|
+
declare const getWorkersCIBranchName: () => string | undefined;
|
|
153
|
+
/**
|
|
154
|
+
* `WRANGLER_BUILD_CONDITIONS` specifies the "build conditions" to use when importing packages at build time.
|
|
155
|
+
*
|
|
156
|
+
* See https://nodejs.org/api/packages.html#conditional-exports
|
|
157
|
+
* and https://esbuild.github.io/api/#how-conditions-work.
|
|
158
|
+
*
|
|
159
|
+
* If this is set, Wrangler will configure esbuild to use this list of conditions.
|
|
160
|
+
* The format is a string of comma separated conditions.
|
|
161
|
+
*/
|
|
162
|
+
declare const getBuildConditionsFromEnv: () => string | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* `WRANGLER_BUILD_PLATFORM` specifies the "build platform" to use when importing packages at build time.
|
|
165
|
+
*
|
|
166
|
+
* See https://esbuild.github.io/api/#platform
|
|
167
|
+
* and https://esbuild.github.io/api/#how-conditions-work.
|
|
168
|
+
*
|
|
169
|
+
* If this is set, Wrangler will configure esbuild to use this platform.
|
|
170
|
+
*/
|
|
171
|
+
declare const getBuildPlatformFromEnv: () => string | undefined;
|
|
172
|
+
/**
|
|
173
|
+
* `WRANGLER_REGISTRY_PATH` specifies the file based dev registry folder
|
|
174
|
+
*/
|
|
175
|
+
declare const getRegistryPath: () => string;
|
|
176
|
+
/**
|
|
177
|
+
* `WRANGLER_D1_EXTRA_LOCATION_CHOICES` is an internal variable to let D1 team target their testing environments.
|
|
178
|
+
*
|
|
179
|
+
* External accounts cannot access testing environments, so should not set this variable.
|
|
180
|
+
*/
|
|
181
|
+
declare const getD1ExtraLocationChoices: () => string | undefined;
|
|
182
|
+
|
|
183
|
+
declare const getSubdomainMixedStateCheckDisabled: () => boolean;
|
|
184
|
+
/**
|
|
185
|
+
/**
|
|
186
|
+
* `CLOUDFLARE_LOAD_DEV_VARS_FROM_DOT_ENV` specifies whether to load vars for local dev from `.env` files.
|
|
187
|
+
*/
|
|
188
|
+
declare const getCloudflareLoadDevVarsFromDotEnv: () => boolean;
|
|
189
|
+
/**
|
|
190
|
+
* `CLOUDFLARE_INCLUDE_PROCESS_ENV` specifies whether to include the `process.env` in vars loaded from `.env` for local development.
|
|
191
|
+
*/
|
|
192
|
+
declare const getCloudflareIncludeProcessEnvFromEnv: () => boolean;
|
|
193
|
+
declare const getTraceHeader: () => string | undefined;
|
|
194
|
+
declare const getDisableConfigWatching: () => boolean;
|
|
195
|
+
/**
|
|
196
|
+
* Hide the Wrangler version banner and command status (deprecated/experimental) warnings
|
|
197
|
+
*/
|
|
198
|
+
declare const getWranglerHideBanner: () => boolean;
|
|
199
|
+
/**
|
|
200
|
+
* `CLOUDFLARE_ENV` specifies the currently selected Wrangler/Cloudflare environment.
|
|
201
|
+
*/
|
|
202
|
+
declare const getCloudflareEnv: () => string | undefined;
|
|
203
|
+
/**
|
|
204
|
+
* `OPEN_NEXT_DEPLOY` is an environment variables that indicates that the current process is being
|
|
205
|
+
* run by the open-next deploy command
|
|
206
|
+
*/
|
|
207
|
+
declare const getOpenNextDeployFromEnv: () => string | undefined;
|
|
208
|
+
/**
|
|
209
|
+
* `X_LOCAL_EXPLORER` enables the local explorer UI at /cdn-cgi/local/explorer.
|
|
210
|
+
*/
|
|
211
|
+
declare const getLocalExplorerEnabledFromEnv: () => boolean;
|
|
212
|
+
/**
|
|
213
|
+
* `X_LOCAL_OBSERVABILITY` turns on local-dev observability capture. Both
|
|
214
|
+
* `wrangler dev` and the Vite plugin read it and pass it through as the one
|
|
215
|
+
* `unsafeObservability` Miniflare option, which makes core attach the trace
|
|
216
|
+
* collector to each user worker.
|
|
217
|
+
*
|
|
218
|
+
* Defaults to `true` so the Local Explorer's Observability tab captures traces
|
|
219
|
+
* and logs out of the box. Set `X_LOCAL_OBSERVABILITY=false` to opt out — for
|
|
220
|
+
* example if the extra per-worker services (collector + streaming tail) cause
|
|
221
|
+
* trouble in a multi-process dev-registry setup.
|
|
222
|
+
*/
|
|
223
|
+
declare const getLocalObservabilityEnabledFromEnv: () => boolean;
|
|
224
|
+
/**
|
|
225
|
+
* `X_BROWSER_HEADFUL` opens the browser in headful (visible) mode when using the
|
|
226
|
+
* Browser Run API in local development.
|
|
227
|
+
*
|
|
228
|
+
* Set to "true" to enable:
|
|
229
|
+
*
|
|
230
|
+
* ```sh
|
|
231
|
+
* X_BROWSER_HEADFUL=true vite dev
|
|
232
|
+
* ```
|
|
233
|
+
*
|
|
234
|
+
* Note: when using `@cloudflare/playwright`, two Chrome windows may appear — the initial blank
|
|
235
|
+
* page and the one created by `browser.newPage()`. This is expected due to how Playwright handles
|
|
236
|
+
* browser contexts via CDP.
|
|
237
|
+
*/
|
|
238
|
+
declare const getBrowserRenderingHeadfulFromEnv: () => boolean;
|
|
239
|
+
/**
|
|
240
|
+
* `CLOUDFLARE_CF_FETCH_ENABLED` controls whether Miniflare fetches the `cf.json` file
|
|
241
|
+
* containing request.cf properties from workers.cloudflare.com.
|
|
242
|
+
*
|
|
243
|
+
* - If set to "false", disables fetching and uses fallback data (no files created)
|
|
244
|
+
* - If set to "true" or not set, uses the default behavior (fetches and caches cf.json)
|
|
245
|
+
*
|
|
246
|
+
* This is particularly useful for non-JavaScript projects that don't want
|
|
247
|
+
* a node_modules directory created automatically.
|
|
248
|
+
*
|
|
249
|
+
* Example:
|
|
250
|
+
* ```sh
|
|
251
|
+
* # Disable cf fetching entirely
|
|
252
|
+
* CLOUDFLARE_CF_FETCH_ENABLED=false npx wrangler dev
|
|
253
|
+
* ```
|
|
254
|
+
*/
|
|
255
|
+
declare const getCfFetchEnabledFromEnv: () => boolean;
|
|
256
|
+
/**
|
|
257
|
+
* `CLOUDFLARE_CF_FETCH_PATH` specifies a custom path for caching the cf.json file.
|
|
258
|
+
*
|
|
259
|
+
* - If set, uses the specified path instead of the default node_modules/.mf/cf.json
|
|
260
|
+
* - If not set, uses the default location (node_modules/.mf/cf.json)
|
|
261
|
+
*
|
|
262
|
+
* Example:
|
|
263
|
+
* ```sh
|
|
264
|
+
* # Use a custom cache location
|
|
265
|
+
* CLOUDFLARE_CF_FETCH_PATH=/tmp/cf-cache.json npx wrangler dev
|
|
266
|
+
* ```
|
|
267
|
+
*/
|
|
268
|
+
declare const getCfFetchPathFromEnv: () => string | undefined;
|
|
269
|
+
/**
|
|
270
|
+
* `WRANGLER_CACHE_DIR` specifies a custom directory for Wrangler's cache files.
|
|
271
|
+
* This overrides the default `node_modules/.cache/wrangler` location.
|
|
272
|
+
* Useful for Yarn PnP or projects without node_modules.
|
|
273
|
+
*/
|
|
274
|
+
declare const getWranglerCacheDirFromEnv: () => string | undefined;
|
|
275
|
+
/**
|
|
276
|
+
* `CLOUDFLARED_PATH` specifies a custom path to a cloudflared binary.
|
|
277
|
+
*
|
|
278
|
+
* If set, Wrangler will use this cloudflared binary instead of downloading one.
|
|
279
|
+
* The path must point to an existing executable file.
|
|
280
|
+
*/
|
|
281
|
+
declare const getCloudflaredPathFromEnv: () => string | undefined;
|
|
282
|
+
|
|
283
|
+
declare const LOGGER_LEVELS: {
|
|
284
|
+
readonly none: -1;
|
|
285
|
+
readonly error: 0;
|
|
286
|
+
readonly warn: 1;
|
|
287
|
+
readonly info: 2;
|
|
288
|
+
readonly log: 3;
|
|
289
|
+
readonly debug: 4;
|
|
290
|
+
};
|
|
291
|
+
type LoggerLevel = keyof typeof LOGGER_LEVELS;
|
|
292
|
+
type Logger = {
|
|
293
|
+
loggerLevel?: LoggerLevel;
|
|
294
|
+
debug: typeof console.debug;
|
|
295
|
+
debugWithSanitization?: (label: string, ...args: unknown[]) => void;
|
|
296
|
+
log: typeof console.log;
|
|
297
|
+
info: typeof console.info;
|
|
298
|
+
warn: typeof console.warn;
|
|
299
|
+
error: typeof console.error;
|
|
300
|
+
once?: {
|
|
301
|
+
info: typeof console.info;
|
|
302
|
+
log: typeof console.log;
|
|
303
|
+
warn: typeof console.warn;
|
|
304
|
+
error: typeof console.error;
|
|
305
|
+
};
|
|
306
|
+
console?<M extends Exclude<keyof Console, "Console">>(method: M, ...args: Parameters<Console[M]>): void;
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
type ApiCredentials = {
|
|
310
|
+
apiToken: string;
|
|
311
|
+
} | {
|
|
312
|
+
authKey: string;
|
|
313
|
+
authEmail: string;
|
|
314
|
+
};
|
|
315
|
+
interface FetchResult<ResponseType = unknown> {
|
|
316
|
+
success: boolean;
|
|
317
|
+
result: ResponseType;
|
|
318
|
+
errors: FetchError[];
|
|
319
|
+
messages?: (string | {
|
|
320
|
+
code?: number;
|
|
321
|
+
message: string;
|
|
322
|
+
})[];
|
|
323
|
+
result_info?: unknown;
|
|
324
|
+
}
|
|
325
|
+
type FetchResultFetcher = <ResponseType>(complianceConfig: ComplianceConfig, resource: string, init?: RequestInit, queryParams?: URLSearchParams, abortSignal?: AbortSignal) => Promise<ResponseType>;
|
|
326
|
+
type FetchListResultFetcher = <ResponseType>(complianceConfig: ComplianceConfig, resource: string, init?: RequestInit, queryParams?: URLSearchParams) => Promise<ResponseType[]>;
|
|
327
|
+
type FetchPagedListResultFetcher = <ResponseType>(complianceConfig: ComplianceConfig, resource: string, init?: RequestInit, queryParams?: URLSearchParams) => Promise<ResponseType[]>;
|
|
328
|
+
/**
|
|
329
|
+
*
|
|
330
|
+
* Note this requires its caller to handle credentials
|
|
331
|
+
* (need to call requireLoggedIn and requireApiToken)
|
|
332
|
+
*/
|
|
333
|
+
declare function performApiFetchBase(complianceConfig: ComplianceConfig, resource: string, init: RequestInit | undefined, userAgent: string, logger: Logger, queryParams?: URLSearchParams, abortSignal?: AbortSignal, credentials?: ApiCredentials): Promise<Response$1>;
|
|
334
|
+
declare function fetchInternalBase<ResponseType>(complianceConfig: ComplianceConfig, resource: string, init: RequestInit | undefined, userAgent: string, logger: Logger, queryParams?: URLSearchParams, abortSignal?: AbortSignal, credentials?: ApiCredentials): Promise<{
|
|
335
|
+
response: ResponseType;
|
|
336
|
+
status: number;
|
|
337
|
+
retryAfterMs?: number;
|
|
338
|
+
}>;
|
|
339
|
+
declare function fetchResultBase<ResponseType>(complianceConfig: ComplianceConfig, resource: string, init: RequestInit | undefined, userAgent: string, logger: Logger, queryParams?: URLSearchParams, abortSignal?: AbortSignal, credentials?: ApiCredentials): Promise<ResponseType>;
|
|
340
|
+
declare function fetchListResultBase<ResponseType>(complianceConfig: ComplianceConfig, resource: string, init: RequestInit | undefined, userAgent: string, logger: Logger, queryParams?: URLSearchParams, credentials?: ApiCredentials): Promise<ResponseType[]>;
|
|
341
|
+
declare function truncate(text: string, maxLength: number): string;
|
|
342
|
+
declare function isWAFBlockResponse(headers: Headers): boolean;
|
|
343
|
+
/**
|
|
344
|
+
* Parses a `Retry-After` header value (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After)
|
|
345
|
+
* into milliseconds to wait before retrying, or `undefined` if absent/unparsable.
|
|
346
|
+
*
|
|
347
|
+
* Per the HTTP spec, `Retry-After` may either be a number of delay-seconds,
|
|
348
|
+
* or an HTTP-date after which the request may be retried.
|
|
349
|
+
*/
|
|
350
|
+
declare function parseRetryAfterValue(retryAfter: string | null | undefined): number | undefined;
|
|
351
|
+
/** Same as {@link parseRetryAfterValue}, reading the value from a `Headers` object. */
|
|
352
|
+
declare function parseRetryAfterMs(headers: Headers): number | undefined;
|
|
353
|
+
declare function extractWAFBlockRayId(headers: Headers): string | undefined;
|
|
354
|
+
declare function extractAccountTag(resource: string): string | undefined;
|
|
355
|
+
interface PageResultInfo {
|
|
356
|
+
page: number;
|
|
357
|
+
per_page: number;
|
|
358
|
+
count: number;
|
|
359
|
+
total_count: number;
|
|
360
|
+
}
|
|
361
|
+
declare function hasMorePages(result_info: unknown): result_info is PageResultInfo;
|
|
362
|
+
declare function renderError(err: FetchError | {
|
|
363
|
+
code?: number;
|
|
364
|
+
message?: string;
|
|
365
|
+
documentation_url?: string;
|
|
366
|
+
}, level?: number): string;
|
|
367
|
+
declare function addAuthorizationHeader(headers: Headers, auth: ApiCredentials, overrideExisting?: boolean): void;
|
|
368
|
+
declare function throwFetchError(resource: string, response: FetchResult<unknown>, status: number, retryAfterMs?: number): never;
|
|
369
|
+
/**
|
|
370
|
+
* Fetch a raw KV value from the Cloudflare API.
|
|
371
|
+
*
|
|
372
|
+
* This is special-cased because it's the only API endpoint that returns raw
|
|
373
|
+
* binary data instead of a JSON envelope.
|
|
374
|
+
*
|
|
375
|
+
* Note: callers must call encodeURIComponent on `key` before passing it.
|
|
376
|
+
*/
|
|
377
|
+
declare function fetchKVGetValueBase(complianceConfig: ComplianceConfig, accountId: string, namespaceId: string, key: string, userAgent: string, logger: Logger, credentials: ApiCredentials): Promise<ArrayBuffer>;
|
|
378
|
+
type FetchKVGetValueFetcher = (complianceConfig: ComplianceConfig, accountId: string, namespaceId: string, key: string) => Promise<ArrayBuffer>;
|
|
379
|
+
declare function hasCursor(result_info: unknown): result_info is {
|
|
380
|
+
cursor: string;
|
|
381
|
+
};
|
|
382
|
+
declare function maybeAddTraceHeader(headers: Headers): void;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* A symbol to inherit a binding from the deployed worker.
|
|
386
|
+
*/
|
|
387
|
+
declare const INHERIT_SYMBOL: unique symbol;
|
|
388
|
+
declare const SERVICE_TAG_PREFIX = "cf:service=";
|
|
389
|
+
declare const ENVIRONMENT_TAG_PREFIX = "cf:environment=";
|
|
390
|
+
declare const PATH_TO_DEPLOY_CONFIG = ".wrangler/deploy/config.json";
|
|
391
|
+
/**
|
|
392
|
+
* Config formats that use JSON parsing
|
|
393
|
+
*/
|
|
394
|
+
declare const JSON_CONFIG_FORMATS: readonly string[];
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* The type of Worker
|
|
398
|
+
*/
|
|
399
|
+
type CfScriptFormat = "modules" | "service-worker";
|
|
400
|
+
/**
|
|
401
|
+
* A module type.
|
|
402
|
+
*/
|
|
403
|
+
type CfModuleType = "esm" | "commonjs" | "compiled-wasm" | "text" | "buffer" | "python" | "python-requirement";
|
|
404
|
+
/**
|
|
405
|
+
* An imported module.
|
|
406
|
+
*/
|
|
407
|
+
interface CfModule {
|
|
408
|
+
/**
|
|
409
|
+
* The module name.
|
|
410
|
+
*
|
|
411
|
+
* @example
|
|
412
|
+
* './src/index.js'
|
|
413
|
+
*/
|
|
414
|
+
name: string;
|
|
415
|
+
/**
|
|
416
|
+
* The absolute path of the module on disk, or `undefined` if this is a
|
|
417
|
+
* virtual module. Used as the source URL for this module, so source maps are
|
|
418
|
+
* correctly resolved.
|
|
419
|
+
*
|
|
420
|
+
* @example
|
|
421
|
+
* '/path/to/src/index.js'
|
|
422
|
+
*/
|
|
423
|
+
filePath: string | undefined;
|
|
424
|
+
/**
|
|
425
|
+
* The module content, usually JavaScript or WASM code.
|
|
426
|
+
*
|
|
427
|
+
* @example
|
|
428
|
+
* export default {
|
|
429
|
+
* async fetch(request) {
|
|
430
|
+
* return new Response('Ok')
|
|
431
|
+
* }
|
|
432
|
+
* }
|
|
433
|
+
*/
|
|
434
|
+
content: string | Buffer<ArrayBuffer>;
|
|
435
|
+
/**
|
|
436
|
+
* An optional sourcemap for this module if it's of a ESM or CJS type, this will only be present
|
|
437
|
+
* if we're deploying with sourcemaps enabled. Since we copy extra modules that aren't bundled
|
|
438
|
+
* we need to also copy the relevant sourcemaps into the final out directory.
|
|
439
|
+
*/
|
|
440
|
+
sourceMap?: CfWorkerSourceMap;
|
|
441
|
+
/**
|
|
442
|
+
* The module type.
|
|
443
|
+
*
|
|
444
|
+
* If absent, will default to the main module's type.
|
|
445
|
+
*/
|
|
446
|
+
type?: CfModuleType;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* A map of variable names to values.
|
|
450
|
+
*/
|
|
451
|
+
interface CfVars {
|
|
452
|
+
[key: string]: string | Json;
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* A KV namespace.
|
|
456
|
+
*/
|
|
457
|
+
interface CfKvNamespace {
|
|
458
|
+
binding: string;
|
|
459
|
+
id?: string | typeof INHERIT_SYMBOL;
|
|
460
|
+
remote?: boolean;
|
|
461
|
+
raw?: boolean;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* A binding to send email.
|
|
465
|
+
*/
|
|
466
|
+
type CfSendEmailBindings = {
|
|
467
|
+
name: string;
|
|
468
|
+
remote?: boolean;
|
|
469
|
+
allowed_sender_addresses?: string[];
|
|
470
|
+
} & ({
|
|
471
|
+
destination_address: string;
|
|
472
|
+
allowed_destination_addresses?: never;
|
|
473
|
+
} | {
|
|
474
|
+
destination_address?: never;
|
|
475
|
+
allowed_destination_addresses: string[];
|
|
476
|
+
} | {
|
|
477
|
+
destination_address?: never;
|
|
478
|
+
allowed_destination_addresses?: never;
|
|
479
|
+
});
|
|
480
|
+
/**
|
|
481
|
+
* A binding to a wasm module (in service-worker format)
|
|
482
|
+
*/
|
|
483
|
+
interface CfWasmModuleBindings {
|
|
484
|
+
[key: string]: string | Uint8Array<ArrayBuffer>;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* A binding to a text blob (in service-worker format)
|
|
488
|
+
*/
|
|
489
|
+
interface CfTextBlobBindings {
|
|
490
|
+
[key: string]: string;
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* A binding to a browser
|
|
494
|
+
*/
|
|
495
|
+
interface CfBrowserBinding {
|
|
496
|
+
binding: string;
|
|
497
|
+
raw?: boolean;
|
|
498
|
+
remote?: boolean;
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* A binding to the AI project
|
|
502
|
+
*/
|
|
503
|
+
interface CfAIBinding {
|
|
504
|
+
binding: string;
|
|
505
|
+
staging?: boolean;
|
|
506
|
+
remote?: boolean;
|
|
507
|
+
raw?: boolean;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* A binding to Cloudflare Images
|
|
511
|
+
*/
|
|
512
|
+
interface CfImagesBinding {
|
|
513
|
+
binding: string;
|
|
514
|
+
raw?: boolean;
|
|
515
|
+
remote?: boolean;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* A binding to Cloudflare Media Transformations
|
|
519
|
+
*/
|
|
520
|
+
interface CfMediaBinding {
|
|
521
|
+
binding: string;
|
|
522
|
+
remote?: boolean;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* A binding to Cloudflare Stream
|
|
526
|
+
*/
|
|
527
|
+
interface CfStreamBinding {
|
|
528
|
+
binding: string;
|
|
529
|
+
remote?: boolean;
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* A binding to the Worker Version's metadata
|
|
533
|
+
*/
|
|
534
|
+
interface CfVersionMetadataBinding {
|
|
535
|
+
binding: string;
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* A binding to a data blob (in service-worker format)
|
|
539
|
+
*/
|
|
540
|
+
interface CfDataBlobBindings {
|
|
541
|
+
[key: string]: string | Uint8Array<ArrayBuffer>;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* A Durable Object.
|
|
545
|
+
*/
|
|
546
|
+
interface CfDurableObject {
|
|
547
|
+
name: string;
|
|
548
|
+
class_name: string;
|
|
549
|
+
script_name?: string;
|
|
550
|
+
environment?: string;
|
|
551
|
+
}
|
|
552
|
+
interface CfWorkflow {
|
|
553
|
+
name: string;
|
|
554
|
+
class_name: string;
|
|
555
|
+
binding: string;
|
|
556
|
+
script_name?: string;
|
|
557
|
+
raw?: boolean;
|
|
558
|
+
limits?: {
|
|
559
|
+
steps?: number;
|
|
560
|
+
};
|
|
561
|
+
concurrency?: {
|
|
562
|
+
limit?: number;
|
|
563
|
+
};
|
|
564
|
+
schedules?: string | string[];
|
|
565
|
+
}
|
|
566
|
+
interface CfQueue {
|
|
567
|
+
binding: string;
|
|
568
|
+
queue_name?: string | typeof INHERIT_SYMBOL;
|
|
569
|
+
delivery_delay?: number;
|
|
570
|
+
remote?: boolean;
|
|
571
|
+
raw?: boolean;
|
|
572
|
+
}
|
|
573
|
+
interface CfR2Bucket {
|
|
574
|
+
binding: string;
|
|
575
|
+
bucket_name?: string | typeof INHERIT_SYMBOL;
|
|
576
|
+
jurisdiction?: string;
|
|
577
|
+
remote?: boolean;
|
|
578
|
+
raw?: boolean;
|
|
579
|
+
/** Settings that only apply to local development */
|
|
580
|
+
local_dev?: {
|
|
581
|
+
/** EXPERIMENTAL: credentials for the local S3-compatible endpoint */
|
|
582
|
+
experimental_s3_credentials?: LocalS3Credentials;
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
interface CfD1Database {
|
|
586
|
+
binding: string;
|
|
587
|
+
database_id?: string | typeof INHERIT_SYMBOL;
|
|
588
|
+
database_name?: string;
|
|
589
|
+
preview_database_id?: string;
|
|
590
|
+
database_internal_env?: string;
|
|
591
|
+
migrations_table?: string;
|
|
592
|
+
migrations_dir?: string;
|
|
593
|
+
migrations_pattern?: string;
|
|
594
|
+
remote?: boolean;
|
|
595
|
+
raw?: boolean;
|
|
596
|
+
}
|
|
597
|
+
interface CfVectorize {
|
|
598
|
+
binding: string;
|
|
599
|
+
index_name: string;
|
|
600
|
+
raw?: boolean;
|
|
601
|
+
remote?: boolean;
|
|
602
|
+
}
|
|
603
|
+
interface CfAISearchNamespace {
|
|
604
|
+
binding: string;
|
|
605
|
+
namespace: string | typeof INHERIT_SYMBOL;
|
|
606
|
+
remote?: boolean;
|
|
607
|
+
}
|
|
608
|
+
interface CfAISearch {
|
|
609
|
+
binding: string;
|
|
610
|
+
instance_name: string;
|
|
611
|
+
remote?: boolean;
|
|
612
|
+
}
|
|
613
|
+
interface CfWebSearch {
|
|
614
|
+
binding: string;
|
|
615
|
+
remote?: boolean;
|
|
616
|
+
}
|
|
617
|
+
interface CfAgentMemory {
|
|
618
|
+
binding: string;
|
|
619
|
+
namespace: string | typeof INHERIT_SYMBOL;
|
|
620
|
+
remote?: boolean;
|
|
621
|
+
}
|
|
622
|
+
interface CfSecretsStoreSecrets {
|
|
623
|
+
binding: string;
|
|
624
|
+
store_id: string;
|
|
625
|
+
secret_name: string;
|
|
626
|
+
}
|
|
627
|
+
interface CfArtifacts {
|
|
628
|
+
binding: string;
|
|
629
|
+
namespace: string;
|
|
630
|
+
remote?: boolean;
|
|
631
|
+
}
|
|
632
|
+
interface CfHelloWorld {
|
|
633
|
+
binding: string;
|
|
634
|
+
enable_timer?: boolean;
|
|
635
|
+
}
|
|
636
|
+
interface CfFlagship {
|
|
637
|
+
binding: string;
|
|
638
|
+
app_id?: string | typeof INHERIT_SYMBOL;
|
|
639
|
+
remote?: boolean;
|
|
640
|
+
}
|
|
641
|
+
interface CfWorkerLoader {
|
|
642
|
+
binding: string;
|
|
643
|
+
}
|
|
644
|
+
interface CfRateLimit {
|
|
645
|
+
name: string;
|
|
646
|
+
namespace_id: string;
|
|
647
|
+
simple: {
|
|
648
|
+
limit: number;
|
|
649
|
+
period: 10 | 60;
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
interface CfHyperdrive {
|
|
653
|
+
binding: string;
|
|
654
|
+
id: string;
|
|
655
|
+
localConnectionString?: string;
|
|
656
|
+
}
|
|
657
|
+
interface CfDevPluginCfg {
|
|
658
|
+
plugin: {
|
|
659
|
+
/**
|
|
660
|
+
* Package is the bare specifier of the package that exposes plugins to integrate into Miniflare via a named `plugins` export.
|
|
661
|
+
* @example "@cloudflare/my-external-miniflare-plugin"
|
|
662
|
+
*/
|
|
663
|
+
package: string;
|
|
664
|
+
/**
|
|
665
|
+
* Plugin is the name of the plugin exposed by the package.
|
|
666
|
+
* @example "my-unsafe-plugin"
|
|
667
|
+
*/
|
|
668
|
+
name: string;
|
|
669
|
+
};
|
|
670
|
+
/**
|
|
671
|
+
* dev-only options to pass to the plugin.
|
|
672
|
+
*/
|
|
673
|
+
options?: Record<string, unknown>;
|
|
674
|
+
}
|
|
675
|
+
interface CfService {
|
|
676
|
+
binding: string;
|
|
677
|
+
service: string;
|
|
678
|
+
environment?: string;
|
|
679
|
+
entrypoint?: string;
|
|
680
|
+
props?: Record<string, unknown>;
|
|
681
|
+
remote?: boolean;
|
|
682
|
+
cross_account_grant?: string;
|
|
683
|
+
dev?: CfDevPluginCfg;
|
|
684
|
+
}
|
|
685
|
+
interface CfVpcService {
|
|
686
|
+
binding: string;
|
|
687
|
+
service_id: string;
|
|
688
|
+
remote?: boolean;
|
|
689
|
+
}
|
|
690
|
+
interface CfVpcNetwork {
|
|
691
|
+
binding: string;
|
|
692
|
+
tunnel_id?: string;
|
|
693
|
+
network_id?: string;
|
|
694
|
+
remote?: boolean;
|
|
695
|
+
}
|
|
696
|
+
interface CfAnalyticsEngineDataset {
|
|
697
|
+
binding: string;
|
|
698
|
+
dataset?: string;
|
|
699
|
+
}
|
|
700
|
+
interface CfDispatchNamespace {
|
|
701
|
+
binding: string;
|
|
702
|
+
namespace?: string | typeof INHERIT_SYMBOL;
|
|
703
|
+
outbound?: {
|
|
704
|
+
service: string;
|
|
705
|
+
environment?: string;
|
|
706
|
+
parameters?: string[];
|
|
707
|
+
};
|
|
708
|
+
remote?: boolean;
|
|
709
|
+
}
|
|
710
|
+
interface CfMTlsCertificate {
|
|
711
|
+
binding: string;
|
|
712
|
+
certificate_id: string;
|
|
713
|
+
remote?: boolean;
|
|
714
|
+
}
|
|
715
|
+
interface CfLogfwdr {
|
|
716
|
+
bindings: CfLogfwdrBinding[];
|
|
717
|
+
}
|
|
718
|
+
interface CfLogfwdrBinding {
|
|
719
|
+
name: string;
|
|
720
|
+
destination: string;
|
|
721
|
+
}
|
|
722
|
+
interface CfAssetsBinding {
|
|
723
|
+
binding: string;
|
|
724
|
+
}
|
|
725
|
+
interface CfPipeline {
|
|
726
|
+
binding: string;
|
|
727
|
+
stream?: string;
|
|
728
|
+
pipeline?: string;
|
|
729
|
+
remote?: boolean;
|
|
730
|
+
}
|
|
731
|
+
interface CfUnsafeBinding {
|
|
732
|
+
name: string;
|
|
733
|
+
type: string;
|
|
734
|
+
dev?: CfDevPluginCfg;
|
|
735
|
+
}
|
|
736
|
+
type CfUnsafeMetadata = Record<string, unknown>;
|
|
737
|
+
type CfCapnp = {
|
|
738
|
+
base_path?: never;
|
|
739
|
+
source_schemas?: never;
|
|
740
|
+
compiled_schema: string;
|
|
741
|
+
} | {
|
|
742
|
+
base_path: string;
|
|
743
|
+
source_schemas: string[];
|
|
744
|
+
compiled_schema?: never;
|
|
745
|
+
};
|
|
746
|
+
interface CfUnsafe {
|
|
747
|
+
bindings: CfUnsafeBinding[] | undefined;
|
|
748
|
+
metadata: CfUnsafeMetadata | undefined;
|
|
749
|
+
capnp: CfCapnp | undefined;
|
|
750
|
+
}
|
|
751
|
+
interface CfDurableObjectMigrations {
|
|
752
|
+
old_tag?: string;
|
|
753
|
+
new_tag: string;
|
|
754
|
+
steps: {
|
|
755
|
+
new_classes?: string[];
|
|
756
|
+
new_sqlite_classes?: string[];
|
|
757
|
+
renamed_classes?: {
|
|
758
|
+
from: string;
|
|
759
|
+
to: string;
|
|
760
|
+
}[];
|
|
761
|
+
deleted_classes?: string[];
|
|
762
|
+
}[];
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* The declarative `exports` map keyed by class name.
|
|
766
|
+
*
|
|
767
|
+
* Durable Objects can only be configured by `exports` or `migrations`, not both.
|
|
768
|
+
*/
|
|
769
|
+
type CfExports = Exports;
|
|
770
|
+
type CfPlacement = {
|
|
771
|
+
mode: "smart";
|
|
772
|
+
hint?: string;
|
|
773
|
+
} | {
|
|
774
|
+
mode?: "targeted";
|
|
775
|
+
region: string;
|
|
776
|
+
} | {
|
|
777
|
+
mode?: "targeted";
|
|
778
|
+
host: string;
|
|
779
|
+
} | {
|
|
780
|
+
mode?: "targeted";
|
|
781
|
+
hostname: string;
|
|
782
|
+
};
|
|
783
|
+
interface CfTailConsumer {
|
|
784
|
+
service: string;
|
|
785
|
+
environment?: string;
|
|
786
|
+
}
|
|
787
|
+
interface CfUserLimits {
|
|
788
|
+
cpu_ms?: number;
|
|
789
|
+
subrequests?: number;
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* Options for creating a `CfWorker`.
|
|
793
|
+
*/
|
|
794
|
+
interface CfWorkerInit {
|
|
795
|
+
/**
|
|
796
|
+
* The name of the worker.
|
|
797
|
+
*/
|
|
798
|
+
name: string | undefined;
|
|
799
|
+
/**
|
|
800
|
+
* The entrypoint module.
|
|
801
|
+
*/
|
|
802
|
+
main: CfModule;
|
|
803
|
+
/**
|
|
804
|
+
* The list of additional modules.
|
|
805
|
+
*/
|
|
806
|
+
modules: CfModule[] | undefined;
|
|
807
|
+
/**
|
|
808
|
+
* The list of source maps to include on upload.
|
|
809
|
+
*/
|
|
810
|
+
sourceMaps: CfWorkerSourceMap[] | undefined;
|
|
811
|
+
/**
|
|
812
|
+
* A container is linked to its Durable Object either by `class_name`, or by
|
|
813
|
+
* the Durable Object's `exports` entry naming the container by `name`.
|
|
814
|
+
*/
|
|
815
|
+
containers: {
|
|
816
|
+
name?: string;
|
|
817
|
+
class_name?: string;
|
|
818
|
+
}[] | undefined;
|
|
819
|
+
migrations: CfDurableObjectMigrations | undefined;
|
|
820
|
+
/**
|
|
821
|
+
* Declarative exports configuration. Durable Object entries are sent instead
|
|
822
|
+
* of `migrations`.
|
|
823
|
+
*/
|
|
824
|
+
exports: CfExports | undefined;
|
|
825
|
+
compatibility_date: string | undefined;
|
|
826
|
+
compatibility_flags: string[] | undefined;
|
|
827
|
+
keepVars: boolean | undefined;
|
|
828
|
+
keepSecrets: boolean | undefined;
|
|
829
|
+
keepBindings?: WorkerMetadata["keep_bindings"];
|
|
830
|
+
logpush: boolean | undefined;
|
|
831
|
+
placement: CfPlacement | undefined;
|
|
832
|
+
tail_consumers: CfTailConsumer[] | undefined;
|
|
833
|
+
streaming_tail_consumers?: CfTailConsumer[] | undefined;
|
|
834
|
+
limits: CfUserLimits | undefined;
|
|
835
|
+
annotations?: Record<string, string | undefined>;
|
|
836
|
+
keep_assets?: boolean | undefined;
|
|
837
|
+
assets: {
|
|
838
|
+
jwt: string;
|
|
839
|
+
routerConfig: RouterConfig;
|
|
840
|
+
assetConfig: AssetConfig;
|
|
841
|
+
run_worker_first?: string[] | boolean;
|
|
842
|
+
_redirects?: string;
|
|
843
|
+
_headers?: string;
|
|
844
|
+
} | undefined;
|
|
845
|
+
observability: Observability | undefined;
|
|
846
|
+
cache: CacheOptions | undefined;
|
|
847
|
+
/**
|
|
848
|
+
* The list of npm package dependencies collected from the project's package.json.
|
|
849
|
+
* Sent to the API for instrumentation and analytics purposes.
|
|
850
|
+
*/
|
|
851
|
+
package_dependencies?: Array<{
|
|
852
|
+
name: string;
|
|
853
|
+
packageJsonVersion: string;
|
|
854
|
+
installedVersion: string;
|
|
855
|
+
}> | undefined;
|
|
856
|
+
}
|
|
857
|
+
interface CfWorkerContext {
|
|
858
|
+
env: string | undefined;
|
|
859
|
+
zone: string | undefined;
|
|
860
|
+
host: string | undefined;
|
|
861
|
+
routes: Route[] | undefined;
|
|
862
|
+
sendMetrics: boolean | undefined;
|
|
863
|
+
}
|
|
864
|
+
interface CfWorkerSourceMap {
|
|
865
|
+
/**
|
|
866
|
+
* The name of the source map.
|
|
867
|
+
*
|
|
868
|
+
* @example
|
|
869
|
+
* 'out.js.map'
|
|
870
|
+
*/
|
|
871
|
+
name: string;
|
|
872
|
+
/**
|
|
873
|
+
* The content of the source map, which is a JSON object described by the v3
|
|
874
|
+
* spec.
|
|
875
|
+
*
|
|
876
|
+
* @example
|
|
877
|
+
* {
|
|
878
|
+
* "version" : 3,
|
|
879
|
+
* "file": "out.js",
|
|
880
|
+
* "sourceRoot": "",
|
|
881
|
+
* "sources": ["foo.js", "bar.js"],
|
|
882
|
+
* "sourcesContent": [null, null],
|
|
883
|
+
* "names": ["src", "maps", "are", "fun"],
|
|
884
|
+
* "mappings": "A,AAAB;;ABCDE;"
|
|
885
|
+
* }
|
|
886
|
+
*/
|
|
887
|
+
content: string | Buffer;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
type Json = string | number | boolean | null | Json[] | {
|
|
891
|
+
[id: string]: Json;
|
|
892
|
+
};
|
|
893
|
+
type WorkerMetadataBinding = {
|
|
894
|
+
type: "inherit";
|
|
895
|
+
name: string;
|
|
896
|
+
} | {
|
|
897
|
+
type: "plain_text";
|
|
898
|
+
name: string;
|
|
899
|
+
text: string;
|
|
900
|
+
} | {
|
|
901
|
+
type: "secret_text";
|
|
902
|
+
name: string;
|
|
903
|
+
text: string;
|
|
904
|
+
} | {
|
|
905
|
+
type: "json";
|
|
906
|
+
name: string;
|
|
907
|
+
json: Json;
|
|
908
|
+
} | {
|
|
909
|
+
type: "wasm_module";
|
|
910
|
+
name: string;
|
|
911
|
+
part: string;
|
|
912
|
+
} | {
|
|
913
|
+
type: "text_blob";
|
|
914
|
+
name: string;
|
|
915
|
+
part: string;
|
|
916
|
+
} | {
|
|
917
|
+
type: "browser";
|
|
918
|
+
name: string;
|
|
919
|
+
raw?: boolean;
|
|
920
|
+
} | {
|
|
921
|
+
type: "ai";
|
|
922
|
+
name: string;
|
|
923
|
+
staging?: boolean;
|
|
924
|
+
raw?: boolean;
|
|
925
|
+
} | {
|
|
926
|
+
type: "images";
|
|
927
|
+
name: string;
|
|
928
|
+
raw?: boolean;
|
|
929
|
+
} | {
|
|
930
|
+
type: "stream";
|
|
931
|
+
name: string;
|
|
932
|
+
} | {
|
|
933
|
+
type: "version_metadata";
|
|
934
|
+
name: string;
|
|
935
|
+
} | {
|
|
936
|
+
type: "data_blob";
|
|
937
|
+
name: string;
|
|
938
|
+
part: string;
|
|
939
|
+
} | {
|
|
940
|
+
type: "ai_search_namespace";
|
|
941
|
+
name: string;
|
|
942
|
+
namespace: string;
|
|
943
|
+
} | {
|
|
944
|
+
type: "ai_search";
|
|
945
|
+
name: string;
|
|
946
|
+
instance_name: string;
|
|
947
|
+
} | {
|
|
948
|
+
type: "websearch";
|
|
949
|
+
name: string;
|
|
950
|
+
} | {
|
|
951
|
+
type: "agent_memory";
|
|
952
|
+
name: string;
|
|
953
|
+
namespace: string;
|
|
954
|
+
} | {
|
|
955
|
+
type: "kv_namespace";
|
|
956
|
+
name: string;
|
|
957
|
+
namespace_id: string;
|
|
958
|
+
raw?: boolean;
|
|
959
|
+
} | {
|
|
960
|
+
type: "media";
|
|
961
|
+
name: string;
|
|
962
|
+
} | {
|
|
963
|
+
type: "send_email";
|
|
964
|
+
name: string;
|
|
965
|
+
destination_address?: string;
|
|
966
|
+
allowed_destination_addresses?: string[];
|
|
967
|
+
allowed_sender_addresses?: string[];
|
|
968
|
+
} | {
|
|
969
|
+
type: "durable_object_namespace";
|
|
970
|
+
name: string;
|
|
971
|
+
class_name: string;
|
|
972
|
+
script_name?: string;
|
|
973
|
+
environment?: string;
|
|
974
|
+
namespace_id?: string;
|
|
975
|
+
} | {
|
|
976
|
+
type: "workflow";
|
|
977
|
+
name: string;
|
|
978
|
+
workflow_name: string;
|
|
979
|
+
class_name: string;
|
|
980
|
+
script_name?: string;
|
|
981
|
+
raw?: boolean;
|
|
982
|
+
} | {
|
|
983
|
+
type: "queue";
|
|
984
|
+
name: string;
|
|
985
|
+
queue_name: string;
|
|
986
|
+
delivery_delay?: number;
|
|
987
|
+
raw?: boolean;
|
|
988
|
+
} | {
|
|
989
|
+
type: "r2_bucket";
|
|
990
|
+
name: string;
|
|
991
|
+
bucket_name: string;
|
|
992
|
+
jurisdiction?: string;
|
|
993
|
+
raw?: boolean;
|
|
994
|
+
} | {
|
|
995
|
+
type: "d1";
|
|
996
|
+
name: string;
|
|
997
|
+
id: string;
|
|
998
|
+
internalEnv?: string;
|
|
999
|
+
raw?: boolean;
|
|
1000
|
+
} | {
|
|
1001
|
+
type: "vectorize";
|
|
1002
|
+
name: string;
|
|
1003
|
+
index_name: string;
|
|
1004
|
+
internalEnv?: string;
|
|
1005
|
+
raw?: boolean;
|
|
1006
|
+
} | {
|
|
1007
|
+
type: "hyperdrive";
|
|
1008
|
+
name: string;
|
|
1009
|
+
id: string;
|
|
1010
|
+
} | {
|
|
1011
|
+
type: "service";
|
|
1012
|
+
name: string;
|
|
1013
|
+
service: string;
|
|
1014
|
+
environment?: string;
|
|
1015
|
+
entrypoint?: string;
|
|
1016
|
+
cross_account_grant?: string;
|
|
1017
|
+
} | {
|
|
1018
|
+
type: "analytics_engine";
|
|
1019
|
+
name: string;
|
|
1020
|
+
dataset?: string;
|
|
1021
|
+
} | {
|
|
1022
|
+
type: "dispatch_namespace";
|
|
1023
|
+
name: string;
|
|
1024
|
+
namespace: string;
|
|
1025
|
+
outbound?: {
|
|
1026
|
+
worker: {
|
|
1027
|
+
service: string;
|
|
1028
|
+
environment?: string;
|
|
1029
|
+
};
|
|
1030
|
+
params?: {
|
|
1031
|
+
name: string;
|
|
1032
|
+
}[];
|
|
1033
|
+
};
|
|
1034
|
+
} | {
|
|
1035
|
+
type: "mtls_certificate";
|
|
1036
|
+
name: string;
|
|
1037
|
+
certificate_id: string;
|
|
1038
|
+
} | {
|
|
1039
|
+
type: "pipelines";
|
|
1040
|
+
name: string;
|
|
1041
|
+
stream?: string;
|
|
1042
|
+
pipeline?: string;
|
|
1043
|
+
} | {
|
|
1044
|
+
type: "secrets_store_secret";
|
|
1045
|
+
name: string;
|
|
1046
|
+
store_id: string;
|
|
1047
|
+
secret_name: string;
|
|
1048
|
+
} | {
|
|
1049
|
+
type: "artifacts";
|
|
1050
|
+
name: string;
|
|
1051
|
+
namespace: string;
|
|
1052
|
+
} | {
|
|
1053
|
+
type: "unsafe_hello_world";
|
|
1054
|
+
name: string;
|
|
1055
|
+
enable_timer?: boolean;
|
|
1056
|
+
} | {
|
|
1057
|
+
type: "flagship";
|
|
1058
|
+
name: string;
|
|
1059
|
+
app_id: string;
|
|
1060
|
+
} | {
|
|
1061
|
+
type: "ratelimit";
|
|
1062
|
+
name: string;
|
|
1063
|
+
namespace_id: string;
|
|
1064
|
+
simple: {
|
|
1065
|
+
limit: number;
|
|
1066
|
+
period: 10 | 60;
|
|
1067
|
+
};
|
|
1068
|
+
} | {
|
|
1069
|
+
type: "vpc_service";
|
|
1070
|
+
name: string;
|
|
1071
|
+
service_id: string;
|
|
1072
|
+
} | {
|
|
1073
|
+
type: "vpc_network";
|
|
1074
|
+
name: string;
|
|
1075
|
+
tunnel_id?: string;
|
|
1076
|
+
network_id?: string;
|
|
1077
|
+
} | {
|
|
1078
|
+
type: "worker_loader";
|
|
1079
|
+
name: string;
|
|
1080
|
+
} | {
|
|
1081
|
+
type: "logfwdr";
|
|
1082
|
+
name: string;
|
|
1083
|
+
destination: string;
|
|
1084
|
+
} | {
|
|
1085
|
+
type: "assets";
|
|
1086
|
+
name: string;
|
|
1087
|
+
};
|
|
1088
|
+
type AssetConfigMetadata = {
|
|
1089
|
+
html_handling?: AssetConfig["html_handling"];
|
|
1090
|
+
not_found_handling?: AssetConfig["not_found_handling"];
|
|
1091
|
+
run_worker_first?: boolean | string[];
|
|
1092
|
+
_redirects?: string;
|
|
1093
|
+
_headers?: string;
|
|
1094
|
+
};
|
|
1095
|
+
type AssetsOptions = {
|
|
1096
|
+
directory: string;
|
|
1097
|
+
binding?: string;
|
|
1098
|
+
routerConfig: RouterConfig;
|
|
1099
|
+
assetConfig: AssetConfig;
|
|
1100
|
+
_redirects?: string;
|
|
1101
|
+
_headers?: string;
|
|
1102
|
+
run_worker_first?: boolean | string[];
|
|
1103
|
+
};
|
|
1104
|
+
/**
|
|
1105
|
+
* The result of validating and resolving the assets directory, before the
|
|
1106
|
+
* full {@link AssetsOptions} are resolved. Produced by the validation half of
|
|
1107
|
+
* `getAssetsOptions` and consumed by `resolveAssetOptions`.
|
|
1108
|
+
*/
|
|
1109
|
+
type ValidatedAssetsOptions = {
|
|
1110
|
+
directory: string;
|
|
1111
|
+
binding?: string;
|
|
1112
|
+
directoryExists: boolean;
|
|
1113
|
+
};
|
|
1114
|
+
/**
|
|
1115
|
+
* Information about the assets that should be uploaded
|
|
1116
|
+
*/
|
|
1117
|
+
interface LegacyAssetPaths {
|
|
1118
|
+
/**
|
|
1119
|
+
* Absolute path to the root of the project.
|
|
1120
|
+
*
|
|
1121
|
+
* This is the directory containing wrangler.toml or cwd if no config.
|
|
1122
|
+
*/
|
|
1123
|
+
baseDirectory: string;
|
|
1124
|
+
/**
|
|
1125
|
+
* The path to the assets directory, relative to the `baseDirectory`.
|
|
1126
|
+
*/
|
|
1127
|
+
assetDirectory: string;
|
|
1128
|
+
/**
|
|
1129
|
+
* An array of patterns that match files that should be uploaded.
|
|
1130
|
+
*/
|
|
1131
|
+
includePatterns: string[];
|
|
1132
|
+
/**
|
|
1133
|
+
* An array of patterns that match files that should not be uploaded.
|
|
1134
|
+
*/
|
|
1135
|
+
excludePatterns: string[];
|
|
1136
|
+
}
|
|
1137
|
+
type WorkerMetadataPut = {
|
|
1138
|
+
/** The name of the entry point module. Only exists when the worker is in the ES module format */
|
|
1139
|
+
main_module?: string;
|
|
1140
|
+
/** The name of the entry point module. Only exists when the worker is in the service-worker format */
|
|
1141
|
+
body_part?: string;
|
|
1142
|
+
compatibility_date?: string;
|
|
1143
|
+
compatibility_flags?: string[];
|
|
1144
|
+
usage_model?: "bundled" | "unbound";
|
|
1145
|
+
migrations?: CfDurableObjectMigrations;
|
|
1146
|
+
exports?: CfExports;
|
|
1147
|
+
capnp_schema?: string;
|
|
1148
|
+
bindings: WorkerMetadataBinding[];
|
|
1149
|
+
keep_bindings?: (WorkerMetadataBinding["type"] | "secret_text" | "secret_key")[];
|
|
1150
|
+
logpush?: boolean;
|
|
1151
|
+
placement?: CfPlacement;
|
|
1152
|
+
tail_consumers?: CfTailConsumer[];
|
|
1153
|
+
streaming_tail_consumers?: CfTailConsumer[];
|
|
1154
|
+
limits?: CfUserLimits;
|
|
1155
|
+
assets?: {
|
|
1156
|
+
jwt: string;
|
|
1157
|
+
config?: AssetConfigMetadata;
|
|
1158
|
+
};
|
|
1159
|
+
observability?: Observability | undefined;
|
|
1160
|
+
containers?: {
|
|
1161
|
+
name?: string;
|
|
1162
|
+
class_name?: string;
|
|
1163
|
+
}[];
|
|
1164
|
+
package_dependencies?: Array<{
|
|
1165
|
+
name: string;
|
|
1166
|
+
packageJsonVersion: string;
|
|
1167
|
+
installedVersion: string;
|
|
1168
|
+
}>;
|
|
1169
|
+
[key: string]: unknown;
|
|
1170
|
+
};
|
|
1171
|
+
type WorkerMetadataVersionsPost = WorkerMetadataPut & {
|
|
1172
|
+
annotations?: Record<string, string>;
|
|
1173
|
+
};
|
|
1174
|
+
type WorkerMetadata = WorkerMetadataPut | WorkerMetadataVersionsPost;
|
|
1175
|
+
/**
|
|
1176
|
+
* Structured per-class entry returned by the declarative exports
|
|
1177
|
+
* reconciliation flow.
|
|
1178
|
+
*
|
|
1179
|
+
* The same shape is used for both successful info entries (under
|
|
1180
|
+
* `exports_reconciliation.info[]`) and blocking errors (under the v4 error
|
|
1181
|
+
* envelope's `meta.details[]`). The `scenario` tag is the stable, machine-
|
|
1182
|
+
* readable identifier of which reconciliation case produced the entry.
|
|
1183
|
+
*/
|
|
1184
|
+
type ExportsReconciliationEntryBase = {
|
|
1185
|
+
class: string;
|
|
1186
|
+
scenario: string;
|
|
1187
|
+
message: string;
|
|
1188
|
+
namespace_id?: string;
|
|
1189
|
+
};
|
|
1190
|
+
type ExportsReconciliationInfo = ExportsReconciliationEntryBase & {
|
|
1191
|
+
/**
|
|
1192
|
+
* Workers in the account that still bind to the source class name and must
|
|
1193
|
+
* be redeployed before the tombstone is safe to remove.
|
|
1194
|
+
*/
|
|
1195
|
+
referencing_scripts?: string[];
|
|
1196
|
+
};
|
|
1197
|
+
type ExportsReconciliationWarning = ExportsReconciliationEntryBase;
|
|
1198
|
+
type ExportsReconciliationErrorDetail = ExportsReconciliationEntryBase & {
|
|
1199
|
+
suggestion?: string;
|
|
1200
|
+
referencing_scripts?: string[];
|
|
1201
|
+
};
|
|
1202
|
+
type ExportsReconciliationRename = {
|
|
1203
|
+
from: string;
|
|
1204
|
+
to: string;
|
|
1205
|
+
};
|
|
1206
|
+
type ExportsReconciliationTransfer = {
|
|
1207
|
+
class: string;
|
|
1208
|
+
to: string;
|
|
1209
|
+
phase: "committed";
|
|
1210
|
+
};
|
|
1211
|
+
type ExportsReconciliationTransferPending = {
|
|
1212
|
+
class: string;
|
|
1213
|
+
from: string;
|
|
1214
|
+
};
|
|
1215
|
+
/**
|
|
1216
|
+
* The customer-visible summary of a successful exports reconciliation,
|
|
1217
|
+
* embedded in the upload response under `exports_reconciliation`. All arrays
|
|
1218
|
+
* are present, and are empty when there are no entries to report.
|
|
1219
|
+
*/
|
|
1220
|
+
type ExportsReconciliationResult = {
|
|
1221
|
+
created: string[];
|
|
1222
|
+
updated: string[];
|
|
1223
|
+
deleted: string[];
|
|
1224
|
+
renamed: ExportsReconciliationRename[];
|
|
1225
|
+
transferred: ExportsReconciliationTransfer[];
|
|
1226
|
+
transfer_pending: ExportsReconciliationTransferPending[];
|
|
1227
|
+
warnings: ExportsReconciliationWarning[];
|
|
1228
|
+
info: ExportsReconciliationInfo[];
|
|
1229
|
+
removable_entries: string[];
|
|
1230
|
+
};
|
|
1231
|
+
type ServiceMetadataRes = {
|
|
1232
|
+
id: string;
|
|
1233
|
+
default_environment: {
|
|
1234
|
+
environment: string;
|
|
1235
|
+
created_on: string;
|
|
1236
|
+
modified_on: string;
|
|
1237
|
+
script: {
|
|
1238
|
+
id: string;
|
|
1239
|
+
tag: string;
|
|
1240
|
+
tags: string[];
|
|
1241
|
+
etag: string;
|
|
1242
|
+
handlers: string[];
|
|
1243
|
+
modified_on: string;
|
|
1244
|
+
created_on: string;
|
|
1245
|
+
migration_tag: string;
|
|
1246
|
+
usage_model: "bundled" | "unbound";
|
|
1247
|
+
limits: {
|
|
1248
|
+
cpu_ms: number;
|
|
1249
|
+
subrequests: number;
|
|
1250
|
+
};
|
|
1251
|
+
compatibility_date: string;
|
|
1252
|
+
compatibility_flags: string[];
|
|
1253
|
+
last_deployed_from?: "wrangler" | "dash" | "api";
|
|
1254
|
+
placement_mode?: "smart";
|
|
1255
|
+
tail_consumers?: TailConsumer[];
|
|
1256
|
+
observability?: Observability;
|
|
1257
|
+
};
|
|
1258
|
+
};
|
|
1259
|
+
created_on: string;
|
|
1260
|
+
modified_on: string;
|
|
1261
|
+
usage_model: "bundled" | "unbound";
|
|
1262
|
+
environments: [
|
|
1263
|
+
{
|
|
1264
|
+
environment: string;
|
|
1265
|
+
created_on: string;
|
|
1266
|
+
modified_on: string;
|
|
1267
|
+
}
|
|
1268
|
+
];
|
|
1269
|
+
};
|
|
1270
|
+
type ServiceFetch = (request: Request) => Promise<Response> | Response;
|
|
1271
|
+
type File<Contents = string, Path = string> = {
|
|
1272
|
+
path: Path;
|
|
1273
|
+
} | {
|
|
1274
|
+
contents: Contents;
|
|
1275
|
+
path?: Path;
|
|
1276
|
+
};
|
|
1277
|
+
type BinaryFile = File<Uint8Array>;
|
|
1278
|
+
type QueueConsumer = NonNullable<Config["queues"]["consumers"]>[number];
|
|
1279
|
+
type Trigger = {
|
|
1280
|
+
type: "workers.dev";
|
|
1281
|
+
} | {
|
|
1282
|
+
type: "route";
|
|
1283
|
+
pattern: string;
|
|
1284
|
+
} | ({
|
|
1285
|
+
type: "route";
|
|
1286
|
+
} & ZoneIdRoute) | ({
|
|
1287
|
+
type: "route";
|
|
1288
|
+
} & ZoneNameRoute) | ({
|
|
1289
|
+
type: "route";
|
|
1290
|
+
} & CustomDomainRoute) | {
|
|
1291
|
+
type: "cron";
|
|
1292
|
+
cron: string;
|
|
1293
|
+
} | ({
|
|
1294
|
+
type: "queue-consumer";
|
|
1295
|
+
} & Omit<QueueConsumer, "type">) | {
|
|
1296
|
+
type: "connect";
|
|
1297
|
+
protocol: "tcp";
|
|
1298
|
+
port: number;
|
|
1299
|
+
address?: string;
|
|
1300
|
+
};
|
|
1301
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
1302
|
+
type BindingOmit<T> = DistributiveOmit<T, "binding">;
|
|
1303
|
+
type NameOmit<T> = DistributiveOmit<T, "name">;
|
|
1304
|
+
type Binding = {
|
|
1305
|
+
type: "plain_text";
|
|
1306
|
+
value: string;
|
|
1307
|
+
/**
|
|
1308
|
+
* Hide this environment variable in output as it may be sensitive
|
|
1309
|
+
* This is a @deprecated feature to support current Wrangler behaviour, and sensitive
|
|
1310
|
+
* variables should be marked as `type: secret_text` in future
|
|
1311
|
+
*/
|
|
1312
|
+
hidden?: boolean;
|
|
1313
|
+
} | {
|
|
1314
|
+
type: "secret_text";
|
|
1315
|
+
value: string;
|
|
1316
|
+
} | {
|
|
1317
|
+
type: "json";
|
|
1318
|
+
value: Json;
|
|
1319
|
+
} | ({
|
|
1320
|
+
type: "kv_namespace";
|
|
1321
|
+
} & BindingOmit<CfKvNamespace>) | ({
|
|
1322
|
+
type: "send_email";
|
|
1323
|
+
} & NameOmit<CfSendEmailBindings>) | {
|
|
1324
|
+
type: "wasm_module";
|
|
1325
|
+
source: BinaryFile;
|
|
1326
|
+
} | {
|
|
1327
|
+
type: "text_blob";
|
|
1328
|
+
source: File;
|
|
1329
|
+
} | ({
|
|
1330
|
+
type: "browser";
|
|
1331
|
+
} & BindingOmit<CfBrowserBinding>) | ({
|
|
1332
|
+
type: "ai";
|
|
1333
|
+
} & BindingOmit<CfAIBinding>) | ({
|
|
1334
|
+
type: "images";
|
|
1335
|
+
} & BindingOmit<CfImagesBinding>) | ({
|
|
1336
|
+
type: "stream";
|
|
1337
|
+
} & BindingOmit<CfStreamBinding>) | {
|
|
1338
|
+
type: "version_metadata";
|
|
1339
|
+
} | {
|
|
1340
|
+
type: "data_blob";
|
|
1341
|
+
source: BinaryFile;
|
|
1342
|
+
} | ({
|
|
1343
|
+
type: "durable_object_namespace";
|
|
1344
|
+
} & NameOmit<CfDurableObject>) | ({
|
|
1345
|
+
type: "workflow";
|
|
1346
|
+
} & BindingOmit<CfWorkflow>) | ({
|
|
1347
|
+
type: "queue";
|
|
1348
|
+
} & BindingOmit<CfQueue>) | ({
|
|
1349
|
+
type: "r2_bucket";
|
|
1350
|
+
} & BindingOmit<CfR2Bucket>) | ({
|
|
1351
|
+
type: "d1";
|
|
1352
|
+
} & BindingOmit<CfD1Database>) | ({
|
|
1353
|
+
type: "vectorize";
|
|
1354
|
+
} & BindingOmit<CfVectorize>) | ({
|
|
1355
|
+
type: "ai_search_namespace";
|
|
1356
|
+
} & BindingOmit<CfAISearchNamespace>) | ({
|
|
1357
|
+
type: "ai_search";
|
|
1358
|
+
} & BindingOmit<CfAISearch>) | ({
|
|
1359
|
+
type: "websearch";
|
|
1360
|
+
} & BindingOmit<CfWebSearch>) | ({
|
|
1361
|
+
type: "agent_memory";
|
|
1362
|
+
} & BindingOmit<CfAgentMemory>) | ({
|
|
1363
|
+
type: "hyperdrive";
|
|
1364
|
+
} & BindingOmit<CfHyperdrive>) | ({
|
|
1365
|
+
type: "service";
|
|
1366
|
+
} & BindingOmit<CfService>) | {
|
|
1367
|
+
type: "fetcher";
|
|
1368
|
+
fetcher: ServiceFetch;
|
|
1369
|
+
} | ({
|
|
1370
|
+
type: "analytics_engine";
|
|
1371
|
+
} & BindingOmit<CfAnalyticsEngineDataset>) | ({
|
|
1372
|
+
type: "dispatch_namespace";
|
|
1373
|
+
} & BindingOmit<CfDispatchNamespace>) | ({
|
|
1374
|
+
type: "mtls_certificate";
|
|
1375
|
+
} & BindingOmit<CfMTlsCertificate>) | ({
|
|
1376
|
+
type: "pipeline";
|
|
1377
|
+
} & BindingOmit<CfPipeline>) | ({
|
|
1378
|
+
type: "secrets_store_secret";
|
|
1379
|
+
} & BindingOmit<CfSecretsStoreSecrets>) | ({
|
|
1380
|
+
type: "artifacts";
|
|
1381
|
+
} & BindingOmit<CfArtifacts>) | ({
|
|
1382
|
+
type: "logfwdr";
|
|
1383
|
+
} & NameOmit<CfLogfwdrBinding>) | ({
|
|
1384
|
+
type: "unsafe_hello_world";
|
|
1385
|
+
} & BindingOmit<CfHelloWorld>) | ({
|
|
1386
|
+
type: "flagship";
|
|
1387
|
+
} & BindingOmit<CfFlagship>) | ({
|
|
1388
|
+
type: "ratelimit";
|
|
1389
|
+
} & NameOmit<CfRateLimit>) | ({
|
|
1390
|
+
type: "worker_loader";
|
|
1391
|
+
} & BindingOmit<CfWorkerLoader>) | ({
|
|
1392
|
+
type: "vpc_service";
|
|
1393
|
+
} & BindingOmit<CfVpcService>) | ({
|
|
1394
|
+
type: "vpc_network";
|
|
1395
|
+
} & BindingOmit<CfVpcNetwork>) | ({
|
|
1396
|
+
type: "media";
|
|
1397
|
+
} & BindingOmit<CfMediaBinding>) | ({
|
|
1398
|
+
type: `unsafe_${string}`;
|
|
1399
|
+
} & Omit<CfUnsafeBinding, "name" | "type">) | {
|
|
1400
|
+
type: "assets";
|
|
1401
|
+
} | {
|
|
1402
|
+
type: "inherit";
|
|
1403
|
+
};
|
|
1404
|
+
interface CfAccount {
|
|
1405
|
+
/**
|
|
1406
|
+
* An API token.
|
|
1407
|
+
*
|
|
1408
|
+
* @link https://api.cloudflare.com/#user-api-tokens-properties
|
|
1409
|
+
*/
|
|
1410
|
+
apiToken: ApiCredentials;
|
|
1411
|
+
/**
|
|
1412
|
+
* An account ID.
|
|
1413
|
+
*/
|
|
1414
|
+
accountId: string;
|
|
1415
|
+
}
|
|
1416
|
+
type HookValues = string | number | boolean | object | undefined | null;
|
|
1417
|
+
type Hook<T extends HookValues, Args extends unknown[] = []> = T | ((...args: Args) => T);
|
|
1418
|
+
type AsyncHook<T extends HookValues, Args extends unknown[] = []> = Hook<T, Args> | Hook<Promise<T>, Args>;
|
|
1419
|
+
type LogLevel = "debug" | "info" | "log" | "warn" | "error" | "none";
|
|
1420
|
+
type NodeJSCompatMode = "als" | "v1" | "v2" | null;
|
|
1421
|
+
interface StartDevWorkerInput {
|
|
1422
|
+
/** The name of the worker. */
|
|
1423
|
+
name?: string;
|
|
1424
|
+
/**
|
|
1425
|
+
* The javascript or typescript entry-point of the worker.
|
|
1426
|
+
* This is the `main` property of a Wrangler configuration file.
|
|
1427
|
+
*/
|
|
1428
|
+
entrypoint?: string;
|
|
1429
|
+
/** The configuration path of the worker, or a normalized configuration object. */
|
|
1430
|
+
config?: string | Config;
|
|
1431
|
+
/** The compatibility date for the workerd runtime. */
|
|
1432
|
+
compatibilityDate?: string;
|
|
1433
|
+
/** The compatibility flags for the workerd runtime. */
|
|
1434
|
+
compatibilityFlags?: string[];
|
|
1435
|
+
/** Specify the compliance region mode of the Worker. */
|
|
1436
|
+
complianceRegion?: Config["compliance_region"];
|
|
1437
|
+
/** Configuration for Python modules. */
|
|
1438
|
+
pythonModules?: {
|
|
1439
|
+
/** A list of glob patterns to exclude files from the python_modules directory when bundling. */
|
|
1440
|
+
exclude?: string[];
|
|
1441
|
+
};
|
|
1442
|
+
env?: string;
|
|
1443
|
+
/**
|
|
1444
|
+
* An array of paths to the .env files to load for this worker, relative to the project directory.
|
|
1445
|
+
*
|
|
1446
|
+
* If not specified, defaults to the standard `.env` files as given from Wrangler.
|
|
1447
|
+
* The project directory is where the Wrangler configuration file is located or the current working directory otherwise.
|
|
1448
|
+
*/
|
|
1449
|
+
envFiles?: string[];
|
|
1450
|
+
/** The bindings available to the worker. The specified binding type will be exposed to the worker on the `env` object under the same key. */
|
|
1451
|
+
bindings?: Record<string, Binding>;
|
|
1452
|
+
/**
|
|
1453
|
+
* Default bindings that can be overridden by config bindings.
|
|
1454
|
+
* Useful for injecting environment-specific defaults like CF_PAGES variables.
|
|
1455
|
+
*/
|
|
1456
|
+
defaultBindings?: Record<string, Extract<Binding, {
|
|
1457
|
+
type: "plain_text";
|
|
1458
|
+
}>>;
|
|
1459
|
+
migrations?: DurableObjectMigration[];
|
|
1460
|
+
exports?: Exports;
|
|
1461
|
+
containers?: ContainerApp[];
|
|
1462
|
+
/** The triggers which will cause the worker's exported default handlers to be called. */
|
|
1463
|
+
triggers?: Trigger[];
|
|
1464
|
+
tailConsumers?: CfTailConsumer[];
|
|
1465
|
+
streamingTailConsumers?: CfTailConsumer[];
|
|
1466
|
+
/** Cloudflare Access authentication configuration */
|
|
1467
|
+
access?: Config["access"];
|
|
1468
|
+
/**
|
|
1469
|
+
* Whether Wrangler should send usage metrics to Cloudflare for this project.
|
|
1470
|
+
*
|
|
1471
|
+
* When defined this will override any user settings.
|
|
1472
|
+
* Otherwise, Wrangler will use the user's preference.
|
|
1473
|
+
*/
|
|
1474
|
+
sendMetrics?: boolean;
|
|
1475
|
+
/** Options applying to the worker's build step. Applies to deploy and dev. */
|
|
1476
|
+
build?: {
|
|
1477
|
+
/** Whether the worker and its dependencies are bundled. Defaults to true. */
|
|
1478
|
+
bundle?: boolean;
|
|
1479
|
+
additionalModules?: CfModule[];
|
|
1480
|
+
findAdditionalModules?: boolean;
|
|
1481
|
+
processEntrypoint?: boolean;
|
|
1482
|
+
/** Specifies types of modules matched by globs. */
|
|
1483
|
+
moduleRules?: Rule[];
|
|
1484
|
+
/** Replace global identifiers with constant expressions, e.g. { debug: 'true', version: '"1.0.0"' }. Only takes effect if bundle: true. */
|
|
1485
|
+
define?: Record<string, string>;
|
|
1486
|
+
/** Alias modules */
|
|
1487
|
+
alias?: Record<string, string>;
|
|
1488
|
+
/** Whether the bundled worker is minified. Only takes effect if bundle: true. */
|
|
1489
|
+
minify?: boolean;
|
|
1490
|
+
/** Whether to keep function names after JavaScript transpilations. */
|
|
1491
|
+
keepNames?: boolean;
|
|
1492
|
+
/** Options controlling a custom build step. */
|
|
1493
|
+
custom?: {
|
|
1494
|
+
/** Custom shell command to run before bundling. Runs even if bundle. */
|
|
1495
|
+
command?: string;
|
|
1496
|
+
/** The cwd to run the command in. */
|
|
1497
|
+
workingDirectory?: string;
|
|
1498
|
+
/** Filepath(s) to watch for changes. Upon changes, the command will be rerun. */
|
|
1499
|
+
watch?: string | string[];
|
|
1500
|
+
};
|
|
1501
|
+
jsxFactory?: string;
|
|
1502
|
+
jsxFragment?: string;
|
|
1503
|
+
tsconfig?: string;
|
|
1504
|
+
nodejsCompatMode?: Hook<NodeJSCompatMode, [Config]>;
|
|
1505
|
+
moduleRoot?: string;
|
|
1506
|
+
};
|
|
1507
|
+
/** Options applying to the worker's development preview environment. */
|
|
1508
|
+
dev?: {
|
|
1509
|
+
/** Options applying to the worker's inspector server. False disables the inspector server. */
|
|
1510
|
+
inspector?: {
|
|
1511
|
+
hostname?: string;
|
|
1512
|
+
port?: number;
|
|
1513
|
+
secure?: boolean;
|
|
1514
|
+
} | false;
|
|
1515
|
+
/** Whether the worker runs on the edge or locally. */
|
|
1516
|
+
remote?: boolean | "minimal";
|
|
1517
|
+
/** Cloudflare Account credentials. Can be provided upfront or as a function which will be called only when required. */
|
|
1518
|
+
auth?: AsyncHook<CfAccount, [Pick<Config, "account_id">]>;
|
|
1519
|
+
/** Whether local storage (KV, Durable Objects, R2, D1, etc) is persisted. You can also specify the directory to persist data to. Set to `false` to disable persistence. */
|
|
1520
|
+
persist?: string | false;
|
|
1521
|
+
/** Controls which logs are logged. */
|
|
1522
|
+
logLevel?: LogLevel;
|
|
1523
|
+
/** Whether the worker server restarts upon source/config file changes. */
|
|
1524
|
+
watch?: boolean;
|
|
1525
|
+
/** Whether a script tag is inserted on text/html responses which will reload the page upon file changes. Defaults to false. */
|
|
1526
|
+
liveReload?: boolean;
|
|
1527
|
+
/** The local address to reach your worker. Applies to remote: true (remote mode) and remote: false (local mode). */
|
|
1528
|
+
server?: {
|
|
1529
|
+
hostname?: string;
|
|
1530
|
+
port?: number;
|
|
1531
|
+
secure?: boolean;
|
|
1532
|
+
httpsKeyPath?: string;
|
|
1533
|
+
httpsCertPath?: string;
|
|
1534
|
+
};
|
|
1535
|
+
/** Controls what request.url looks like inside the worker. */
|
|
1536
|
+
origin?: {
|
|
1537
|
+
hostname?: string;
|
|
1538
|
+
secure?: boolean;
|
|
1539
|
+
};
|
|
1540
|
+
/** A hook for outbound fetch calls from within the worker. */
|
|
1541
|
+
outboundService?: ServiceFetch;
|
|
1542
|
+
/** An undici MockAgent to declaratively mock fetch calls to particular resources. */
|
|
1543
|
+
mockFetch?: MockAgent;
|
|
1544
|
+
testScheduled?: boolean;
|
|
1545
|
+
/** Treat this as the primary worker in a multiworker setup (i.e. the first Worker in Miniflare's options) */
|
|
1546
|
+
multiworkerPrimary?: boolean;
|
|
1547
|
+
/** Whether to infer the local request origin from configured routes. */
|
|
1548
|
+
inferOriginFromRoutes?: boolean;
|
|
1549
|
+
/** Whether local requests should be matched against configured routes. */
|
|
1550
|
+
routeRequestsByRoutes?: boolean;
|
|
1551
|
+
containerBuildId?: string;
|
|
1552
|
+
/** Whether to build and connect to containers during local dev. Requires Docker daemon to be running. Defaults to true. */
|
|
1553
|
+
enableContainers?: boolean;
|
|
1554
|
+
/** Path to the dev registry directory */
|
|
1555
|
+
registry?: string;
|
|
1556
|
+
/** Path to the docker executable. Defaults to 'docker' */
|
|
1557
|
+
dockerPath?: string;
|
|
1558
|
+
/** Options for the container engine */
|
|
1559
|
+
containerEngine?: ContainerEngine;
|
|
1560
|
+
/** Re-generate your worker types when your Wrangler configuration file changes */
|
|
1561
|
+
generateTypes?: boolean;
|
|
1562
|
+
/**
|
|
1563
|
+
* Experimental: Use `cloudflare.config.ts` + optional `wrangler.config.ts`
|
|
1564
|
+
* instead of `wrangler.json[c]` / `wrangler.toml`.
|
|
1565
|
+
*/
|
|
1566
|
+
experimentalNewConfig?: boolean;
|
|
1567
|
+
/** Tunnel configuration for this dev session. */
|
|
1568
|
+
tunnel?: {
|
|
1569
|
+
enabled: boolean;
|
|
1570
|
+
name?: string;
|
|
1571
|
+
};
|
|
1572
|
+
};
|
|
1573
|
+
legacy?: {
|
|
1574
|
+
site?: Hook<Config["site"], [Config]>;
|
|
1575
|
+
};
|
|
1576
|
+
unsafe?: Omit<CfUnsafe, "bindings">;
|
|
1577
|
+
assets?: string;
|
|
1578
|
+
experimental?: Record<string, never>;
|
|
1579
|
+
}
|
|
1580
|
+
/**
|
|
1581
|
+
* An entry point for the Worker.
|
|
1582
|
+
*
|
|
1583
|
+
* It consists not just of a `file`, but also of a `directory` that is used to resolve relative paths.
|
|
1584
|
+
*/
|
|
1585
|
+
type Entry = {
|
|
1586
|
+
/** A worker's entrypoint */
|
|
1587
|
+
file: string;
|
|
1588
|
+
/** A worker's directory. Usually where the Wrangler configuration file is located */
|
|
1589
|
+
projectRoot: string;
|
|
1590
|
+
/** The path to the config file, if it exists. */
|
|
1591
|
+
configPath: string | undefined;
|
|
1592
|
+
/** Is this a module worker or a service worker? */
|
|
1593
|
+
format: CfScriptFormat;
|
|
1594
|
+
/** The directory that contains all of a `--no-bundle` worker's modules. Usually `${directory}/src`. Defaults to path.dirname(file) */
|
|
1595
|
+
moduleRoot: string;
|
|
1596
|
+
/**
|
|
1597
|
+
* A worker's name
|
|
1598
|
+
*/
|
|
1599
|
+
name?: string | undefined;
|
|
1600
|
+
/** Export from a Worker's entrypoint */
|
|
1601
|
+
exports: string[];
|
|
1602
|
+
};
|
|
1603
|
+
|
|
1604
|
+
/**
|
|
1605
|
+
* Wrangler configuration types. The JSDoc on these fields is also the source
|
|
1606
|
+
* of truth for the equivalent fields in `@cloudflare/config`
|
|
1607
|
+
* (`packages/config/src/types.ts` — `WorkerConfig` — and the binding option
|
|
1608
|
+
* interfaces in `packages/config/src/config.ts`). When editing prose here,
|
|
1609
|
+
* mirror the changes there.
|
|
1610
|
+
*/
|
|
1611
|
+
|
|
1612
|
+
/**
|
|
1613
|
+
* The `Environment` interface declares all the configuration fields that
|
|
1614
|
+
* can be specified for an environment.
|
|
1615
|
+
*
|
|
1616
|
+
* This could be the top-level default environment, or a specific named environment.
|
|
1617
|
+
*/
|
|
1618
|
+
interface Environment extends EnvironmentInheritable, EnvironmentNonInheritable {
|
|
1619
|
+
}
|
|
1620
|
+
type SimpleRoute = string;
|
|
1621
|
+
/** AWS SigV4 credentials for miniflare's local S3-compatible endpoint */
|
|
1622
|
+
interface LocalS3Credentials {
|
|
1623
|
+
accessKeyId: string;
|
|
1624
|
+
secretAccessKey: string;
|
|
1625
|
+
}
|
|
1626
|
+
type ZoneIdRoute = {
|
|
1627
|
+
pattern: string;
|
|
1628
|
+
zone_id: string;
|
|
1629
|
+
custom_domain?: boolean;
|
|
1630
|
+
};
|
|
1631
|
+
type ZoneNameRoute = {
|
|
1632
|
+
pattern: string;
|
|
1633
|
+
zone_name: string;
|
|
1634
|
+
custom_domain?: boolean;
|
|
1635
|
+
};
|
|
1636
|
+
type CustomDomainRoute = {
|
|
1637
|
+
pattern: string;
|
|
1638
|
+
custom_domain: boolean;
|
|
1639
|
+
enabled?: boolean;
|
|
1640
|
+
previews_enabled?: boolean;
|
|
1641
|
+
};
|
|
1642
|
+
type Route = SimpleRoute | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
|
|
1643
|
+
/**
|
|
1644
|
+
* Configuration in wrangler for Cloudchamber
|
|
1645
|
+
*/
|
|
1646
|
+
type CloudchamberConfig = {
|
|
1647
|
+
image?: string;
|
|
1648
|
+
location?: string;
|
|
1649
|
+
instance_type?: "dev" | "basic" | "standard" | "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4";
|
|
1650
|
+
vcpu?: number;
|
|
1651
|
+
memory?: string;
|
|
1652
|
+
ipv4?: boolean;
|
|
1653
|
+
};
|
|
1654
|
+
type UnsafeBinding = {
|
|
1655
|
+
/**
|
|
1656
|
+
* The name of the binding provided to the Worker
|
|
1657
|
+
*/
|
|
1658
|
+
name: string;
|
|
1659
|
+
/**
|
|
1660
|
+
* The 'type' of the unsafe binding.
|
|
1661
|
+
*/
|
|
1662
|
+
type: string;
|
|
1663
|
+
dev?: {
|
|
1664
|
+
plugin: {
|
|
1665
|
+
/**
|
|
1666
|
+
* Package is the bare specifier of the package that exposes plugins to integrate into Miniflare via a named `plugins` export.
|
|
1667
|
+
* @example "@cloudflare/my-external-miniflare-plugin"
|
|
1668
|
+
*/
|
|
1669
|
+
package: string;
|
|
1670
|
+
/**
|
|
1671
|
+
* Plugin is the name of the plugin exposed by the package.
|
|
1672
|
+
* @example "MY_UNSAFE_PLUGIN"
|
|
1673
|
+
*/
|
|
1674
|
+
name: string;
|
|
1675
|
+
};
|
|
1676
|
+
/**
|
|
1677
|
+
* Optional mapping of unsafe bindings names to options provided for the plugin.
|
|
1678
|
+
*/
|
|
1679
|
+
options?: Record<string, unknown>;
|
|
1680
|
+
};
|
|
1681
|
+
[key: string]: unknown;
|
|
1682
|
+
};
|
|
1683
|
+
/**
|
|
1684
|
+
* Configuration for a container application
|
|
1685
|
+
*/
|
|
1686
|
+
type ContainerApp = {
|
|
1687
|
+
/**
|
|
1688
|
+
* Name of the application.
|
|
1689
|
+
*
|
|
1690
|
+
* This is also the identifier used to reference the container from a Durable
|
|
1691
|
+
* Object's `exports` entry via its `container` field.
|
|
1692
|
+
*
|
|
1693
|
+
* @optional Defaults to `worker_name-class_name` if not specified. A name is
|
|
1694
|
+
* required when `class_name` is not set, since there is no class name to
|
|
1695
|
+
* derive the default from.
|
|
1696
|
+
*/
|
|
1697
|
+
name?: string;
|
|
1698
|
+
/**
|
|
1699
|
+
* Number of application instances
|
|
1700
|
+
* @deprecated
|
|
1701
|
+
* @hidden
|
|
1702
|
+
*/
|
|
1703
|
+
instances?: number;
|
|
1704
|
+
/**
|
|
1705
|
+
* Number of maximum application instances.
|
|
1706
|
+
* @optional
|
|
1707
|
+
*/
|
|
1708
|
+
max_instances?: number;
|
|
1709
|
+
/**
|
|
1710
|
+
* The path to a Dockerfile, or an image URI for the Cloudflare registry.
|
|
1711
|
+
*/
|
|
1712
|
+
image: string;
|
|
1713
|
+
/**
|
|
1714
|
+
* Build context of the application.
|
|
1715
|
+
* @optional - defaults to the directory of `image`.
|
|
1716
|
+
*/
|
|
1717
|
+
image_build_context?: string;
|
|
1718
|
+
/**
|
|
1719
|
+
* Image variables available to the image at build-time only.
|
|
1720
|
+
* For runtime env vars, refer to https://developers.cloudflare.com/containers/examples/env-vars-and-secrets/
|
|
1721
|
+
* @optional
|
|
1722
|
+
*/
|
|
1723
|
+
image_vars?: Record<string, string>;
|
|
1724
|
+
/**
|
|
1725
|
+
* The class name of the Durable Object the container is connected to.
|
|
1726
|
+
*
|
|
1727
|
+
* @optional Instead of naming the Durable Object here, you can reference this
|
|
1728
|
+
* container from the Durable Object's `exports` entry via its `container`
|
|
1729
|
+
* field. Exactly one of the two directions must be configured.
|
|
1730
|
+
*/
|
|
1731
|
+
class_name?: string;
|
|
1732
|
+
/**
|
|
1733
|
+
* The scheduling policy of the application
|
|
1734
|
+
* @optional
|
|
1735
|
+
* @default "default"
|
|
1736
|
+
*/
|
|
1737
|
+
scheduling_policy?: "default" | "moon" | "regional";
|
|
1738
|
+
/**
|
|
1739
|
+
* The instance type to be used for the container.
|
|
1740
|
+
* Select from one of the following named instance types:
|
|
1741
|
+
* - lite: 1/16 vCPU, 256 MiB memory, and 2 GB disk
|
|
1742
|
+
* - basic: 1/4 vCPU, 1 GiB memory, and 4 GB disk
|
|
1743
|
+
* - standard-1: 1/2 vCPU, 4 GiB memory, and 8 GB disk
|
|
1744
|
+
* - standard-2: 1 vCPU, 6 GiB memory, and 12 GB disk
|
|
1745
|
+
* - standard-3: 2 vCPU, 8 GiB memory, and 16 GB disk
|
|
1746
|
+
* - standard-4: 4 vCPU, 12 GiB memory, and 20 GB disk
|
|
1747
|
+
* - dev: 1/16 vCPU, 256 MiB memory, and 2 GB disk (deprecated, use "lite" instead)
|
|
1748
|
+
* - standard: 1 vCPU, 4 GiB memory, and 4 GB disk (deprecated, use "standard-1" instead)
|
|
1749
|
+
*
|
|
1750
|
+
* Customers on an enterprise plan have the additional option to set custom limits.
|
|
1751
|
+
*
|
|
1752
|
+
* @optional
|
|
1753
|
+
* @default "dev"
|
|
1754
|
+
*/
|
|
1755
|
+
instance_type?: "dev" | "basic" | "standard" | "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4" | {
|
|
1756
|
+
/** @defaults to 0.0625 (1/16 vCPU) */
|
|
1757
|
+
vcpu?: number;
|
|
1758
|
+
/** @defaults to 256 MiB */
|
|
1759
|
+
memory_mib?: number;
|
|
1760
|
+
/** @defaults to 2 GB */
|
|
1761
|
+
disk_mb?: number;
|
|
1762
|
+
};
|
|
1763
|
+
ssh?: {
|
|
1764
|
+
/**
|
|
1765
|
+
* If enabled, those with write access to a container will be able to SSH into it through Wrangler.
|
|
1766
|
+
* @default false
|
|
1767
|
+
*/
|
|
1768
|
+
enabled: boolean;
|
|
1769
|
+
/**
|
|
1770
|
+
* Port that the SSH service is running on
|
|
1771
|
+
* @defaults to 22
|
|
1772
|
+
*/
|
|
1773
|
+
port?: number;
|
|
1774
|
+
};
|
|
1775
|
+
/**
|
|
1776
|
+
* @deprecated Use `ssh` instead.
|
|
1777
|
+
* @hidden
|
|
1778
|
+
*/
|
|
1779
|
+
wrangler_ssh?: {
|
|
1780
|
+
enabled: boolean;
|
|
1781
|
+
port?: number;
|
|
1782
|
+
};
|
|
1783
|
+
/**
|
|
1784
|
+
* SSH public keys to put in the container's authorized_keys file.
|
|
1785
|
+
*/
|
|
1786
|
+
authorized_keys?: {
|
|
1787
|
+
name: string;
|
|
1788
|
+
public_key: string;
|
|
1789
|
+
}[];
|
|
1790
|
+
/**
|
|
1791
|
+
* Trusted user CA keys to put in the container's trusted_user_ca_keys file.
|
|
1792
|
+
*/
|
|
1793
|
+
trusted_user_ca_keys?: {
|
|
1794
|
+
name?: string;
|
|
1795
|
+
public_key: string;
|
|
1796
|
+
}[];
|
|
1797
|
+
/**
|
|
1798
|
+
* @deprecated Use top level `containers` fields instead.
|
|
1799
|
+
* `configuration.image` should be `image`
|
|
1800
|
+
* limits should be set via `instance_type`
|
|
1801
|
+
* @hidden
|
|
1802
|
+
*/
|
|
1803
|
+
configuration?: {
|
|
1804
|
+
image?: string;
|
|
1805
|
+
labels?: {
|
|
1806
|
+
name: string;
|
|
1807
|
+
value: string;
|
|
1808
|
+
}[];
|
|
1809
|
+
secrets?: {
|
|
1810
|
+
name: string;
|
|
1811
|
+
type: "env";
|
|
1812
|
+
secret: string;
|
|
1813
|
+
}[];
|
|
1814
|
+
disk?: {
|
|
1815
|
+
size_mb: number;
|
|
1816
|
+
};
|
|
1817
|
+
vcpu?: number;
|
|
1818
|
+
memory_mib?: number;
|
|
1819
|
+
};
|
|
1820
|
+
/**
|
|
1821
|
+
* Scheduling constraints for container placement.
|
|
1822
|
+
*/
|
|
1823
|
+
constraints?: {
|
|
1824
|
+
/**
|
|
1825
|
+
* Limit container placement to specific geographic regions.
|
|
1826
|
+
*/
|
|
1827
|
+
regions?: ("ENAM" | "WNAM" | "EEUR" | "WEUR" | "APAC" | "SAM" | "ME" | "OC" | "AFR")[];
|
|
1828
|
+
/**
|
|
1829
|
+
* Restrict containers to compliance boundaries.
|
|
1830
|
+
*/
|
|
1831
|
+
jurisdiction?: "eu" | "fedramp";
|
|
1832
|
+
/**
|
|
1833
|
+
* @hidden
|
|
1834
|
+
*/
|
|
1835
|
+
cities?: string[];
|
|
1836
|
+
/**
|
|
1837
|
+
* @deprecated Use `tiers` instead
|
|
1838
|
+
* @hidden
|
|
1839
|
+
*/
|
|
1840
|
+
tier?: number;
|
|
1841
|
+
/**
|
|
1842
|
+
* @hidden
|
|
1843
|
+
*/
|
|
1844
|
+
tiers?: number[];
|
|
1845
|
+
};
|
|
1846
|
+
/**
|
|
1847
|
+
* Scheduling affinities
|
|
1848
|
+
* @hidden
|
|
1849
|
+
*/
|
|
1850
|
+
affinities?: {
|
|
1851
|
+
colocation?: "datacenter";
|
|
1852
|
+
hardware_generation?: "highest-overall-performance";
|
|
1853
|
+
};
|
|
1854
|
+
/**
|
|
1855
|
+
* @deprecated use the `class_name` field instead.
|
|
1856
|
+
* @hidden
|
|
1857
|
+
*/
|
|
1858
|
+
durable_objects?: {
|
|
1859
|
+
namespace_id: string;
|
|
1860
|
+
};
|
|
1861
|
+
/**
|
|
1862
|
+
* Configures what percentage of instances should be updated at each step of a rollout.
|
|
1863
|
+
* You can specify this as a single number, or an array of numbers.
|
|
1864
|
+
*
|
|
1865
|
+
* If this is a single number, each step will progress by that percentage.
|
|
1866
|
+
* The options are 5, 10, 20, 25, 50 or 100.
|
|
1867
|
+
*
|
|
1868
|
+
* If this is an array, each step specifies the cumulative rollout progress.
|
|
1869
|
+
* The final step must be 100.
|
|
1870
|
+
*
|
|
1871
|
+
* This can be overridden adhoc by deploying with the `--containers-rollout=immediate` flag,
|
|
1872
|
+
* which will roll out to 100% of instances in one step.
|
|
1873
|
+
*
|
|
1874
|
+
* @optional
|
|
1875
|
+
* @default [10,100]
|
|
1876
|
+
* */
|
|
1877
|
+
rollout_step_percentage?: number | number[];
|
|
1878
|
+
/**
|
|
1879
|
+
* How a rollout should be created. It supports the following modes:
|
|
1880
|
+
* - full_auto: The container application will be rolled out fully automatically.
|
|
1881
|
+
* - none: The container application won't have a roll out or update.
|
|
1882
|
+
* - manual: The container application will be rollout fully by manually actioning progress steps.
|
|
1883
|
+
* @optional
|
|
1884
|
+
* @default "full_auto"
|
|
1885
|
+
* @hidden
|
|
1886
|
+
*/
|
|
1887
|
+
rollout_kind?: "full_auto" | "none" | "full_manual";
|
|
1888
|
+
/**
|
|
1889
|
+
* Configures the grace period (in seconds) for active instances before being shutdown during a rollout.
|
|
1890
|
+
* @optional
|
|
1891
|
+
* @default 0
|
|
1892
|
+
*/
|
|
1893
|
+
rollout_active_grace_period?: number;
|
|
1894
|
+
/**
|
|
1895
|
+
* Directly passed to the API without wrangler-side validation or transformation.
|
|
1896
|
+
* @hidden
|
|
1897
|
+
*/
|
|
1898
|
+
unsafe?: Record<string, unknown>;
|
|
1899
|
+
};
|
|
1900
|
+
/**
|
|
1901
|
+
* Configuration in wrangler for Durable Object Migrations
|
|
1902
|
+
*/
|
|
1903
|
+
type DurableObjectMigration = {
|
|
1904
|
+
/** A unique identifier for this migration. */
|
|
1905
|
+
tag: string;
|
|
1906
|
+
/** The new Durable Objects being defined. */
|
|
1907
|
+
new_classes?: string[];
|
|
1908
|
+
/** The new SQLite Durable Objects being defined. */
|
|
1909
|
+
new_sqlite_classes?: string[];
|
|
1910
|
+
/** The Durable Objects being renamed. */
|
|
1911
|
+
renamed_classes?: {
|
|
1912
|
+
from: string;
|
|
1913
|
+
to: string;
|
|
1914
|
+
}[];
|
|
1915
|
+
/** The Durable Objects being removed. */
|
|
1916
|
+
deleted_classes?: string[];
|
|
1917
|
+
};
|
|
1918
|
+
/**
|
|
1919
|
+
* Storage backend for a declarative Durable Object export. See
|
|
1920
|
+
* {@link DurableObjectExport}.
|
|
1921
|
+
*/
|
|
1922
|
+
type DurableObjectExportStorage = "sqlite" | "legacy-kv";
|
|
1923
|
+
/**
|
|
1924
|
+
* A single declarative Durable Object export entry in the `exports` config
|
|
1925
|
+
* map. `type` is reserved for the export kind. `state` carries the Durable
|
|
1926
|
+
* Object lifecycle and defaults to `"created"` (live) when omitted.
|
|
1927
|
+
*
|
|
1928
|
+
* Mutually exclusive with {@link DurableObjectMigration} at the config-
|
|
1929
|
+
* validation boundary.
|
|
1930
|
+
*
|
|
1931
|
+
* - `created` (default, live): `storage` is required.
|
|
1932
|
+
* - `deleted` (tombstone): retire a provisioned namespace whose class has
|
|
1933
|
+
* been removed from code.
|
|
1934
|
+
* - `renamed` (tombstone): rewrite a provisioned namespace's class name to
|
|
1935
|
+
* `renamed_to`. The target name must also appear as a live (state
|
|
1936
|
+
* `"created"`) `durable-object` entry in the same map.
|
|
1937
|
+
* - `transferred` (tombstone): hand ownership of the namespace to another
|
|
1938
|
+
* script in the same account (`transferred_to`). Two-phase commit;
|
|
1939
|
+
* the target must first deploy an `expecting-transfer` entry naming this
|
|
1940
|
+
* script via `transfer_from`.
|
|
1941
|
+
* - `expecting-transfer` (live): receiving side of a two-phase transfer;
|
|
1942
|
+
* `storage` and `transfer_from` are both required.
|
|
1943
|
+
*
|
|
1944
|
+
* The live states may additionally attach a container via `container`, which
|
|
1945
|
+
* names an entry in the top-level `containers` array. Tombstones cannot.
|
|
1946
|
+
*/
|
|
1947
|
+
type DurableObjectExport = {
|
|
1948
|
+
type: "durable-object";
|
|
1949
|
+
state?: "created";
|
|
1950
|
+
storage: DurableObjectExportStorage;
|
|
1951
|
+
/**
|
|
1952
|
+
* Attach a container to this Durable Object. Must match the `name` of an
|
|
1953
|
+
* entry in the top-level `containers` array, and requires
|
|
1954
|
+
* `storage: "sqlite"`.
|
|
1955
|
+
*
|
|
1956
|
+
* @optional
|
|
1957
|
+
*/
|
|
1958
|
+
container?: string;
|
|
1959
|
+
} | {
|
|
1960
|
+
type: "durable-object";
|
|
1961
|
+
state: "deleted";
|
|
1962
|
+
} | {
|
|
1963
|
+
type: "durable-object";
|
|
1964
|
+
state: "renamed";
|
|
1965
|
+
renamed_to: string;
|
|
1966
|
+
} | {
|
|
1967
|
+
type: "durable-object";
|
|
1968
|
+
state: "transferred";
|
|
1969
|
+
transferred_to: string;
|
|
1970
|
+
} | {
|
|
1971
|
+
type: "durable-object";
|
|
1972
|
+
state: "expecting-transfer";
|
|
1973
|
+
storage: DurableObjectExportStorage;
|
|
1974
|
+
transfer_from: string;
|
|
1975
|
+
/**
|
|
1976
|
+
* Attach a container to this Durable Object. Must match the `name` of an
|
|
1977
|
+
* entry in the top-level `containers` array, and requires
|
|
1978
|
+
* `storage: "sqlite"`.
|
|
1979
|
+
*
|
|
1980
|
+
* @optional
|
|
1981
|
+
*/
|
|
1982
|
+
container?: string;
|
|
1983
|
+
};
|
|
1984
|
+
interface WorkerEntrypointExport {
|
|
1985
|
+
type: "worker";
|
|
1986
|
+
cache?: {
|
|
1987
|
+
/** Whether cache is enabled for this entrypoint. */
|
|
1988
|
+
enabled: boolean;
|
|
1989
|
+
};
|
|
1990
|
+
}
|
|
1991
|
+
type ConfiguredExport = DurableObjectExport | WorkerEntrypointExport;
|
|
1992
|
+
/**
|
|
1993
|
+
* The declarative `exports` map keyed by export name. Durable Object exports
|
|
1994
|
+
* are mutually exclusive with `migrations` at the wrangler config layer.
|
|
1995
|
+
*/
|
|
1996
|
+
type Exports = Record<string, ConfiguredExport>;
|
|
1997
|
+
/**
|
|
1998
|
+
* The `EnvironmentInheritable` interface declares all the configuration fields for an environment
|
|
1999
|
+
* that can be inherited (and overridden) from the top-level environment.
|
|
2000
|
+
*/
|
|
2001
|
+
interface EnvironmentInheritable {
|
|
2002
|
+
/**
|
|
2003
|
+
* The name of your Worker. Alphanumeric + dashes only.
|
|
2004
|
+
*
|
|
2005
|
+
* @inheritable
|
|
2006
|
+
*/
|
|
2007
|
+
name: string | undefined;
|
|
2008
|
+
/**
|
|
2009
|
+
* This is the ID of the account associated with your zone.
|
|
2010
|
+
* You might have more than one account, so make sure to use
|
|
2011
|
+
* the ID of the account associated with the zone/route you
|
|
2012
|
+
* provide, if you provide one. It can also be specified through
|
|
2013
|
+
* the CLOUDFLARE_ACCOUNT_ID environment variable.
|
|
2014
|
+
*
|
|
2015
|
+
* @inheritable
|
|
2016
|
+
*/
|
|
2017
|
+
account_id: string | undefined;
|
|
2018
|
+
/**
|
|
2019
|
+
* A date in the form yyyy-mm-dd, which will be used to determine
|
|
2020
|
+
* which version of the Workers runtime is used.
|
|
2021
|
+
*
|
|
2022
|
+
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
|
|
2023
|
+
*
|
|
2024
|
+
* @inheritable
|
|
2025
|
+
*/
|
|
2026
|
+
compatibility_date: string | undefined;
|
|
2027
|
+
/**
|
|
2028
|
+
* A list of flags that enable features from upcoming features of
|
|
2029
|
+
* the Workers runtime, usually used together with compatibility_date.
|
|
2030
|
+
*
|
|
2031
|
+
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
|
|
2032
|
+
*
|
|
2033
|
+
* @default []
|
|
2034
|
+
* @inheritable
|
|
2035
|
+
*/
|
|
2036
|
+
compatibility_flags: string[];
|
|
2037
|
+
/**
|
|
2038
|
+
* The entrypoint/path to the JavaScript file that will be executed.
|
|
2039
|
+
*
|
|
2040
|
+
* @inheritable
|
|
2041
|
+
*/
|
|
2042
|
+
main: string | undefined;
|
|
2043
|
+
/**
|
|
2044
|
+
* If true then Wrangler will traverse the file tree below `base_dir`;
|
|
2045
|
+
* Any files that match `rules` will be included in the deployed Worker.
|
|
2046
|
+
* Defaults to true if `no_bundle` is true, otherwise false.
|
|
2047
|
+
*
|
|
2048
|
+
* @inheritable
|
|
2049
|
+
*/
|
|
2050
|
+
find_additional_modules: boolean | undefined;
|
|
2051
|
+
/**
|
|
2052
|
+
* Determines whether Wrangler will preserve bundled file names.
|
|
2053
|
+
* Defaults to false.
|
|
2054
|
+
* If left unset, files will be named using the pattern ${fileHash}-${basename},
|
|
2055
|
+
* for example, `34de60b44167af5c5a709e62a4e20c4f18c9e3b6-favicon.ico`.
|
|
2056
|
+
*
|
|
2057
|
+
* @inheritable
|
|
2058
|
+
*/
|
|
2059
|
+
preserve_file_names: boolean | undefined;
|
|
2060
|
+
/**
|
|
2061
|
+
* The directory in which module rules should be evaluated when including additional files into a Worker deployment.
|
|
2062
|
+
* This defaults to the directory containing the `main` entry point of the Worker if not specified.
|
|
2063
|
+
*
|
|
2064
|
+
* @inheritable
|
|
2065
|
+
*/
|
|
2066
|
+
base_dir: string | undefined;
|
|
2067
|
+
/**
|
|
2068
|
+
* Whether we use <name>.<subdomain>.workers.dev to
|
|
2069
|
+
* test and deploy your Worker.
|
|
2070
|
+
*
|
|
2071
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
|
|
2072
|
+
*
|
|
2073
|
+
* @default true
|
|
2074
|
+
* @breaking
|
|
2075
|
+
* @inheritable
|
|
2076
|
+
*/
|
|
2077
|
+
workers_dev: boolean | undefined;
|
|
2078
|
+
/**
|
|
2079
|
+
* Whether we use <version>-<name>.<subdomain>.workers.dev to
|
|
2080
|
+
* serve Preview URLs for your Worker.
|
|
2081
|
+
*
|
|
2082
|
+
* @default false
|
|
2083
|
+
* @inheritable
|
|
2084
|
+
*/
|
|
2085
|
+
preview_urls: boolean | undefined;
|
|
2086
|
+
/**
|
|
2087
|
+
* A list of routes that your Worker should be published to.
|
|
2088
|
+
* Only one of `routes` or `route` is required.
|
|
2089
|
+
*
|
|
2090
|
+
* Only required when workers_dev is false, and there's no scheduled Worker (see `triggers`)
|
|
2091
|
+
*
|
|
2092
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
|
|
2093
|
+
*
|
|
2094
|
+
* @inheritable
|
|
2095
|
+
*/
|
|
2096
|
+
routes: Route[] | undefined;
|
|
2097
|
+
/**
|
|
2098
|
+
* A route that your Worker should be published to. Literally
|
|
2099
|
+
* the same as routes, but only one.
|
|
2100
|
+
* Only one of `routes` or `route` is required.
|
|
2101
|
+
*
|
|
2102
|
+
* Only required when workers_dev is false, and there's no scheduled Worker
|
|
2103
|
+
*
|
|
2104
|
+
* @inheritable
|
|
2105
|
+
*/
|
|
2106
|
+
route: Route | undefined;
|
|
2107
|
+
/**
|
|
2108
|
+
* Path to a custom tsconfig
|
|
2109
|
+
*
|
|
2110
|
+
* @inheritable
|
|
2111
|
+
*/
|
|
2112
|
+
tsconfig: string | undefined;
|
|
2113
|
+
/**
|
|
2114
|
+
* The function to use to replace jsx syntax.
|
|
2115
|
+
*
|
|
2116
|
+
* @default "React.createElement"
|
|
2117
|
+
* @inheritable
|
|
2118
|
+
*/
|
|
2119
|
+
jsx_factory: string;
|
|
2120
|
+
/**
|
|
2121
|
+
* The function to use to replace jsx fragment syntax.
|
|
2122
|
+
*
|
|
2123
|
+
* @default "React.Fragment"
|
|
2124
|
+
* @inheritable
|
|
2125
|
+
*/
|
|
2126
|
+
jsx_fragment: string;
|
|
2127
|
+
/**
|
|
2128
|
+
* A list of migrations that should be uploaded with your Worker.
|
|
2129
|
+
*
|
|
2130
|
+
* These define changes in your Durable Object declarations.
|
|
2131
|
+
*
|
|
2132
|
+
* More details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations
|
|
2133
|
+
*
|
|
2134
|
+
* @default []
|
|
2135
|
+
* @inheritable
|
|
2136
|
+
*/
|
|
2137
|
+
migrations: DurableObjectMigration[];
|
|
2138
|
+
/**
|
|
2139
|
+
* Declarative exports configuration — a map of class name to export configuration.
|
|
2140
|
+
*
|
|
2141
|
+
* The configuration of Durable Objects via `exports` is mutually exclusive with `migrations`.
|
|
2142
|
+
*
|
|
2143
|
+
* @default {}
|
|
2144
|
+
* @inheritable
|
|
2145
|
+
*/
|
|
2146
|
+
exports: Exports;
|
|
2147
|
+
/**
|
|
2148
|
+
* Definitions that trigger a Worker from a schedule or a Cloudflare event.
|
|
2149
|
+
*
|
|
2150
|
+
* More details about cron triggers: https://developers.cloudflare.com/workers/platform/cron-triggers
|
|
2151
|
+
*
|
|
2152
|
+
* More details about Artifacts events: https://developers.cloudflare.com/artifacts/guides/event-subscriptions/
|
|
2153
|
+
*
|
|
2154
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
|
|
2155
|
+
*
|
|
2156
|
+
* @default {crons:[]}
|
|
2157
|
+
* @inheritable
|
|
2158
|
+
*/
|
|
2159
|
+
triggers: {
|
|
2160
|
+
crons?: string[];
|
|
2161
|
+
events?: ArtifactsEventTrigger[];
|
|
2162
|
+
};
|
|
2163
|
+
/**
|
|
2164
|
+
* Specify limits for runtime behavior.
|
|
2165
|
+
* Only supported for the "standard" Usage Model
|
|
2166
|
+
*
|
|
2167
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#limits
|
|
2168
|
+
*
|
|
2169
|
+
* @inheritable
|
|
2170
|
+
*/
|
|
2171
|
+
limits: UserLimits | undefined;
|
|
2172
|
+
/**
|
|
2173
|
+
* An ordered list of rules that define which modules to import,
|
|
2174
|
+
* and what type to import them as. You will need to specify rules
|
|
2175
|
+
* to use Text, Data, and CompiledWasm modules, or when you wish to
|
|
2176
|
+
* have a .js file be treated as an ESModule instead of CommonJS.
|
|
2177
|
+
*
|
|
2178
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#bundling
|
|
2179
|
+
*
|
|
2180
|
+
* @inheritable
|
|
2181
|
+
*/
|
|
2182
|
+
rules: Rule[];
|
|
2183
|
+
/**
|
|
2184
|
+
* Configures a custom build step to be run by Wrangler when building your Worker.
|
|
2185
|
+
*
|
|
2186
|
+
* Refer to the [custom builds documentation](https://developers.cloudflare.com/workers/cli-wrangler/configuration#build)
|
|
2187
|
+
* for more details.
|
|
2188
|
+
*
|
|
2189
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#custom-builds
|
|
2190
|
+
*
|
|
2191
|
+
* @default {watch_dir:"./src"}
|
|
2192
|
+
*/
|
|
2193
|
+
build: {
|
|
2194
|
+
/** 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. */
|
|
2195
|
+
command?: string;
|
|
2196
|
+
/** The directory in which the command is executed. */
|
|
2197
|
+
cwd?: string;
|
|
2198
|
+
/** The directory to watch for changes while using wrangler dev, defaults to the current working directory */
|
|
2199
|
+
watch_dir?: string | string[];
|
|
2200
|
+
};
|
|
2201
|
+
/**
|
|
2202
|
+
* Skip internal build steps and directly deploy script
|
|
2203
|
+
* @inheritable
|
|
2204
|
+
*/
|
|
2205
|
+
no_bundle: boolean | undefined;
|
|
2206
|
+
/**
|
|
2207
|
+
* Minify the script before uploading.
|
|
2208
|
+
* @inheritable
|
|
2209
|
+
*/
|
|
2210
|
+
minify: boolean | undefined;
|
|
2211
|
+
/**
|
|
2212
|
+
* Set the `name` property to the original name for functions and classes renamed during minification.
|
|
2213
|
+
*
|
|
2214
|
+
* See https://esbuild.github.io/api/#keep-names
|
|
2215
|
+
*
|
|
2216
|
+
* @default true
|
|
2217
|
+
* @inheritable
|
|
2218
|
+
*/
|
|
2219
|
+
keep_names: boolean | undefined;
|
|
2220
|
+
/**
|
|
2221
|
+
* Designates this Worker as an internal-only "first-party" Worker.
|
|
2222
|
+
*
|
|
2223
|
+
* @inheritable
|
|
2224
|
+
*/
|
|
2225
|
+
first_party_worker: boolean | undefined;
|
|
2226
|
+
/**
|
|
2227
|
+
* List of bindings that you will send to logfwdr
|
|
2228
|
+
*
|
|
2229
|
+
* @default {bindings:[]}
|
|
2230
|
+
* @inheritable
|
|
2231
|
+
*/
|
|
2232
|
+
logfwdr: {
|
|
2233
|
+
bindings: {
|
|
2234
|
+
/** The binding name used to refer to logfwdr */
|
|
2235
|
+
name: string;
|
|
2236
|
+
/** The destination for this logged message */
|
|
2237
|
+
destination: string;
|
|
2238
|
+
}[];
|
|
2239
|
+
};
|
|
2240
|
+
/**
|
|
2241
|
+
* Send Trace Events from this Worker to Workers Logpush.
|
|
2242
|
+
*
|
|
2243
|
+
* This will not configure a corresponding Logpush job automatically.
|
|
2244
|
+
*
|
|
2245
|
+
* For more information about Workers Logpush, see:
|
|
2246
|
+
* https://blog.cloudflare.com/logpush-for-workers/
|
|
2247
|
+
*
|
|
2248
|
+
* @inheritable
|
|
2249
|
+
*/
|
|
2250
|
+
logpush: boolean | undefined;
|
|
2251
|
+
/**
|
|
2252
|
+
* Include source maps when uploading this worker.
|
|
2253
|
+
*
|
|
2254
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#source-maps
|
|
2255
|
+
*
|
|
2256
|
+
* @inheritable
|
|
2257
|
+
*/
|
|
2258
|
+
upload_source_maps: boolean | undefined;
|
|
2259
|
+
/**
|
|
2260
|
+
* Specify how the Worker should be located to minimize round-trip time.
|
|
2261
|
+
*
|
|
2262
|
+
* More details: https://developers.cloudflare.com/workers/platform/smart-placement/
|
|
2263
|
+
*
|
|
2264
|
+
* @inheritable
|
|
2265
|
+
*/
|
|
2266
|
+
placement: {
|
|
2267
|
+
mode: "off" | "smart";
|
|
2268
|
+
hint?: string;
|
|
2269
|
+
} | {
|
|
2270
|
+
mode?: "targeted";
|
|
2271
|
+
region: string;
|
|
2272
|
+
} | {
|
|
2273
|
+
mode?: "targeted";
|
|
2274
|
+
host: string;
|
|
2275
|
+
} | {
|
|
2276
|
+
mode?: "targeted";
|
|
2277
|
+
hostname: string;
|
|
2278
|
+
} | undefined;
|
|
2279
|
+
/**
|
|
2280
|
+
* Specify the directory of static assets to deploy/serve
|
|
2281
|
+
*
|
|
2282
|
+
* More details at https://developers.cloudflare.com/workers/frameworks/
|
|
2283
|
+
*
|
|
2284
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
|
|
2285
|
+
*
|
|
2286
|
+
* @inheritable
|
|
2287
|
+
*/
|
|
2288
|
+
assets: Assets | undefined;
|
|
2289
|
+
/**
|
|
2290
|
+
* Specify the observability behavior of the Worker.
|
|
2291
|
+
*
|
|
2292
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
|
|
2293
|
+
*
|
|
2294
|
+
* @inheritable
|
|
2295
|
+
*/
|
|
2296
|
+
observability: Observability | undefined;
|
|
2297
|
+
/**
|
|
2298
|
+
* Specify the Cloudflare Access authentication behavior of the Worker.
|
|
2299
|
+
*
|
|
2300
|
+
* @inheritable
|
|
2301
|
+
*/
|
|
2302
|
+
access: Access | undefined;
|
|
2303
|
+
/**
|
|
2304
|
+
* Specify the cache behavior of the Worker.
|
|
2305
|
+
*
|
|
2306
|
+
* @inheritable
|
|
2307
|
+
*/
|
|
2308
|
+
cache: CacheOptions | undefined;
|
|
2309
|
+
/**
|
|
2310
|
+
* Specify the compliance region mode of the Worker.
|
|
2311
|
+
*
|
|
2312
|
+
* Although if the user does not specify a compliance region, the default is `public`,
|
|
2313
|
+
* it can be set to `undefined` in configuration to delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable.
|
|
2314
|
+
*/
|
|
2315
|
+
compliance_region: "public" | "fedramp_high" | undefined;
|
|
2316
|
+
/**
|
|
2317
|
+
* Configuration for Python modules.
|
|
2318
|
+
*
|
|
2319
|
+
* @inheritable
|
|
2320
|
+
*/
|
|
2321
|
+
python_modules: {
|
|
2322
|
+
/**
|
|
2323
|
+
* A list of glob patterns to exclude files from the python_modules directory when bundling.
|
|
2324
|
+
*
|
|
2325
|
+
* Patterns are relative to the python_modules directory and use glob syntax.
|
|
2326
|
+
*
|
|
2327
|
+
* @default ["**\*.pyc"]
|
|
2328
|
+
*/
|
|
2329
|
+
exclude: string[];
|
|
2330
|
+
};
|
|
2331
|
+
/**
|
|
2332
|
+
* Configuration for Worker Previews.
|
|
2333
|
+
*
|
|
2334
|
+
* Previews are branches of your Worker's main instance used to test features
|
|
2335
|
+
* in development outside of production. This block defines the settings
|
|
2336
|
+
* used when creating Preview deployments via `wrangler preview`.
|
|
2337
|
+
*
|
|
2338
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#previews
|
|
2339
|
+
*
|
|
2340
|
+
* @inheritable
|
|
2341
|
+
*/
|
|
2342
|
+
previews: PreviewsConfig | undefined;
|
|
2343
|
+
}
|
|
2344
|
+
type DurableObjectBindings = {
|
|
2345
|
+
/** The name of the binding used to refer to the Durable Object */
|
|
2346
|
+
name: string;
|
|
2347
|
+
/** The exported class name of the Durable Object */
|
|
2348
|
+
class_name: string;
|
|
2349
|
+
/** The script where the Durable Object is defined (if it's external to this Worker) */
|
|
2350
|
+
script_name?: string;
|
|
2351
|
+
/** The service environment of the script_name to bind to */
|
|
2352
|
+
environment?: string;
|
|
2353
|
+
}[];
|
|
2354
|
+
declare const ARTIFACTS_EVENT_TYPES: readonly ["cf.artifacts.repo.created", "cf.artifacts.repo.deleted", "cf.artifacts.repo.forked", "cf.artifacts.repo.imported", "cf.artifacts.repo.pushed", "cf.artifacts.repo.cloned", "cf.artifacts.repo.fetched", "cf.artifacts.repo.token.created", "cf.artifacts.repo.token.revoked"];
|
|
2355
|
+
type ArtifactsEventType = (typeof ARTIFACTS_EVENT_TYPES)[number];
|
|
2356
|
+
type ArtifactsEventTrigger = {
|
|
2357
|
+
type: ArtifactsEventType;
|
|
2358
|
+
filter?: {
|
|
2359
|
+
namespace?: string;
|
|
2360
|
+
repo_name?: string;
|
|
2361
|
+
};
|
|
2362
|
+
targets: {
|
|
2363
|
+
type: "workflow";
|
|
2364
|
+
workflow_name: string;
|
|
2365
|
+
}[];
|
|
2366
|
+
};
|
|
2367
|
+
type WorkflowBinding = {
|
|
2368
|
+
/** The name of the binding used to refer to the Workflow */
|
|
2369
|
+
binding: string;
|
|
2370
|
+
/** The name of the Workflow */
|
|
2371
|
+
name: string;
|
|
2372
|
+
/** The exported class name of the Workflow */
|
|
2373
|
+
class_name: string;
|
|
2374
|
+
/** The script where the Workflow is defined (if it's external to this Worker) */
|
|
2375
|
+
script_name?: string;
|
|
2376
|
+
/** Optional limits for the Workflow */
|
|
2377
|
+
limits?: {
|
|
2378
|
+
/** Maximum number of steps a Workflow instance can execute */
|
|
2379
|
+
steps?: number;
|
|
2380
|
+
};
|
|
2381
|
+
/** Optional concurrency configuration for the Workflow */
|
|
2382
|
+
concurrency?: {
|
|
2383
|
+
/** Maximum number of Workflow instances that can run concurrently */
|
|
2384
|
+
limit?: number;
|
|
2385
|
+
};
|
|
2386
|
+
/** Optional cron schedule(s) for automatically triggering workflow instances */
|
|
2387
|
+
schedules?: string | string[];
|
|
2388
|
+
/**
|
|
2389
|
+
* Optional default retention for instances of this Workflow, applied when an instance does not
|
|
2390
|
+
* set its own retention. Accepts milliseconds or a duration string such as `"3 days"`, and is
|
|
2391
|
+
* validated by the Workflows API at deploy time.
|
|
2392
|
+
*/
|
|
2393
|
+
default_retention?: {
|
|
2394
|
+
/** How long to retain instances that completed successfully or were terminated */
|
|
2395
|
+
success_retention?: number | string;
|
|
2396
|
+
/** How long to retain errored instances */
|
|
2397
|
+
error_retention?: number | string;
|
|
2398
|
+
};
|
|
2399
|
+
};
|
|
2400
|
+
/**
|
|
2401
|
+
* The `EnvironmentNonInheritable` interface declares all the configuration fields for an environment
|
|
2402
|
+
* that cannot be inherited from the top-level environment, and must be defined specifically.
|
|
2403
|
+
*
|
|
2404
|
+
* If any of these fields are defined at the top-level then they should also be specifically defined
|
|
2405
|
+
* for each named environment.
|
|
2406
|
+
*/
|
|
2407
|
+
interface EnvironmentNonInheritable {
|
|
2408
|
+
/**
|
|
2409
|
+
* A map of values to substitute when deploying your Worker.
|
|
2410
|
+
*
|
|
2411
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2412
|
+
* and so must be specified in every named environment.
|
|
2413
|
+
*
|
|
2414
|
+
* @default {}
|
|
2415
|
+
* @nonInheritable
|
|
2416
|
+
*/
|
|
2417
|
+
define: Record<string, string>;
|
|
2418
|
+
/**
|
|
2419
|
+
* A map of environment variables to set when deploying your Worker.
|
|
2420
|
+
*
|
|
2421
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2422
|
+
* and so must be specified in every named environment.
|
|
2423
|
+
*
|
|
2424
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
|
|
2425
|
+
*
|
|
2426
|
+
* @default {}
|
|
2427
|
+
* @nonInheritable
|
|
2428
|
+
*/
|
|
2429
|
+
vars: Record<string, string | Json>;
|
|
2430
|
+
/**
|
|
2431
|
+
* Secrets configuration.
|
|
2432
|
+
*
|
|
2433
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2434
|
+
* and so must be specified in every named environment.
|
|
2435
|
+
*
|
|
2436
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
|
|
2437
|
+
*
|
|
2438
|
+
* @nonInheritable
|
|
2439
|
+
*/
|
|
2440
|
+
secrets?: {
|
|
2441
|
+
/**
|
|
2442
|
+
* List of secret names that are required by your Worker.
|
|
2443
|
+
* When defined, this property:
|
|
2444
|
+
* - Replaces .dev.vars/.env/process.env inference for type generation
|
|
2445
|
+
* - Enables local dev validation with warnings for missing secrets
|
|
2446
|
+
*/
|
|
2447
|
+
required?: string[];
|
|
2448
|
+
};
|
|
2449
|
+
/**
|
|
2450
|
+
* A list of durable objects that your Worker should be bound to.
|
|
2451
|
+
*
|
|
2452
|
+
* For more information about Durable Objects, see the documentation at
|
|
2453
|
+
* https://developers.cloudflare.com/workers/learning/using-durable-objects
|
|
2454
|
+
*
|
|
2455
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2456
|
+
* and so must be specified in every named environment.
|
|
2457
|
+
*
|
|
2458
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
2459
|
+
*
|
|
2460
|
+
* @default {bindings:[]}
|
|
2461
|
+
* @nonInheritable
|
|
2462
|
+
*/
|
|
2463
|
+
durable_objects: {
|
|
2464
|
+
bindings: DurableObjectBindings;
|
|
2465
|
+
};
|
|
2466
|
+
/**
|
|
2467
|
+
* A list of workflows that your Worker should be bound to.
|
|
2468
|
+
*
|
|
2469
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2470
|
+
* and so must be specified in every named environment.
|
|
2471
|
+
*
|
|
2472
|
+
* @default []
|
|
2473
|
+
* @nonInheritable
|
|
2474
|
+
*/
|
|
2475
|
+
workflows: WorkflowBinding[];
|
|
2476
|
+
/**
|
|
2477
|
+
* Cloudchamber configuration
|
|
2478
|
+
*
|
|
2479
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2480
|
+
* and so must be specified in every named environment.
|
|
2481
|
+
*
|
|
2482
|
+
* @default {}
|
|
2483
|
+
* @nonInheritable
|
|
2484
|
+
*/
|
|
2485
|
+
cloudchamber: CloudchamberConfig;
|
|
2486
|
+
/**
|
|
2487
|
+
* Container related configuration
|
|
2488
|
+
*
|
|
2489
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2490
|
+
* and so must be specified in every named environment.
|
|
2491
|
+
*
|
|
2492
|
+
* @default []
|
|
2493
|
+
* @nonInheritable
|
|
2494
|
+
*/
|
|
2495
|
+
containers?: ContainerApp[];
|
|
2496
|
+
/**
|
|
2497
|
+
* These specify any Workers KV Namespaces you want to
|
|
2498
|
+
* access from inside your Worker.
|
|
2499
|
+
*
|
|
2500
|
+
* To learn more about KV Namespaces,
|
|
2501
|
+
* see the documentation at https://developers.cloudflare.com/workers/learning/how-kv-works
|
|
2502
|
+
*
|
|
2503
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2504
|
+
* and so must be specified in every named environment.
|
|
2505
|
+
*
|
|
2506
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
|
|
2507
|
+
*
|
|
2508
|
+
* @default []
|
|
2509
|
+
* @nonInheritable
|
|
2510
|
+
*/
|
|
2511
|
+
kv_namespaces: {
|
|
2512
|
+
/** The binding name used to refer to the KV Namespace */
|
|
2513
|
+
binding: string;
|
|
2514
|
+
/** The ID of the KV namespace */
|
|
2515
|
+
id?: string;
|
|
2516
|
+
/** The ID of the KV namespace used during `wrangler dev` */
|
|
2517
|
+
preview_id?: string;
|
|
2518
|
+
/** Whether the KV namespace should be remote or not in local development */
|
|
2519
|
+
remote?: boolean;
|
|
2520
|
+
}[];
|
|
2521
|
+
/**
|
|
2522
|
+
* These specify bindings to send email from inside your Worker.
|
|
2523
|
+
*
|
|
2524
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2525
|
+
* and so must be specified in every named environment.
|
|
2526
|
+
*
|
|
2527
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
|
|
2528
|
+
*
|
|
2529
|
+
* @default []
|
|
2530
|
+
* @nonInheritable
|
|
2531
|
+
*/
|
|
2532
|
+
send_email: {
|
|
2533
|
+
/** The binding name used to refer to the this binding */
|
|
2534
|
+
name: string;
|
|
2535
|
+
/** If this binding should be restricted to a specific verified address */
|
|
2536
|
+
destination_address?: string;
|
|
2537
|
+
/** If this binding should be restricted to a set of verified addresses */
|
|
2538
|
+
allowed_destination_addresses?: string[];
|
|
2539
|
+
/** If this binding should be restricted to a set of sender addresses */
|
|
2540
|
+
allowed_sender_addresses?: string[];
|
|
2541
|
+
/** Whether the binding should be remote or not in local development */
|
|
2542
|
+
remote?: boolean;
|
|
2543
|
+
}[];
|
|
2544
|
+
/**
|
|
2545
|
+
* Specifies Queues that are bound to this Worker environment.
|
|
2546
|
+
*
|
|
2547
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2548
|
+
* and so must be specified in every named environment.
|
|
2549
|
+
*
|
|
2550
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
2551
|
+
*
|
|
2552
|
+
* @default {consumers:[],producers:[]}
|
|
2553
|
+
* @nonInheritable
|
|
2554
|
+
*/
|
|
2555
|
+
queues: {
|
|
2556
|
+
/** Producer bindings */
|
|
2557
|
+
producers?: {
|
|
2558
|
+
/** The binding name used to refer to the Queue in the Worker. */
|
|
2559
|
+
binding: string;
|
|
2560
|
+
/** The name of this Queue. */
|
|
2561
|
+
queue?: string;
|
|
2562
|
+
/** The number of seconds to wait before delivering a message */
|
|
2563
|
+
delivery_delay?: number;
|
|
2564
|
+
/** Whether the Queue producer should be remote or not in local development */
|
|
2565
|
+
remote?: boolean;
|
|
2566
|
+
}[];
|
|
2567
|
+
/** Consumer configuration */
|
|
2568
|
+
consumers?: {
|
|
2569
|
+
/** The name of the queue from which this consumer should consume. */
|
|
2570
|
+
queue: string;
|
|
2571
|
+
/** The consumer type. Only "worker" is supported in wrangler config. Default is "worker". */
|
|
2572
|
+
type?: "worker";
|
|
2573
|
+
/** The maximum number of messages per batch */
|
|
2574
|
+
max_batch_size?: number;
|
|
2575
|
+
/** The maximum number of seconds to wait to fill a batch with messages. */
|
|
2576
|
+
max_batch_timeout?: number;
|
|
2577
|
+
/** The maximum number of retries for each message. */
|
|
2578
|
+
max_retries?: number;
|
|
2579
|
+
/** The queue to send messages that failed to be consumed. */
|
|
2580
|
+
dead_letter_queue?: string;
|
|
2581
|
+
/** 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. */
|
|
2582
|
+
max_concurrency?: number | null;
|
|
2583
|
+
/** The number of milliseconds to wait for pulled messages to become visible again */
|
|
2584
|
+
visibility_timeout_ms?: number;
|
|
2585
|
+
/** The number of seconds to wait before retrying a message */
|
|
2586
|
+
retry_delay?: number;
|
|
2587
|
+
}[];
|
|
2588
|
+
};
|
|
2589
|
+
/**
|
|
2590
|
+
* Specifies raw sockets that this Worker should listen on.
|
|
2591
|
+
* Each entry opens a listening socket on the
|
|
2592
|
+
* given port that delivers incoming connections directly to the Worker's
|
|
2593
|
+
* `connect(socket, env, ctx)` handler.
|
|
2594
|
+
*
|
|
2595
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2596
|
+
* and so must be specified in every named environment.
|
|
2597
|
+
*
|
|
2598
|
+
* @default []
|
|
2599
|
+
* @nonInheritable
|
|
2600
|
+
*/
|
|
2601
|
+
connect: {
|
|
2602
|
+
/** The transport protocol to listen for. */
|
|
2603
|
+
protocol: "tcp";
|
|
2604
|
+
/** The port to listen on. */
|
|
2605
|
+
port: number;
|
|
2606
|
+
/** The address to bind to. Defaults to `127.0.0.1`. */
|
|
2607
|
+
address?: string;
|
|
2608
|
+
}[];
|
|
2609
|
+
/**
|
|
2610
|
+
* Specifies R2 buckets that are bound to this Worker environment.
|
|
2611
|
+
*
|
|
2612
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2613
|
+
* and so must be specified in every named environment.
|
|
2614
|
+
*
|
|
2615
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
|
|
2616
|
+
*
|
|
2617
|
+
* @default []
|
|
2618
|
+
* @nonInheritable
|
|
2619
|
+
*/
|
|
2620
|
+
r2_buckets: {
|
|
2621
|
+
/** The binding name used to refer to the R2 bucket in the Worker. */
|
|
2622
|
+
binding: string;
|
|
2623
|
+
/** The name of this R2 bucket at the edge. */
|
|
2624
|
+
bucket_name?: string;
|
|
2625
|
+
/** The preview name of this R2 bucket at the edge. */
|
|
2626
|
+
preview_bucket_name?: string;
|
|
2627
|
+
/** The jurisdiction that the bucket exists in. Default if not present. */
|
|
2628
|
+
jurisdiction?: string;
|
|
2629
|
+
/** Whether the R2 bucket should be remote or not in local development */
|
|
2630
|
+
remote?: boolean;
|
|
2631
|
+
/** Settings that only apply to local development */
|
|
2632
|
+
local_dev?: {
|
|
2633
|
+
/**
|
|
2634
|
+
* EXPERIMENTAL: AWS SigV4 credentials for the local S3-compatible
|
|
2635
|
+
* endpoint. When set, the bucket is served at
|
|
2636
|
+
* `/cdn-cgi/local/r2/s3/<bucket-name>` during local development.
|
|
2637
|
+
* Ignored when the bucket runs remotely.
|
|
2638
|
+
*/
|
|
2639
|
+
experimental_s3_credentials?: LocalS3Credentials;
|
|
2640
|
+
};
|
|
2641
|
+
}[];
|
|
2642
|
+
/**
|
|
2643
|
+
* Specifies D1 databases that are bound to this Worker environment.
|
|
2644
|
+
*
|
|
2645
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2646
|
+
* and so must be specified in every named environment.
|
|
2647
|
+
*
|
|
2648
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
|
|
2649
|
+
*
|
|
2650
|
+
* @default []
|
|
2651
|
+
* @nonInheritable
|
|
2652
|
+
*/
|
|
2653
|
+
d1_databases: {
|
|
2654
|
+
/** The binding name used to refer to the D1 database in the Worker. */
|
|
2655
|
+
binding: string;
|
|
2656
|
+
/** The name of this D1 database. */
|
|
2657
|
+
database_name?: string;
|
|
2658
|
+
/** The UUID of this D1 database (not required). */
|
|
2659
|
+
database_id?: string;
|
|
2660
|
+
/** The UUID of this D1 database for Wrangler Dev (if specified). */
|
|
2661
|
+
preview_database_id?: string;
|
|
2662
|
+
/** The name of the migrations table for this D1 database (defaults to 'd1_migrations'). */
|
|
2663
|
+
migrations_table?: string;
|
|
2664
|
+
/** The path to the directory of migrations for this D1 database (defaults to './migrations'). */
|
|
2665
|
+
migrations_dir?: string;
|
|
2666
|
+
/**
|
|
2667
|
+
* A glob pattern (relative to the Wrangler config file) used to discover
|
|
2668
|
+
* migration files for this D1 database. Defaults to `${migrations_dir}/*.sql`
|
|
2669
|
+
* if not specified.
|
|
2670
|
+
*
|
|
2671
|
+
* Use this to opt in to nested layouts such as `migrations/*\/migration.sql`
|
|
2672
|
+
* (as produced by some ORMs).
|
|
2673
|
+
*
|
|
2674
|
+
* When `migrations_pattern` is set, `migrations_dir` must also be set, and
|
|
2675
|
+
* `migrations_pattern` must start with `${migrations_dir}/`. This keeps the
|
|
2676
|
+
* relationship between the two settings explicit and lets Wrangler record
|
|
2677
|
+
* each migration's name in the migrations table as a path relative to
|
|
2678
|
+
* `migrations_dir`.
|
|
2679
|
+
*/
|
|
2680
|
+
migrations_pattern?: string;
|
|
2681
|
+
/** Internal use only. */
|
|
2682
|
+
database_internal_env?: string;
|
|
2683
|
+
/** Whether the D1 database should be remote or not in local development */
|
|
2684
|
+
remote?: boolean;
|
|
2685
|
+
}[];
|
|
2686
|
+
/**
|
|
2687
|
+
* Specifies Vectorize indexes that are bound to this Worker environment.
|
|
2688
|
+
*
|
|
2689
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2690
|
+
* and so must be specified in every named environment.
|
|
2691
|
+
*
|
|
2692
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
|
|
2693
|
+
*
|
|
2694
|
+
* @default []
|
|
2695
|
+
* @nonInheritable
|
|
2696
|
+
*/
|
|
2697
|
+
vectorize: {
|
|
2698
|
+
/** The binding name used to refer to the Vectorize index in the Worker. */
|
|
2699
|
+
binding: string;
|
|
2700
|
+
/** The name of the index. */
|
|
2701
|
+
index_name: string;
|
|
2702
|
+
/** Whether the Vectorize index should be remote or not in local development */
|
|
2703
|
+
remote?: boolean;
|
|
2704
|
+
}[];
|
|
2705
|
+
/**
|
|
2706
|
+
* Specifies AI Search namespace bindings that are bound to this Worker environment.
|
|
2707
|
+
* Each binding is scoped to a namespace and allows dynamic instance CRUD within it.
|
|
2708
|
+
*
|
|
2709
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2710
|
+
* and so must be specified in every named environment.
|
|
2711
|
+
*
|
|
2712
|
+
* @default []
|
|
2713
|
+
* @nonInheritable
|
|
2714
|
+
*/
|
|
2715
|
+
ai_search_namespaces: {
|
|
2716
|
+
/** The binding name used to refer to the AI Search namespace in the Worker. */
|
|
2717
|
+
binding: string;
|
|
2718
|
+
/** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
|
|
2719
|
+
namespace: string;
|
|
2720
|
+
/** Whether the AI Search namespace binding should be remote in local development */
|
|
2721
|
+
remote?: boolean;
|
|
2722
|
+
}[];
|
|
2723
|
+
/**
|
|
2724
|
+
* Specifies AI Search instance bindings that are bound to this Worker environment.
|
|
2725
|
+
* Each binding is bound directly to a single pre-existing instance within the "default" namespace.
|
|
2726
|
+
*
|
|
2727
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2728
|
+
* and so must be specified in every named environment.
|
|
2729
|
+
*
|
|
2730
|
+
* @default []
|
|
2731
|
+
* @nonInheritable
|
|
2732
|
+
*/
|
|
2733
|
+
ai_search: {
|
|
2734
|
+
/** The binding name used to refer to the AI Search instance in the Worker. */
|
|
2735
|
+
binding: string;
|
|
2736
|
+
/** The user-chosen instance name. Must exist in Cloudflare at deploy time. */
|
|
2737
|
+
instance_name: string;
|
|
2738
|
+
/** Whether the AI Search instance binding should be remote in local development */
|
|
2739
|
+
remote?: boolean;
|
|
2740
|
+
}[];
|
|
2741
|
+
/**
|
|
2742
|
+
* Specifies Agent Memory namespace bindings that are bound to this Worker environment.
|
|
2743
|
+
*
|
|
2744
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2745
|
+
* and so must be specified in every named environment.
|
|
2746
|
+
*
|
|
2747
|
+
* @default []
|
|
2748
|
+
* @nonInheritable
|
|
2749
|
+
*/
|
|
2750
|
+
agent_memory: {
|
|
2751
|
+
/** The binding name used to refer to the Agent Memory namespace in the Worker. */
|
|
2752
|
+
binding: string;
|
|
2753
|
+
/** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
|
|
2754
|
+
namespace: string;
|
|
2755
|
+
/** Whether the Agent Memory binding should be remote in local development */
|
|
2756
|
+
remote?: boolean;
|
|
2757
|
+
}[];
|
|
2758
|
+
/**
|
|
2759
|
+
* Cloudflare Web Search binding. There is exactly one shared web corpus, so the
|
|
2760
|
+
* binding is zero-config -- only the variable name is required, declared as a
|
|
2761
|
+
* single object (not an array).
|
|
2762
|
+
*
|
|
2763
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2764
|
+
* and so must be specified in every named environment.
|
|
2765
|
+
*
|
|
2766
|
+
* @default {}
|
|
2767
|
+
* @nonInheritable
|
|
2768
|
+
*/
|
|
2769
|
+
websearch: {
|
|
2770
|
+
/** The binding name used to refer to Web Search in the Worker. */
|
|
2771
|
+
binding: string;
|
|
2772
|
+
/** Whether the Web Search binding should be remote or not in local development */
|
|
2773
|
+
remote?: boolean;
|
|
2774
|
+
} | undefined;
|
|
2775
|
+
/**
|
|
2776
|
+
* Specifies Hyperdrive configs that are bound to this Worker environment.
|
|
2777
|
+
*
|
|
2778
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2779
|
+
* and so must be specified in every named environment.
|
|
2780
|
+
*
|
|
2781
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
|
|
2782
|
+
*
|
|
2783
|
+
* @default []
|
|
2784
|
+
* @nonInheritable
|
|
2785
|
+
*/
|
|
2786
|
+
hyperdrive: {
|
|
2787
|
+
/** The binding name used to refer to the project in the Worker. */
|
|
2788
|
+
binding: string;
|
|
2789
|
+
/** The id of the database. */
|
|
2790
|
+
id: string;
|
|
2791
|
+
/** The local database connection string for `wrangler dev` */
|
|
2792
|
+
localConnectionString?: string;
|
|
2793
|
+
}[];
|
|
2794
|
+
/**
|
|
2795
|
+
* Specifies service bindings (Worker-to-Worker) that are bound to this Worker environment.
|
|
2796
|
+
*
|
|
2797
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2798
|
+
* and so must be specified in every named environment.
|
|
2799
|
+
*
|
|
2800
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
|
|
2801
|
+
*
|
|
2802
|
+
* @default []
|
|
2803
|
+
* @nonInheritable
|
|
2804
|
+
*/
|
|
2805
|
+
services: {
|
|
2806
|
+
/** The binding name used to refer to the bound service. */
|
|
2807
|
+
binding: string;
|
|
2808
|
+
/**
|
|
2809
|
+
* The name of the service.
|
|
2810
|
+
* To bind to a worker in a specific environment,
|
|
2811
|
+
* you should use the format `<worker_name>-<environment_name>`.
|
|
2812
|
+
*/
|
|
2813
|
+
service: string;
|
|
2814
|
+
/**
|
|
2815
|
+
* @hidden
|
|
2816
|
+
* @deprecated you should use `service: <worker_name>-<environment_name>` instead.
|
|
2817
|
+
* This refers to the deprecated concept of 'service environments'.
|
|
2818
|
+
* The environment of the service (e.g. production, staging, etc).
|
|
2819
|
+
*/
|
|
2820
|
+
environment?: string;
|
|
2821
|
+
/** Optionally, the entrypoint (named export) of the service to bind to. */
|
|
2822
|
+
entrypoint?: string;
|
|
2823
|
+
/** Optional properties that will be made available to the service via ctx.props. */
|
|
2824
|
+
props?: Record<string, unknown>;
|
|
2825
|
+
/** Whether the service binding should be remote or not in local development */
|
|
2826
|
+
remote?: boolean;
|
|
2827
|
+
}[] | undefined;
|
|
2828
|
+
/**
|
|
2829
|
+
* Specifies analytics engine datasets that are bound to this Worker environment.
|
|
2830
|
+
*
|
|
2831
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2832
|
+
* and so must be specified in every named environment.
|
|
2833
|
+
*
|
|
2834
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
|
|
2835
|
+
*
|
|
2836
|
+
* @default []
|
|
2837
|
+
* @nonInheritable
|
|
2838
|
+
*/
|
|
2839
|
+
analytics_engine_datasets: {
|
|
2840
|
+
/** The binding name used to refer to the dataset in the Worker. */
|
|
2841
|
+
binding: string;
|
|
2842
|
+
/** The name of this dataset to write to. */
|
|
2843
|
+
dataset?: string;
|
|
2844
|
+
}[];
|
|
2845
|
+
/**
|
|
2846
|
+
* A browser that will be usable from the Worker.
|
|
2847
|
+
*
|
|
2848
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2849
|
+
* and so must be specified in every named environment.
|
|
2850
|
+
*
|
|
2851
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
|
|
2852
|
+
*
|
|
2853
|
+
* @default {}
|
|
2854
|
+
* @nonInheritable
|
|
2855
|
+
*/
|
|
2856
|
+
browser: {
|
|
2857
|
+
binding: string;
|
|
2858
|
+
/** Whether the Browser binding should be remote or not in local development */
|
|
2859
|
+
remote?: boolean;
|
|
2860
|
+
} | undefined;
|
|
2861
|
+
/**
|
|
2862
|
+
* Binding to the AI project.
|
|
2863
|
+
*
|
|
2864
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2865
|
+
* and so must be specified in every named environment.
|
|
2866
|
+
*
|
|
2867
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
|
|
2868
|
+
*
|
|
2869
|
+
* @default {}
|
|
2870
|
+
* @nonInheritable
|
|
2871
|
+
*/
|
|
2872
|
+
ai: {
|
|
2873
|
+
binding: string;
|
|
2874
|
+
staging?: boolean;
|
|
2875
|
+
/** Whether the AI binding should be remote or not in local development */
|
|
2876
|
+
remote?: boolean;
|
|
2877
|
+
} | undefined;
|
|
2878
|
+
/**
|
|
2879
|
+
* Binding to Cloudflare Images
|
|
2880
|
+
*
|
|
2881
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2882
|
+
* and so must be specified in every named environment.
|
|
2883
|
+
*
|
|
2884
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
|
|
2885
|
+
*
|
|
2886
|
+
* @default {}
|
|
2887
|
+
* @nonInheritable
|
|
2888
|
+
*/
|
|
2889
|
+
images: {
|
|
2890
|
+
binding: string;
|
|
2891
|
+
/** Whether the Images binding should be remote or not in local development */
|
|
2892
|
+
remote?: boolean;
|
|
2893
|
+
} | undefined;
|
|
2894
|
+
/**
|
|
2895
|
+
* Binding to Cloudflare Media Transformations
|
|
2896
|
+
*
|
|
2897
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2898
|
+
* and so must be specified in every named environment.
|
|
2899
|
+
*
|
|
2900
|
+
* @default {}
|
|
2901
|
+
* @nonInheritable
|
|
2902
|
+
*/
|
|
2903
|
+
media: {
|
|
2904
|
+
binding: string;
|
|
2905
|
+
/** Whether the Media binding should be remote or not */
|
|
2906
|
+
remote?: boolean;
|
|
2907
|
+
} | undefined;
|
|
2908
|
+
/**
|
|
2909
|
+
* Binding to Cloudflare Stream
|
|
2910
|
+
*
|
|
2911
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2912
|
+
* and so must be specified in every named environment.
|
|
2913
|
+
*
|
|
2914
|
+
* @default {}
|
|
2915
|
+
* @nonInheritable
|
|
2916
|
+
*/
|
|
2917
|
+
stream: {
|
|
2918
|
+
binding: string;
|
|
2919
|
+
/** Whether the Stream binding should be remote or not in local development */
|
|
2920
|
+
remote?: boolean;
|
|
2921
|
+
} | undefined;
|
|
2922
|
+
/**
|
|
2923
|
+
* Binding to the Worker Version's metadata
|
|
2924
|
+
*/
|
|
2925
|
+
version_metadata: {
|
|
2926
|
+
binding: string;
|
|
2927
|
+
} | undefined;
|
|
2928
|
+
/**
|
|
2929
|
+
* "Unsafe" tables for features that aren't directly supported by wrangler.
|
|
2930
|
+
*
|
|
2931
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2932
|
+
* and so must be specified in every named environment.
|
|
2933
|
+
*
|
|
2934
|
+
* @default {}
|
|
2935
|
+
* @nonInheritable
|
|
2936
|
+
*/
|
|
2937
|
+
unsafe: {
|
|
2938
|
+
/**
|
|
2939
|
+
* A set of bindings that should be put into a Worker's upload metadata without changes. These
|
|
2940
|
+
* can be used to implement bindings for features that haven't released and aren't supported
|
|
2941
|
+
* directly by wrangler or miniflare.
|
|
2942
|
+
*/
|
|
2943
|
+
bindings?: UnsafeBinding[];
|
|
2944
|
+
/**
|
|
2945
|
+
* Arbitrary key/value pairs that will be included in the uploaded metadata. Values specified
|
|
2946
|
+
* here will always be applied to metadata last, so can add new or override existing fields.
|
|
2947
|
+
*/
|
|
2948
|
+
metadata?: {
|
|
2949
|
+
[key: string]: unknown;
|
|
2950
|
+
};
|
|
2951
|
+
/**
|
|
2952
|
+
* Used for internal capnp uploads for the Workers runtime
|
|
2953
|
+
*/
|
|
2954
|
+
capnp?: {
|
|
2955
|
+
base_path: string;
|
|
2956
|
+
source_schemas: string[];
|
|
2957
|
+
compiled_schema?: never;
|
|
2958
|
+
} | {
|
|
2959
|
+
base_path?: never;
|
|
2960
|
+
source_schemas?: never;
|
|
2961
|
+
compiled_schema: string;
|
|
2962
|
+
};
|
|
2963
|
+
};
|
|
2964
|
+
/**
|
|
2965
|
+
* Specifies a list of mTLS certificates that are bound to this Worker environment.
|
|
2966
|
+
*
|
|
2967
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2968
|
+
* and so must be specified in every named environment.
|
|
2969
|
+
*
|
|
2970
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
|
|
2971
|
+
*
|
|
2972
|
+
* @default []
|
|
2973
|
+
* @nonInheritable
|
|
2974
|
+
*/
|
|
2975
|
+
mtls_certificates: {
|
|
2976
|
+
/** The binding name used to refer to the certificate in the Worker */
|
|
2977
|
+
binding: string;
|
|
2978
|
+
/** The uuid of the uploaded mTLS certificate */
|
|
2979
|
+
certificate_id: string;
|
|
2980
|
+
/** Whether the mtls fetcher should be remote or not in local development */
|
|
2981
|
+
remote?: boolean;
|
|
2982
|
+
}[];
|
|
2983
|
+
/**
|
|
2984
|
+
* Specifies a list of Tail Workers that are bound to this Worker environment
|
|
2985
|
+
*
|
|
2986
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2987
|
+
* and so must be specified in every named environment.
|
|
2988
|
+
*
|
|
2989
|
+
* @default []
|
|
2990
|
+
* @nonInheritable
|
|
2991
|
+
*/
|
|
2992
|
+
tail_consumers?: TailConsumer[];
|
|
2993
|
+
/**
|
|
2994
|
+
* Specifies a list of Streaming Tail Workers that are bound to this Worker environment
|
|
2995
|
+
*
|
|
2996
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2997
|
+
* and so must be specified in every named environment.
|
|
2998
|
+
*
|
|
2999
|
+
* @default []
|
|
3000
|
+
* @nonInheritable
|
|
3001
|
+
*/
|
|
3002
|
+
streaming_tail_consumers?: StreamingTailConsumer[];
|
|
3003
|
+
/**
|
|
3004
|
+
* Specifies namespace bindings that are bound to this Worker environment.
|
|
3005
|
+
*
|
|
3006
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
3007
|
+
* and so must be specified in every named environment.
|
|
3008
|
+
*
|
|
3009
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
|
|
3010
|
+
*
|
|
3011
|
+
* @default []
|
|
3012
|
+
* @nonInheritable
|
|
3013
|
+
*/
|
|
3014
|
+
dispatch_namespaces: {
|
|
3015
|
+
/** The binding name used to refer to the bound service. */
|
|
3016
|
+
binding: string;
|
|
3017
|
+
/** The namespace to bind to. */
|
|
3018
|
+
namespace?: string;
|
|
3019
|
+
/** Details about the outbound Worker which will handle outbound requests from your namespace */
|
|
3020
|
+
outbound?: DispatchNamespaceOutbound;
|
|
3021
|
+
/** Whether the Dispatch Namespace should be remote or not in local development */
|
|
3022
|
+
remote?: boolean;
|
|
3023
|
+
}[];
|
|
3024
|
+
/**
|
|
3025
|
+
* Specifies list of Pipelines bound to this Worker environment
|
|
3026
|
+
*
|
|
3027
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
3028
|
+
* and so must be specified in every named environment.
|
|
3029
|
+
*
|
|
3030
|
+
* @default []
|
|
3031
|
+
* @nonInheritable
|
|
3032
|
+
*/
|
|
3033
|
+
pipelines: {
|
|
3034
|
+
/** The binding name used to refer to the bound service. */
|
|
3035
|
+
binding: string;
|
|
3036
|
+
/** Id of the Stream to bind */
|
|
3037
|
+
stream?: string;
|
|
3038
|
+
/**
|
|
3039
|
+
* Id of the Stream to bind
|
|
3040
|
+
* @deprecated Use `stream` instead.
|
|
3041
|
+
*/
|
|
3042
|
+
pipeline?: string;
|
|
3043
|
+
/** Whether the pipeline should be remote or not in local development */
|
|
3044
|
+
remote?: boolean;
|
|
3045
|
+
}[];
|
|
3046
|
+
/**
|
|
3047
|
+
* Specifies Secret Store bindings that are bound to this Worker environment.
|
|
3048
|
+
*
|
|
3049
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
3050
|
+
* and so must be specified in every named environment.
|
|
3051
|
+
*
|
|
3052
|
+
* @default []
|
|
3053
|
+
* @nonInheritable
|
|
3054
|
+
*/
|
|
3055
|
+
secrets_store_secrets: {
|
|
3056
|
+
/** The binding name used to refer to the bound service. */
|
|
3057
|
+
binding: string;
|
|
3058
|
+
/** Id of the secret store */
|
|
3059
|
+
store_id: string;
|
|
3060
|
+
/** Name of the secret */
|
|
3061
|
+
secret_name: string;
|
|
3062
|
+
}[];
|
|
3063
|
+
/**
|
|
3064
|
+
* Specifies Artifacts bindings that are bound to this Worker environment.
|
|
3065
|
+
* Artifacts provides git-compatible file storage on Cloudflare Workers.
|
|
3066
|
+
*
|
|
3067
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
3068
|
+
* and so must be specified in every named environment.
|
|
3069
|
+
*
|
|
3070
|
+
* @default []
|
|
3071
|
+
* @nonInheritable
|
|
3072
|
+
*/
|
|
3073
|
+
artifacts: {
|
|
3074
|
+
/** The binding name used to refer to the Artifacts instance. */
|
|
3075
|
+
binding: string;
|
|
3076
|
+
/** The namespace to use. */
|
|
3077
|
+
namespace: string;
|
|
3078
|
+
/** Whether to use the remote Artifacts service in local dev. */
|
|
3079
|
+
remote?: boolean;
|
|
3080
|
+
}[];
|
|
3081
|
+
/**
|
|
3082
|
+
* **DO NOT USE**. Hello World Binding Config to serve as an explanatory example.
|
|
3083
|
+
*
|
|
3084
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
3085
|
+
* and so must be specified in every named environment.
|
|
3086
|
+
*
|
|
3087
|
+
* @default []
|
|
3088
|
+
* @nonInheritable
|
|
3089
|
+
*/
|
|
3090
|
+
unsafe_hello_world: {
|
|
3091
|
+
/** The binding name used to refer to the bound service. */
|
|
3092
|
+
binding: string;
|
|
3093
|
+
/** Whether the timer is enabled */
|
|
3094
|
+
enable_timer?: boolean;
|
|
3095
|
+
}[];
|
|
3096
|
+
/**
|
|
3097
|
+
* Specifies Flagship feature flag bindings that are bound to this Worker environment.
|
|
3098
|
+
*
|
|
3099
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
3100
|
+
* and so must be specified in every named environment.
|
|
3101
|
+
*
|
|
3102
|
+
* @default []
|
|
3103
|
+
* @nonInheritable
|
|
3104
|
+
*/
|
|
3105
|
+
flagship: {
|
|
3106
|
+
/** The binding name used to refer to the bound Flagship service. */
|
|
3107
|
+
binding: string;
|
|
3108
|
+
/** The Flagship app ID to bind to. */
|
|
3109
|
+
app_id?: string;
|
|
3110
|
+
/** Set to `true` to suppress the remote binding warning in local dev. Flagship bindings are always remote. */
|
|
3111
|
+
remote?: boolean;
|
|
3112
|
+
}[];
|
|
3113
|
+
/**
|
|
3114
|
+
* Specifies rate limit bindings that are bound to this Worker environment.
|
|
3115
|
+
*
|
|
3116
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
3117
|
+
* and so must be specified in every named environment.
|
|
3118
|
+
*
|
|
3119
|
+
* @default []
|
|
3120
|
+
* @nonInheritable
|
|
3121
|
+
*/
|
|
3122
|
+
ratelimits: {
|
|
3123
|
+
/** The binding name used to refer to the rate limiter in the Worker. */
|
|
3124
|
+
name: string;
|
|
3125
|
+
/** The namespace ID for this rate limiter. */
|
|
3126
|
+
namespace_id: string;
|
|
3127
|
+
/** Simple rate limiting configuration. */
|
|
3128
|
+
simple: {
|
|
3129
|
+
/** The maximum number of requests allowed in the time period. */
|
|
3130
|
+
limit: number;
|
|
3131
|
+
/** The time period in seconds (10 for ten seconds, 60 for one minute). */
|
|
3132
|
+
period: 10 | 60;
|
|
3133
|
+
};
|
|
3134
|
+
}[];
|
|
3135
|
+
/**
|
|
3136
|
+
* Specifies Worker Loader bindings that are bound to this Worker environment.
|
|
3137
|
+
*
|
|
3138
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
3139
|
+
* and so must be specified in every named environment.
|
|
3140
|
+
*
|
|
3141
|
+
* @default []
|
|
3142
|
+
* @nonInheritable
|
|
3143
|
+
*/
|
|
3144
|
+
worker_loaders: {
|
|
3145
|
+
/** The binding name used to refer to the Worker Loader in the Worker. */
|
|
3146
|
+
binding: string;
|
|
3147
|
+
}[];
|
|
3148
|
+
/**
|
|
3149
|
+
* Specifies VPC services that are bound to this Worker environment.
|
|
3150
|
+
*
|
|
3151
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
3152
|
+
* and so must be specified in every named environment.
|
|
3153
|
+
*
|
|
3154
|
+
* @default []
|
|
3155
|
+
* @nonInheritable
|
|
3156
|
+
*/
|
|
3157
|
+
vpc_services: {
|
|
3158
|
+
/** The binding name used to refer to the VPC service in the Worker. */
|
|
3159
|
+
binding: string;
|
|
3160
|
+
/** The service ID of the VPC connectivity service. */
|
|
3161
|
+
service_id: string;
|
|
3162
|
+
/** Whether the VPC service is remote or not */
|
|
3163
|
+
remote?: boolean;
|
|
3164
|
+
}[];
|
|
3165
|
+
/**
|
|
3166
|
+
* Specifies VPC networks that are bound to this Worker environment.
|
|
3167
|
+
*
|
|
3168
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
3169
|
+
* and so must be specified in every named environment.
|
|
3170
|
+
*
|
|
3171
|
+
* @default []
|
|
3172
|
+
* @nonInheritable
|
|
3173
|
+
*/
|
|
3174
|
+
vpc_networks: ({
|
|
3175
|
+
/** The binding name used to refer to the VPC network in the Worker. */
|
|
3176
|
+
binding: string;
|
|
3177
|
+
/** The tunnel ID of the Cloudflare Tunnel to route traffic through. Mutually exclusive with network_id. */
|
|
3178
|
+
tunnel_id: string;
|
|
3179
|
+
/** Whether the VPC network is remote or not */
|
|
3180
|
+
remote?: boolean;
|
|
3181
|
+
} | {
|
|
3182
|
+
/** The binding name used to refer to the VPC network in the Worker. */
|
|
3183
|
+
binding: string;
|
|
3184
|
+
/** The network ID to route traffic through. Mutually exclusive with tunnel_id. */
|
|
3185
|
+
network_id: string;
|
|
3186
|
+
/** Whether the VPC network is remote or not */
|
|
3187
|
+
remote?: boolean;
|
|
3188
|
+
})[];
|
|
3189
|
+
}
|
|
3190
|
+
/**
|
|
3191
|
+
* The raw environment configuration that we read from the config file.
|
|
3192
|
+
*
|
|
3193
|
+
* All the properties are optional, and will be replaced with defaults in the configuration that
|
|
3194
|
+
* is used in the rest of the codebase.
|
|
3195
|
+
*/
|
|
3196
|
+
type RawEnvironment = Partial<Environment>;
|
|
3197
|
+
/**
|
|
3198
|
+
* A bundling resolver rule, defining the modules type for paths that match the specified globs.
|
|
3199
|
+
*/
|
|
3200
|
+
type Rule = {
|
|
3201
|
+
type: ConfigModuleRuleType;
|
|
3202
|
+
globs: string[];
|
|
3203
|
+
fallthrough?: boolean;
|
|
3204
|
+
};
|
|
3205
|
+
/**
|
|
3206
|
+
* The possible types for a `Rule`.
|
|
3207
|
+
*/
|
|
3208
|
+
type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data" | "PythonModule" | "PythonRequirement";
|
|
3209
|
+
type TailConsumer = {
|
|
3210
|
+
/** The name of the service tail events will be forwarded to. */
|
|
3211
|
+
service: string;
|
|
3212
|
+
/** (Optional) The environment of the service. */
|
|
3213
|
+
environment?: string;
|
|
3214
|
+
};
|
|
3215
|
+
type StreamingTailConsumer = {
|
|
3216
|
+
/** The name of the service streaming tail events will be forwarded to. */
|
|
3217
|
+
service: string;
|
|
3218
|
+
};
|
|
3219
|
+
interface DispatchNamespaceOutbound {
|
|
3220
|
+
/** Name of the service handling the outbound requests */
|
|
3221
|
+
service: string;
|
|
3222
|
+
/** (Optional) Name of the environment handling the outbound requests. */
|
|
3223
|
+
environment?: string;
|
|
3224
|
+
/** (Optional) List of parameter names, for sending context from your dispatch Worker to the outbound handler */
|
|
3225
|
+
parameters?: string[];
|
|
3226
|
+
}
|
|
3227
|
+
interface UserLimits {
|
|
3228
|
+
/** Maximum allowed CPU time for a Worker's invocation in milliseconds */
|
|
3229
|
+
cpu_ms?: number;
|
|
3230
|
+
/** Maximum allowed number of fetch requests that a Worker's invocation can execute */
|
|
3231
|
+
subrequests?: number;
|
|
3232
|
+
}
|
|
3233
|
+
type Assets = {
|
|
3234
|
+
/** Absolute path to assets directory */
|
|
3235
|
+
directory?: string;
|
|
3236
|
+
/** Name of `env` binding property in the User Worker. */
|
|
3237
|
+
binding?: string;
|
|
3238
|
+
/** How to handle HTML requests. */
|
|
3239
|
+
html_handling?: "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | "none";
|
|
3240
|
+
/** How to handle requests that do not match an asset. */
|
|
3241
|
+
not_found_handling?: "single-page-application" | "404-page" | "none";
|
|
3242
|
+
/**
|
|
3243
|
+
* Matches will be routed to the User Worker, and matches to negative rules will go to the Asset Worker.
|
|
3244
|
+
*
|
|
3245
|
+
* Can also be `true`, indicating that every request should be routed to the User Worker.
|
|
3246
|
+
*/
|
|
3247
|
+
run_worker_first?: string[] | boolean;
|
|
3248
|
+
};
|
|
3249
|
+
interface Observability {
|
|
3250
|
+
/** If observability is enabled for this Worker */
|
|
3251
|
+
enabled?: boolean;
|
|
3252
|
+
/** The sampling rate */
|
|
3253
|
+
head_sampling_rate?: number;
|
|
3254
|
+
/**
|
|
3255
|
+
* Whether query strings are removed from request URLs in logs and traces.
|
|
3256
|
+
*
|
|
3257
|
+
* @default false
|
|
3258
|
+
*/
|
|
3259
|
+
redact_query_string?: boolean;
|
|
3260
|
+
logs?: {
|
|
3261
|
+
enabled?: boolean;
|
|
3262
|
+
/** The sampling rate */
|
|
3263
|
+
head_sampling_rate?: number;
|
|
3264
|
+
/** Set to false to disable invocation logs */
|
|
3265
|
+
invocation_logs?: boolean;
|
|
3266
|
+
/**
|
|
3267
|
+
* If logs should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
|
|
3268
|
+
*
|
|
3269
|
+
* @default true
|
|
3270
|
+
*/
|
|
3271
|
+
persist?: boolean;
|
|
3272
|
+
/**
|
|
3273
|
+
* What destinations logs emitted from the Worker should be sent to.
|
|
3274
|
+
*
|
|
3275
|
+
* @default []
|
|
3276
|
+
*/
|
|
3277
|
+
destinations?: string[];
|
|
3278
|
+
};
|
|
3279
|
+
traces?: {
|
|
3280
|
+
enabled?: boolean;
|
|
3281
|
+
/** The sampling rate */
|
|
3282
|
+
head_sampling_rate?: number;
|
|
3283
|
+
/**
|
|
3284
|
+
* If traces should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
|
|
3285
|
+
*
|
|
3286
|
+
* @default true
|
|
3287
|
+
*/
|
|
3288
|
+
persist?: boolean;
|
|
3289
|
+
/**
|
|
3290
|
+
* What destinations traces emitted from the Worker should be sent to.
|
|
3291
|
+
*
|
|
3292
|
+
* @default []
|
|
3293
|
+
*/
|
|
3294
|
+
destinations?: string[];
|
|
3295
|
+
};
|
|
3296
|
+
}
|
|
3297
|
+
interface Access {
|
|
3298
|
+
/** Local dev simulation of Cloudflare Access authentication */
|
|
3299
|
+
dev?: {
|
|
3300
|
+
/** The Access application audience tag (aud) */
|
|
3301
|
+
aud: string;
|
|
3302
|
+
/** Mock identity object returned by ctx.access.getIdentity() */
|
|
3303
|
+
identity?: Record<string, unknown>;
|
|
3304
|
+
};
|
|
3305
|
+
}
|
|
3306
|
+
interface CacheOptions {
|
|
3307
|
+
/** If cache is enabled for this Worker */
|
|
3308
|
+
enabled: boolean;
|
|
3309
|
+
/** Whether cached assets may be reused across Worker versions. */
|
|
3310
|
+
cross_version_cache?: boolean;
|
|
3311
|
+
}
|
|
3312
|
+
type DockerConfiguration = {
|
|
3313
|
+
/** Socket used by miniflare to communicate with Docker */
|
|
3314
|
+
socketPath: string;
|
|
3315
|
+
/** Docker image name for the container egress interceptor sidecar */
|
|
3316
|
+
containerEgressInterceptorImage?: string;
|
|
3317
|
+
};
|
|
3318
|
+
type ContainerEngine = {
|
|
3319
|
+
localDocker: DockerConfiguration;
|
|
3320
|
+
} | string;
|
|
3321
|
+
/**
|
|
3322
|
+
* Configuration for Worker Previews.
|
|
3323
|
+
*
|
|
3324
|
+
* This defines the settings used when creating Preview deployments.
|
|
3325
|
+
* Previews are branches of your Worker's main instance used to test features
|
|
3326
|
+
* during feature development outside of production.
|
|
3327
|
+
*
|
|
3328
|
+
* The `previews` block contains any intentionally divergent configuration intended solely for Previews, including:
|
|
3329
|
+
* - All non-inheritable properties (environment variables and bindings like KV, D1, R2, etc.)
|
|
3330
|
+
* - Select inheritable properties: `logpush`, `observability`, `limits`, `cache`
|
|
3331
|
+
*
|
|
3332
|
+
* @inheritable
|
|
3333
|
+
*/
|
|
3334
|
+
interface PreviewsConfig extends Partial<EnvironmentNonInheritable>, Partial<Pick<EnvironmentInheritable, "logpush" | "observability" | "limits" | "cache">> {
|
|
3335
|
+
}
|
|
3336
|
+
|
|
3337
|
+
/**
|
|
3338
|
+
* This is the static type definition for the configuration object.
|
|
3339
|
+
*
|
|
3340
|
+
* It reflects a normalized and validated version of the configuration that you can write in a Wrangler configuration file,
|
|
3341
|
+
* and optionally augment with arguments passed directly to wrangler.
|
|
3342
|
+
*
|
|
3343
|
+
* For more information about the configuration object, see the
|
|
3344
|
+
* documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration
|
|
3345
|
+
*
|
|
3346
|
+
* Notes:
|
|
3347
|
+
*
|
|
3348
|
+
* - Fields that are only specified in `ConfigFields` and not `Environment` can only appear
|
|
3349
|
+
* in the top level config and should not appear in any environments.
|
|
3350
|
+
* - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects
|
|
3351
|
+
* - All top level fields in config and environments are optional in the Wrangler configuration file.
|
|
3352
|
+
*
|
|
3353
|
+
* Legend for the annotations:
|
|
3354
|
+
*
|
|
3355
|
+
* - `@breaking`: the deprecation/optionality is a breaking change from Wrangler v1.
|
|
3356
|
+
* - `@todo`: there's more work to be done (with details attached).
|
|
3357
|
+
*/
|
|
3358
|
+
type Config = ComputedFields & ConfigFields<DevConfig> & PagesConfigFields & Environment;
|
|
3359
|
+
type RawConfig = Partial<ConfigFields<RawDevConfig>> & PagesConfigFields & RawEnvironment & EnvironmentMap & {
|
|
3360
|
+
$schema?: string;
|
|
3361
|
+
};
|
|
3362
|
+
type RedirectedRawConfig = RawConfig & Partial<ComputedFields>;
|
|
3363
|
+
interface ComputedFields {
|
|
3364
|
+
/** The path to the Wrangler configuration file (if any, and possibly redirected from the user Wrangler configuration) used to create this configuration. */
|
|
3365
|
+
configPath: string | undefined;
|
|
3366
|
+
/** 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. */
|
|
3367
|
+
userConfigPath: string | undefined;
|
|
3368
|
+
/**
|
|
3369
|
+
* The original top level name for the Worker in the raw configuration.
|
|
3370
|
+
*
|
|
3371
|
+
* When a raw configuration has been flattened to a single environment the worker name may have been replaced or transformed.
|
|
3372
|
+
* It can be useful to know what the top-level name was before the flattening.
|
|
3373
|
+
*/
|
|
3374
|
+
topLevelName: string | undefined;
|
|
3375
|
+
/** A list of environment names declared in the raw configuration. */
|
|
3376
|
+
definedEnvironments: string[] | undefined;
|
|
3377
|
+
/** The name of the environment being targeted. */
|
|
3378
|
+
targetEnvironment: string | undefined;
|
|
3379
|
+
}
|
|
3380
|
+
interface ConfigFields<Dev extends RawDevConfig> {
|
|
3381
|
+
/**
|
|
3382
|
+
* Whether Wrangler should send usage metrics to Cloudflare for this project.
|
|
3383
|
+
*
|
|
3384
|
+
* When defined this will override any user settings.
|
|
3385
|
+
* Otherwise, Wrangler will use the user's preference.
|
|
3386
|
+
*/
|
|
3387
|
+
send_metrics: boolean | undefined;
|
|
3388
|
+
/**
|
|
3389
|
+
* Configuration for npm package dependency instrumentation.
|
|
3390
|
+
*
|
|
3391
|
+
* Controls whether Wrangler should collect and send npm package dependency
|
|
3392
|
+
* metadata when deploying or uploading a Worker version.
|
|
3393
|
+
*
|
|
3394
|
+
* When `enabled` is set to `false`, Wrangler will not include
|
|
3395
|
+
* `package_dependencies` in the upload payload. Defaults to enabled when
|
|
3396
|
+
* not specified.
|
|
3397
|
+
*
|
|
3398
|
+
* Note: This is considered build metadata, so managed separately from the
|
|
3399
|
+
* telemetry one and not disabled when
|
|
3400
|
+
* `send_metrics`/`WRANGLER_SEND_METRICS` is set to `false`
|
|
3401
|
+
*/
|
|
3402
|
+
dependencies_instrumentation: {
|
|
3403
|
+
/** Whether dependency instrumentation is enabled. Defaults to `true`. */
|
|
3404
|
+
enabled: boolean;
|
|
3405
|
+
/**
|
|
3406
|
+
* An optional list of package name patterns to exclude from the
|
|
3407
|
+
* collected dependency metadata.
|
|
3408
|
+
*
|
|
3409
|
+
* Each entry can be an exact package name (e.g. `"lodash"`) or a glob
|
|
3410
|
+
* pattern using `*` as a wildcard (e.g. `"@internal/*"` to exclude all
|
|
3411
|
+
* packages under the `@internal` scope).
|
|
3412
|
+
*/
|
|
3413
|
+
exclude_packages?: string[];
|
|
3414
|
+
} | undefined;
|
|
3415
|
+
/**
|
|
3416
|
+
* Options to configure the development server that your worker will use.
|
|
3417
|
+
*
|
|
3418
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#local-development-settings
|
|
3419
|
+
*/
|
|
3420
|
+
dev: Dev;
|
|
3421
|
+
/**
|
|
3422
|
+
* The definition of a Worker Site, a feature that lets you upload
|
|
3423
|
+
* static assets with your Worker.
|
|
3424
|
+
*
|
|
3425
|
+
* More details at https://developers.cloudflare.com/workers/platform/sites
|
|
3426
|
+
*
|
|
3427
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-sites
|
|
3428
|
+
*/
|
|
3429
|
+
site: {
|
|
3430
|
+
/**
|
|
3431
|
+
* The directory containing your static assets.
|
|
3432
|
+
*
|
|
3433
|
+
* It must be a path relative to your Wrangler configuration file.
|
|
3434
|
+
* Example: bucket = "./public"
|
|
3435
|
+
*
|
|
3436
|
+
* If there is a `site` field then it must contain this `bucket` field.
|
|
3437
|
+
*/
|
|
3438
|
+
bucket: string;
|
|
3439
|
+
/**
|
|
3440
|
+
* The location of your Worker script.
|
|
3441
|
+
*
|
|
3442
|
+
* @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.
|
|
3443
|
+
* @breaking
|
|
3444
|
+
*/
|
|
3445
|
+
"entry-point"?: string;
|
|
3446
|
+
/**
|
|
3447
|
+
* An exclusive list of .gitignore-style patterns that match file
|
|
3448
|
+
* or directory names from your bucket location. Only matched
|
|
3449
|
+
* items will be uploaded. Example: include = ["upload_dir"]
|
|
3450
|
+
*
|
|
3451
|
+
* @optional
|
|
3452
|
+
* @default []
|
|
3453
|
+
*/
|
|
3454
|
+
include?: string[];
|
|
3455
|
+
/**
|
|
3456
|
+
* A list of .gitignore-style patterns that match files or
|
|
3457
|
+
* directories in your bucket that should be excluded from
|
|
3458
|
+
* uploads. Example: exclude = ["ignore_dir"]
|
|
3459
|
+
*
|
|
3460
|
+
* @optional
|
|
3461
|
+
* @default []
|
|
3462
|
+
*/
|
|
3463
|
+
exclude?: string[];
|
|
3464
|
+
} | undefined;
|
|
3465
|
+
/**
|
|
3466
|
+
* A list of wasm modules that your worker should be bound to. This is
|
|
3467
|
+
* the "legacy" way of binding to a wasm module. ES module workers should
|
|
3468
|
+
* do proper module imports.
|
|
3469
|
+
*/
|
|
3470
|
+
wasm_modules: {
|
|
3471
|
+
[key: string]: string;
|
|
3472
|
+
} | undefined;
|
|
3473
|
+
/**
|
|
3474
|
+
* A list of text files that your worker should be bound to. This is
|
|
3475
|
+
* the "legacy" way of binding to a text file. ES module workers should
|
|
3476
|
+
* do proper module imports.
|
|
3477
|
+
*/
|
|
3478
|
+
text_blobs: {
|
|
3479
|
+
[key: string]: string;
|
|
3480
|
+
} | undefined;
|
|
3481
|
+
/**
|
|
3482
|
+
* A list of data files that your worker should be bound to. This is
|
|
3483
|
+
* the "legacy" way of binding to a data file. ES module workers should
|
|
3484
|
+
* do proper module imports.
|
|
3485
|
+
*/
|
|
3486
|
+
data_blobs: {
|
|
3487
|
+
[key: string]: string;
|
|
3488
|
+
} | undefined;
|
|
3489
|
+
/**
|
|
3490
|
+
* A map of module aliases. Lets you swap out a module for any others.
|
|
3491
|
+
* Corresponds with esbuild's `alias` config
|
|
3492
|
+
*
|
|
3493
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#module-aliasing
|
|
3494
|
+
*/
|
|
3495
|
+
alias: {
|
|
3496
|
+
[key: string]: string;
|
|
3497
|
+
} | undefined;
|
|
3498
|
+
/**
|
|
3499
|
+
* By default, the Wrangler configuration file is the source of truth for your environment configuration, like a terraform file.
|
|
3500
|
+
*
|
|
3501
|
+
* If you change your vars in the dashboard, wrangler *will* override/delete them on its next deploy.
|
|
3502
|
+
*
|
|
3503
|
+
* If you want to keep your dashboard vars when wrangler deploys, set this field to true.
|
|
3504
|
+
*
|
|
3505
|
+
* @default false
|
|
3506
|
+
* @nonInheritable
|
|
3507
|
+
*/
|
|
3508
|
+
keep_vars?: boolean;
|
|
3509
|
+
/**
|
|
3510
|
+
* The inbound email addresses handled by the Worker being deployed.
|
|
3511
|
+
*
|
|
3512
|
+
* Each entry is a literal recipient address (e.g. `"support@example.com"`)
|
|
3513
|
+
* or a `*@domain` catch-all (e.g. `"*@example.com"`). Every entry creates an
|
|
3514
|
+
* Email Routing rule whose action routes mail to this Worker.
|
|
3515
|
+
*
|
|
3516
|
+
* This field is top-level only and applies to every environment of the
|
|
3517
|
+
* Worker; it cannot be set under `env.*`.
|
|
3518
|
+
*
|
|
3519
|
+
* @nonInheritable
|
|
3520
|
+
*/
|
|
3521
|
+
addresses?: string[];
|
|
3522
|
+
}
|
|
3523
|
+
interface PagesConfigFields {
|
|
3524
|
+
/**
|
|
3525
|
+
* The directory of static assets to serve.
|
|
3526
|
+
*
|
|
3527
|
+
* The presence of this field in a Wrangler configuration file indicates a Pages project,
|
|
3528
|
+
* and will prompt the handling of the configuration file according to the
|
|
3529
|
+
* Pages-specific validation rules.
|
|
3530
|
+
*/
|
|
3531
|
+
pages_build_output_dir?: string;
|
|
3532
|
+
}
|
|
3533
|
+
interface DevConfig {
|
|
3534
|
+
/**
|
|
3535
|
+
* IP address for the local dev server to listen on,
|
|
3536
|
+
*
|
|
3537
|
+
* @default localhost
|
|
3538
|
+
*/
|
|
3539
|
+
ip: string;
|
|
3540
|
+
/**
|
|
3541
|
+
* Port for the local dev server to listen on
|
|
3542
|
+
*
|
|
3543
|
+
* @default 8787
|
|
3544
|
+
*/
|
|
3545
|
+
port: number | undefined;
|
|
3546
|
+
/**
|
|
3547
|
+
* Port for the local dev server's inspector to listen on
|
|
3548
|
+
*
|
|
3549
|
+
* @default 9229
|
|
3550
|
+
*/
|
|
3551
|
+
inspector_port: number | undefined;
|
|
3552
|
+
/**
|
|
3553
|
+
* IP address for the local dev server's inspector to listen on
|
|
3554
|
+
*
|
|
3555
|
+
* @default 127.0.0.1
|
|
3556
|
+
*/
|
|
3557
|
+
inspector_ip: string | undefined;
|
|
3558
|
+
/**
|
|
3559
|
+
* Protocol that local wrangler dev server listens to requests on.
|
|
3560
|
+
*
|
|
3561
|
+
* @default http
|
|
3562
|
+
*/
|
|
3563
|
+
local_protocol: "http" | "https";
|
|
3564
|
+
/**
|
|
3565
|
+
* Protocol that wrangler dev forwards requests on
|
|
3566
|
+
*
|
|
3567
|
+
* Setting this to `http` is not currently implemented for remote mode.
|
|
3568
|
+
* See https://github.com/cloudflare/workers-sdk/issues/583
|
|
3569
|
+
*
|
|
3570
|
+
* @default https
|
|
3571
|
+
*/
|
|
3572
|
+
upstream_protocol: "https" | "http";
|
|
3573
|
+
/**
|
|
3574
|
+
* Host to forward requests to, defaults to the host of the first route of project
|
|
3575
|
+
*/
|
|
3576
|
+
host: string | undefined;
|
|
3577
|
+
/**
|
|
3578
|
+
* When developing, whether to build and connect to containers. This requires a Docker daemon to be running.
|
|
3579
|
+
* Defaults to `true`.
|
|
3580
|
+
*
|
|
3581
|
+
* @default true
|
|
3582
|
+
*/
|
|
3583
|
+
enable_containers: boolean;
|
|
3584
|
+
/**
|
|
3585
|
+
* Either the Docker unix socket i.e. `unix:///var/run/docker.sock` or a full configuration.
|
|
3586
|
+
* Note that windows is only supported via WSL at the moment
|
|
3587
|
+
*/
|
|
3588
|
+
container_engine: ContainerEngine | undefined;
|
|
3589
|
+
/**
|
|
3590
|
+
* Re-generate your worker types when your Wrangler configuration file changes.
|
|
3591
|
+
*
|
|
3592
|
+
* @default false
|
|
3593
|
+
*/
|
|
3594
|
+
generate_types: boolean;
|
|
3595
|
+
}
|
|
3596
|
+
type RawDevConfig = Partial<DevConfig>;
|
|
3597
|
+
interface EnvironmentMap {
|
|
3598
|
+
/**
|
|
3599
|
+
* The `env` section defines overrides for the configuration for different environments.
|
|
3600
|
+
*
|
|
3601
|
+
* All environment fields can be specified at the top level of the config indicating the default environment settings.
|
|
3602
|
+
*
|
|
3603
|
+
* - Some fields are inherited and overridable in each environment.
|
|
3604
|
+
* - But some are not inherited and must be explicitly specified in every environment, if they are specified at the top level.
|
|
3605
|
+
*
|
|
3606
|
+
* For more information, see the documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration#environments
|
|
3607
|
+
*
|
|
3608
|
+
* @default {}
|
|
3609
|
+
*/
|
|
3610
|
+
env?: {
|
|
3611
|
+
[envName: string]: RawEnvironment;
|
|
3612
|
+
};
|
|
3613
|
+
}
|
|
3614
|
+
declare const defaultWranglerConfig: Config;
|
|
3615
|
+
|
|
3616
|
+
export { type CfModuleType as $, ARTIFACTS_EVENT_TYPES as A, type Binding as B, type ComputedFields as C, type DurableObjectExport as D, type Exports as E, type CfBrowserBinding as F, type CfCapnp as G, type CfD1Database as H, type CfDataBlobBindings as I, type CfDevPluginCfg as J, type CfDispatchNamespace as K, type Logger as L, type CfDurableObject as M, type CfDurableObjectMigrations as N, type CfExports as O, type CfFlagship as P, type CfHelloWorld as Q, type RawConfig as R, type CfHyperdrive as S, type CfImagesBinding as T, type CfKvNamespace as U, type CfLogfwdr as V, type WorkerEntrypointExport as W, type CfLogfwdrBinding as X, type CfMTlsCertificate as Y, type CfMediaBinding as Z, type CfModule as _, type RedirectedRawConfig as a, type LocalS3Credentials as a$, type CfPipeline as a0, type CfPlacement as a1, type CfQueue as a2, type CfR2Bucket as a3, type CfRateLimit as a4, type CfScriptFormat as a5, type CfSecretsStoreSecrets as a6, type CfSendEmailBindings as a7, type CfService as a8, type CfStreamBinding as a9, type DurableObjectExportStorage as aA, type DurableObjectMigration as aB, ENVIRONMENT_TAG_PREFIX as aC, type Entry as aD, type Environment as aE, type EnvironmentNonInheritable as aF, type ExportsReconciliationEntryBase as aG, type ExportsReconciliationErrorDetail as aH, type ExportsReconciliationInfo as aI, type ExportsReconciliationRename as aJ, type ExportsReconciliationResult as aK, type ExportsReconciliationTransfer as aL, type ExportsReconciliationTransferPending as aM, type ExportsReconciliationWarning as aN, type FetchKVGetValueFetcher as aO, type FetchListResultFetcher as aP, type FetchPagedListResultFetcher as aQ, type FetchResult as aR, type FetchResultFetcher as aS, type File as aT, type Hook as aU, type HookValues as aV, INHERIT_SYMBOL as aW, JSON_CONFIG_FORMATS as aX, type Json as aY, LOGGER_LEVELS as aZ, type LegacyAssetPaths as a_, type CfTextBlobBindings as aa, type CfUnsafe as ab, type CfUnsafeBinding as ac, type CfUserLimits as ad, type CfVars as ae, type CfVectorize as af, type CfVersionMetadataBinding as ag, type CfVpcNetwork as ah, type CfVpcService as ai, type CfWasmModuleBindings as aj, type CfWebSearch as ak, type CfWorkerContext as al, type CfWorkerInit as am, type CfWorkerLoader as an, type CfWorkerSourceMap as ao, type CfWorkflow as ap, type CloudchamberConfig as aq, type ComplianceConfig as ar, type ConfigFields as as, type ConfigModuleRuleType as at, type ConfiguredExport as au, type ContainerEngine as av, type CustomDomainRoute as aw, type DispatchNamespaceOutbound as ax, type DockerConfiguration as ay, type DurableObjectBindings as az, type Config as b, getWranglerSendErrorReportsFromEnv as b$, type LogLevel as b0, type LoggerLevel as b1, type NodeJSCompatMode as b2, type Observability as b3, PATH_TO_DEPLOY_CONFIG as b4, type PreviewsConfig as b5, type RawDevConfig as b6, type RawEnvironment as b7, type Rule as b8, SERVICE_TAG_PREFIX as b9, getCIOverrideName as bA, getCIOverrideNetworkModeHost as bB, getCfFetchEnabledFromEnv as bC, getCfFetchPathFromEnv as bD, getCloudflareApiBaseUrl as bE, getCloudflareApiEnvironmentFromEnv as bF, getCloudflareComplianceRegion as bG, getCloudflareEnv as bH, getCloudflareIncludeProcessEnvFromEnv as bI, getCloudflareLoadDevVarsFromDotEnv as bJ, getCloudflaredPathFromEnv as bK, getComplianceRegionSubdomain as bL, getD1ExtraLocationChoices as bM, getDisableConfigWatching as bN, getLocalExplorerEnabledFromEnv as bO, getLocalObservabilityEnabledFromEnv as bP, getNoSkillsUpdatePromptsFromEnv as bQ, getOpenNextDeployFromEnv as bR, getOutputFileDirectoryFromEnv as bS, getOutputFilePathFromEnv as bT, getRegistryPath as bU, getSanitizeLogs as bV, getSubdomainMixedStateCheckDisabled as bW, getTraceHeader as bX, getWorkersCIBranchName as bY, getWranglerCacheDirFromEnv as bZ, getWranglerHideBanner as b_, type ServiceFetch as ba, type ServiceMetadataRes as bb, type StartDevWorkerInput as bc, type StreamingTailConsumer as bd, type TailConsumer as be, type Trigger as bf, type UserLimits as bg, type ValidatedAssetsOptions as bh, type WorkerMetadata as bi, type WorkflowBinding as bj, type ZoneIdRoute as bk, type ZoneNameRoute as bl, addAuthorizationHeader as bm, defaultWranglerConfig as bn, extractAccountTag as bo, extractWAFBlockRayId as bp, fetchInternalBase as bq, fetchKVGetValueBase as br, fetchListResultBase as bs, fetchResultBase as bt, getBrowserRenderingHeadfulFromEnv as bu, getBuildConditionsFromEnv as bv, getBuildPlatformFromEnv as bw, getC3CommandFromEnv as bx, getCIGeneratePreviewAlias as by, getCIMatchTag as bz, type ContainerApp as c, getWranglerSendMetricsFromEnv as c0, hasCursor as c1, hasMorePages as c2, isDoNotTrackEnabled as c3, isWAFBlockResponse as c4, maybeAddTraceHeader as c5, parseRetryAfterMs as c6, parseRetryAfterValue as c7, performApiFetchBase as c8, renderError as c9, throwFetchError as ca, truncate as cb, type WorkerMetadataBinding as d, type CfTailConsumer as e, type Route as f, type Access as g, type ApiCredentials as h, type ArtifactsEventTrigger as i, type ArtifactsEventType as j, type AssetConfigMetadata as k, type Assets as l, type AssetsOptions as m, type AsyncHook as n, type BinaryFile as o, COMPLIANCE_REGION_CONFIG_PUBLIC as p, COMPLIANCE_REGION_CONFIG_UNKNOWN as q, type CacheOptions as r, type CfAIBinding as s, type CfAISearch as t, type CfAISearchNamespace as u, type CfAccount as v, type CfAgentMemory as w, type CfAnalyticsEngineDataset as x, type CfArtifacts as y, type CfAssetsBinding as z };
|