@cloudflare/workers-utils 0.43.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.mts +2399 -3
- package/dist/browser.mjs +482 -2
- package/dist/{chunk-C6O4ION7.mjs → chunk-2Q77CKVU.mjs} +3 -1
- package/dist/{chunk-Z62CVNHJ.mjs → chunk-6G6FCMPX.mjs} +4 -1
- package/dist/{chunk-FLRJ77A6.mjs → chunk-AUSY7DKT.mjs} +6 -3
- package/dist/{chunk-IYSONYTF.mjs → chunk-FR75DWDU.mjs} +7 -5
- package/dist/{chunk-MCNIGVAF.mjs → chunk-M3RITKR3.mjs} +4 -1
- package/dist/{chunk-53IMCORZ.mjs → chunk-MIA26B4M.mjs} +3 -1
- package/dist/{chunk-34VZWBGB.mjs → chunk-MV2OJK3L.mjs} +4 -2
- package/dist/{chunk-WO2IAW6M.mjs → chunk-OWPFSLY6.mjs} +4 -1
- package/dist/{chunk-OWXQB7GP.mjs → chunk-PWC7WAOU.mjs} +4 -1
- package/dist/{chunk-3IYLA2JH.mjs → chunk-QSRIB43D.mjs} +5 -2
- package/dist/{chunk-Q72B4Q5Z.mjs → chunk-U6NEESU5.mjs} +6 -3
- package/dist/compatibility-date.mjs +5 -2
- package/dist/{compliance-DzwHmPKm.d.mts → compliance-CADarBwY.d.mts} +589 -514
- package/dist/compliance.d.mts +1 -1
- package/dist/compliance.mjs +10 -7
- package/dist/docker-path.mjs +6 -3
- package/dist/errors.mjs +5 -2
- package/dist/fs-helpers.mjs +5 -2
- package/dist/global-wrangler-config-path.mjs +6 -3
- package/dist/index.d.mts +48 -9
- package/dist/index.mjs +716 -37
- package/dist/local-env.mjs +4 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/{open-PBXRGS4R.mjs → open-PCXX3ZDZ.mjs} +3 -1
- package/dist/prometheus-metrics.mjs +5 -2
- package/dist/test-helpers/index.d.mts +1 -1
- package/dist/test-helpers/index.mjs +8 -5
- package/dist/zod-format.mjs +5 -2
- package/package.json +4 -4
- package/dist/chunk-DKSA7K25.mjs +0 -468
package/dist/browser.d.mts
CHANGED
|
@@ -1,8 +1,2404 @@
|
|
|
1
|
-
import { bh as TailConsumer, bn as WorkerMetadata, R as RawConfig } from './compliance-DzwHmPKm.mjs';
|
|
2
1
|
import { AssetConfig } from '@cloudflare/workers-shared';
|
|
3
2
|
import { Cloudflare } from 'cloudflare';
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
|
|
4
|
+
interface CfDurableObjectMigrations {
|
|
5
|
+
old_tag?: string;
|
|
6
|
+
new_tag: string;
|
|
7
|
+
steps: {
|
|
8
|
+
new_classes?: string[];
|
|
9
|
+
new_sqlite_classes?: string[];
|
|
10
|
+
renamed_classes?: {
|
|
11
|
+
from: string;
|
|
12
|
+
to: string;
|
|
13
|
+
}[];
|
|
14
|
+
transferred_classes?: {
|
|
15
|
+
from: string;
|
|
16
|
+
from_script: string;
|
|
17
|
+
to: string;
|
|
18
|
+
}[];
|
|
19
|
+
deleted_classes?: string[];
|
|
20
|
+
}[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The declarative `exports` map keyed by class name.
|
|
24
|
+
*
|
|
25
|
+
* Durable Objects can only be configured by `exports` or `migrations`, not both.
|
|
26
|
+
*/
|
|
27
|
+
type CfExports = Exports;
|
|
28
|
+
type CfPlacement = {
|
|
29
|
+
mode: "smart";
|
|
30
|
+
hint?: string;
|
|
31
|
+
} | {
|
|
32
|
+
mode?: "targeted";
|
|
33
|
+
region: string;
|
|
34
|
+
} | {
|
|
35
|
+
mode?: "targeted";
|
|
36
|
+
host: string;
|
|
37
|
+
} | {
|
|
38
|
+
mode?: "targeted";
|
|
39
|
+
hostname: string;
|
|
40
|
+
};
|
|
41
|
+
interface CfTailConsumer {
|
|
42
|
+
service: string;
|
|
43
|
+
environment?: string;
|
|
44
|
+
}
|
|
45
|
+
interface CfUserLimits {
|
|
46
|
+
cpu_ms?: number;
|
|
47
|
+
subrequests?: number;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
type Json = string | number | boolean | null | Json[] | {
|
|
51
|
+
[id: string]: Json;
|
|
52
|
+
};
|
|
53
|
+
type WorkerMetadataBinding = {
|
|
54
|
+
type: "inherit";
|
|
55
|
+
name: string;
|
|
56
|
+
} | {
|
|
57
|
+
type: "plain_text";
|
|
58
|
+
name: string;
|
|
59
|
+
text: string;
|
|
60
|
+
} | {
|
|
61
|
+
type: "secret_text";
|
|
62
|
+
name: string;
|
|
63
|
+
text: string;
|
|
64
|
+
} | {
|
|
65
|
+
type: "json";
|
|
66
|
+
name: string;
|
|
67
|
+
json: Json;
|
|
68
|
+
} | {
|
|
69
|
+
type: "wasm_module";
|
|
70
|
+
name: string;
|
|
71
|
+
part: string;
|
|
72
|
+
} | {
|
|
73
|
+
type: "text_blob";
|
|
74
|
+
name: string;
|
|
75
|
+
part: string;
|
|
76
|
+
} | {
|
|
77
|
+
type: "browser";
|
|
78
|
+
name: string;
|
|
79
|
+
raw?: boolean;
|
|
80
|
+
} | {
|
|
81
|
+
type: "analytics";
|
|
82
|
+
name: string;
|
|
83
|
+
} | {
|
|
84
|
+
type: "ai";
|
|
85
|
+
name: string;
|
|
86
|
+
staging?: boolean;
|
|
87
|
+
raw?: boolean;
|
|
88
|
+
} | {
|
|
89
|
+
type: "images";
|
|
90
|
+
name: string;
|
|
91
|
+
raw?: boolean;
|
|
92
|
+
} | {
|
|
93
|
+
type: "stream";
|
|
94
|
+
name: string;
|
|
95
|
+
} | {
|
|
96
|
+
type: "version_metadata";
|
|
97
|
+
name: string;
|
|
98
|
+
} | {
|
|
99
|
+
type: "data_blob";
|
|
100
|
+
name: string;
|
|
101
|
+
part: string;
|
|
102
|
+
} | {
|
|
103
|
+
type: "ai_search_namespace";
|
|
104
|
+
name: string;
|
|
105
|
+
namespace: string;
|
|
106
|
+
} | {
|
|
107
|
+
type: "ai_search";
|
|
108
|
+
name: string;
|
|
109
|
+
instance_name: string;
|
|
110
|
+
} | {
|
|
111
|
+
type: "agent_memory";
|
|
112
|
+
name: string;
|
|
113
|
+
namespace: string;
|
|
114
|
+
} | {
|
|
115
|
+
type: "kv_namespace";
|
|
116
|
+
name: string;
|
|
117
|
+
namespace_id: string;
|
|
118
|
+
raw?: boolean;
|
|
119
|
+
} | {
|
|
120
|
+
type: "media";
|
|
121
|
+
name: string;
|
|
122
|
+
} | {
|
|
123
|
+
type: "send_email";
|
|
124
|
+
name: string;
|
|
125
|
+
destination_address?: string;
|
|
126
|
+
allowed_destination_addresses?: string[];
|
|
127
|
+
allowed_sender_addresses?: string[];
|
|
128
|
+
} | {
|
|
129
|
+
type: "durable_object_namespace";
|
|
130
|
+
name: string;
|
|
131
|
+
class_name: string;
|
|
132
|
+
script_name?: string;
|
|
133
|
+
environment?: string;
|
|
134
|
+
namespace_id?: string;
|
|
135
|
+
} | {
|
|
136
|
+
type: "workflow";
|
|
137
|
+
name: string;
|
|
138
|
+
workflow_name: string;
|
|
139
|
+
class_name: string;
|
|
140
|
+
script_name?: string;
|
|
141
|
+
raw?: boolean;
|
|
142
|
+
} | {
|
|
143
|
+
type: "queue";
|
|
144
|
+
name: string;
|
|
145
|
+
queue_name: string;
|
|
146
|
+
delivery_delay?: number;
|
|
147
|
+
raw?: boolean;
|
|
148
|
+
} | {
|
|
149
|
+
type: "r2_bucket";
|
|
150
|
+
name: string;
|
|
151
|
+
bucket_name: string;
|
|
152
|
+
jurisdiction?: string;
|
|
153
|
+
raw?: boolean;
|
|
154
|
+
} | {
|
|
155
|
+
type: "d1";
|
|
156
|
+
name: string;
|
|
157
|
+
id: string;
|
|
158
|
+
internalEnv?: string;
|
|
159
|
+
raw?: boolean;
|
|
160
|
+
} | {
|
|
161
|
+
type: "vectorize";
|
|
162
|
+
name: string;
|
|
163
|
+
index_name: string;
|
|
164
|
+
internalEnv?: string;
|
|
165
|
+
raw?: boolean;
|
|
166
|
+
} | {
|
|
167
|
+
type: "hyperdrive";
|
|
168
|
+
name: string;
|
|
169
|
+
id: string;
|
|
170
|
+
} | {
|
|
171
|
+
type: "service";
|
|
172
|
+
name: string;
|
|
173
|
+
service: string;
|
|
174
|
+
environment?: string;
|
|
175
|
+
entrypoint?: string;
|
|
176
|
+
cross_account_grant?: string;
|
|
177
|
+
} | {
|
|
178
|
+
type: "analytics_engine";
|
|
179
|
+
name: string;
|
|
180
|
+
dataset?: string;
|
|
181
|
+
} | {
|
|
182
|
+
type: "dispatch_namespace";
|
|
183
|
+
name: string;
|
|
184
|
+
namespace: string;
|
|
185
|
+
outbound?: {
|
|
186
|
+
worker: {
|
|
187
|
+
service: string;
|
|
188
|
+
environment?: string;
|
|
189
|
+
};
|
|
190
|
+
params?: {
|
|
191
|
+
name: string;
|
|
192
|
+
}[];
|
|
193
|
+
};
|
|
194
|
+
} | {
|
|
195
|
+
type: "mtls_certificate";
|
|
196
|
+
name: string;
|
|
197
|
+
certificate_id: string;
|
|
198
|
+
} | {
|
|
199
|
+
type: "pipelines";
|
|
200
|
+
name: string;
|
|
201
|
+
stream?: string;
|
|
202
|
+
pipeline?: string;
|
|
203
|
+
} | {
|
|
204
|
+
type: "k2";
|
|
205
|
+
name: string;
|
|
206
|
+
stream: string;
|
|
207
|
+
} | {
|
|
208
|
+
type: "secrets_store_secret";
|
|
209
|
+
name: string;
|
|
210
|
+
store_id: string;
|
|
211
|
+
secret_name: string;
|
|
212
|
+
} | {
|
|
213
|
+
type: "artifacts";
|
|
214
|
+
name: string;
|
|
215
|
+
namespace: string;
|
|
216
|
+
} | {
|
|
217
|
+
type: "unsafe_hello_world";
|
|
218
|
+
name: string;
|
|
219
|
+
enable_timer?: boolean;
|
|
220
|
+
} | {
|
|
221
|
+
type: "flagship";
|
|
222
|
+
name: string;
|
|
223
|
+
app_id: string;
|
|
224
|
+
} | {
|
|
225
|
+
type: "ratelimit";
|
|
226
|
+
name: string;
|
|
227
|
+
namespace_id: string;
|
|
228
|
+
simple: {
|
|
229
|
+
limit: number;
|
|
230
|
+
period: 10 | 60;
|
|
231
|
+
};
|
|
232
|
+
} | {
|
|
233
|
+
type: "vpc_service";
|
|
234
|
+
name: string;
|
|
235
|
+
service_id: string;
|
|
236
|
+
} | {
|
|
237
|
+
type: "vpc_network";
|
|
238
|
+
name: string;
|
|
239
|
+
tunnel_id?: string;
|
|
240
|
+
network_id?: string;
|
|
241
|
+
} | {
|
|
242
|
+
type: "worker_loader";
|
|
243
|
+
name: string;
|
|
244
|
+
} | {
|
|
245
|
+
type: "logfwdr";
|
|
246
|
+
name: string;
|
|
247
|
+
destination: string;
|
|
248
|
+
} | {
|
|
249
|
+
type: "assets";
|
|
250
|
+
name: string;
|
|
251
|
+
};
|
|
252
|
+
type AssetConfigMetadata = {
|
|
253
|
+
html_handling?: AssetConfig["html_handling"];
|
|
254
|
+
not_found_handling?: AssetConfig["not_found_handling"];
|
|
255
|
+
run_worker_first?: boolean | string[];
|
|
256
|
+
_redirects?: string;
|
|
257
|
+
_headers?: string;
|
|
258
|
+
};
|
|
259
|
+
type WorkerMetadataPut = {
|
|
260
|
+
/** The name of the entry point module. Only exists when the worker is in the ES module format */
|
|
261
|
+
main_module?: string;
|
|
262
|
+
/** The name of the entry point module. Only exists when the worker is in the service-worker format */
|
|
263
|
+
body_part?: string;
|
|
264
|
+
compatibility_date?: string;
|
|
265
|
+
compatibility_flags?: string[];
|
|
266
|
+
usage_model?: "bundled" | "unbound";
|
|
267
|
+
migrations?: CfDurableObjectMigrations;
|
|
268
|
+
code_update_strategy?: DurableObjectCodeUpdateStrategy;
|
|
269
|
+
exports?: CfExports;
|
|
270
|
+
capnp_schema?: string;
|
|
271
|
+
bindings: WorkerMetadataBinding[];
|
|
272
|
+
keep_bindings?: (WorkerMetadataBinding["type"] | "secret_text" | "secret_key")[];
|
|
273
|
+
logpush?: boolean;
|
|
274
|
+
placement?: CfPlacement;
|
|
275
|
+
tail_consumers?: CfTailConsumer[];
|
|
276
|
+
streaming_tail_consumers?: CfTailConsumer[];
|
|
277
|
+
limits?: CfUserLimits;
|
|
278
|
+
assets?: {
|
|
279
|
+
jwt: string;
|
|
280
|
+
config?: AssetConfigMetadata;
|
|
281
|
+
};
|
|
282
|
+
observability?: Observability | undefined;
|
|
283
|
+
containers?: {
|
|
284
|
+
name?: string;
|
|
285
|
+
class_name?: string;
|
|
286
|
+
images?: Record<string, string>;
|
|
287
|
+
}[];
|
|
288
|
+
package_dependencies?: Array<{
|
|
289
|
+
name: string;
|
|
290
|
+
packageJsonVersion: string;
|
|
291
|
+
installedVersion: string;
|
|
292
|
+
}>;
|
|
293
|
+
[key: string]: unknown;
|
|
294
|
+
};
|
|
295
|
+
type WorkerMetadataVersionsPost = WorkerMetadataPut & {
|
|
296
|
+
annotations?: Record<string, string>;
|
|
297
|
+
};
|
|
298
|
+
type WorkerMetadata = WorkerMetadataPut | WorkerMetadataVersionsPost;
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Wrangler configuration types. The JSDoc on these fields is also the source
|
|
302
|
+
* of truth for the equivalent fields in `@cloudflare/config`
|
|
303
|
+
* (`packages/config/src/types.ts` — `WorkerConfig` — and the binding option
|
|
304
|
+
* interfaces in `packages/config/src/config.ts`). When editing prose here,
|
|
305
|
+
* mirror the changes there.
|
|
306
|
+
*/
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* The `Environment` interface declares all the configuration fields that
|
|
310
|
+
* can be specified for an environment.
|
|
311
|
+
*
|
|
312
|
+
* This could be the top-level default environment, or a specific named environment.
|
|
313
|
+
*/
|
|
314
|
+
interface Environment extends EnvironmentInheritable, EnvironmentNonInheritable {
|
|
315
|
+
}
|
|
316
|
+
type SimpleRoute = string;
|
|
317
|
+
/** AWS SigV4 credentials for miniflare's local S3-compatible endpoint */
|
|
318
|
+
interface LocalS3Credentials {
|
|
319
|
+
accessKeyId: string;
|
|
320
|
+
secretAccessKey: string;
|
|
321
|
+
}
|
|
322
|
+
type ZoneIdRoute = {
|
|
323
|
+
pattern: string;
|
|
324
|
+
zone_id: string;
|
|
325
|
+
custom_domain?: boolean;
|
|
326
|
+
};
|
|
327
|
+
type ZoneNameRoute = {
|
|
328
|
+
pattern: string;
|
|
329
|
+
zone_name: string;
|
|
330
|
+
custom_domain?: boolean;
|
|
331
|
+
};
|
|
332
|
+
type CustomDomainRoute = {
|
|
333
|
+
pattern: string;
|
|
334
|
+
custom_domain: boolean;
|
|
335
|
+
enabled?: boolean;
|
|
336
|
+
previews_enabled?: boolean;
|
|
337
|
+
};
|
|
338
|
+
type Route = SimpleRoute | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
|
|
339
|
+
/**
|
|
340
|
+
* Configuration in wrangler for Cloudchamber
|
|
341
|
+
*/
|
|
342
|
+
type CloudchamberConfig = {
|
|
343
|
+
image?: string;
|
|
344
|
+
location?: string;
|
|
345
|
+
instance_type?: "dev" | "basic" | "standard" | "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4";
|
|
346
|
+
vcpu?: number;
|
|
347
|
+
memory?: string;
|
|
348
|
+
ipv4?: boolean;
|
|
349
|
+
};
|
|
350
|
+
type UnsafeBinding = {
|
|
351
|
+
/**
|
|
352
|
+
* The name of the binding provided to the Worker
|
|
353
|
+
*/
|
|
354
|
+
name: string;
|
|
355
|
+
/**
|
|
356
|
+
* The 'type' of the unsafe binding.
|
|
357
|
+
*/
|
|
358
|
+
type: string;
|
|
359
|
+
dev?: {
|
|
360
|
+
plugin: {
|
|
361
|
+
/**
|
|
362
|
+
* Package is the bare specifier of the package that exposes plugins to integrate into Miniflare via a named `plugins` export.
|
|
363
|
+
* @example "@cloudflare/my-external-miniflare-plugin"
|
|
364
|
+
*/
|
|
365
|
+
package: string;
|
|
366
|
+
/**
|
|
367
|
+
* Plugin is the name of the plugin exposed by the package.
|
|
368
|
+
* @example "MY_UNSAFE_PLUGIN"
|
|
369
|
+
*/
|
|
370
|
+
name: string;
|
|
371
|
+
};
|
|
372
|
+
/**
|
|
373
|
+
* Optional mapping of unsafe bindings names to options provided for the plugin.
|
|
374
|
+
*/
|
|
375
|
+
options?: Record<string, unknown>;
|
|
376
|
+
};
|
|
377
|
+
[key: string]: unknown;
|
|
378
|
+
};
|
|
379
|
+
/**
|
|
380
|
+
* An image Wrangler prepares for a Durable Object-managed container.
|
|
381
|
+
*/
|
|
382
|
+
type DurableObjectContainerImage = {
|
|
383
|
+
/**
|
|
384
|
+
* Path to the Dockerfile Wrangler builds and pushes.
|
|
385
|
+
*/
|
|
386
|
+
dockerfile: string;
|
|
387
|
+
/**
|
|
388
|
+
* Build context, relative to the Wrangler configuration file.
|
|
389
|
+
* Defaults to the Dockerfile's directory.
|
|
390
|
+
*/
|
|
391
|
+
build_context?: string;
|
|
392
|
+
/** Variables available to the image only while it is being built. */
|
|
393
|
+
build_vars?: Record<string, string>;
|
|
394
|
+
image?: never;
|
|
395
|
+
} | {
|
|
396
|
+
/**
|
|
397
|
+
* Digest-pinned image in the account's managed registry.
|
|
398
|
+
*/
|
|
399
|
+
image: string;
|
|
400
|
+
dockerfile?: never;
|
|
401
|
+
build_context?: never;
|
|
402
|
+
build_vars?: never;
|
|
403
|
+
};
|
|
404
|
+
/**
|
|
405
|
+
* Configuration for a container application.
|
|
406
|
+
*/
|
|
407
|
+
type ContainerObservability = {
|
|
408
|
+
/** If observability is enabled for this container application */
|
|
409
|
+
enabled?: boolean;
|
|
410
|
+
logs?: {
|
|
411
|
+
enabled?: boolean;
|
|
412
|
+
};
|
|
413
|
+
/**
|
|
414
|
+
* Percentage of instances to target with application-level observability hot reloads.
|
|
415
|
+
* Mutually exclusive with `target_instance_count`.
|
|
416
|
+
*/
|
|
417
|
+
target_instance_percentage?: number;
|
|
418
|
+
/**
|
|
419
|
+
* Number of instances to target with application-level observability hot reloads.
|
|
420
|
+
* Mutually exclusive with `target_instance_percentage`.
|
|
421
|
+
*/
|
|
422
|
+
target_instance_count?: number;
|
|
423
|
+
};
|
|
424
|
+
type ContainerApp = {
|
|
425
|
+
/**
|
|
426
|
+
* Name of the application.
|
|
427
|
+
*
|
|
428
|
+
* This is also the identifier used to reference the container from a Durable
|
|
429
|
+
* Object's `exports` entry via its `container` field.
|
|
430
|
+
*
|
|
431
|
+
* @optional Defaults to `worker_name-class_name` if not specified. A name is
|
|
432
|
+
* required when `class_name` is not set, since there is no class name to
|
|
433
|
+
* derive the default from.
|
|
434
|
+
*/
|
|
435
|
+
name?: string;
|
|
436
|
+
/**
|
|
437
|
+
* Number of application instances
|
|
438
|
+
* @deprecated
|
|
439
|
+
* @hidden
|
|
440
|
+
*/
|
|
441
|
+
instances?: number;
|
|
442
|
+
/**
|
|
443
|
+
* Number of maximum application instances.
|
|
444
|
+
* @optional
|
|
445
|
+
*/
|
|
446
|
+
max_instances?: number;
|
|
447
|
+
/**
|
|
448
|
+
* The path to a Dockerfile, or an image URI for the Cloudflare registry.
|
|
449
|
+
*/
|
|
450
|
+
image?: string;
|
|
451
|
+
/**
|
|
452
|
+
* Named images available to a Durable Object-managed container through
|
|
453
|
+
* `ctx.container.images`.
|
|
454
|
+
*
|
|
455
|
+
* Only supported when `scheduling_policy` is `"durable_object"`.
|
|
456
|
+
* When omitted, run `wrangler deploy` to provision the application before
|
|
457
|
+
* uploading versions. Version deployments use its existing application.
|
|
458
|
+
*/
|
|
459
|
+
images?: Record<string, DurableObjectContainerImage>;
|
|
460
|
+
/**
|
|
461
|
+
* Build context of the application.
|
|
462
|
+
* @optional - defaults to the directory of `image`.
|
|
463
|
+
*/
|
|
464
|
+
image_build_context?: string;
|
|
465
|
+
/**
|
|
466
|
+
* Image variables available to the image at build-time only.
|
|
467
|
+
* For runtime env vars, refer to https://developers.cloudflare.com/containers/examples/env-vars-and-secrets/
|
|
468
|
+
* @optional
|
|
469
|
+
*/
|
|
470
|
+
image_vars?: Record<string, string>;
|
|
471
|
+
/**
|
|
472
|
+
* The class name of the Durable Object the container is connected to.
|
|
473
|
+
*
|
|
474
|
+
* @optional Instead of naming the Durable Object here, you can reference this
|
|
475
|
+
* container from the Durable Object's `exports` entry via its `container`
|
|
476
|
+
* field. Exactly one of the two directions must be configured.
|
|
477
|
+
*/
|
|
478
|
+
class_name?: string;
|
|
479
|
+
/**
|
|
480
|
+
* Specify the observability behavior of this container application.
|
|
481
|
+
*
|
|
482
|
+
* When set, this overrides the root `observability` config for this container.
|
|
483
|
+
* Durable Object-managed Containers only support enabling or disabling logs.
|
|
484
|
+
* Their settings are application-wide, and omitted settings preserve the
|
|
485
|
+
* existing application rather than inheriting root Worker observability.
|
|
486
|
+
*/
|
|
487
|
+
observability?: ContainerObservability;
|
|
488
|
+
/**
|
|
489
|
+
* The scheduling policy of the application
|
|
490
|
+
* @optional
|
|
491
|
+
* `"durable_object"` makes each Durable Object instance own its Container.
|
|
492
|
+
* In that mode, `name`, `class_name`, `scheduling_policy`, `images`,
|
|
493
|
+
* application-wide log `observability`, `ssh`, and `authorized_keys` are
|
|
494
|
+
* supported on this entry.
|
|
495
|
+
*
|
|
496
|
+
* @default "default"
|
|
497
|
+
*/
|
|
498
|
+
scheduling_policy?: "default" | "durable_object" | "moon" | "regional";
|
|
499
|
+
/**
|
|
500
|
+
* The instance type to be used for the container.
|
|
501
|
+
* Select from one of the following named instance types:
|
|
502
|
+
* - lite: 1/16 vCPU, 256 MiB memory, and 2 GB disk
|
|
503
|
+
* - basic: 1/4 vCPU, 1 GiB memory, and 4 GB disk
|
|
504
|
+
* - standard-1: 1/2 vCPU, 4 GiB memory, and 8 GB disk
|
|
505
|
+
* - standard-2: 1 vCPU, 6 GiB memory, and 12 GB disk
|
|
506
|
+
* - standard-3: 2 vCPU, 8 GiB memory, and 16 GB disk
|
|
507
|
+
* - standard-4: 4 vCPU, 12 GiB memory, and 20 GB disk
|
|
508
|
+
* - dev: 1/16 vCPU, 256 MiB memory, and 2 GB disk (deprecated, use "lite" instead)
|
|
509
|
+
* - standard: 1 vCPU, 4 GiB memory, and 4 GB disk (deprecated, use "standard-1" instead)
|
|
510
|
+
*
|
|
511
|
+
* Customers on an enterprise plan have the additional option to set custom limits.
|
|
512
|
+
*
|
|
513
|
+
* @optional
|
|
514
|
+
* @default "dev"
|
|
515
|
+
*/
|
|
516
|
+
instance_type?: "dev" | "basic" | "standard" | "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4" | {
|
|
517
|
+
/** @defaults to 0.0625 (1/16 vCPU) */
|
|
518
|
+
vcpu?: number;
|
|
519
|
+
/** @defaults to 256 MiB */
|
|
520
|
+
memory_mib?: number;
|
|
521
|
+
/** @defaults to 2 GB */
|
|
522
|
+
disk_mb?: number;
|
|
523
|
+
};
|
|
524
|
+
ssh?: {
|
|
525
|
+
/**
|
|
526
|
+
* If enabled, those with write access to a container will be able to SSH into it through Wrangler.
|
|
527
|
+
* @default false
|
|
528
|
+
*/
|
|
529
|
+
enabled: boolean;
|
|
530
|
+
/**
|
|
531
|
+
* Port that the SSH service is running on
|
|
532
|
+
* @defaults to 22
|
|
533
|
+
*/
|
|
534
|
+
port?: number;
|
|
535
|
+
};
|
|
536
|
+
/**
|
|
537
|
+
* @deprecated Use `ssh` instead.
|
|
538
|
+
* @hidden
|
|
539
|
+
*/
|
|
540
|
+
wrangler_ssh?: {
|
|
541
|
+
enabled: boolean;
|
|
542
|
+
port?: number;
|
|
543
|
+
};
|
|
544
|
+
/**
|
|
545
|
+
* SSH public keys to put in the container's authorized_keys file.
|
|
546
|
+
*/
|
|
547
|
+
authorized_keys?: {
|
|
548
|
+
name: string;
|
|
549
|
+
public_key: string;
|
|
550
|
+
}[];
|
|
551
|
+
/**
|
|
552
|
+
* Trusted user CA keys to put in the container's trusted_user_ca_keys file.
|
|
553
|
+
*/
|
|
554
|
+
trusted_user_ca_keys?: {
|
|
555
|
+
name?: string;
|
|
556
|
+
public_key: string;
|
|
557
|
+
}[];
|
|
558
|
+
/**
|
|
559
|
+
* @deprecated Use top level `containers` fields instead.
|
|
560
|
+
* `configuration.image` should be `image`
|
|
561
|
+
* limits should be set via `instance_type`
|
|
562
|
+
* @hidden
|
|
563
|
+
*/
|
|
564
|
+
configuration?: {
|
|
565
|
+
image?: string;
|
|
566
|
+
labels?: {
|
|
567
|
+
name: string;
|
|
568
|
+
value: string;
|
|
569
|
+
}[];
|
|
570
|
+
secrets?: {
|
|
571
|
+
name: string;
|
|
572
|
+
type: "env";
|
|
573
|
+
secret: string;
|
|
574
|
+
}[];
|
|
575
|
+
disk?: {
|
|
576
|
+
size_mb: number;
|
|
577
|
+
};
|
|
578
|
+
vcpu?: number;
|
|
579
|
+
memory_mib?: number;
|
|
580
|
+
};
|
|
581
|
+
/**
|
|
582
|
+
* Scheduling constraints for container placement.
|
|
583
|
+
*/
|
|
584
|
+
constraints?: {
|
|
585
|
+
/**
|
|
586
|
+
* Limit container placement to specific geographic regions.
|
|
587
|
+
*/
|
|
588
|
+
regions?: ("ENAM" | "WNAM" | "EEUR" | "WEUR" | "APAC" | "SAM" | "ME" | "OC" | "AFR")[];
|
|
589
|
+
/**
|
|
590
|
+
* Restrict containers to compliance boundaries.
|
|
591
|
+
*/
|
|
592
|
+
jurisdiction?: "eu" | "fedramp";
|
|
593
|
+
/**
|
|
594
|
+
* @hidden
|
|
595
|
+
*/
|
|
596
|
+
cities?: string[];
|
|
597
|
+
/**
|
|
598
|
+
* @deprecated Use `tiers` instead
|
|
599
|
+
* @hidden
|
|
600
|
+
*/
|
|
601
|
+
tier?: number;
|
|
602
|
+
/**
|
|
603
|
+
* @hidden
|
|
604
|
+
*/
|
|
605
|
+
tiers?: number[];
|
|
606
|
+
};
|
|
607
|
+
/**
|
|
608
|
+
* Scheduling affinities
|
|
609
|
+
* @hidden
|
|
610
|
+
*/
|
|
611
|
+
affinities?: {
|
|
612
|
+
colocation?: "datacenter";
|
|
613
|
+
hardware_generation?: "highest-overall-performance";
|
|
614
|
+
};
|
|
615
|
+
/**
|
|
616
|
+
* @deprecated use the `class_name` field instead.
|
|
617
|
+
* @hidden
|
|
618
|
+
*/
|
|
619
|
+
durable_objects?: {
|
|
620
|
+
namespace_id: string;
|
|
621
|
+
};
|
|
622
|
+
/**
|
|
623
|
+
* Configures what percentage of instances should be updated at each step of a rollout.
|
|
624
|
+
* You can specify this as a single number, or an array of numbers.
|
|
625
|
+
*
|
|
626
|
+
* If this is a single number, each step will progress by that percentage.
|
|
627
|
+
* The options are 5, 10, 20, 25, 50 or 100.
|
|
628
|
+
*
|
|
629
|
+
* If this is an array, each step specifies the cumulative rollout progress.
|
|
630
|
+
* The final step must be 100.
|
|
631
|
+
*
|
|
632
|
+
* This can be overridden adhoc by deploying with the `--containers-rollout=immediate` flag,
|
|
633
|
+
* which will roll out to 100% of instances in one step.
|
|
634
|
+
*
|
|
635
|
+
* @optional
|
|
636
|
+
* @default [10,100]
|
|
637
|
+
* */
|
|
638
|
+
rollout_step_percentage?: number | number[];
|
|
639
|
+
/**
|
|
640
|
+
* How a rollout should be created. It supports the following modes:
|
|
641
|
+
* - full_auto: The container application will be rolled out fully automatically.
|
|
642
|
+
* - none: The container application won't have a roll out or update.
|
|
643
|
+
* - manual: The container application will be rollout fully by manually actioning progress steps.
|
|
644
|
+
* @optional
|
|
645
|
+
* @default "full_auto"
|
|
646
|
+
* @hidden
|
|
647
|
+
*/
|
|
648
|
+
rollout_kind?: "full_auto" | "none" | "full_manual";
|
|
649
|
+
/**
|
|
650
|
+
* Configures the grace period (in seconds) for active instances before being shutdown during a rollout.
|
|
651
|
+
* @optional
|
|
652
|
+
* @default 0
|
|
653
|
+
*/
|
|
654
|
+
rollout_active_grace_period?: number;
|
|
655
|
+
/**
|
|
656
|
+
* Directly passed to the API without wrangler-side validation or transformation.
|
|
657
|
+
* @hidden
|
|
658
|
+
*/
|
|
659
|
+
unsafe?: Record<string, unknown>;
|
|
660
|
+
};
|
|
661
|
+
/**
|
|
662
|
+
* Configuration in wrangler for Durable Object Migrations
|
|
663
|
+
*/
|
|
664
|
+
type DurableObjectMigration = {
|
|
665
|
+
/** A unique identifier for this migration. */
|
|
666
|
+
tag: string;
|
|
667
|
+
/** The new Durable Objects being defined. */
|
|
668
|
+
new_classes?: string[];
|
|
669
|
+
/** The new SQLite Durable Objects being defined. */
|
|
670
|
+
new_sqlite_classes?: string[];
|
|
671
|
+
/** The Durable Objects being renamed. */
|
|
672
|
+
renamed_classes?: {
|
|
673
|
+
from: string;
|
|
674
|
+
to: string;
|
|
675
|
+
}[];
|
|
676
|
+
/** The Durable Objects being transferred from another Worker. */
|
|
677
|
+
transferred_classes?: {
|
|
678
|
+
from: string;
|
|
679
|
+
from_script: string;
|
|
680
|
+
to: string;
|
|
681
|
+
}[];
|
|
682
|
+
/** The Durable Objects being removed. */
|
|
683
|
+
deleted_classes?: string[];
|
|
684
|
+
};
|
|
685
|
+
/**
|
|
686
|
+
* Storage backend for a declarative Durable Object export. See
|
|
687
|
+
* {@link DurableObjectExport}.
|
|
688
|
+
*/
|
|
689
|
+
type DurableObjectExportStorage = "sqlite" | "legacy-kv";
|
|
690
|
+
/**
|
|
691
|
+
* A single declarative Durable Object export entry in the `exports` config
|
|
692
|
+
* map. `type` is reserved for the export kind. `state` carries the Durable
|
|
693
|
+
* Object lifecycle and defaults to `"created"` (live) when omitted.
|
|
694
|
+
*
|
|
695
|
+
* Mutually exclusive with {@link DurableObjectMigration} at the config-
|
|
696
|
+
* validation boundary.
|
|
697
|
+
*
|
|
698
|
+
* - `created` (default, live): `storage` is required.
|
|
699
|
+
* - `deleted` (tombstone): retire a provisioned namespace whose class has
|
|
700
|
+
* been removed from code.
|
|
701
|
+
* - `renamed` (tombstone): rewrite a provisioned namespace's class name to
|
|
702
|
+
* `renamed_to`. The target name must also appear as a live (state
|
|
703
|
+
* `"created"`) `durable-object` entry in the same map.
|
|
704
|
+
* - `transferred` (tombstone): hand ownership of the namespace to another
|
|
705
|
+
* script in the same account (`transferred_to`). Two-phase commit;
|
|
706
|
+
* the target must first deploy an `expecting-transfer` entry naming this
|
|
707
|
+
* script via `transfer_from`.
|
|
708
|
+
* - `expecting-transfer` (live): receiving side of a two-phase transfer;
|
|
709
|
+
* `storage` and `transfer_from` are both required.
|
|
710
|
+
*
|
|
711
|
+
* The live states may additionally attach a container via `container`, which
|
|
712
|
+
* names an entry in the top-level `containers` array. Tombstones cannot.
|
|
713
|
+
*/
|
|
714
|
+
type DurableObjectExport = {
|
|
715
|
+
type: "durable-object";
|
|
716
|
+
state?: "created";
|
|
717
|
+
storage: DurableObjectExportStorage;
|
|
718
|
+
/**
|
|
719
|
+
* Attach a container to this Durable Object. Must match the `name` of an
|
|
720
|
+
* entry in the top-level `containers` array, and requires
|
|
721
|
+
* `storage: "sqlite"`.
|
|
722
|
+
*
|
|
723
|
+
* @optional
|
|
724
|
+
*/
|
|
725
|
+
container?: string;
|
|
726
|
+
} | {
|
|
727
|
+
type: "durable-object";
|
|
728
|
+
state: "deleted";
|
|
729
|
+
} | {
|
|
730
|
+
type: "durable-object";
|
|
731
|
+
state: "renamed";
|
|
732
|
+
renamed_to: string;
|
|
733
|
+
} | {
|
|
734
|
+
type: "durable-object";
|
|
735
|
+
state: "transferred";
|
|
736
|
+
transferred_to: string;
|
|
737
|
+
} | {
|
|
738
|
+
type: "durable-object";
|
|
739
|
+
state: "expecting-transfer";
|
|
740
|
+
storage: DurableObjectExportStorage;
|
|
741
|
+
transfer_from: string;
|
|
742
|
+
/**
|
|
743
|
+
* Attach a container to this Durable Object. Must match the `name` of an
|
|
744
|
+
* entry in the top-level `containers` array, and requires
|
|
745
|
+
* `storage: "sqlite"`.
|
|
746
|
+
*
|
|
747
|
+
* @optional
|
|
748
|
+
*/
|
|
749
|
+
container?: string;
|
|
750
|
+
};
|
|
751
|
+
interface WorkerEntrypointExport {
|
|
752
|
+
type: "worker";
|
|
753
|
+
cache?: {
|
|
754
|
+
/** Whether cache is enabled for this entrypoint. */
|
|
755
|
+
enabled: boolean;
|
|
756
|
+
};
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* A single declarative Workflow export entry in the `exports` config map. The
|
|
760
|
+
* map key is the exported class name (the class extending `WorkflowEntrypoint`);
|
|
761
|
+
* `name` is the workflow's stable identity, used for instance and storage
|
|
762
|
+
* namespacing, and is required. The remaining settings match the ones accepted
|
|
763
|
+
* by `workflows` bindings.
|
|
764
|
+
*/
|
|
765
|
+
interface WorkflowExport extends Pick<WorkflowBinding, "limits" | "concurrency" | "schedules" | "default_retention"> {
|
|
766
|
+
type: "workflow";
|
|
767
|
+
name: string;
|
|
768
|
+
}
|
|
769
|
+
type ConfiguredExport = DurableObjectExport | WorkerEntrypointExport | WorkflowExport;
|
|
770
|
+
/**
|
|
771
|
+
* The declarative `exports` map keyed by export name. Durable Object exports
|
|
772
|
+
* are mutually exclusive with `migrations` at the wrangler config layer.
|
|
773
|
+
*/
|
|
774
|
+
type Exports = Record<string, ConfiguredExport>;
|
|
775
|
+
/**
|
|
776
|
+
* The `EnvironmentInheritable` interface declares all the configuration fields for an environment
|
|
777
|
+
* that can be inherited (and overridden) from the top-level environment.
|
|
778
|
+
*/
|
|
779
|
+
interface EnvironmentInheritable {
|
|
780
|
+
/**
|
|
781
|
+
* The name of your Worker. Alphanumeric + dashes only.
|
|
782
|
+
*
|
|
783
|
+
* @inheritable
|
|
784
|
+
*/
|
|
785
|
+
name: string | undefined;
|
|
786
|
+
/**
|
|
787
|
+
* This is the ID of the account associated with your zone.
|
|
788
|
+
* You might have more than one account, so make sure to use
|
|
789
|
+
* the ID of the account associated with the zone/route you
|
|
790
|
+
* provide, if you provide one. It can also be specified through
|
|
791
|
+
* the CLOUDFLARE_ACCOUNT_ID environment variable.
|
|
792
|
+
*
|
|
793
|
+
* @inheritable
|
|
794
|
+
*/
|
|
795
|
+
account_id: string | undefined;
|
|
796
|
+
/**
|
|
797
|
+
* A date in the form yyyy-mm-dd, which will be used to determine
|
|
798
|
+
* which version of the Workers runtime is used.
|
|
799
|
+
*
|
|
800
|
+
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
|
|
801
|
+
*
|
|
802
|
+
* @inheritable
|
|
803
|
+
*/
|
|
804
|
+
compatibility_date: string | undefined;
|
|
805
|
+
/**
|
|
806
|
+
* A list of flags that enable features from upcoming features of
|
|
807
|
+
* the Workers runtime, usually used together with compatibility_date.
|
|
808
|
+
*
|
|
809
|
+
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
|
|
810
|
+
*
|
|
811
|
+
* @default []
|
|
812
|
+
* @inheritable
|
|
813
|
+
*/
|
|
814
|
+
compatibility_flags: string[];
|
|
815
|
+
/**
|
|
816
|
+
* The entrypoint/path to the JavaScript file that will be executed.
|
|
817
|
+
*
|
|
818
|
+
* @inheritable
|
|
819
|
+
*/
|
|
820
|
+
main: string | undefined;
|
|
821
|
+
/**
|
|
822
|
+
* If true then Wrangler will traverse the file tree below `base_dir`;
|
|
823
|
+
* Any files that match `rules` will be included in the deployed Worker.
|
|
824
|
+
* Defaults to true if `no_bundle` is true, otherwise false.
|
|
825
|
+
*
|
|
826
|
+
* @inheritable
|
|
827
|
+
*/
|
|
828
|
+
find_additional_modules: boolean | undefined;
|
|
829
|
+
/**
|
|
830
|
+
* Determines whether Wrangler will preserve bundled file names.
|
|
831
|
+
* Defaults to false.
|
|
832
|
+
* If left unset, files will be named using the pattern ${fileHash}-${basename},
|
|
833
|
+
* for example, `34de60b44167af5c5a709e62a4e20c4f18c9e3b6-favicon.ico`.
|
|
834
|
+
*
|
|
835
|
+
* @inheritable
|
|
836
|
+
*/
|
|
837
|
+
preserve_file_names: boolean | undefined;
|
|
838
|
+
/**
|
|
839
|
+
* The directory in which module rules should be evaluated when including additional files into a Worker deployment.
|
|
840
|
+
* This defaults to the directory containing the `main` entry point of the Worker if not specified.
|
|
841
|
+
*
|
|
842
|
+
* @inheritable
|
|
843
|
+
*/
|
|
844
|
+
base_dir: string | undefined;
|
|
845
|
+
/**
|
|
846
|
+
* Whether we use <name>.<subdomain>.workers.dev to
|
|
847
|
+
* test and deploy your Worker.
|
|
848
|
+
*
|
|
849
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
|
|
850
|
+
*
|
|
851
|
+
* @default true
|
|
852
|
+
* @breaking
|
|
853
|
+
* @inheritable
|
|
854
|
+
*/
|
|
855
|
+
workers_dev: boolean | undefined;
|
|
856
|
+
/**
|
|
857
|
+
* Whether we use <version>-<name>.<subdomain>.workers.dev to
|
|
858
|
+
* serve Preview URLs for your Worker.
|
|
859
|
+
*
|
|
860
|
+
* @default false
|
|
861
|
+
* @inheritable
|
|
862
|
+
*/
|
|
863
|
+
preview_urls: boolean | undefined;
|
|
864
|
+
/**
|
|
865
|
+
* A list of routes that your Worker should be published to.
|
|
866
|
+
* Only one of `routes` or `route` is required.
|
|
867
|
+
*
|
|
868
|
+
* Only required when workers_dev is false, and there's no scheduled Worker (see `triggers`)
|
|
869
|
+
*
|
|
870
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
|
|
871
|
+
*
|
|
872
|
+
* @inheritable
|
|
873
|
+
*/
|
|
874
|
+
routes: Route[] | undefined;
|
|
875
|
+
/**
|
|
876
|
+
* A route that your Worker should be published to. Literally
|
|
877
|
+
* the same as routes, but only one.
|
|
878
|
+
* Only one of `routes` or `route` is required.
|
|
879
|
+
*
|
|
880
|
+
* Only required when workers_dev is false, and there's no scheduled Worker
|
|
881
|
+
*
|
|
882
|
+
* @inheritable
|
|
883
|
+
*/
|
|
884
|
+
route: Route | undefined;
|
|
885
|
+
/**
|
|
886
|
+
* Path to a custom tsconfig
|
|
887
|
+
*
|
|
888
|
+
* @inheritable
|
|
889
|
+
*/
|
|
890
|
+
tsconfig: string | undefined;
|
|
891
|
+
/**
|
|
892
|
+
* The function to use to replace jsx syntax.
|
|
893
|
+
*
|
|
894
|
+
* @default "React.createElement"
|
|
895
|
+
* @inheritable
|
|
896
|
+
*/
|
|
897
|
+
jsx_factory: string;
|
|
898
|
+
/**
|
|
899
|
+
* The function to use to replace jsx fragment syntax.
|
|
900
|
+
*
|
|
901
|
+
* @default "React.Fragment"
|
|
902
|
+
* @inheritable
|
|
903
|
+
*/
|
|
904
|
+
jsx_fragment: string;
|
|
905
|
+
/**
|
|
906
|
+
* A list of migrations that should be uploaded with your Worker.
|
|
907
|
+
*
|
|
908
|
+
* These define changes in your Durable Object declarations.
|
|
909
|
+
*
|
|
910
|
+
* More details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations
|
|
911
|
+
*
|
|
912
|
+
* @default []
|
|
913
|
+
* @inheritable
|
|
914
|
+
*/
|
|
915
|
+
migrations: DurableObjectMigration[];
|
|
916
|
+
/**
|
|
917
|
+
* Declarative exports configuration — a map of class name to export configuration.
|
|
918
|
+
*
|
|
919
|
+
* The configuration of Durable Objects via `exports` is mutually exclusive with `migrations`.
|
|
920
|
+
*
|
|
921
|
+
* @default {}
|
|
922
|
+
* @inheritable
|
|
923
|
+
*/
|
|
924
|
+
exports: Exports;
|
|
925
|
+
/**
|
|
926
|
+
* Definitions that trigger a Worker from a schedule or a Cloudflare event.
|
|
927
|
+
*
|
|
928
|
+
* More details about cron triggers: https://developers.cloudflare.com/workers/platform/cron-triggers
|
|
929
|
+
*
|
|
930
|
+
* More details about Artifacts events: https://developers.cloudflare.com/artifacts/guides/event-subscriptions/
|
|
931
|
+
*
|
|
932
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
|
|
933
|
+
*
|
|
934
|
+
* @default {crons:[]}
|
|
935
|
+
* @inheritable
|
|
936
|
+
*/
|
|
937
|
+
triggers: {
|
|
938
|
+
crons?: string[];
|
|
939
|
+
events?: ArtifactsEventTrigger[];
|
|
940
|
+
};
|
|
941
|
+
/**
|
|
942
|
+
* Specify limits for runtime behavior.
|
|
943
|
+
* Only supported for the "standard" Usage Model
|
|
944
|
+
*
|
|
945
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#limits
|
|
946
|
+
*
|
|
947
|
+
* @inheritable
|
|
948
|
+
*/
|
|
949
|
+
limits: UserLimits | undefined;
|
|
950
|
+
/**
|
|
951
|
+
* An ordered list of rules that define which modules to import,
|
|
952
|
+
* and what type to import them as. You will need to specify rules
|
|
953
|
+
* to use Text, Data, and CompiledWasm modules, or when you wish to
|
|
954
|
+
* have a .js file be treated as an ESModule instead of CommonJS.
|
|
955
|
+
*
|
|
956
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#bundling
|
|
957
|
+
*
|
|
958
|
+
* @inheritable
|
|
959
|
+
*/
|
|
960
|
+
rules: Rule[];
|
|
961
|
+
/**
|
|
962
|
+
* Configures a custom build step to be run by Wrangler when building your Worker.
|
|
963
|
+
*
|
|
964
|
+
* Refer to the [custom builds documentation](https://developers.cloudflare.com/workers/cli-wrangler/configuration#build)
|
|
965
|
+
* for more details.
|
|
966
|
+
*
|
|
967
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#custom-builds
|
|
968
|
+
*
|
|
969
|
+
* @default {watch_dir:"./src"}
|
|
970
|
+
*/
|
|
971
|
+
build: {
|
|
972
|
+
/** 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. */
|
|
973
|
+
command?: string;
|
|
974
|
+
/** The directory in which the command is executed. */
|
|
975
|
+
cwd?: string;
|
|
976
|
+
/** The directory to watch for changes while using wrangler dev, defaults to the current working directory */
|
|
977
|
+
watch_dir?: string | string[];
|
|
978
|
+
};
|
|
979
|
+
/**
|
|
980
|
+
* Skip internal build steps and directly deploy script
|
|
981
|
+
* @inheritable
|
|
982
|
+
*/
|
|
983
|
+
no_bundle: boolean | undefined;
|
|
984
|
+
/**
|
|
985
|
+
* Minify the script before uploading.
|
|
986
|
+
* @inheritable
|
|
987
|
+
*/
|
|
988
|
+
minify: boolean | undefined;
|
|
989
|
+
/**
|
|
990
|
+
* Set the `name` property to the original name for functions and classes renamed during minification.
|
|
991
|
+
*
|
|
992
|
+
* See https://esbuild.github.io/api/#keep-names
|
|
993
|
+
*
|
|
994
|
+
* @default true
|
|
995
|
+
* @inheritable
|
|
996
|
+
*/
|
|
997
|
+
keep_names: boolean | undefined;
|
|
998
|
+
/**
|
|
999
|
+
* Designates this Worker as an internal-only "first-party" Worker.
|
|
1000
|
+
*
|
|
1001
|
+
* @inheritable
|
|
1002
|
+
*/
|
|
1003
|
+
first_party_worker: boolean | undefined;
|
|
1004
|
+
/**
|
|
1005
|
+
* List of bindings that you will send to logfwdr
|
|
1006
|
+
*
|
|
1007
|
+
* @default {bindings:[]}
|
|
1008
|
+
* @inheritable
|
|
1009
|
+
*/
|
|
1010
|
+
logfwdr: {
|
|
1011
|
+
bindings: {
|
|
1012
|
+
/** The binding name used to refer to logfwdr */
|
|
1013
|
+
name: string;
|
|
1014
|
+
/** The destination for this logged message */
|
|
1015
|
+
destination: string;
|
|
1016
|
+
}[];
|
|
1017
|
+
};
|
|
1018
|
+
/**
|
|
1019
|
+
* Send Trace Events from this Worker to Workers Logpush.
|
|
1020
|
+
*
|
|
1021
|
+
* This will not configure a corresponding Logpush job automatically.
|
|
1022
|
+
*
|
|
1023
|
+
* For more information about Workers Logpush, see:
|
|
1024
|
+
* https://blog.cloudflare.com/logpush-for-workers/
|
|
1025
|
+
*
|
|
1026
|
+
* @inheritable
|
|
1027
|
+
*/
|
|
1028
|
+
logpush: boolean | undefined;
|
|
1029
|
+
/**
|
|
1030
|
+
* Include source maps when uploading this worker.
|
|
1031
|
+
*
|
|
1032
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#source-maps
|
|
1033
|
+
*
|
|
1034
|
+
* @inheritable
|
|
1035
|
+
*/
|
|
1036
|
+
upload_source_maps: boolean | undefined;
|
|
1037
|
+
/**
|
|
1038
|
+
* Specify how the Worker should be located to minimize round-trip time.
|
|
1039
|
+
*
|
|
1040
|
+
* More details: https://developers.cloudflare.com/workers/platform/smart-placement/
|
|
1041
|
+
*
|
|
1042
|
+
* @inheritable
|
|
1043
|
+
*/
|
|
1044
|
+
placement: {
|
|
1045
|
+
mode: "off" | "smart";
|
|
1046
|
+
hint?: string;
|
|
1047
|
+
} | {
|
|
1048
|
+
mode?: "targeted";
|
|
1049
|
+
region: string;
|
|
1050
|
+
} | {
|
|
1051
|
+
mode?: "targeted";
|
|
1052
|
+
host: string;
|
|
1053
|
+
} | {
|
|
1054
|
+
mode?: "targeted";
|
|
1055
|
+
hostname: string;
|
|
1056
|
+
} | undefined;
|
|
1057
|
+
/**
|
|
1058
|
+
* Specify the directory of static assets to deploy/serve
|
|
1059
|
+
*
|
|
1060
|
+
* More details at https://developers.cloudflare.com/workers/frameworks/
|
|
1061
|
+
*
|
|
1062
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
|
|
1063
|
+
*
|
|
1064
|
+
* @inheritable
|
|
1065
|
+
*/
|
|
1066
|
+
assets: Assets | undefined;
|
|
1067
|
+
/**
|
|
1068
|
+
* Specify the observability behavior of the Worker.
|
|
1069
|
+
*
|
|
1070
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
|
|
1071
|
+
*
|
|
1072
|
+
* @inheritable
|
|
1073
|
+
*/
|
|
1074
|
+
observability: Observability | undefined;
|
|
1075
|
+
/**
|
|
1076
|
+
* Specify the Cloudflare Access authentication behavior of the Worker.
|
|
1077
|
+
*
|
|
1078
|
+
* @inheritable
|
|
1079
|
+
*/
|
|
1080
|
+
access: Access | undefined;
|
|
1081
|
+
/**
|
|
1082
|
+
* Specify the cache behavior of the Worker.
|
|
1083
|
+
*
|
|
1084
|
+
* @inheritable
|
|
1085
|
+
*/
|
|
1086
|
+
cache: CacheOptions | undefined;
|
|
1087
|
+
/**
|
|
1088
|
+
* Specify the compliance region mode of the Worker.
|
|
1089
|
+
*
|
|
1090
|
+
* Although if the user does not specify a compliance region, the default is `public`,
|
|
1091
|
+
* it can be set to `undefined` in configuration to delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable.
|
|
1092
|
+
*/
|
|
1093
|
+
compliance_region: "public" | "fedramp_high" | undefined;
|
|
1094
|
+
/**
|
|
1095
|
+
* Configuration for Python modules.
|
|
1096
|
+
*
|
|
1097
|
+
* @inheritable
|
|
1098
|
+
*/
|
|
1099
|
+
python_modules: {
|
|
1100
|
+
/**
|
|
1101
|
+
* A list of glob patterns to exclude files from the python_modules directory when bundling.
|
|
1102
|
+
*
|
|
1103
|
+
* Patterns are relative to the python_modules directory and use glob syntax.
|
|
1104
|
+
*
|
|
1105
|
+
* @default ["**\*.pyc"]
|
|
1106
|
+
*/
|
|
1107
|
+
exclude: string[];
|
|
1108
|
+
};
|
|
1109
|
+
/**
|
|
1110
|
+
* Configuration for Worker Previews.
|
|
1111
|
+
*
|
|
1112
|
+
* Previews are branches of your Worker's main instance used to test features
|
|
1113
|
+
* in development outside of production. This block defines the settings
|
|
1114
|
+
* used when creating Preview deployments via `wrangler preview`.
|
|
1115
|
+
*
|
|
1116
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#previews
|
|
1117
|
+
*
|
|
1118
|
+
* @inheritable
|
|
1119
|
+
*/
|
|
1120
|
+
previews: PreviewsConfig | undefined;
|
|
1121
|
+
}
|
|
1122
|
+
type DurableObjectBindings = {
|
|
1123
|
+
/** The name of the binding used to refer to the Durable Object */
|
|
1124
|
+
name: string;
|
|
1125
|
+
/** The exported class name of the Durable Object */
|
|
1126
|
+
class_name: string;
|
|
1127
|
+
/** The script where the Durable Object is defined (if it's external to this Worker) */
|
|
1128
|
+
script_name?: string;
|
|
1129
|
+
/** The service environment of the script_name to bind to */
|
|
1130
|
+
environment?: string;
|
|
1131
|
+
}[];
|
|
1132
|
+
type DurableObjectCodeUpdateStrategy = {
|
|
1133
|
+
/** How Durable Object code updates should be applied. */
|
|
1134
|
+
mode: "immediate" | "deferred";
|
|
1135
|
+
/**
|
|
1136
|
+
* Maximum time, in seconds, to wait for Durable Objects to hibernate.
|
|
1137
|
+
* Defaults to 300 (5 minutes) and cannot exceed 86400 (24 hours).
|
|
1138
|
+
* @minimum 0
|
|
1139
|
+
* @maximum 86400
|
|
1140
|
+
* @multipleOf 0.001
|
|
1141
|
+
* @default 300
|
|
1142
|
+
*/
|
|
1143
|
+
max_delay?: number;
|
|
1144
|
+
};
|
|
1145
|
+
type DurableObjectsConfig = {
|
|
1146
|
+
bindings: DurableObjectBindings;
|
|
1147
|
+
code_update_strategy?: DurableObjectCodeUpdateStrategy;
|
|
1148
|
+
};
|
|
1149
|
+
type RawDurableObjectsConfig = Omit<DurableObjectsConfig, "bindings"> & {
|
|
1150
|
+
bindings?: DurableObjectBindings;
|
|
1151
|
+
};
|
|
1152
|
+
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"];
|
|
1153
|
+
type ArtifactsEventType = (typeof ARTIFACTS_EVENT_TYPES)[number];
|
|
1154
|
+
type ArtifactsEventTrigger = {
|
|
1155
|
+
type: ArtifactsEventType;
|
|
1156
|
+
filter?: {
|
|
1157
|
+
namespace?: string;
|
|
1158
|
+
repo_name?: string;
|
|
1159
|
+
};
|
|
1160
|
+
targets: {
|
|
1161
|
+
type: "workflow";
|
|
1162
|
+
workflow_name: string;
|
|
1163
|
+
}[];
|
|
1164
|
+
};
|
|
1165
|
+
type WorkflowBinding = {
|
|
1166
|
+
/** The name of the binding used to refer to the Workflow */
|
|
1167
|
+
binding: string;
|
|
1168
|
+
/** The name of the Workflow */
|
|
1169
|
+
name: string;
|
|
1170
|
+
/** The exported class name of the Workflow */
|
|
1171
|
+
class_name: string;
|
|
1172
|
+
/** The script where the Workflow is defined (if it's external to this Worker) */
|
|
1173
|
+
script_name?: string;
|
|
1174
|
+
/** Optional limits for the Workflow */
|
|
1175
|
+
limits?: {
|
|
1176
|
+
/** Maximum number of steps a Workflow instance can execute */
|
|
1177
|
+
steps?: number;
|
|
1178
|
+
};
|
|
1179
|
+
/** Optional concurrency configuration for the Workflow */
|
|
1180
|
+
concurrency?: {
|
|
1181
|
+
/** Maximum number of Workflow instances that can run concurrently */
|
|
1182
|
+
limit?: number;
|
|
1183
|
+
};
|
|
1184
|
+
/** Optional cron schedule(s) for automatically triggering workflow instances */
|
|
1185
|
+
schedules?: string | string[];
|
|
1186
|
+
/**
|
|
1187
|
+
* Optional default retention for instances of this Workflow, applied when an instance does not
|
|
1188
|
+
* set its own retention. Accepts milliseconds or a duration string such as `"3 days"`, and is
|
|
1189
|
+
* validated by the Workflows API at deploy time.
|
|
1190
|
+
*/
|
|
1191
|
+
default_retention?: {
|
|
1192
|
+
/** How long to retain instances that completed successfully or were terminated */
|
|
1193
|
+
success_retention?: number | string;
|
|
1194
|
+
/** How long to retain errored instances */
|
|
1195
|
+
error_retention?: number | string;
|
|
1196
|
+
};
|
|
1197
|
+
};
|
|
1198
|
+
type ConnectHandlerConfigBase = {
|
|
1199
|
+
/** The port to listen on. */
|
|
1200
|
+
port: number;
|
|
1201
|
+
/** The address to bind to. Defaults to `127.0.0.1`. */
|
|
1202
|
+
address?: string;
|
|
1203
|
+
};
|
|
1204
|
+
type TcpConnectHandlerConfig = ConnectHandlerConfigBase & {
|
|
1205
|
+
protocol: "tcp";
|
|
1206
|
+
};
|
|
1207
|
+
type UdpConnectHandlerConfig = ConnectHandlerConfigBase & {
|
|
1208
|
+
protocol: "udp";
|
|
1209
|
+
/** The idle timeout in milliseconds after which a peer flow is closed. */
|
|
1210
|
+
idle_timeout_ms?: number;
|
|
1211
|
+
/** The maximum number of pending datagram bytes per peer flow. */
|
|
1212
|
+
max_pending_bytes?: number;
|
|
1213
|
+
};
|
|
1214
|
+
type ConnectHandlerConfig = TcpConnectHandlerConfig | UdpConnectHandlerConfig;
|
|
1215
|
+
/**
|
|
1216
|
+
* The `EnvironmentNonInheritable` interface declares all the configuration fields for an environment
|
|
1217
|
+
* that cannot be inherited from the top-level environment, and must be defined specifically.
|
|
1218
|
+
*
|
|
1219
|
+
* If any of these fields are defined at the top-level then they should also be specifically defined
|
|
1220
|
+
* for each named environment.
|
|
1221
|
+
*/
|
|
1222
|
+
interface EnvironmentNonInheritable {
|
|
1223
|
+
/**
|
|
1224
|
+
* A map of values to substitute when deploying your Worker.
|
|
1225
|
+
*
|
|
1226
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1227
|
+
* and so must be specified in every named environment.
|
|
1228
|
+
*
|
|
1229
|
+
* @default {}
|
|
1230
|
+
* @nonInheritable
|
|
1231
|
+
*/
|
|
1232
|
+
define: Record<string, string>;
|
|
1233
|
+
/**
|
|
1234
|
+
* A map of environment variables to set when deploying your Worker.
|
|
1235
|
+
*
|
|
1236
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1237
|
+
* and so must be specified in every named environment.
|
|
1238
|
+
*
|
|
1239
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
|
|
1240
|
+
*
|
|
1241
|
+
* @default {}
|
|
1242
|
+
* @nonInheritable
|
|
1243
|
+
*/
|
|
1244
|
+
vars: Record<string, string | Json>;
|
|
1245
|
+
/**
|
|
1246
|
+
* Secrets configuration.
|
|
1247
|
+
*
|
|
1248
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1249
|
+
* and so must be specified in every named environment.
|
|
1250
|
+
*
|
|
1251
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
|
|
1252
|
+
*
|
|
1253
|
+
* @nonInheritable
|
|
1254
|
+
*/
|
|
1255
|
+
secrets?: {
|
|
1256
|
+
/**
|
|
1257
|
+
* List of secret names that are required by your Worker.
|
|
1258
|
+
* When defined, this property:
|
|
1259
|
+
* - Replaces .dev.vars/.env/process.env inference for type generation
|
|
1260
|
+
* - Enables local dev validation with warnings for missing secrets
|
|
1261
|
+
*/
|
|
1262
|
+
required?: string[];
|
|
1263
|
+
};
|
|
1264
|
+
/**
|
|
1265
|
+
* Durable Object bindings and code update strategy for your Worker.
|
|
1266
|
+
*
|
|
1267
|
+
* For more information about Durable Objects, see the documentation at
|
|
1268
|
+
* https://developers.cloudflare.com/workers/learning/using-durable-objects
|
|
1269
|
+
*
|
|
1270
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1271
|
+
* and so must be specified in every named environment.
|
|
1272
|
+
*
|
|
1273
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
1274
|
+
*
|
|
1275
|
+
* @default {bindings:[]}
|
|
1276
|
+
* @nonInheritable
|
|
1277
|
+
*/
|
|
1278
|
+
durable_objects: DurableObjectsConfig;
|
|
1279
|
+
/**
|
|
1280
|
+
* A list of workflows that your Worker should be bound to.
|
|
1281
|
+
*
|
|
1282
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1283
|
+
* and so must be specified in every named environment.
|
|
1284
|
+
*
|
|
1285
|
+
* @default []
|
|
1286
|
+
* @nonInheritable
|
|
1287
|
+
*/
|
|
1288
|
+
workflows: WorkflowBinding[];
|
|
1289
|
+
/**
|
|
1290
|
+
* Cloudchamber configuration
|
|
1291
|
+
*
|
|
1292
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1293
|
+
* and so must be specified in every named environment.
|
|
1294
|
+
*
|
|
1295
|
+
* @default {}
|
|
1296
|
+
* @nonInheritable
|
|
1297
|
+
*/
|
|
1298
|
+
cloudchamber: CloudchamberConfig;
|
|
1299
|
+
/**
|
|
1300
|
+
* Container related configuration
|
|
1301
|
+
*
|
|
1302
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1303
|
+
* and so must be specified in every named environment.
|
|
1304
|
+
*
|
|
1305
|
+
* @default []
|
|
1306
|
+
* @nonInheritable
|
|
1307
|
+
*/
|
|
1308
|
+
containers?: ContainerApp[];
|
|
1309
|
+
/**
|
|
1310
|
+
* These specify any Workers KV Namespaces you want to
|
|
1311
|
+
* access from inside your Worker.
|
|
1312
|
+
*
|
|
1313
|
+
* To learn more about KV Namespaces,
|
|
1314
|
+
* see the documentation at https://developers.cloudflare.com/workers/learning/how-kv-works
|
|
1315
|
+
*
|
|
1316
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1317
|
+
* and so must be specified in every named environment.
|
|
1318
|
+
*
|
|
1319
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
|
|
1320
|
+
*
|
|
1321
|
+
* @default []
|
|
1322
|
+
* @nonInheritable
|
|
1323
|
+
*/
|
|
1324
|
+
kv_namespaces: {
|
|
1325
|
+
/** The binding name used to refer to the KV Namespace */
|
|
1326
|
+
binding: string;
|
|
1327
|
+
/** The ID of the KV namespace */
|
|
1328
|
+
id?: string;
|
|
1329
|
+
/** The ID of the KV namespace used during `wrangler dev` */
|
|
1330
|
+
preview_id?: string;
|
|
1331
|
+
/** Whether the KV namespace should be remote or not in local development */
|
|
1332
|
+
remote?: boolean;
|
|
1333
|
+
}[];
|
|
1334
|
+
/**
|
|
1335
|
+
* These specify bindings to send email from inside your Worker.
|
|
1336
|
+
*
|
|
1337
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1338
|
+
* and so must be specified in every named environment.
|
|
1339
|
+
*
|
|
1340
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
|
|
1341
|
+
*
|
|
1342
|
+
* @default []
|
|
1343
|
+
* @nonInheritable
|
|
1344
|
+
*/
|
|
1345
|
+
send_email: {
|
|
1346
|
+
/** The binding name used to refer to the this binding */
|
|
1347
|
+
name: string;
|
|
1348
|
+
/** If this binding should be restricted to a specific verified address */
|
|
1349
|
+
destination_address?: string;
|
|
1350
|
+
/** If this binding should be restricted to a set of verified addresses */
|
|
1351
|
+
allowed_destination_addresses?: string[];
|
|
1352
|
+
/** If this binding should be restricted to a set of sender addresses */
|
|
1353
|
+
allowed_sender_addresses?: string[];
|
|
1354
|
+
/** Whether the binding should be remote or not in local development */
|
|
1355
|
+
remote?: boolean;
|
|
1356
|
+
}[];
|
|
1357
|
+
/**
|
|
1358
|
+
* Specifies Queues that are bound to this Worker environment.
|
|
1359
|
+
*
|
|
1360
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1361
|
+
* and so must be specified in every named environment.
|
|
1362
|
+
*
|
|
1363
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
1364
|
+
*
|
|
1365
|
+
* @default {consumers:[],producers:[]}
|
|
1366
|
+
* @nonInheritable
|
|
1367
|
+
*/
|
|
1368
|
+
queues: {
|
|
1369
|
+
/** Producer bindings */
|
|
1370
|
+
producers?: {
|
|
1371
|
+
/** The binding name used to refer to the Queue in the Worker. */
|
|
1372
|
+
binding: string;
|
|
1373
|
+
/** The name of this Queue. */
|
|
1374
|
+
queue?: string;
|
|
1375
|
+
/** The number of seconds to wait before delivering a message */
|
|
1376
|
+
delivery_delay?: number;
|
|
1377
|
+
/** Whether the Queue producer should be remote or not in local development */
|
|
1378
|
+
remote?: boolean;
|
|
1379
|
+
}[];
|
|
1380
|
+
/** Consumer configuration */
|
|
1381
|
+
consumers?: {
|
|
1382
|
+
/** The name of the queue from which this consumer should consume. */
|
|
1383
|
+
queue: string;
|
|
1384
|
+
/** The consumer type. Only "worker" is supported in wrangler config. Default is "worker". */
|
|
1385
|
+
type?: "worker";
|
|
1386
|
+
/** The maximum number of messages per batch */
|
|
1387
|
+
max_batch_size?: number;
|
|
1388
|
+
/** The maximum number of seconds to wait to fill a batch with messages. */
|
|
1389
|
+
max_batch_timeout?: number;
|
|
1390
|
+
/** The maximum number of retries for each message. */
|
|
1391
|
+
max_retries?: number;
|
|
1392
|
+
/** The queue to send messages that failed to be consumed. */
|
|
1393
|
+
dead_letter_queue?: string;
|
|
1394
|
+
/** 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. */
|
|
1395
|
+
max_concurrency?: number | null;
|
|
1396
|
+
/** The number of milliseconds to wait for pulled messages to become visible again */
|
|
1397
|
+
visibility_timeout_ms?: number;
|
|
1398
|
+
/** The number of seconds to wait before retrying a message */
|
|
1399
|
+
retry_delay?: number;
|
|
1400
|
+
}[];
|
|
1401
|
+
};
|
|
1402
|
+
/**
|
|
1403
|
+
* Specifies raw sockets that this Worker should listen on.
|
|
1404
|
+
* Each entry opens a listening socket on the
|
|
1405
|
+
* given port that delivers incoming connections directly to the Worker's
|
|
1406
|
+
* `connect(socket, env, ctx)` handler.
|
|
1407
|
+
*
|
|
1408
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1409
|
+
* and so must be specified in every named environment.
|
|
1410
|
+
*
|
|
1411
|
+
* @default []
|
|
1412
|
+
* @nonInheritable
|
|
1413
|
+
*/
|
|
1414
|
+
connect: ConnectHandlerConfig[];
|
|
1415
|
+
/**
|
|
1416
|
+
* Specifies R2 buckets that are bound to this Worker environment.
|
|
1417
|
+
*
|
|
1418
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1419
|
+
* and so must be specified in every named environment.
|
|
1420
|
+
*
|
|
1421
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
|
|
1422
|
+
*
|
|
1423
|
+
* @default []
|
|
1424
|
+
* @nonInheritable
|
|
1425
|
+
*/
|
|
1426
|
+
r2_buckets: {
|
|
1427
|
+
/** The binding name used to refer to the R2 bucket in the Worker. */
|
|
1428
|
+
binding: string;
|
|
1429
|
+
/** The name of this R2 bucket at the edge. */
|
|
1430
|
+
bucket_name?: string;
|
|
1431
|
+
/** The preview name of this R2 bucket at the edge. */
|
|
1432
|
+
preview_bucket_name?: string;
|
|
1433
|
+
/** The jurisdiction that the bucket exists in. Default if not present. */
|
|
1434
|
+
jurisdiction?: string;
|
|
1435
|
+
/** Whether the R2 bucket should be remote or not in local development */
|
|
1436
|
+
remote?: boolean;
|
|
1437
|
+
/** Settings that only apply to local development */
|
|
1438
|
+
local_dev?: {
|
|
1439
|
+
/**
|
|
1440
|
+
* EXPERIMENTAL: AWS SigV4 credentials for the local S3-compatible
|
|
1441
|
+
* endpoint. When set, the bucket is served at
|
|
1442
|
+
* `/cdn-cgi/local/r2/s3/<bucket-name>` during local development.
|
|
1443
|
+
* Ignored when the bucket runs remotely.
|
|
1444
|
+
*/
|
|
1445
|
+
experimental_s3_credentials?: LocalS3Credentials;
|
|
1446
|
+
};
|
|
1447
|
+
}[];
|
|
1448
|
+
/**
|
|
1449
|
+
* Specifies D1 databases that are bound to this Worker environment.
|
|
1450
|
+
*
|
|
1451
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1452
|
+
* and so must be specified in every named environment.
|
|
1453
|
+
*
|
|
1454
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
|
|
1455
|
+
*
|
|
1456
|
+
* @default []
|
|
1457
|
+
* @nonInheritable
|
|
1458
|
+
*/
|
|
1459
|
+
d1_databases: {
|
|
1460
|
+
/** The binding name used to refer to the D1 database in the Worker. */
|
|
1461
|
+
binding: string;
|
|
1462
|
+
/** The name of this D1 database. */
|
|
1463
|
+
database_name?: string;
|
|
1464
|
+
/** The UUID of this D1 database (not required). */
|
|
1465
|
+
database_id?: string;
|
|
1466
|
+
/** The UUID of this D1 database for Wrangler Dev (if specified). */
|
|
1467
|
+
preview_database_id?: string;
|
|
1468
|
+
/** The name of the migrations table for this D1 database (defaults to 'd1_migrations'). */
|
|
1469
|
+
migrations_table?: string;
|
|
1470
|
+
/** The path to the directory of migrations for this D1 database (defaults to './migrations'). */
|
|
1471
|
+
migrations_dir?: string;
|
|
1472
|
+
/**
|
|
1473
|
+
* A glob pattern (relative to the Wrangler config file) used to discover
|
|
1474
|
+
* migration files for this D1 database. Defaults to `${migrations_dir}/*.sql`
|
|
1475
|
+
* if not specified.
|
|
1476
|
+
*
|
|
1477
|
+
* Use this to opt in to nested layouts such as `migrations/*\/migration.sql`
|
|
1478
|
+
* (as produced by some ORMs).
|
|
1479
|
+
*
|
|
1480
|
+
* When `migrations_pattern` is set, `migrations_dir` must also be set, and
|
|
1481
|
+
* `migrations_pattern` must start with `${migrations_dir}/`. This keeps the
|
|
1482
|
+
* relationship between the two settings explicit and lets Wrangler record
|
|
1483
|
+
* each migration's name in the migrations table as a path relative to
|
|
1484
|
+
* `migrations_dir`.
|
|
1485
|
+
*/
|
|
1486
|
+
migrations_pattern?: string;
|
|
1487
|
+
/** Internal use only. */
|
|
1488
|
+
database_internal_env?: string;
|
|
1489
|
+
/** Whether the D1 database should be remote or not in local development */
|
|
1490
|
+
remote?: boolean;
|
|
1491
|
+
}[];
|
|
1492
|
+
/**
|
|
1493
|
+
* Specifies Vectorize indexes that are bound to this Worker environment.
|
|
1494
|
+
*
|
|
1495
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1496
|
+
* and so must be specified in every named environment.
|
|
1497
|
+
*
|
|
1498
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
|
|
1499
|
+
*
|
|
1500
|
+
* @default []
|
|
1501
|
+
* @nonInheritable
|
|
1502
|
+
*/
|
|
1503
|
+
vectorize: {
|
|
1504
|
+
/** The binding name used to refer to the Vectorize index in the Worker. */
|
|
1505
|
+
binding: string;
|
|
1506
|
+
/** The name of the index. */
|
|
1507
|
+
index_name: string;
|
|
1508
|
+
/** Whether the Vectorize index should be remote or not in local development */
|
|
1509
|
+
remote?: boolean;
|
|
1510
|
+
}[];
|
|
1511
|
+
/**
|
|
1512
|
+
* Specifies AI Search namespace bindings that are bound to this Worker environment.
|
|
1513
|
+
* Each binding is scoped to a namespace and allows dynamic instance CRUD within it.
|
|
1514
|
+
*
|
|
1515
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1516
|
+
* and so must be specified in every named environment.
|
|
1517
|
+
*
|
|
1518
|
+
* @default []
|
|
1519
|
+
* @nonInheritable
|
|
1520
|
+
*/
|
|
1521
|
+
ai_search_namespaces: {
|
|
1522
|
+
/** The binding name used to refer to the AI Search namespace in the Worker. */
|
|
1523
|
+
binding: string;
|
|
1524
|
+
/** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
|
|
1525
|
+
namespace: string;
|
|
1526
|
+
/** Whether the AI Search namespace binding should be remote in local development */
|
|
1527
|
+
remote?: boolean;
|
|
1528
|
+
}[];
|
|
1529
|
+
/**
|
|
1530
|
+
* Specifies AI Search instance bindings that are bound to this Worker environment.
|
|
1531
|
+
* Each binding is bound directly to a single pre-existing instance within the "default" namespace.
|
|
1532
|
+
*
|
|
1533
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1534
|
+
* and so must be specified in every named environment.
|
|
1535
|
+
*
|
|
1536
|
+
* @default []
|
|
1537
|
+
* @nonInheritable
|
|
1538
|
+
*/
|
|
1539
|
+
ai_search: {
|
|
1540
|
+
/** The binding name used to refer to the AI Search instance in the Worker. */
|
|
1541
|
+
binding: string;
|
|
1542
|
+
/** The user-chosen instance name. Must exist in Cloudflare at deploy time. */
|
|
1543
|
+
instance_name: string;
|
|
1544
|
+
/** Whether the AI Search instance binding should be remote in local development */
|
|
1545
|
+
remote?: boolean;
|
|
1546
|
+
}[];
|
|
1547
|
+
/**
|
|
1548
|
+
* Specifies Agent Memory namespace bindings that are bound to this Worker environment.
|
|
1549
|
+
*
|
|
1550
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1551
|
+
* and so must be specified in every named environment.
|
|
1552
|
+
*
|
|
1553
|
+
* @default []
|
|
1554
|
+
* @nonInheritable
|
|
1555
|
+
*/
|
|
1556
|
+
agent_memory: {
|
|
1557
|
+
/** The binding name used to refer to the Agent Memory namespace in the Worker. */
|
|
1558
|
+
binding: string;
|
|
1559
|
+
/** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
|
|
1560
|
+
namespace: string;
|
|
1561
|
+
/** Whether the Agent Memory binding should be remote in local development */
|
|
1562
|
+
remote?: boolean;
|
|
1563
|
+
}[];
|
|
1564
|
+
/**
|
|
1565
|
+
* Specifies Hyperdrive configs that are bound to this Worker environment.
|
|
1566
|
+
*
|
|
1567
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1568
|
+
* and so must be specified in every named environment.
|
|
1569
|
+
*
|
|
1570
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
|
|
1571
|
+
*
|
|
1572
|
+
* @default []
|
|
1573
|
+
* @nonInheritable
|
|
1574
|
+
*/
|
|
1575
|
+
hyperdrive: {
|
|
1576
|
+
/** The binding name used to refer to the project in the Worker. */
|
|
1577
|
+
binding: string;
|
|
1578
|
+
/** The id of the database. */
|
|
1579
|
+
id: string;
|
|
1580
|
+
/** The local database connection string for `wrangler dev` */
|
|
1581
|
+
localConnectionString?: string;
|
|
1582
|
+
}[];
|
|
1583
|
+
/**
|
|
1584
|
+
* Specifies service bindings (Worker-to-Worker) that are bound to this Worker environment.
|
|
1585
|
+
*
|
|
1586
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1587
|
+
* and so must be specified in every named environment.
|
|
1588
|
+
*
|
|
1589
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
|
|
1590
|
+
*
|
|
1591
|
+
* @default []
|
|
1592
|
+
* @nonInheritable
|
|
1593
|
+
*/
|
|
1594
|
+
services: {
|
|
1595
|
+
/** The binding name used to refer to the bound service. */
|
|
1596
|
+
binding: string;
|
|
1597
|
+
/**
|
|
1598
|
+
* The name of the service.
|
|
1599
|
+
* To bind to a worker in a specific environment,
|
|
1600
|
+
* you should use the format `<worker_name>-<environment_name>`.
|
|
1601
|
+
*/
|
|
1602
|
+
service: string;
|
|
1603
|
+
/**
|
|
1604
|
+
* @hidden
|
|
1605
|
+
* @deprecated you should use `service: <worker_name>-<environment_name>` instead.
|
|
1606
|
+
* This refers to the deprecated concept of 'service environments'.
|
|
1607
|
+
* The environment of the service (e.g. production, staging, etc).
|
|
1608
|
+
*/
|
|
1609
|
+
environment?: string;
|
|
1610
|
+
/** Optionally, the entrypoint (named export) of the service to bind to. */
|
|
1611
|
+
entrypoint?: string;
|
|
1612
|
+
/** Optional properties that will be made available to the service via ctx.props. */
|
|
1613
|
+
props?: Record<string, unknown>;
|
|
1614
|
+
/** Whether the service binding should be remote or not in local development */
|
|
1615
|
+
remote?: boolean;
|
|
1616
|
+
}[] | undefined;
|
|
1617
|
+
/**
|
|
1618
|
+
* Specifies analytics engine datasets that are bound to this Worker environment.
|
|
1619
|
+
*
|
|
1620
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1621
|
+
* and so must be specified in every named environment.
|
|
1622
|
+
*
|
|
1623
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
|
|
1624
|
+
*
|
|
1625
|
+
* @default []
|
|
1626
|
+
* @nonInheritable
|
|
1627
|
+
*/
|
|
1628
|
+
analytics_engine_datasets: {
|
|
1629
|
+
/** The binding name used to refer to the dataset in the Worker. */
|
|
1630
|
+
binding: string;
|
|
1631
|
+
/** The name of this dataset to write to. */
|
|
1632
|
+
dataset?: string;
|
|
1633
|
+
}[];
|
|
1634
|
+
/**
|
|
1635
|
+
* A browser that will be usable from the Worker.
|
|
1636
|
+
*
|
|
1637
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1638
|
+
* and so must be specified in every named environment.
|
|
1639
|
+
*
|
|
1640
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
|
|
1641
|
+
*
|
|
1642
|
+
* @default {}
|
|
1643
|
+
* @nonInheritable
|
|
1644
|
+
*/
|
|
1645
|
+
browser: {
|
|
1646
|
+
binding: string;
|
|
1647
|
+
/** Whether the Browser binding should be remote or not in local development */
|
|
1648
|
+
remote?: boolean;
|
|
1649
|
+
} | undefined;
|
|
1650
|
+
/**
|
|
1651
|
+
* An Analytics SQL binding.
|
|
1652
|
+
*
|
|
1653
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1654
|
+
* and so must be specified in every named environment.
|
|
1655
|
+
*
|
|
1656
|
+
* @default {}
|
|
1657
|
+
* @nonInheritable
|
|
1658
|
+
*/
|
|
1659
|
+
analytics: {
|
|
1660
|
+
binding: string;
|
|
1661
|
+
/** Whether the binding should connect to the remote service during local development. */
|
|
1662
|
+
remote?: boolean;
|
|
1663
|
+
} | undefined;
|
|
1664
|
+
/**
|
|
1665
|
+
* Binding to the AI project.
|
|
1666
|
+
*
|
|
1667
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1668
|
+
* and so must be specified in every named environment.
|
|
1669
|
+
*
|
|
1670
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
|
|
1671
|
+
*
|
|
1672
|
+
* @default {}
|
|
1673
|
+
* @nonInheritable
|
|
1674
|
+
*/
|
|
1675
|
+
ai: {
|
|
1676
|
+
binding: string;
|
|
1677
|
+
staging?: boolean;
|
|
1678
|
+
/** Whether the AI binding should be remote or not in local development */
|
|
1679
|
+
remote?: boolean;
|
|
1680
|
+
} | undefined;
|
|
1681
|
+
/**
|
|
1682
|
+
* Binding to Cloudflare Images
|
|
1683
|
+
*
|
|
1684
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1685
|
+
* and so must be specified in every named environment.
|
|
1686
|
+
*
|
|
1687
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
|
|
1688
|
+
*
|
|
1689
|
+
* @default {}
|
|
1690
|
+
* @nonInheritable
|
|
1691
|
+
*/
|
|
1692
|
+
images: {
|
|
1693
|
+
binding: string;
|
|
1694
|
+
/** Whether the Images binding should be remote or not in local development */
|
|
1695
|
+
remote?: boolean;
|
|
1696
|
+
} | undefined;
|
|
1697
|
+
/**
|
|
1698
|
+
* Binding to Cloudflare Media Transformations
|
|
1699
|
+
*
|
|
1700
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1701
|
+
* and so must be specified in every named environment.
|
|
1702
|
+
*
|
|
1703
|
+
* @default {}
|
|
1704
|
+
* @nonInheritable
|
|
1705
|
+
*/
|
|
1706
|
+
media: {
|
|
1707
|
+
binding: string;
|
|
1708
|
+
/** Whether the Media binding should be remote or not */
|
|
1709
|
+
remote?: boolean;
|
|
1710
|
+
} | undefined;
|
|
1711
|
+
/**
|
|
1712
|
+
* Binding to Cloudflare Stream
|
|
1713
|
+
*
|
|
1714
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1715
|
+
* and so must be specified in every named environment.
|
|
1716
|
+
*
|
|
1717
|
+
* @default {}
|
|
1718
|
+
* @nonInheritable
|
|
1719
|
+
*/
|
|
1720
|
+
stream: {
|
|
1721
|
+
binding: string;
|
|
1722
|
+
/** Whether the Stream binding should be remote or not in local development */
|
|
1723
|
+
remote?: boolean;
|
|
1724
|
+
} | undefined;
|
|
1725
|
+
/**
|
|
1726
|
+
* Binding to the Worker Version's metadata
|
|
1727
|
+
*/
|
|
1728
|
+
version_metadata: {
|
|
1729
|
+
binding: string;
|
|
1730
|
+
} | undefined;
|
|
1731
|
+
/**
|
|
1732
|
+
* "Unsafe" tables for features that aren't directly supported by wrangler.
|
|
1733
|
+
*
|
|
1734
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1735
|
+
* and so must be specified in every named environment.
|
|
1736
|
+
*
|
|
1737
|
+
* @default {}
|
|
1738
|
+
* @nonInheritable
|
|
1739
|
+
*/
|
|
1740
|
+
unsafe: {
|
|
1741
|
+
/**
|
|
1742
|
+
* A set of bindings that should be put into a Worker's upload metadata without changes. These
|
|
1743
|
+
* can be used to implement bindings for features that haven't released and aren't supported
|
|
1744
|
+
* directly by wrangler or miniflare.
|
|
1745
|
+
*/
|
|
1746
|
+
bindings?: UnsafeBinding[];
|
|
1747
|
+
/**
|
|
1748
|
+
* Arbitrary key/value pairs that will be included in the uploaded metadata. Values specified
|
|
1749
|
+
* here will always be applied to metadata last, so can add new or override existing fields.
|
|
1750
|
+
*/
|
|
1751
|
+
metadata?: {
|
|
1752
|
+
[key: string]: unknown;
|
|
1753
|
+
};
|
|
1754
|
+
/**
|
|
1755
|
+
* Used for internal capnp uploads for the Workers runtime
|
|
1756
|
+
*/
|
|
1757
|
+
capnp?: {
|
|
1758
|
+
base_path: string;
|
|
1759
|
+
source_schemas: string[];
|
|
1760
|
+
compiled_schema?: never;
|
|
1761
|
+
} | {
|
|
1762
|
+
base_path?: never;
|
|
1763
|
+
source_schemas?: never;
|
|
1764
|
+
compiled_schema: string;
|
|
1765
|
+
};
|
|
1766
|
+
};
|
|
1767
|
+
/**
|
|
1768
|
+
* Specifies a list of mTLS certificates that are bound to this Worker environment.
|
|
1769
|
+
*
|
|
1770
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1771
|
+
* and so must be specified in every named environment.
|
|
1772
|
+
*
|
|
1773
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
|
|
1774
|
+
*
|
|
1775
|
+
* @default []
|
|
1776
|
+
* @nonInheritable
|
|
1777
|
+
*/
|
|
1778
|
+
mtls_certificates: {
|
|
1779
|
+
/** The binding name used to refer to the certificate in the Worker */
|
|
1780
|
+
binding: string;
|
|
1781
|
+
/** The uuid of the uploaded mTLS certificate */
|
|
1782
|
+
certificate_id: string;
|
|
1783
|
+
/** Whether the mtls fetcher should be remote or not in local development */
|
|
1784
|
+
remote?: boolean;
|
|
1785
|
+
}[];
|
|
1786
|
+
/**
|
|
1787
|
+
* Specifies a list of Tail Workers that are bound to this Worker environment
|
|
1788
|
+
*
|
|
1789
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1790
|
+
* and so must be specified in every named environment.
|
|
1791
|
+
*
|
|
1792
|
+
* @default []
|
|
1793
|
+
* @nonInheritable
|
|
1794
|
+
*/
|
|
1795
|
+
tail_consumers?: TailConsumer[];
|
|
1796
|
+
/**
|
|
1797
|
+
* Specifies a list of Streaming Tail Workers that are bound to this Worker environment
|
|
1798
|
+
*
|
|
1799
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1800
|
+
* and so must be specified in every named environment.
|
|
1801
|
+
*
|
|
1802
|
+
* @default []
|
|
1803
|
+
* @nonInheritable
|
|
1804
|
+
*/
|
|
1805
|
+
streaming_tail_consumers?: StreamingTailConsumer[];
|
|
1806
|
+
/**
|
|
1807
|
+
* Specifies namespace bindings that are bound to this Worker environment.
|
|
1808
|
+
*
|
|
1809
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1810
|
+
* and so must be specified in every named environment.
|
|
1811
|
+
*
|
|
1812
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
|
|
1813
|
+
*
|
|
1814
|
+
* @default []
|
|
1815
|
+
* @nonInheritable
|
|
1816
|
+
*/
|
|
1817
|
+
dispatch_namespaces: {
|
|
1818
|
+
/** The binding name used to refer to the bound service. */
|
|
1819
|
+
binding: string;
|
|
1820
|
+
/** The namespace to bind to. */
|
|
1821
|
+
namespace?: string;
|
|
1822
|
+
/** Details about the outbound Worker which will handle outbound requests from your namespace */
|
|
1823
|
+
outbound?: DispatchNamespaceOutbound;
|
|
1824
|
+
/** Whether the Dispatch Namespace should be remote or not in local development */
|
|
1825
|
+
remote?: boolean;
|
|
1826
|
+
}[];
|
|
1827
|
+
/**
|
|
1828
|
+
* Specifies list of Pipelines bound to this Worker environment
|
|
1829
|
+
*
|
|
1830
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1831
|
+
* and so must be specified in every named environment.
|
|
1832
|
+
*
|
|
1833
|
+
* @default []
|
|
1834
|
+
* @nonInheritable
|
|
1835
|
+
*/
|
|
1836
|
+
pipelines: {
|
|
1837
|
+
/** The binding name used to refer to the bound service. */
|
|
1838
|
+
binding: string;
|
|
1839
|
+
/** Id of the Stream to bind */
|
|
1840
|
+
stream?: string;
|
|
1841
|
+
/**
|
|
1842
|
+
* Id of the Stream to bind
|
|
1843
|
+
* @deprecated Use `stream` instead.
|
|
1844
|
+
*/
|
|
1845
|
+
pipeline?: string;
|
|
1846
|
+
/** Whether the pipeline should be remote or not in local development */
|
|
1847
|
+
remote?: boolean;
|
|
1848
|
+
}[];
|
|
1849
|
+
/**
|
|
1850
|
+
* K2 producer bindings. Create streams using the Dashboard or API.
|
|
1851
|
+
*
|
|
1852
|
+
* This field must be specified separately in each named environment.
|
|
1853
|
+
* @default []
|
|
1854
|
+
* @nonInheritable
|
|
1855
|
+
*/
|
|
1856
|
+
k2: {
|
|
1857
|
+
/** The binding name exposed on the Worker's env object. */
|
|
1858
|
+
binding: string;
|
|
1859
|
+
/** The ID of the K2 stream. */
|
|
1860
|
+
stream: string;
|
|
1861
|
+
/** Always uses the real stream in development. Set true to suppress the usage warning; false is unsupported. */
|
|
1862
|
+
remote?: boolean;
|
|
1863
|
+
}[];
|
|
1864
|
+
/**
|
|
1865
|
+
* Specifies Secret Store bindings that are bound to this Worker environment.
|
|
1866
|
+
*
|
|
1867
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1868
|
+
* and so must be specified in every named environment.
|
|
1869
|
+
*
|
|
1870
|
+
* @default []
|
|
1871
|
+
* @nonInheritable
|
|
1872
|
+
*/
|
|
1873
|
+
secrets_store_secrets: {
|
|
1874
|
+
/** The binding name used to refer to the bound service. */
|
|
1875
|
+
binding: string;
|
|
1876
|
+
/** Id of the secret store */
|
|
1877
|
+
store_id: string;
|
|
1878
|
+
/** Name of the secret */
|
|
1879
|
+
secret_name: string;
|
|
1880
|
+
}[];
|
|
1881
|
+
/**
|
|
1882
|
+
* Specifies Artifacts bindings that are bound to this Worker environment.
|
|
1883
|
+
* Artifacts provides git-compatible file storage on Cloudflare Workers.
|
|
1884
|
+
*
|
|
1885
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1886
|
+
* and so must be specified in every named environment.
|
|
1887
|
+
*
|
|
1888
|
+
* @default []
|
|
1889
|
+
* @nonInheritable
|
|
1890
|
+
*/
|
|
1891
|
+
artifacts: {
|
|
1892
|
+
/** The binding name used to refer to the Artifacts instance. */
|
|
1893
|
+
binding: string;
|
|
1894
|
+
/** The namespace to use. */
|
|
1895
|
+
namespace: string;
|
|
1896
|
+
/** Whether to use the remote Artifacts service in local dev. */
|
|
1897
|
+
remote?: boolean;
|
|
1898
|
+
}[];
|
|
1899
|
+
/**
|
|
1900
|
+
* **DO NOT USE**. Hello World Binding Config to serve as an explanatory example.
|
|
1901
|
+
*
|
|
1902
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1903
|
+
* and so must be specified in every named environment.
|
|
1904
|
+
*
|
|
1905
|
+
* @default []
|
|
1906
|
+
* @nonInheritable
|
|
1907
|
+
*/
|
|
1908
|
+
unsafe_hello_world: {
|
|
1909
|
+
/** The binding name used to refer to the bound service. */
|
|
1910
|
+
binding: string;
|
|
1911
|
+
/** Whether the timer is enabled */
|
|
1912
|
+
enable_timer?: boolean;
|
|
1913
|
+
}[];
|
|
1914
|
+
/**
|
|
1915
|
+
* Specifies Flagship feature flag bindings that are bound to this Worker environment.
|
|
1916
|
+
*
|
|
1917
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1918
|
+
* and so must be specified in every named environment.
|
|
1919
|
+
*
|
|
1920
|
+
* @default []
|
|
1921
|
+
* @nonInheritable
|
|
1922
|
+
*/
|
|
1923
|
+
flagship: {
|
|
1924
|
+
/** The binding name used to refer to the bound Flagship service. */
|
|
1925
|
+
binding: string;
|
|
1926
|
+
/** The Flagship app ID to bind to. */
|
|
1927
|
+
app_id?: string;
|
|
1928
|
+
/** Set to `true` to evaluate flags against the remote Flagship app during local dev, instead of the local simulator. */
|
|
1929
|
+
remote?: boolean;
|
|
1930
|
+
}[];
|
|
1931
|
+
/**
|
|
1932
|
+
* Specifies rate limit bindings that are bound to this Worker environment.
|
|
1933
|
+
*
|
|
1934
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1935
|
+
* and so must be specified in every named environment.
|
|
1936
|
+
*
|
|
1937
|
+
* @default []
|
|
1938
|
+
* @nonInheritable
|
|
1939
|
+
*/
|
|
1940
|
+
ratelimits: {
|
|
1941
|
+
/** The binding name used to refer to the rate limiter in the Worker. */
|
|
1942
|
+
name: string;
|
|
1943
|
+
/** The namespace ID for this rate limiter. */
|
|
1944
|
+
namespace_id: string;
|
|
1945
|
+
/** Simple rate limiting configuration. */
|
|
1946
|
+
simple: {
|
|
1947
|
+
/** The maximum number of requests allowed in the time period. */
|
|
1948
|
+
limit: number;
|
|
1949
|
+
/** The time period in seconds (10 for ten seconds, 60 for one minute). */
|
|
1950
|
+
period: 10 | 60;
|
|
1951
|
+
};
|
|
1952
|
+
}[];
|
|
1953
|
+
/**
|
|
1954
|
+
* Specifies Worker Loader bindings that are bound to this Worker environment.
|
|
1955
|
+
*
|
|
1956
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1957
|
+
* and so must be specified in every named environment.
|
|
1958
|
+
*
|
|
1959
|
+
* @default []
|
|
1960
|
+
* @nonInheritable
|
|
1961
|
+
*/
|
|
1962
|
+
worker_loaders: {
|
|
1963
|
+
/** The binding name used to refer to the Worker Loader in the Worker. */
|
|
1964
|
+
binding: string;
|
|
1965
|
+
}[];
|
|
1966
|
+
/**
|
|
1967
|
+
* Specifies VPC services that are bound to this Worker environment.
|
|
1968
|
+
*
|
|
1969
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1970
|
+
* and so must be specified in every named environment.
|
|
1971
|
+
*
|
|
1972
|
+
* @default []
|
|
1973
|
+
* @nonInheritable
|
|
1974
|
+
*/
|
|
1975
|
+
vpc_services: {
|
|
1976
|
+
/** The binding name used to refer to the VPC service in the Worker. */
|
|
1977
|
+
binding: string;
|
|
1978
|
+
/** The service ID of the VPC connectivity service. */
|
|
1979
|
+
service_id: string;
|
|
1980
|
+
/** Whether the VPC service is remote or not */
|
|
1981
|
+
remote?: boolean;
|
|
1982
|
+
}[];
|
|
1983
|
+
/**
|
|
1984
|
+
* Specifies VPC networks that are bound to this Worker environment.
|
|
1985
|
+
*
|
|
1986
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1987
|
+
* and so must be specified in every named environment.
|
|
1988
|
+
*
|
|
1989
|
+
* @default []
|
|
1990
|
+
* @nonInheritable
|
|
1991
|
+
*/
|
|
1992
|
+
vpc_networks: ({
|
|
1993
|
+
/** The binding name used to refer to the VPC network in the Worker. */
|
|
1994
|
+
binding: string;
|
|
1995
|
+
/** The tunnel ID of the Cloudflare Tunnel to route traffic through. Mutually exclusive with network_id. */
|
|
1996
|
+
tunnel_id: string;
|
|
1997
|
+
/** Whether the VPC network is remote or not */
|
|
1998
|
+
remote?: boolean;
|
|
1999
|
+
} | {
|
|
2000
|
+
/** The binding name used to refer to the VPC network in the Worker. */
|
|
2001
|
+
binding: string;
|
|
2002
|
+
/** The network ID to route traffic through. Mutually exclusive with tunnel_id. */
|
|
2003
|
+
network_id: string;
|
|
2004
|
+
/** Whether the VPC network is remote or not */
|
|
2005
|
+
remote?: boolean;
|
|
2006
|
+
})[];
|
|
2007
|
+
}
|
|
2008
|
+
/**
|
|
2009
|
+
* The raw environment configuration that we read from the config file.
|
|
2010
|
+
*
|
|
2011
|
+
* All the properties are optional, and will be replaced with defaults in the configuration that
|
|
2012
|
+
* is used in the rest of the codebase.
|
|
2013
|
+
*/
|
|
2014
|
+
type RawEnvironment = Partial<Omit<Environment, "durable_objects">> & {
|
|
2015
|
+
durable_objects?: RawDurableObjectsConfig;
|
|
2016
|
+
};
|
|
2017
|
+
/**
|
|
2018
|
+
* A bundling resolver rule, defining the modules type for paths that match the specified globs.
|
|
2019
|
+
*/
|
|
2020
|
+
type Rule = {
|
|
2021
|
+
type: ConfigModuleRuleType;
|
|
2022
|
+
globs: string[];
|
|
2023
|
+
fallthrough?: boolean;
|
|
2024
|
+
};
|
|
2025
|
+
/**
|
|
2026
|
+
* The possible types for a `Rule`.
|
|
2027
|
+
*/
|
|
2028
|
+
type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data" | "PythonModule" | "PythonRequirement";
|
|
2029
|
+
type TailConsumer = {
|
|
2030
|
+
/** The name of the service tail events will be forwarded to. */
|
|
2031
|
+
service: string;
|
|
2032
|
+
/** (Optional) The environment of the service. */
|
|
2033
|
+
environment?: string;
|
|
2034
|
+
};
|
|
2035
|
+
type StreamingTailConsumer = {
|
|
2036
|
+
/** The name of the service streaming tail events will be forwarded to. */
|
|
2037
|
+
service: string;
|
|
2038
|
+
};
|
|
2039
|
+
interface DispatchNamespaceOutbound {
|
|
2040
|
+
/** Name of the service handling the outbound requests */
|
|
2041
|
+
service: string;
|
|
2042
|
+
/** (Optional) Name of the environment handling the outbound requests. */
|
|
2043
|
+
environment?: string;
|
|
2044
|
+
/** (Optional) List of parameter names, for sending context from your dispatch Worker to the outbound handler */
|
|
2045
|
+
parameters?: string[];
|
|
2046
|
+
}
|
|
2047
|
+
interface UserLimits {
|
|
2048
|
+
/** Maximum allowed CPU time for a Worker's invocation in milliseconds */
|
|
2049
|
+
cpu_ms?: number;
|
|
2050
|
+
/** Maximum allowed number of fetch requests that a Worker's invocation can execute */
|
|
2051
|
+
subrequests?: number;
|
|
2052
|
+
}
|
|
2053
|
+
type Assets = {
|
|
2054
|
+
/** Absolute path to assets directory */
|
|
2055
|
+
directory?: string;
|
|
2056
|
+
/** Name of `env` binding property in the User Worker. */
|
|
2057
|
+
binding?: string;
|
|
2058
|
+
/** How to handle HTML requests. */
|
|
2059
|
+
html_handling?: "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | "none";
|
|
2060
|
+
/** How to handle requests that do not match an asset. */
|
|
2061
|
+
not_found_handling?: "single-page-application" | "404-page" | "none";
|
|
2062
|
+
/**
|
|
2063
|
+
* Matches will be routed to the User Worker, and matches to negative rules will go to the Asset Worker.
|
|
2064
|
+
*
|
|
2065
|
+
* Can also be `true`, indicating that every request should be routed to the User Worker.
|
|
2066
|
+
*/
|
|
2067
|
+
run_worker_first?: string[] | boolean;
|
|
2068
|
+
};
|
|
2069
|
+
interface Observability {
|
|
2070
|
+
/** If observability is enabled for this Worker */
|
|
2071
|
+
enabled?: boolean;
|
|
2072
|
+
/** The sampling rate */
|
|
2073
|
+
head_sampling_rate?: number;
|
|
2074
|
+
/**
|
|
2075
|
+
* Whether query strings are removed from request URLs in logs and traces.
|
|
2076
|
+
*
|
|
2077
|
+
* @default false
|
|
2078
|
+
*/
|
|
2079
|
+
redact_query_string?: boolean;
|
|
2080
|
+
/** Real-time Issues settings for this Worker. */
|
|
2081
|
+
issues?: {
|
|
2082
|
+
/** Whether real-time Issues are enabled. */
|
|
2083
|
+
enabled?: boolean;
|
|
2084
|
+
};
|
|
2085
|
+
logs?: {
|
|
2086
|
+
enabled?: boolean;
|
|
2087
|
+
/** The sampling rate */
|
|
2088
|
+
head_sampling_rate?: number;
|
|
2089
|
+
/** Set to false to disable invocation logs */
|
|
2090
|
+
invocation_logs?: boolean;
|
|
2091
|
+
/**
|
|
2092
|
+
* If logs should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
|
|
2093
|
+
*
|
|
2094
|
+
* @default true
|
|
2095
|
+
*/
|
|
2096
|
+
persist?: boolean;
|
|
2097
|
+
/**
|
|
2098
|
+
* What destinations logs emitted from the Worker should be sent to.
|
|
2099
|
+
*
|
|
2100
|
+
* @default []
|
|
2101
|
+
*/
|
|
2102
|
+
destinations?: string[];
|
|
2103
|
+
};
|
|
2104
|
+
traces?: {
|
|
2105
|
+
enabled?: boolean;
|
|
2106
|
+
/** The sampling rate */
|
|
2107
|
+
head_sampling_rate?: number;
|
|
2108
|
+
/**
|
|
2109
|
+
* If traces should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
|
|
2110
|
+
*
|
|
2111
|
+
* @default true
|
|
2112
|
+
*/
|
|
2113
|
+
persist?: boolean;
|
|
2114
|
+
/**
|
|
2115
|
+
* What destinations traces emitted from the Worker should be sent to.
|
|
2116
|
+
*
|
|
2117
|
+
* @default []
|
|
2118
|
+
*/
|
|
2119
|
+
destinations?: string[];
|
|
2120
|
+
};
|
|
2121
|
+
}
|
|
2122
|
+
interface Access {
|
|
2123
|
+
/** Local dev simulation of Cloudflare Access authentication */
|
|
2124
|
+
dev?: {
|
|
2125
|
+
/** The Access application audience tag (aud) */
|
|
2126
|
+
aud: string;
|
|
2127
|
+
/** Mock identity object returned by ctx.access.getIdentity() */
|
|
2128
|
+
identity?: Record<string, unknown>;
|
|
2129
|
+
};
|
|
2130
|
+
}
|
|
2131
|
+
interface CacheOptions {
|
|
2132
|
+
/** If cache is enabled for this Worker */
|
|
2133
|
+
enabled: boolean;
|
|
2134
|
+
/** Whether cached assets may be reused across Worker versions. */
|
|
2135
|
+
cross_version_cache?: boolean;
|
|
2136
|
+
}
|
|
2137
|
+
type DockerConfiguration = {
|
|
2138
|
+
/** Socket used by miniflare to communicate with Docker */
|
|
2139
|
+
socketPath: string;
|
|
2140
|
+
/** Docker image name for the container egress interceptor sidecar */
|
|
2141
|
+
containerEgressInterceptorImage?: string;
|
|
2142
|
+
};
|
|
2143
|
+
type ContainerEngine = {
|
|
2144
|
+
localDocker: DockerConfiguration;
|
|
2145
|
+
} | string;
|
|
2146
|
+
/**
|
|
2147
|
+
* Configuration for Worker Previews.
|
|
2148
|
+
*
|
|
2149
|
+
* This defines the settings used when creating Preview deployments.
|
|
2150
|
+
* Previews are branches of your Worker's main instance used to test features
|
|
2151
|
+
* during feature development outside of production.
|
|
2152
|
+
*
|
|
2153
|
+
* The `previews` block contains any intentionally divergent configuration intended solely for Previews, including:
|
|
2154
|
+
* - All non-inheritable properties (environment variables and bindings like KV, D1, R2, etc.)
|
|
2155
|
+
* - Select inheritable properties: `logpush`, `observability`, `limits`, `placement`, `cache`
|
|
2156
|
+
*
|
|
2157
|
+
* @inheritable
|
|
2158
|
+
*/
|
|
2159
|
+
interface PreviewsConfig extends Partial<Omit<EnvironmentNonInheritable, "durable_objects">>, Partial<Pick<EnvironmentInheritable, "logpush" | "observability" | "limits" | "placement" | "cache">> {
|
|
2160
|
+
durable_objects?: {
|
|
2161
|
+
bindings: DurableObjectBindings;
|
|
2162
|
+
};
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
type RawConfig = Partial<ConfigFields<RawDevConfig>> & PagesConfigFields & RawEnvironment & EnvironmentMap & {
|
|
2166
|
+
$schema?: string;
|
|
2167
|
+
};
|
|
2168
|
+
interface ConfigFields<Dev extends RawDevConfig> {
|
|
2169
|
+
/**
|
|
2170
|
+
* Whether Wrangler should send usage metrics to Cloudflare for this project.
|
|
2171
|
+
*
|
|
2172
|
+
* When defined this will override any user settings.
|
|
2173
|
+
* Otherwise, Wrangler will use the user's preference.
|
|
2174
|
+
*/
|
|
2175
|
+
send_metrics: boolean | undefined;
|
|
2176
|
+
/**
|
|
2177
|
+
* Configuration for npm package dependency instrumentation.
|
|
2178
|
+
*
|
|
2179
|
+
* Controls whether Wrangler should collect and send npm package dependency
|
|
2180
|
+
* metadata when deploying or uploading a Worker version.
|
|
2181
|
+
*
|
|
2182
|
+
* When `enabled` is set to `false`, Wrangler will not include
|
|
2183
|
+
* `package_dependencies` in the upload payload. Defaults to enabled when
|
|
2184
|
+
* not specified.
|
|
2185
|
+
*
|
|
2186
|
+
* Note: This is considered build metadata, so managed separately from the
|
|
2187
|
+
* telemetry one and not disabled when
|
|
2188
|
+
* `send_metrics`/`WRANGLER_SEND_METRICS` is set to `false`
|
|
2189
|
+
*/
|
|
2190
|
+
dependencies_instrumentation: {
|
|
2191
|
+
/** Whether dependency instrumentation is enabled. Defaults to `true`. */
|
|
2192
|
+
enabled: boolean;
|
|
2193
|
+
/**
|
|
2194
|
+
* An optional list of package name patterns to exclude from the
|
|
2195
|
+
* collected dependency metadata.
|
|
2196
|
+
*
|
|
2197
|
+
* Each entry can be an exact package name (e.g. `"lodash"`) or a glob
|
|
2198
|
+
* pattern using `*` as a wildcard (e.g. `"@internal/*"` to exclude all
|
|
2199
|
+
* packages under the `@internal` scope).
|
|
2200
|
+
*/
|
|
2201
|
+
exclude_packages?: string[];
|
|
2202
|
+
} | undefined;
|
|
2203
|
+
/**
|
|
2204
|
+
* Options to configure the development server that your worker will use.
|
|
2205
|
+
*
|
|
2206
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#local-development-settings
|
|
2207
|
+
*/
|
|
2208
|
+
dev: Dev;
|
|
2209
|
+
/**
|
|
2210
|
+
* The definition of a Worker Site, a feature that lets you upload
|
|
2211
|
+
* static assets with your Worker.
|
|
2212
|
+
*
|
|
2213
|
+
* More details at https://developers.cloudflare.com/workers/platform/sites
|
|
2214
|
+
*
|
|
2215
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-sites
|
|
2216
|
+
*/
|
|
2217
|
+
site: {
|
|
2218
|
+
/**
|
|
2219
|
+
* The directory containing your static assets.
|
|
2220
|
+
*
|
|
2221
|
+
* It must be a path relative to your Wrangler configuration file.
|
|
2222
|
+
* Example: bucket = "./public"
|
|
2223
|
+
*
|
|
2224
|
+
* If there is a `site` field then it must contain this `bucket` field.
|
|
2225
|
+
*/
|
|
2226
|
+
bucket: string;
|
|
2227
|
+
/**
|
|
2228
|
+
* The location of your Worker script.
|
|
2229
|
+
*
|
|
2230
|
+
* @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.
|
|
2231
|
+
* @breaking
|
|
2232
|
+
*/
|
|
2233
|
+
"entry-point"?: string;
|
|
2234
|
+
/**
|
|
2235
|
+
* An exclusive list of .gitignore-style patterns that match file
|
|
2236
|
+
* or directory names from your bucket location. Only matched
|
|
2237
|
+
* items will be uploaded. Example: include = ["upload_dir"]
|
|
2238
|
+
*
|
|
2239
|
+
* @optional
|
|
2240
|
+
* @default []
|
|
2241
|
+
*/
|
|
2242
|
+
include?: string[];
|
|
2243
|
+
/**
|
|
2244
|
+
* A list of .gitignore-style patterns that match files or
|
|
2245
|
+
* directories in your bucket that should be excluded from
|
|
2246
|
+
* uploads. Example: exclude = ["ignore_dir"]
|
|
2247
|
+
*
|
|
2248
|
+
* @optional
|
|
2249
|
+
* @default []
|
|
2250
|
+
*/
|
|
2251
|
+
exclude?: string[];
|
|
2252
|
+
} | undefined;
|
|
2253
|
+
/**
|
|
2254
|
+
* A list of wasm modules that your worker should be bound to. This is
|
|
2255
|
+
* the "legacy" way of binding to a wasm module. ES module workers should
|
|
2256
|
+
* do proper module imports.
|
|
2257
|
+
*/
|
|
2258
|
+
wasm_modules: {
|
|
2259
|
+
[key: string]: string;
|
|
2260
|
+
} | undefined;
|
|
2261
|
+
/**
|
|
2262
|
+
* A list of text files that your worker should be bound to. This is
|
|
2263
|
+
* the "legacy" way of binding to a text file. ES module workers should
|
|
2264
|
+
* do proper module imports.
|
|
2265
|
+
*/
|
|
2266
|
+
text_blobs: {
|
|
2267
|
+
[key: string]: string;
|
|
2268
|
+
} | undefined;
|
|
2269
|
+
/**
|
|
2270
|
+
* A list of data files that your worker should be bound to. This is
|
|
2271
|
+
* the "legacy" way of binding to a data file. ES module workers should
|
|
2272
|
+
* do proper module imports.
|
|
2273
|
+
*/
|
|
2274
|
+
data_blobs: {
|
|
2275
|
+
[key: string]: string;
|
|
2276
|
+
} | undefined;
|
|
2277
|
+
/**
|
|
2278
|
+
* A map of module aliases. Lets you swap out a module for any others.
|
|
2279
|
+
* Corresponds with esbuild's `alias` config
|
|
2280
|
+
*
|
|
2281
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#module-aliasing
|
|
2282
|
+
*/
|
|
2283
|
+
alias: {
|
|
2284
|
+
[key: string]: string;
|
|
2285
|
+
} | undefined;
|
|
2286
|
+
/**
|
|
2287
|
+
* By default, the Wrangler configuration file is the source of truth for your environment configuration, like a terraform file.
|
|
2288
|
+
*
|
|
2289
|
+
* If you change your vars in the dashboard, wrangler *will* override/delete them on its next deploy.
|
|
2290
|
+
*
|
|
2291
|
+
* If you want to keep your dashboard vars when wrangler deploys, set this field to true.
|
|
2292
|
+
*
|
|
2293
|
+
* @default false
|
|
2294
|
+
* @nonInheritable
|
|
2295
|
+
*/
|
|
2296
|
+
keep_vars?: boolean;
|
|
2297
|
+
/**
|
|
2298
|
+
* The inbound email addresses handled by the Worker being deployed.
|
|
2299
|
+
*
|
|
2300
|
+
* Each entry is a literal recipient address (e.g. `"support@example.com"`)
|
|
2301
|
+
* or a `*@domain` catch-all (e.g. `"*@example.com"`). Every entry creates an
|
|
2302
|
+
* Email Routing rule whose action routes mail to this Worker.
|
|
2303
|
+
*
|
|
2304
|
+
* This field is top-level only and applies to every environment of the
|
|
2305
|
+
* Worker; it cannot be set under `env.*`.
|
|
2306
|
+
*
|
|
2307
|
+
* @nonInheritable
|
|
2308
|
+
*/
|
|
2309
|
+
addresses?: string[];
|
|
2310
|
+
}
|
|
2311
|
+
interface PagesConfigFields {
|
|
2312
|
+
/**
|
|
2313
|
+
* The directory of static assets to serve.
|
|
2314
|
+
*
|
|
2315
|
+
* The presence of this field in a Wrangler configuration file indicates a Pages project,
|
|
2316
|
+
* and will prompt the handling of the configuration file according to the
|
|
2317
|
+
* Pages-specific validation rules.
|
|
2318
|
+
*/
|
|
2319
|
+
pages_build_output_dir?: string;
|
|
2320
|
+
}
|
|
2321
|
+
interface DevConfig {
|
|
2322
|
+
/**
|
|
2323
|
+
* IP address for the local dev server to listen on,
|
|
2324
|
+
*
|
|
2325
|
+
* @default localhost
|
|
2326
|
+
*/
|
|
2327
|
+
ip: string;
|
|
2328
|
+
/**
|
|
2329
|
+
* Port for the local dev server to listen on
|
|
2330
|
+
*
|
|
2331
|
+
* @default 8787
|
|
2332
|
+
*/
|
|
2333
|
+
port: number | undefined;
|
|
2334
|
+
/**
|
|
2335
|
+
* Port for the local dev server's inspector to listen on
|
|
2336
|
+
*
|
|
2337
|
+
* @default 9229
|
|
2338
|
+
*/
|
|
2339
|
+
inspector_port: number | undefined;
|
|
2340
|
+
/**
|
|
2341
|
+
* IP address for the local dev server's inspector to listen on
|
|
2342
|
+
*
|
|
2343
|
+
* @default 127.0.0.1
|
|
2344
|
+
*/
|
|
2345
|
+
inspector_ip: string | undefined;
|
|
2346
|
+
/**
|
|
2347
|
+
* Protocol that local wrangler dev server listens to requests on.
|
|
2348
|
+
*
|
|
2349
|
+
* @default http
|
|
2350
|
+
*/
|
|
2351
|
+
local_protocol: "http" | "https";
|
|
2352
|
+
/**
|
|
2353
|
+
* Protocol that wrangler dev forwards requests on
|
|
2354
|
+
*
|
|
2355
|
+
* Setting this to `http` is not currently implemented for remote mode.
|
|
2356
|
+
* See https://github.com/cloudflare/workers-sdk/issues/583
|
|
2357
|
+
*
|
|
2358
|
+
* @default https
|
|
2359
|
+
*/
|
|
2360
|
+
upstream_protocol: "https" | "http";
|
|
2361
|
+
/**
|
|
2362
|
+
* Host to forward requests to, defaults to the host of the first route of project
|
|
2363
|
+
*/
|
|
2364
|
+
host: string | undefined;
|
|
2365
|
+
/**
|
|
2366
|
+
* When developing, whether to build and connect to containers. This requires a Docker daemon to be running.
|
|
2367
|
+
* Defaults to `true`.
|
|
2368
|
+
*
|
|
2369
|
+
* @default true
|
|
2370
|
+
*/
|
|
2371
|
+
enable_containers: boolean;
|
|
2372
|
+
/**
|
|
2373
|
+
* Either the Docker unix socket i.e. `unix:///var/run/docker.sock` or a full configuration.
|
|
2374
|
+
* Note that windows is only supported via WSL at the moment
|
|
2375
|
+
*/
|
|
2376
|
+
container_engine: ContainerEngine | undefined;
|
|
2377
|
+
/**
|
|
2378
|
+
* Re-generate your worker types when your Wrangler configuration file changes.
|
|
2379
|
+
*
|
|
2380
|
+
* @default false
|
|
2381
|
+
*/
|
|
2382
|
+
generate_types: boolean;
|
|
2383
|
+
}
|
|
2384
|
+
type RawDevConfig = Partial<DevConfig>;
|
|
2385
|
+
interface EnvironmentMap {
|
|
2386
|
+
/**
|
|
2387
|
+
* The `env` section defines overrides for the configuration for different environments.
|
|
2388
|
+
*
|
|
2389
|
+
* All environment fields can be specified at the top level of the config indicating the default environment settings.
|
|
2390
|
+
*
|
|
2391
|
+
* - Some fields are inherited and overridable in each environment.
|
|
2392
|
+
* - But some are not inherited and must be explicitly specified in every environment, if they are specified at the top level.
|
|
2393
|
+
*
|
|
2394
|
+
* For more information, see the documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration#environments
|
|
2395
|
+
*
|
|
2396
|
+
* @default {}
|
|
2397
|
+
*/
|
|
2398
|
+
env?: {
|
|
2399
|
+
[envName: string]: RawEnvironment;
|
|
2400
|
+
};
|
|
2401
|
+
}
|
|
6
2402
|
|
|
7
2403
|
type RoutesRes = {
|
|
8
2404
|
id: string;
|