devflare 0.0.0 → 1.0.0-next.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/README.md +737 -1
- package/bin/devflare.js +14 -0
- package/dist/account-rvrj687w.js +397 -0
- package/dist/ai-dx4fr9jh.js +107 -0
- package/dist/bridge/client.d.ts +82 -0
- package/dist/bridge/client.d.ts.map +1 -0
- package/dist/bridge/index.d.ts +7 -0
- package/dist/bridge/index.d.ts.map +1 -0
- package/dist/bridge/miniflare.d.ts +70 -0
- package/dist/bridge/miniflare.d.ts.map +1 -0
- package/dist/bridge/protocol.d.ts +146 -0
- package/dist/bridge/protocol.d.ts.map +1 -0
- package/dist/bridge/proxy.d.ts +49 -0
- package/dist/bridge/proxy.d.ts.map +1 -0
- package/dist/bridge/serialization.d.ts +83 -0
- package/dist/bridge/serialization.d.ts.map +1 -0
- package/dist/bridge/server.d.ts +8 -0
- package/dist/bridge/server.d.ts.map +1 -0
- package/dist/browser-shim/binding-worker.d.ts +7 -0
- package/dist/browser-shim/binding-worker.d.ts.map +1 -0
- package/dist/browser-shim/handler.d.ts +21 -0
- package/dist/browser-shim/handler.d.ts.map +1 -0
- package/dist/browser-shim/index.d.ts +3 -0
- package/dist/browser-shim/index.d.ts.map +1 -0
- package/dist/browser-shim/server.d.ts +25 -0
- package/dist/browser-shim/server.d.ts.map +1 -0
- package/dist/browser-shim/worker.d.ts +14 -0
- package/dist/browser-shim/worker.d.ts.map +1 -0
- package/dist/build-mnf6v8gd.js +53 -0
- package/dist/bundler/do-bundler.d.ts +42 -0
- package/dist/bundler/do-bundler.d.ts.map +1 -0
- package/dist/bundler/index.d.ts +2 -0
- package/dist/bundler/index.d.ts.map +1 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/colors.d.ts +11 -0
- package/dist/cli/colors.d.ts.map +1 -0
- package/dist/cli/commands/account.d.ts +4 -0
- package/dist/cli/commands/account.d.ts.map +1 -0
- package/dist/cli/commands/ai.d.ts +3 -0
- package/dist/cli/commands/ai.d.ts.map +1 -0
- package/dist/cli/commands/build.d.ts +4 -0
- package/dist/cli/commands/build.d.ts.map +1 -0
- package/dist/cli/commands/deploy.d.ts +4 -0
- package/dist/cli/commands/deploy.d.ts.map +1 -0
- package/dist/cli/commands/dev.d.ts +4 -0
- package/dist/cli/commands/dev.d.ts.map +1 -0
- package/dist/cli/commands/doctor.d.ts +4 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/init.d.ts +4 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/remote.d.ts +4 -0
- package/dist/cli/commands/remote.d.ts.map +1 -0
- package/dist/cli/commands/types.d.ts +4 -0
- package/dist/cli/commands/types.d.ts.map +1 -0
- package/dist/cli/dependencies.d.ts +90 -0
- package/dist/cli/dependencies.d.ts.map +1 -0
- package/dist/cli/index.d.ts +23 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/wrangler-auth.d.ts +36 -0
- package/dist/cli/wrangler-auth.d.ts.map +1 -0
- package/dist/cloudflare/account.d.ts +65 -0
- package/dist/cloudflare/account.d.ts.map +1 -0
- package/dist/cloudflare/api.d.ts +51 -0
- package/dist/cloudflare/api.d.ts.map +1 -0
- package/dist/cloudflare/auth.d.ts +35 -0
- package/dist/cloudflare/auth.d.ts.map +1 -0
- package/dist/cloudflare/index.d.ts +107 -0
- package/dist/cloudflare/index.d.ts.map +1 -0
- package/dist/cloudflare/index.js +13 -0
- package/dist/cloudflare/preferences.d.ts +46 -0
- package/dist/cloudflare/preferences.d.ts.map +1 -0
- package/dist/cloudflare/pricing.d.ts +15 -0
- package/dist/cloudflare/pricing.d.ts.map +1 -0
- package/dist/cloudflare/remote-config.d.ts +37 -0
- package/dist/cloudflare/remote-config.d.ts.map +1 -0
- package/dist/cloudflare/types.d.ts +161 -0
- package/dist/cloudflare/types.d.ts.map +1 -0
- package/dist/cloudflare/usage.d.ts +77 -0
- package/dist/cloudflare/usage.d.ts.map +1 -0
- package/dist/config/compiler.d.ts +146 -0
- package/dist/config/compiler.d.ts.map +1 -0
- package/dist/config/define.d.ts +44 -0
- package/dist/config/define.d.ts.map +1 -0
- package/dist/config/index.d.ts +6 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/loader.d.ts +52 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/ref.d.ts +160 -0
- package/dist/config/ref.d.ts.map +1 -0
- package/dist/config/schema.d.ts +3318 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/decorators/durable-object.d.ts +59 -0
- package/dist/decorators/durable-object.d.ts.map +1 -0
- package/dist/decorators/index.d.ts +3 -0
- package/dist/decorators/index.d.ts.map +1 -0
- package/dist/decorators/index.js +9 -0
- package/dist/deploy-nhceck39.js +70 -0
- package/dist/dev-qnxet3j9.js +2096 -0
- package/dist/dev-server/index.d.ts +2 -0
- package/dist/dev-server/index.d.ts.map +1 -0
- package/dist/dev-server/server.d.ts +30 -0
- package/dist/dev-server/server.d.ts.map +1 -0
- package/dist/doctor-e8fy6fj5.js +186 -0
- package/dist/durable-object-t4kbb0yt.js +13 -0
- package/dist/env.d.ts +48 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/index-07q6yxyc.js +168 -0
- package/dist/index-1xpj0m4r.js +57 -0
- package/dist/index-37x76zdn.js +4 -0
- package/dist/index-3t6rypgc.js +13 -0
- package/dist/index-67qcae0f.js +183 -0
- package/dist/index-a855bdsx.js +18 -0
- package/dist/index-d8bdkx2h.js +109 -0
- package/dist/index-ep3445yc.js +2225 -0
- package/dist/index-gz1gndna.js +307 -0
- package/dist/index-hcex3rgh.js +266 -0
- package/dist/index-m2q41jwa.js +462 -0
- package/dist/index-n7rs26ft.js +77 -0
- package/dist/index-pf5s73n9.js +1413 -0
- package/dist/index-rbht7m9r.js +36 -0
- package/dist/index-tfyxa77h.js +850 -0
- package/dist/index-tk6ej9dj.js +94 -0
- package/dist/index-z14anrqp.js +226 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +298 -0
- package/dist/init-f9mgmew3.js +186 -0
- package/dist/remote-q59qk463.js +97 -0
- package/dist/runtime/context.d.ts +46 -0
- package/dist/runtime/context.d.ts.map +1 -0
- package/dist/runtime/exports.d.ts +118 -0
- package/dist/runtime/exports.d.ts.map +1 -0
- package/dist/runtime/index.d.ts +4 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +111 -0
- package/dist/runtime/middleware.d.ts +82 -0
- package/dist/runtime/middleware.d.ts.map +1 -0
- package/dist/runtime/validation.d.ts +37 -0
- package/dist/runtime/validation.d.ts.map +1 -0
- package/dist/sveltekit/index.d.ts +2 -0
- package/dist/sveltekit/index.d.ts.map +1 -0
- package/dist/sveltekit/index.js +182 -0
- package/dist/sveltekit/platform.d.ts +141 -0
- package/dist/sveltekit/platform.d.ts.map +1 -0
- package/dist/test/bridge-context.d.ts +73 -0
- package/dist/test/bridge-context.d.ts.map +1 -0
- package/dist/test/cf.d.ts +130 -0
- package/dist/test/cf.d.ts.map +1 -0
- package/dist/test/email.d.ts +75 -0
- package/dist/test/email.d.ts.map +1 -0
- package/dist/test/index.d.ts +22 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +71 -0
- package/dist/test/multi-worker-context.d.ts +114 -0
- package/dist/test/multi-worker-context.d.ts.map +1 -0
- package/dist/test/queue.d.ts +74 -0
- package/dist/test/queue.d.ts.map +1 -0
- package/dist/test/remote-ai.d.ts +6 -0
- package/dist/test/remote-ai.d.ts.map +1 -0
- package/dist/test/remote-vectorize.d.ts +6 -0
- package/dist/test/remote-vectorize.d.ts.map +1 -0
- package/dist/test/resolve-service-bindings.d.ts +68 -0
- package/dist/test/resolve-service-bindings.d.ts.map +1 -0
- package/dist/test/scheduled.d.ts +58 -0
- package/dist/test/scheduled.d.ts.map +1 -0
- package/dist/test/should-skip.d.ts +50 -0
- package/dist/test/should-skip.d.ts.map +1 -0
- package/dist/test/simple-context.d.ts +43 -0
- package/dist/test/simple-context.d.ts.map +1 -0
- package/dist/test/tail.d.ts +86 -0
- package/dist/test/tail.d.ts.map +1 -0
- package/dist/test/utilities.d.ts +99 -0
- package/dist/test/utilities.d.ts.map +1 -0
- package/dist/test/worker.d.ts +76 -0
- package/dist/test/worker.d.ts.map +1 -0
- package/dist/transform/durable-object.d.ts +46 -0
- package/dist/transform/durable-object.d.ts.map +1 -0
- package/dist/transform/index.d.ts +3 -0
- package/dist/transform/index.d.ts.map +1 -0
- package/dist/transform/worker-entrypoint.d.ts +66 -0
- package/dist/transform/worker-entrypoint.d.ts.map +1 -0
- package/dist/types-5nyrz1sz.js +454 -0
- package/dist/utils/entrypoint-discovery.d.ts +29 -0
- package/dist/utils/entrypoint-discovery.d.ts.map +1 -0
- package/dist/utils/glob.d.ts +33 -0
- package/dist/utils/glob.d.ts.map +1 -0
- package/dist/utils/resolve-package.d.ts +10 -0
- package/dist/utils/resolve-package.d.ts.map +1 -0
- package/dist/vite/index.d.ts +3 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +339 -0
- package/dist/vite/plugin.d.ts +138 -0
- package/dist/vite/plugin.d.ts.map +1 -0
- package/dist/worker-entrypoint-m9th0rg0.js +13 -0
- package/dist/workerName.d.ts +17 -0
- package/dist/workerName.d.ts.map +1 -0
- package/package.json +111 -1
|
@@ -0,0 +1,3318 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Durable Object binding input type.
|
|
4
|
+
* Accepts both string shorthand and object form (including DOBindingRef from ref()).
|
|
5
|
+
*/
|
|
6
|
+
type DurableObjectBindingInput = string | {
|
|
7
|
+
/** The Durable Object class name */
|
|
8
|
+
readonly className: string;
|
|
9
|
+
/**
|
|
10
|
+
* Script name for cross-worker DO access.
|
|
11
|
+
* For local DOs: file path (e.g., 'do.counter.ts')
|
|
12
|
+
* For cross-worker DOs: worker name (e.g., 'do-service')
|
|
13
|
+
*/
|
|
14
|
+
readonly scriptName?: string;
|
|
15
|
+
/** @internal Reference marker for cross-worker DO bindings */
|
|
16
|
+
readonly __ref?: unknown;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Durable Object binding schema.
|
|
20
|
+
* Validates DO binding configuration in either string or object form.
|
|
21
|
+
*
|
|
22
|
+
* @example String form (local DO)
|
|
23
|
+
* ```ts
|
|
24
|
+
* durableObjects: { COUNTER: 'Counter' }
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @example Object form (cross-worker DO)
|
|
28
|
+
* ```ts
|
|
29
|
+
* durableObjects: { COUNTER: doService.COUNTER }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare const durableObjectBindingSchema: z.ZodType<DurableObjectBindingInput, z.ZodTypeDef, DurableObjectBindingInput>;
|
|
33
|
+
/**
|
|
34
|
+
* Queue consumer configuration.
|
|
35
|
+
* Defines how messages are consumed from a Cloudflare Queue.
|
|
36
|
+
*/
|
|
37
|
+
declare const queueConsumerSchema: z.ZodObject<{
|
|
38
|
+
/** Queue name to consume from */
|
|
39
|
+
queue: z.ZodString;
|
|
40
|
+
/**
|
|
41
|
+
* Maximum messages per batch (1-100).
|
|
42
|
+
* @default 10
|
|
43
|
+
*/
|
|
44
|
+
maxBatchSize: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
/**
|
|
46
|
+
* Maximum seconds to wait for a full batch.
|
|
47
|
+
* @default 5
|
|
48
|
+
*/
|
|
49
|
+
maxBatchTimeout: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
/**
|
|
51
|
+
* Maximum retry attempts for failed messages.
|
|
52
|
+
* @default 3
|
|
53
|
+
*/
|
|
54
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
/** Queue name to send failed messages after max retries */
|
|
56
|
+
deadLetterQueue: z.ZodOptional<z.ZodString>;
|
|
57
|
+
/** Maximum concurrent batch invocations */
|
|
58
|
+
maxConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
/** Delay in seconds between retries */
|
|
60
|
+
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
queue: string;
|
|
63
|
+
maxBatchSize?: number | undefined;
|
|
64
|
+
maxBatchTimeout?: number | undefined;
|
|
65
|
+
maxRetries?: number | undefined;
|
|
66
|
+
deadLetterQueue?: string | undefined;
|
|
67
|
+
maxConcurrency?: number | undefined;
|
|
68
|
+
retryDelay?: number | undefined;
|
|
69
|
+
}, {
|
|
70
|
+
queue: string;
|
|
71
|
+
maxBatchSize?: number | undefined;
|
|
72
|
+
maxBatchTimeout?: number | undefined;
|
|
73
|
+
maxRetries?: number | undefined;
|
|
74
|
+
deadLetterQueue?: string | undefined;
|
|
75
|
+
maxConcurrency?: number | undefined;
|
|
76
|
+
retryDelay?: number | undefined;
|
|
77
|
+
}>;
|
|
78
|
+
/**
|
|
79
|
+
* Queues configuration for producers and consumers.
|
|
80
|
+
*/
|
|
81
|
+
declare const queuesConfigSchema: z.ZodObject<{
|
|
82
|
+
/**
|
|
83
|
+
* Queue producer bindings.
|
|
84
|
+
* Maps binding name to queue name.
|
|
85
|
+
* @example { TASK_QUEUE: 'task-queue' }
|
|
86
|
+
*/
|
|
87
|
+
producers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
88
|
+
/**
|
|
89
|
+
* Queue consumer configurations.
|
|
90
|
+
* Array of consumer configs for processing queue messages.
|
|
91
|
+
*/
|
|
92
|
+
consumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
93
|
+
/** Queue name to consume from */
|
|
94
|
+
queue: z.ZodString;
|
|
95
|
+
/**
|
|
96
|
+
* Maximum messages per batch (1-100).
|
|
97
|
+
* @default 10
|
|
98
|
+
*/
|
|
99
|
+
maxBatchSize: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
/**
|
|
101
|
+
* Maximum seconds to wait for a full batch.
|
|
102
|
+
* @default 5
|
|
103
|
+
*/
|
|
104
|
+
maxBatchTimeout: z.ZodOptional<z.ZodNumber>;
|
|
105
|
+
/**
|
|
106
|
+
* Maximum retry attempts for failed messages.
|
|
107
|
+
* @default 3
|
|
108
|
+
*/
|
|
109
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
110
|
+
/** Queue name to send failed messages after max retries */
|
|
111
|
+
deadLetterQueue: z.ZodOptional<z.ZodString>;
|
|
112
|
+
/** Maximum concurrent batch invocations */
|
|
113
|
+
maxConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
/** Delay in seconds between retries */
|
|
115
|
+
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
}, "strip", z.ZodTypeAny, {
|
|
117
|
+
queue: string;
|
|
118
|
+
maxBatchSize?: number | undefined;
|
|
119
|
+
maxBatchTimeout?: number | undefined;
|
|
120
|
+
maxRetries?: number | undefined;
|
|
121
|
+
deadLetterQueue?: string | undefined;
|
|
122
|
+
maxConcurrency?: number | undefined;
|
|
123
|
+
retryDelay?: number | undefined;
|
|
124
|
+
}, {
|
|
125
|
+
queue: string;
|
|
126
|
+
maxBatchSize?: number | undefined;
|
|
127
|
+
maxBatchTimeout?: number | undefined;
|
|
128
|
+
maxRetries?: number | undefined;
|
|
129
|
+
deadLetterQueue?: string | undefined;
|
|
130
|
+
maxConcurrency?: number | undefined;
|
|
131
|
+
retryDelay?: number | undefined;
|
|
132
|
+
}>, "many">>;
|
|
133
|
+
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
producers?: Record<string, string> | undefined;
|
|
135
|
+
consumers?: {
|
|
136
|
+
queue: string;
|
|
137
|
+
maxBatchSize?: number | undefined;
|
|
138
|
+
maxBatchTimeout?: number | undefined;
|
|
139
|
+
maxRetries?: number | undefined;
|
|
140
|
+
deadLetterQueue?: string | undefined;
|
|
141
|
+
maxConcurrency?: number | undefined;
|
|
142
|
+
retryDelay?: number | undefined;
|
|
143
|
+
}[] | undefined;
|
|
144
|
+
}, {
|
|
145
|
+
producers?: Record<string, string> | undefined;
|
|
146
|
+
consumers?: {
|
|
147
|
+
queue: string;
|
|
148
|
+
maxBatchSize?: number | undefined;
|
|
149
|
+
maxBatchTimeout?: number | undefined;
|
|
150
|
+
maxRetries?: number | undefined;
|
|
151
|
+
deadLetterQueue?: string | undefined;
|
|
152
|
+
maxConcurrency?: number | undefined;
|
|
153
|
+
retryDelay?: number | undefined;
|
|
154
|
+
}[] | undefined;
|
|
155
|
+
}>;
|
|
156
|
+
/**
|
|
157
|
+
* Service binding schema.
|
|
158
|
+
* Binds to another Worker for RPC-style communication.
|
|
159
|
+
* Accepts plain objects or WorkerBinding from ref().worker.
|
|
160
|
+
*/
|
|
161
|
+
declare const serviceBindingSchema: z.ZodType<{
|
|
162
|
+
/** Target worker/service name */
|
|
163
|
+
service: string;
|
|
164
|
+
/** Optional environment (staging, production, etc.) */
|
|
165
|
+
environment?: string | undefined;
|
|
166
|
+
/** Optional entrypoint class name for named exports */
|
|
167
|
+
entrypoint?: string | undefined;
|
|
168
|
+
/** @internal Reference marker for ref() bindings */
|
|
169
|
+
__ref?: unknown;
|
|
170
|
+
}, z.ZodTypeDef, {
|
|
171
|
+
/** Target worker/service name */
|
|
172
|
+
service: string;
|
|
173
|
+
/** Optional environment (staging, production, etc.) */
|
|
174
|
+
environment?: string | undefined;
|
|
175
|
+
/** Optional entrypoint class name for named exports */
|
|
176
|
+
entrypoint?: string | undefined;
|
|
177
|
+
/** @internal Reference marker for ref() bindings */
|
|
178
|
+
__ref?: unknown;
|
|
179
|
+
}>;
|
|
180
|
+
/**
|
|
181
|
+
* Route configuration for worker deployment.
|
|
182
|
+
* Defines URL patterns that trigger the worker.
|
|
183
|
+
* @see https://developers.cloudflare.com/workers/configuration/routing/routes/
|
|
184
|
+
*/
|
|
185
|
+
declare const routeConfigSchema: z.ZodObject<{
|
|
186
|
+
/**
|
|
187
|
+
* URL pattern to match (e.g., 'example.com/*').
|
|
188
|
+
* Supports wildcards (*) for path matching.
|
|
189
|
+
*/
|
|
190
|
+
pattern: z.ZodString;
|
|
191
|
+
/** Zone name to associate the route with */
|
|
192
|
+
zone_name: z.ZodOptional<z.ZodString>;
|
|
193
|
+
/** Zone ID to associate the route with (alternative to zone_name) */
|
|
194
|
+
zone_id: z.ZodOptional<z.ZodString>;
|
|
195
|
+
/** Whether this is a custom domain route */
|
|
196
|
+
custom_domain: z.ZodOptional<z.ZodBoolean>;
|
|
197
|
+
}, "strip", z.ZodTypeAny, {
|
|
198
|
+
pattern: string;
|
|
199
|
+
zone_name?: string | undefined;
|
|
200
|
+
zone_id?: string | undefined;
|
|
201
|
+
custom_domain?: boolean | undefined;
|
|
202
|
+
}, {
|
|
203
|
+
pattern: string;
|
|
204
|
+
zone_name?: string | undefined;
|
|
205
|
+
zone_id?: string | undefined;
|
|
206
|
+
custom_domain?: boolean | undefined;
|
|
207
|
+
}>;
|
|
208
|
+
/**
|
|
209
|
+
* WebSocket route configuration for dev mode Durable Object proxying.
|
|
210
|
+
* Enables WebSocket connections to DOs in local development.
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```ts
|
|
214
|
+
* wsRoutes: [{
|
|
215
|
+
* pattern: '/chat/api',
|
|
216
|
+
* doNamespace: 'CHAT_ROOM',
|
|
217
|
+
* idParam: 'roomId',
|
|
218
|
+
* forwardPath: '/websocket'
|
|
219
|
+
* }]
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
222
|
+
declare const wsRouteConfigSchema: z.ZodObject<{
|
|
223
|
+
/**
|
|
224
|
+
* URL pattern to match for WebSocket upgrade requests.
|
|
225
|
+
* @example '/chat/api'
|
|
226
|
+
*/
|
|
227
|
+
pattern: z.ZodString;
|
|
228
|
+
/**
|
|
229
|
+
* Durable Object namespace binding name to route to.
|
|
230
|
+
* Must match a binding name in bindings.durableObjects.
|
|
231
|
+
*/
|
|
232
|
+
doNamespace: z.ZodString;
|
|
233
|
+
/**
|
|
234
|
+
* Query parameter name used to identify DO instances.
|
|
235
|
+
* @default 'id'
|
|
236
|
+
* @example `/chat/api?roomId=room123`
|
|
237
|
+
*/
|
|
238
|
+
idParam: z.ZodDefault<z.ZodString>;
|
|
239
|
+
/**
|
|
240
|
+
* Path to forward within the Durable Object.
|
|
241
|
+
* @default '/websocket'
|
|
242
|
+
*/
|
|
243
|
+
forwardPath: z.ZodDefault<z.ZodString>;
|
|
244
|
+
}, "strip", z.ZodTypeAny, {
|
|
245
|
+
pattern: string;
|
|
246
|
+
doNamespace: string;
|
|
247
|
+
idParam: string;
|
|
248
|
+
forwardPath: string;
|
|
249
|
+
}, {
|
|
250
|
+
pattern: string;
|
|
251
|
+
doNamespace: string;
|
|
252
|
+
idParam?: string | undefined;
|
|
253
|
+
forwardPath?: string | undefined;
|
|
254
|
+
}>;
|
|
255
|
+
/**
|
|
256
|
+
* Static assets configuration.
|
|
257
|
+
* Serves static files from a directory alongside your worker.
|
|
258
|
+
* @see https://developers.cloudflare.com/workers/static-assets/
|
|
259
|
+
*/
|
|
260
|
+
declare const assetsConfigSchema: z.ZodOptional<z.ZodObject<{
|
|
261
|
+
/** Directory containing static assets (relative to config file) */
|
|
262
|
+
directory: z.ZodString;
|
|
263
|
+
/**
|
|
264
|
+
* Optional binding name to access assets programmatically.
|
|
265
|
+
* If provided, assets can be fetched via env[binding].fetch()
|
|
266
|
+
*/
|
|
267
|
+
binding: z.ZodOptional<z.ZodString>;
|
|
268
|
+
}, "strip", z.ZodTypeAny, {
|
|
269
|
+
directory: string;
|
|
270
|
+
binding?: string | undefined;
|
|
271
|
+
}, {
|
|
272
|
+
directory: string;
|
|
273
|
+
binding?: string | undefined;
|
|
274
|
+
}>>;
|
|
275
|
+
/**
|
|
276
|
+
* Build configuration for worker bundling.
|
|
277
|
+
* Controls esbuild/rolldown options for worker compilation.
|
|
278
|
+
*/
|
|
279
|
+
declare const buildConfigSchema: z.ZodOptional<z.ZodObject<{
|
|
280
|
+
/**
|
|
281
|
+
* Build target environment.
|
|
282
|
+
* @example 'es2022'
|
|
283
|
+
*/
|
|
284
|
+
target: z.ZodOptional<z.ZodString>;
|
|
285
|
+
/** Enable minification for smaller bundle size */
|
|
286
|
+
minify: z.ZodOptional<z.ZodBoolean>;
|
|
287
|
+
/** Generate source maps for debugging */
|
|
288
|
+
sourcemap: z.ZodOptional<z.ZodBoolean>;
|
|
289
|
+
/**
|
|
290
|
+
* Additional Rolldown bundler options.
|
|
291
|
+
* @see https://rolldown.rs/
|
|
292
|
+
*/
|
|
293
|
+
rolldownOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
294
|
+
}, "strip", z.ZodTypeAny, {
|
|
295
|
+
target?: string | undefined;
|
|
296
|
+
minify?: boolean | undefined;
|
|
297
|
+
sourcemap?: boolean | undefined;
|
|
298
|
+
rolldownOptions?: Record<string, unknown> | undefined;
|
|
299
|
+
}, {
|
|
300
|
+
target?: string | undefined;
|
|
301
|
+
minify?: boolean | undefined;
|
|
302
|
+
sourcemap?: boolean | undefined;
|
|
303
|
+
rolldownOptions?: Record<string, unknown> | undefined;
|
|
304
|
+
}>>;
|
|
305
|
+
/**
|
|
306
|
+
* Durable Object migration configuration.
|
|
307
|
+
* Required when changing DO class names or storage backends.
|
|
308
|
+
* @see https://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/
|
|
309
|
+
*/
|
|
310
|
+
declare const migrationSchema: z.ZodObject<{
|
|
311
|
+
/**
|
|
312
|
+
* Migration tag (version identifier).
|
|
313
|
+
* Must be unique and in chronological order.
|
|
314
|
+
* @example 'v1', 'v2'
|
|
315
|
+
*/
|
|
316
|
+
tag: z.ZodString;
|
|
317
|
+
/**
|
|
318
|
+
* New DO classes introduced in this migration.
|
|
319
|
+
* Classes that didn't exist before.
|
|
320
|
+
*/
|
|
321
|
+
new_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
322
|
+
/**
|
|
323
|
+
* Classes being renamed.
|
|
324
|
+
* State is preserved during rename.
|
|
325
|
+
*/
|
|
326
|
+
renamed_classes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
327
|
+
from: z.ZodString;
|
|
328
|
+
to: z.ZodString;
|
|
329
|
+
}, "strip", z.ZodTypeAny, {
|
|
330
|
+
from: string;
|
|
331
|
+
to: string;
|
|
332
|
+
}, {
|
|
333
|
+
from: string;
|
|
334
|
+
to: string;
|
|
335
|
+
}>, "many">>;
|
|
336
|
+
/**
|
|
337
|
+
* Classes being deleted.
|
|
338
|
+
* ⚠️ All state in these classes will be lost!
|
|
339
|
+
*/
|
|
340
|
+
deleted_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
341
|
+
/**
|
|
342
|
+
* Classes migrating to SQLite storage backend.
|
|
343
|
+
* Enables SQL API for these DO classes.
|
|
344
|
+
*/
|
|
345
|
+
new_sqlite_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
346
|
+
}, "strip", z.ZodTypeAny, {
|
|
347
|
+
tag: string;
|
|
348
|
+
new_classes?: string[] | undefined;
|
|
349
|
+
renamed_classes?: {
|
|
350
|
+
from: string;
|
|
351
|
+
to: string;
|
|
352
|
+
}[] | undefined;
|
|
353
|
+
deleted_classes?: string[] | undefined;
|
|
354
|
+
new_sqlite_classes?: string[] | undefined;
|
|
355
|
+
}, {
|
|
356
|
+
tag: string;
|
|
357
|
+
new_classes?: string[] | undefined;
|
|
358
|
+
renamed_classes?: {
|
|
359
|
+
from: string;
|
|
360
|
+
to: string;
|
|
361
|
+
}[] | undefined;
|
|
362
|
+
deleted_classes?: string[] | undefined;
|
|
363
|
+
new_sqlite_classes?: string[] | undefined;
|
|
364
|
+
}>;
|
|
365
|
+
/**
|
|
366
|
+
* Environment-specific configuration overrides.
|
|
367
|
+
* Allows different settings per deployment environment (staging, production, etc.).
|
|
368
|
+
*
|
|
369
|
+
* All fields are optional — only specify what differs from the base config.
|
|
370
|
+
*
|
|
371
|
+
* @example
|
|
372
|
+
* ```ts
|
|
373
|
+
* env: {
|
|
374
|
+
* production: {
|
|
375
|
+
* vars: { LOG_LEVEL: 'error' }
|
|
376
|
+
* },
|
|
377
|
+
* staging: {
|
|
378
|
+
* vars: { LOG_LEVEL: 'debug' }
|
|
379
|
+
* }
|
|
380
|
+
* }
|
|
381
|
+
* ```
|
|
382
|
+
*/
|
|
383
|
+
declare const envConfigSchemaInner: z.ZodObject<{
|
|
384
|
+
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
385
|
+
compatibilityDate: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
386
|
+
compatibilityFlags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
387
|
+
files: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
388
|
+
/**
|
|
389
|
+
* Main fetch handler file path.
|
|
390
|
+
* This handles HTTP requests to your worker.
|
|
391
|
+
* @default 'src/fetch.{ts,js}'
|
|
392
|
+
* @example 'src/fetch.ts'
|
|
393
|
+
*/
|
|
394
|
+
fetch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
395
|
+
/**
|
|
396
|
+
* Queue consumer handler file path.
|
|
397
|
+
* Handles messages from Cloudflare Queues.
|
|
398
|
+
* @default 'src/queue.ts'
|
|
399
|
+
* @example 'src/queue.ts'
|
|
400
|
+
*/
|
|
401
|
+
queue: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
402
|
+
/**
|
|
403
|
+
* Scheduled (cron) handler file path.
|
|
404
|
+
* Handles cron trigger invocations.
|
|
405
|
+
* @default 'src/scheduled.ts'
|
|
406
|
+
* @example 'src/scheduled.ts'
|
|
407
|
+
*/
|
|
408
|
+
scheduled: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
409
|
+
/**
|
|
410
|
+
* Email handler file path.
|
|
411
|
+
* Handles incoming emails via Email Routing.
|
|
412
|
+
* @default 'src/email.ts'
|
|
413
|
+
* @example 'src/email.ts'
|
|
414
|
+
*/
|
|
415
|
+
email: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
416
|
+
/**
|
|
417
|
+
* Durable Object class discovery glob pattern.
|
|
418
|
+
* Files matching this pattern are scanned for DO classes.
|
|
419
|
+
* Respects `.gitignore` automatically.
|
|
420
|
+
*
|
|
421
|
+
* @default `**/do.*.{ts,js}` (recursive)
|
|
422
|
+
* @example `**/do.*.{ts,js}` — Matches src/do.counter.ts, lib/do.chat.ts
|
|
423
|
+
* @example `src/do.*.ts` — Legacy single-directory pattern
|
|
424
|
+
*/
|
|
425
|
+
durableObjects: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
426
|
+
/**
|
|
427
|
+
* WorkerEntrypoint class discovery glob pattern.
|
|
428
|
+
* Files matching this pattern are scanned for named entrypoint classes.
|
|
429
|
+
* Respects `.gitignore` automatically.
|
|
430
|
+
*
|
|
431
|
+
* Entrypoints enable typed cross-worker RPC via service bindings:
|
|
432
|
+
* ```ts
|
|
433
|
+
* // ep.admin.ts
|
|
434
|
+
* export class AdminEntrypoint extends WorkerEntrypoint {
|
|
435
|
+
* async getStats() { return { users: 100 } }
|
|
436
|
+
* }
|
|
437
|
+
*
|
|
438
|
+
* // Consumer worker
|
|
439
|
+
* const stats = await env.ADMIN_SERVICE.getStats()
|
|
440
|
+
* ```
|
|
441
|
+
*
|
|
442
|
+
* @default `**/ep.*.{ts,js}` (recursive)
|
|
443
|
+
* @example `**/ep.*.{ts,js}` — Matches src/ep.admin.ts, lib/ep.auth.ts
|
|
444
|
+
* @example `src/ep.*.ts` — Legacy single-directory pattern
|
|
445
|
+
*/
|
|
446
|
+
entrypoints: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
447
|
+
/**
|
|
448
|
+
* Workflow class discovery glob pattern.
|
|
449
|
+
* Files matching this pattern are scanned for Workflow classes.
|
|
450
|
+
* Respects `.gitignore` automatically.
|
|
451
|
+
*
|
|
452
|
+
* Workflows enable durable multi-step execution with automatic retries:
|
|
453
|
+
* ```ts
|
|
454
|
+
* // wf.order-processor.ts
|
|
455
|
+
* export class OrderProcessingWorkflow extends Workflow {
|
|
456
|
+
* async run(event, step) {
|
|
457
|
+
* const validated = await step.do('validate', () => validate(event.payload))
|
|
458
|
+
* const charged = await step.do('charge', () => charge(validated))
|
|
459
|
+
* return { orderId: charged.id }
|
|
460
|
+
* }
|
|
461
|
+
* }
|
|
462
|
+
* ```
|
|
463
|
+
*
|
|
464
|
+
* @default `**/wf.*.{ts,js}` (recursive)
|
|
465
|
+
* @example `**/wf.*.{ts,js}` — Matches src/wf.order.ts, lib/wf.pipeline.ts
|
|
466
|
+
* @example `src/wf.*.ts` — Legacy single-directory pattern
|
|
467
|
+
*/
|
|
468
|
+
workflows: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
469
|
+
/**
|
|
470
|
+
* File-based routing configuration.
|
|
471
|
+
* Enables automatic route discovery from a directory.
|
|
472
|
+
*
|
|
473
|
+
* Directory structure maps to URL paths:
|
|
474
|
+
* ```
|
|
475
|
+
* src/routes/
|
|
476
|
+
* ├── index.ts → GET /
|
|
477
|
+
* ├── users/
|
|
478
|
+
* │ ├── index.ts → GET /users POST /users
|
|
479
|
+
* │ ├── [id].ts → GET /users/:id
|
|
480
|
+
* │ └── [id]/
|
|
481
|
+
* │ └── posts.ts → GET /users/:id/posts
|
|
482
|
+
* └── api/
|
|
483
|
+
* └── health.ts → GET /api/health
|
|
484
|
+
* ```
|
|
485
|
+
*
|
|
486
|
+
* Each file exports HTTP method handlers:
|
|
487
|
+
* ```ts
|
|
488
|
+
* export function GET(req: Request, env: Env) { ... }
|
|
489
|
+
* export function POST(req: Request, env: Env) { ... }
|
|
490
|
+
* ```
|
|
491
|
+
*/
|
|
492
|
+
routes: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
493
|
+
/** Directory containing route files (e.g., 'src/routes') */
|
|
494
|
+
dir: z.ZodString;
|
|
495
|
+
/** Optional URL prefix for all routes (e.g., '/api') */
|
|
496
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
497
|
+
}, "strip", z.ZodTypeAny, {
|
|
498
|
+
dir: string;
|
|
499
|
+
prefix?: string | undefined;
|
|
500
|
+
}, {
|
|
501
|
+
dir: string;
|
|
502
|
+
prefix?: string | undefined;
|
|
503
|
+
}>, z.ZodLiteral<false>]>>;
|
|
504
|
+
/**
|
|
505
|
+
* Transport file for custom RPC serialization.
|
|
506
|
+
* Implements SvelteKit-style encode/decode for complex types.
|
|
507
|
+
* @default 'src/transport.ts'
|
|
508
|
+
* @example 'src/transport.ts'
|
|
509
|
+
*/
|
|
510
|
+
transport: z.ZodOptional<z.ZodString>;
|
|
511
|
+
}, "strip", z.ZodTypeAny, {
|
|
512
|
+
fetch?: string | false | undefined;
|
|
513
|
+
queue?: string | false | undefined;
|
|
514
|
+
scheduled?: string | false | undefined;
|
|
515
|
+
email?: string | false | undefined;
|
|
516
|
+
durableObjects?: string | false | undefined;
|
|
517
|
+
entrypoints?: string | false | undefined;
|
|
518
|
+
workflows?: string | false | undefined;
|
|
519
|
+
routes?: false | {
|
|
520
|
+
dir: string;
|
|
521
|
+
prefix?: string | undefined;
|
|
522
|
+
} | undefined;
|
|
523
|
+
transport?: string | undefined;
|
|
524
|
+
}, {
|
|
525
|
+
fetch?: string | false | undefined;
|
|
526
|
+
queue?: string | false | undefined;
|
|
527
|
+
scheduled?: string | false | undefined;
|
|
528
|
+
email?: string | false | undefined;
|
|
529
|
+
durableObjects?: string | false | undefined;
|
|
530
|
+
entrypoints?: string | false | undefined;
|
|
531
|
+
workflows?: string | false | undefined;
|
|
532
|
+
routes?: false | {
|
|
533
|
+
dir: string;
|
|
534
|
+
prefix?: string | undefined;
|
|
535
|
+
} | undefined;
|
|
536
|
+
transport?: string | undefined;
|
|
537
|
+
}>>>;
|
|
538
|
+
bindings: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
539
|
+
/**
|
|
540
|
+
* KV Namespace bindings.
|
|
541
|
+
* Maps binding name to KV namespace ID.
|
|
542
|
+
* @example { CACHE: 'cache-kv-namespace-id' }
|
|
543
|
+
*/
|
|
544
|
+
kv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
545
|
+
/**
|
|
546
|
+
* D1 Database bindings.
|
|
547
|
+
* Maps binding name to D1 database ID.
|
|
548
|
+
* @example { DB: 'main-database-id' }
|
|
549
|
+
*/
|
|
550
|
+
d1: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
551
|
+
/**
|
|
552
|
+
* R2 Bucket bindings.
|
|
553
|
+
* Maps binding name to R2 bucket name.
|
|
554
|
+
* @example { IMAGES: 'images-bucket' }
|
|
555
|
+
*/
|
|
556
|
+
r2: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
557
|
+
/**
|
|
558
|
+
* Durable Object bindings.
|
|
559
|
+
* Maps binding name to DO class configuration.
|
|
560
|
+
* @example { COUNTER: 'Counter' } or { COUNTER: { className: 'Counter' } }
|
|
561
|
+
*/
|
|
562
|
+
durableObjects: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<DurableObjectBindingInput, z.ZodTypeDef, DurableObjectBindingInput>>>;
|
|
563
|
+
/**
|
|
564
|
+
* Queue bindings for producers and consumers.
|
|
565
|
+
*/
|
|
566
|
+
queues: z.ZodOptional<z.ZodObject<{
|
|
567
|
+
/**
|
|
568
|
+
* Queue producer bindings.
|
|
569
|
+
* Maps binding name to queue name.
|
|
570
|
+
* @example { TASK_QUEUE: 'task-queue' }
|
|
571
|
+
*/
|
|
572
|
+
producers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
573
|
+
/**
|
|
574
|
+
* Queue consumer configurations.
|
|
575
|
+
* Array of consumer configs for processing queue messages.
|
|
576
|
+
*/
|
|
577
|
+
consumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
578
|
+
/** Queue name to consume from */
|
|
579
|
+
queue: z.ZodString;
|
|
580
|
+
/**
|
|
581
|
+
* Maximum messages per batch (1-100).
|
|
582
|
+
* @default 10
|
|
583
|
+
*/
|
|
584
|
+
maxBatchSize: z.ZodOptional<z.ZodNumber>;
|
|
585
|
+
/**
|
|
586
|
+
* Maximum seconds to wait for a full batch.
|
|
587
|
+
* @default 5
|
|
588
|
+
*/
|
|
589
|
+
maxBatchTimeout: z.ZodOptional<z.ZodNumber>;
|
|
590
|
+
/**
|
|
591
|
+
* Maximum retry attempts for failed messages.
|
|
592
|
+
* @default 3
|
|
593
|
+
*/
|
|
594
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
595
|
+
/** Queue name to send failed messages after max retries */
|
|
596
|
+
deadLetterQueue: z.ZodOptional<z.ZodString>;
|
|
597
|
+
/** Maximum concurrent batch invocations */
|
|
598
|
+
maxConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
599
|
+
/** Delay in seconds between retries */
|
|
600
|
+
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
601
|
+
}, "strip", z.ZodTypeAny, {
|
|
602
|
+
queue: string;
|
|
603
|
+
maxBatchSize?: number | undefined;
|
|
604
|
+
maxBatchTimeout?: number | undefined;
|
|
605
|
+
maxRetries?: number | undefined;
|
|
606
|
+
deadLetterQueue?: string | undefined;
|
|
607
|
+
maxConcurrency?: number | undefined;
|
|
608
|
+
retryDelay?: number | undefined;
|
|
609
|
+
}, {
|
|
610
|
+
queue: string;
|
|
611
|
+
maxBatchSize?: number | undefined;
|
|
612
|
+
maxBatchTimeout?: number | undefined;
|
|
613
|
+
maxRetries?: number | undefined;
|
|
614
|
+
deadLetterQueue?: string | undefined;
|
|
615
|
+
maxConcurrency?: number | undefined;
|
|
616
|
+
retryDelay?: number | undefined;
|
|
617
|
+
}>, "many">>;
|
|
618
|
+
}, "strip", z.ZodTypeAny, {
|
|
619
|
+
producers?: Record<string, string> | undefined;
|
|
620
|
+
consumers?: {
|
|
621
|
+
queue: string;
|
|
622
|
+
maxBatchSize?: number | undefined;
|
|
623
|
+
maxBatchTimeout?: number | undefined;
|
|
624
|
+
maxRetries?: number | undefined;
|
|
625
|
+
deadLetterQueue?: string | undefined;
|
|
626
|
+
maxConcurrency?: number | undefined;
|
|
627
|
+
retryDelay?: number | undefined;
|
|
628
|
+
}[] | undefined;
|
|
629
|
+
}, {
|
|
630
|
+
producers?: Record<string, string> | undefined;
|
|
631
|
+
consumers?: {
|
|
632
|
+
queue: string;
|
|
633
|
+
maxBatchSize?: number | undefined;
|
|
634
|
+
maxBatchTimeout?: number | undefined;
|
|
635
|
+
maxRetries?: number | undefined;
|
|
636
|
+
deadLetterQueue?: string | undefined;
|
|
637
|
+
maxConcurrency?: number | undefined;
|
|
638
|
+
retryDelay?: number | undefined;
|
|
639
|
+
}[] | undefined;
|
|
640
|
+
}>>;
|
|
641
|
+
/**
|
|
642
|
+
* Service bindings to other Workers.
|
|
643
|
+
* Enables RPC-style communication between workers.
|
|
644
|
+
* @example { MATH: mathWorker.worker }
|
|
645
|
+
*/
|
|
646
|
+
services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<{
|
|
647
|
+
/** Target worker/service name */
|
|
648
|
+
service: string;
|
|
649
|
+
/** Optional environment (staging, production, etc.) */
|
|
650
|
+
environment?: string | undefined;
|
|
651
|
+
/** Optional entrypoint class name for named exports */
|
|
652
|
+
entrypoint?: string | undefined;
|
|
653
|
+
/** @internal Reference marker for ref() bindings */
|
|
654
|
+
__ref?: unknown;
|
|
655
|
+
}, z.ZodTypeDef, {
|
|
656
|
+
/** Target worker/service name */
|
|
657
|
+
service: string;
|
|
658
|
+
/** Optional environment (staging, production, etc.) */
|
|
659
|
+
environment?: string | undefined;
|
|
660
|
+
/** Optional entrypoint class name for named exports */
|
|
661
|
+
entrypoint?: string | undefined;
|
|
662
|
+
/** @internal Reference marker for ref() bindings */
|
|
663
|
+
__ref?: unknown;
|
|
664
|
+
}>>>;
|
|
665
|
+
/**
|
|
666
|
+
* Workers AI binding for ML inference.
|
|
667
|
+
* @example { binding: 'AI' }
|
|
668
|
+
*/
|
|
669
|
+
ai: z.ZodOptional<z.ZodObject<{
|
|
670
|
+
/** Binding name exposed in env (e.g., 'AI') */
|
|
671
|
+
binding: z.ZodString;
|
|
672
|
+
}, "strip", z.ZodTypeAny, {
|
|
673
|
+
binding: string;
|
|
674
|
+
}, {
|
|
675
|
+
binding: string;
|
|
676
|
+
}>>;
|
|
677
|
+
/**
|
|
678
|
+
* Vectorize index bindings for vector similarity search.
|
|
679
|
+
* @example { EMBEDDINGS: { indexName: 'my-index' } }
|
|
680
|
+
*/
|
|
681
|
+
vectorize: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
682
|
+
/** Name of the Vectorize index */
|
|
683
|
+
indexName: z.ZodString;
|
|
684
|
+
}, "strip", z.ZodTypeAny, {
|
|
685
|
+
indexName: string;
|
|
686
|
+
}, {
|
|
687
|
+
indexName: string;
|
|
688
|
+
}>>>;
|
|
689
|
+
/**
|
|
690
|
+
* Hyperdrive bindings for accelerated PostgreSQL.
|
|
691
|
+
* @example { DB: { id: 'hyperdrive-config-id' } }
|
|
692
|
+
*/
|
|
693
|
+
hyperdrive: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
694
|
+
/** Hyperdrive configuration ID */
|
|
695
|
+
id: z.ZodString;
|
|
696
|
+
}, "strip", z.ZodTypeAny, {
|
|
697
|
+
id: string;
|
|
698
|
+
}, {
|
|
699
|
+
id: string;
|
|
700
|
+
}>>>;
|
|
701
|
+
/**
|
|
702
|
+
* Browser Rendering binding for headless browser access.
|
|
703
|
+
* @example { binding: 'BROWSER' }
|
|
704
|
+
*/
|
|
705
|
+
browser: z.ZodOptional<z.ZodObject<{
|
|
706
|
+
/** Binding name exposed in env (e.g., 'BROWSER') */
|
|
707
|
+
binding: z.ZodString;
|
|
708
|
+
}, "strip", z.ZodTypeAny, {
|
|
709
|
+
binding: string;
|
|
710
|
+
}, {
|
|
711
|
+
binding: string;
|
|
712
|
+
}>>;
|
|
713
|
+
/**
|
|
714
|
+
* Analytics Engine bindings for event logging.
|
|
715
|
+
* @example { ANALYTICS: { dataset: 'my-dataset' } }
|
|
716
|
+
*/
|
|
717
|
+
analyticsEngine: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
718
|
+
/** Analytics Engine dataset name */
|
|
719
|
+
dataset: z.ZodString;
|
|
720
|
+
}, "strip", z.ZodTypeAny, {
|
|
721
|
+
dataset: string;
|
|
722
|
+
}, {
|
|
723
|
+
dataset: string;
|
|
724
|
+
}>>>;
|
|
725
|
+
/**
|
|
726
|
+
* Email sending bindings.
|
|
727
|
+
* @example { EMAIL: { destinationAddress: 'admin@example.com' } }
|
|
728
|
+
*/
|
|
729
|
+
sendEmail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
730
|
+
/** Default destination address (can be overridden per-send) */
|
|
731
|
+
destinationAddress: z.ZodOptional<z.ZodString>;
|
|
732
|
+
}, "strip", z.ZodTypeAny, {
|
|
733
|
+
destinationAddress?: string | undefined;
|
|
734
|
+
}, {
|
|
735
|
+
destinationAddress?: string | undefined;
|
|
736
|
+
}>>>;
|
|
737
|
+
}, "strip", z.ZodTypeAny, {
|
|
738
|
+
kv?: Record<string, string> | undefined;
|
|
739
|
+
d1?: Record<string, string> | undefined;
|
|
740
|
+
r2?: Record<string, string> | undefined;
|
|
741
|
+
durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
|
|
742
|
+
queues?: {
|
|
743
|
+
producers?: Record<string, string> | undefined;
|
|
744
|
+
consumers?: {
|
|
745
|
+
queue: string;
|
|
746
|
+
maxBatchSize?: number | undefined;
|
|
747
|
+
maxBatchTimeout?: number | undefined;
|
|
748
|
+
maxRetries?: number | undefined;
|
|
749
|
+
deadLetterQueue?: string | undefined;
|
|
750
|
+
maxConcurrency?: number | undefined;
|
|
751
|
+
retryDelay?: number | undefined;
|
|
752
|
+
}[] | undefined;
|
|
753
|
+
} | undefined;
|
|
754
|
+
services?: Record<string, {
|
|
755
|
+
/** Target worker/service name */
|
|
756
|
+
service: string;
|
|
757
|
+
/** Optional environment (staging, production, etc.) */
|
|
758
|
+
environment?: string | undefined;
|
|
759
|
+
/** Optional entrypoint class name for named exports */
|
|
760
|
+
entrypoint?: string | undefined;
|
|
761
|
+
/** @internal Reference marker for ref() bindings */
|
|
762
|
+
__ref?: unknown;
|
|
763
|
+
}> | undefined;
|
|
764
|
+
ai?: {
|
|
765
|
+
binding: string;
|
|
766
|
+
} | undefined;
|
|
767
|
+
vectorize?: Record<string, {
|
|
768
|
+
indexName: string;
|
|
769
|
+
}> | undefined;
|
|
770
|
+
hyperdrive?: Record<string, {
|
|
771
|
+
id: string;
|
|
772
|
+
}> | undefined;
|
|
773
|
+
browser?: {
|
|
774
|
+
binding: string;
|
|
775
|
+
} | undefined;
|
|
776
|
+
analyticsEngine?: Record<string, {
|
|
777
|
+
dataset: string;
|
|
778
|
+
}> | undefined;
|
|
779
|
+
sendEmail?: Record<string, {
|
|
780
|
+
destinationAddress?: string | undefined;
|
|
781
|
+
}> | undefined;
|
|
782
|
+
}, {
|
|
783
|
+
kv?: Record<string, string> | undefined;
|
|
784
|
+
d1?: Record<string, string> | undefined;
|
|
785
|
+
r2?: Record<string, string> | undefined;
|
|
786
|
+
durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
|
|
787
|
+
queues?: {
|
|
788
|
+
producers?: Record<string, string> | undefined;
|
|
789
|
+
consumers?: {
|
|
790
|
+
queue: string;
|
|
791
|
+
maxBatchSize?: number | undefined;
|
|
792
|
+
maxBatchTimeout?: number | undefined;
|
|
793
|
+
maxRetries?: number | undefined;
|
|
794
|
+
deadLetterQueue?: string | undefined;
|
|
795
|
+
maxConcurrency?: number | undefined;
|
|
796
|
+
retryDelay?: number | undefined;
|
|
797
|
+
}[] | undefined;
|
|
798
|
+
} | undefined;
|
|
799
|
+
services?: Record<string, {
|
|
800
|
+
/** Target worker/service name */
|
|
801
|
+
service: string;
|
|
802
|
+
/** Optional environment (staging, production, etc.) */
|
|
803
|
+
environment?: string | undefined;
|
|
804
|
+
/** Optional entrypoint class name for named exports */
|
|
805
|
+
entrypoint?: string | undefined;
|
|
806
|
+
/** @internal Reference marker for ref() bindings */
|
|
807
|
+
__ref?: unknown;
|
|
808
|
+
}> | undefined;
|
|
809
|
+
ai?: {
|
|
810
|
+
binding: string;
|
|
811
|
+
} | undefined;
|
|
812
|
+
vectorize?: Record<string, {
|
|
813
|
+
indexName: string;
|
|
814
|
+
}> | undefined;
|
|
815
|
+
hyperdrive?: Record<string, {
|
|
816
|
+
id: string;
|
|
817
|
+
}> | undefined;
|
|
818
|
+
browser?: {
|
|
819
|
+
binding: string;
|
|
820
|
+
} | undefined;
|
|
821
|
+
analyticsEngine?: Record<string, {
|
|
822
|
+
dataset: string;
|
|
823
|
+
}> | undefined;
|
|
824
|
+
sendEmail?: Record<string, {
|
|
825
|
+
destinationAddress?: string | undefined;
|
|
826
|
+
}> | undefined;
|
|
827
|
+
}>>>;
|
|
828
|
+
triggers: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
829
|
+
/**
|
|
830
|
+
* Array of cron expressions for scheduled execution.
|
|
831
|
+
*
|
|
832
|
+
* Examples:
|
|
833
|
+
* - `'0 0 * * *'` — Daily at midnight
|
|
834
|
+
* - `'0/5 * * * *'` — Every 5 minutes
|
|
835
|
+
* - `'0 9 * * 1'` — Every Monday at 9am
|
|
836
|
+
*/
|
|
837
|
+
crons: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
838
|
+
}, "strip", z.ZodTypeAny, {
|
|
839
|
+
crons?: string[] | undefined;
|
|
840
|
+
}, {
|
|
841
|
+
crons?: string[] | undefined;
|
|
842
|
+
}>>>;
|
|
843
|
+
vars: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
844
|
+
secrets: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
845
|
+
/**
|
|
846
|
+
* Whether this secret is required for the worker to run.
|
|
847
|
+
* If true, worker will fail to start if secret is missing.
|
|
848
|
+
* @default true
|
|
849
|
+
*/
|
|
850
|
+
required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
851
|
+
}, "strip", z.ZodTypeAny, {
|
|
852
|
+
required: boolean;
|
|
853
|
+
}, {
|
|
854
|
+
required?: boolean | undefined;
|
|
855
|
+
}>>>>;
|
|
856
|
+
routes: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
857
|
+
/**
|
|
858
|
+
* URL pattern to match (e.g., 'example.com/*').
|
|
859
|
+
* Supports wildcards (*) for path matching.
|
|
860
|
+
*/
|
|
861
|
+
pattern: z.ZodString;
|
|
862
|
+
/** Zone name to associate the route with */
|
|
863
|
+
zone_name: z.ZodOptional<z.ZodString>;
|
|
864
|
+
/** Zone ID to associate the route with (alternative to zone_name) */
|
|
865
|
+
zone_id: z.ZodOptional<z.ZodString>;
|
|
866
|
+
/** Whether this is a custom domain route */
|
|
867
|
+
custom_domain: z.ZodOptional<z.ZodBoolean>;
|
|
868
|
+
}, "strip", z.ZodTypeAny, {
|
|
869
|
+
pattern: string;
|
|
870
|
+
zone_name?: string | undefined;
|
|
871
|
+
zone_id?: string | undefined;
|
|
872
|
+
custom_domain?: boolean | undefined;
|
|
873
|
+
}, {
|
|
874
|
+
pattern: string;
|
|
875
|
+
zone_name?: string | undefined;
|
|
876
|
+
zone_id?: string | undefined;
|
|
877
|
+
custom_domain?: boolean | undefined;
|
|
878
|
+
}>, "many">>>;
|
|
879
|
+
assets: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
880
|
+
/** Directory containing static assets (relative to config file) */
|
|
881
|
+
directory: z.ZodString;
|
|
882
|
+
/**
|
|
883
|
+
* Optional binding name to access assets programmatically.
|
|
884
|
+
* If provided, assets can be fetched via env[binding].fetch()
|
|
885
|
+
*/
|
|
886
|
+
binding: z.ZodOptional<z.ZodString>;
|
|
887
|
+
}, "strip", z.ZodTypeAny, {
|
|
888
|
+
directory: string;
|
|
889
|
+
binding?: string | undefined;
|
|
890
|
+
}, {
|
|
891
|
+
directory: string;
|
|
892
|
+
binding?: string | undefined;
|
|
893
|
+
}>>>;
|
|
894
|
+
limits: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
895
|
+
/**
|
|
896
|
+
* Maximum CPU time in milliseconds.
|
|
897
|
+
* Only applicable to Workers with Usage Model set to Unbound.
|
|
898
|
+
*/
|
|
899
|
+
cpu_ms: z.ZodOptional<z.ZodNumber>;
|
|
900
|
+
}, "strip", z.ZodTypeAny, {
|
|
901
|
+
cpu_ms?: number | undefined;
|
|
902
|
+
}, {
|
|
903
|
+
cpu_ms?: number | undefined;
|
|
904
|
+
}>>>;
|
|
905
|
+
observability: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
906
|
+
/** Enable Worker Logs */
|
|
907
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
908
|
+
/**
|
|
909
|
+
* Head sampling rate for logs (0-1).
|
|
910
|
+
* 1.0 = log all requests, 0.1 = log 10% of requests.
|
|
911
|
+
*/
|
|
912
|
+
head_sampling_rate: z.ZodOptional<z.ZodNumber>;
|
|
913
|
+
}, "strip", z.ZodTypeAny, {
|
|
914
|
+
enabled?: boolean | undefined;
|
|
915
|
+
head_sampling_rate?: number | undefined;
|
|
916
|
+
}, {
|
|
917
|
+
enabled?: boolean | undefined;
|
|
918
|
+
head_sampling_rate?: number | undefined;
|
|
919
|
+
}>>>;
|
|
920
|
+
migrations: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
921
|
+
/**
|
|
922
|
+
* Migration tag (version identifier).
|
|
923
|
+
* Must be unique and in chronological order.
|
|
924
|
+
* @example 'v1', 'v2'
|
|
925
|
+
*/
|
|
926
|
+
tag: z.ZodString;
|
|
927
|
+
/**
|
|
928
|
+
* New DO classes introduced in this migration.
|
|
929
|
+
* Classes that didn't exist before.
|
|
930
|
+
*/
|
|
931
|
+
new_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
932
|
+
/**
|
|
933
|
+
* Classes being renamed.
|
|
934
|
+
* State is preserved during rename.
|
|
935
|
+
*/
|
|
936
|
+
renamed_classes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
937
|
+
from: z.ZodString;
|
|
938
|
+
to: z.ZodString;
|
|
939
|
+
}, "strip", z.ZodTypeAny, {
|
|
940
|
+
from: string;
|
|
941
|
+
to: string;
|
|
942
|
+
}, {
|
|
943
|
+
from: string;
|
|
944
|
+
to: string;
|
|
945
|
+
}>, "many">>;
|
|
946
|
+
/**
|
|
947
|
+
* Classes being deleted.
|
|
948
|
+
* ⚠️ All state in these classes will be lost!
|
|
949
|
+
*/
|
|
950
|
+
deleted_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
951
|
+
/**
|
|
952
|
+
* Classes migrating to SQLite storage backend.
|
|
953
|
+
* Enables SQL API for these DO classes.
|
|
954
|
+
*/
|
|
955
|
+
new_sqlite_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
956
|
+
}, "strip", z.ZodTypeAny, {
|
|
957
|
+
tag: string;
|
|
958
|
+
new_classes?: string[] | undefined;
|
|
959
|
+
renamed_classes?: {
|
|
960
|
+
from: string;
|
|
961
|
+
to: string;
|
|
962
|
+
}[] | undefined;
|
|
963
|
+
deleted_classes?: string[] | undefined;
|
|
964
|
+
new_sqlite_classes?: string[] | undefined;
|
|
965
|
+
}, {
|
|
966
|
+
tag: string;
|
|
967
|
+
new_classes?: string[] | undefined;
|
|
968
|
+
renamed_classes?: {
|
|
969
|
+
from: string;
|
|
970
|
+
to: string;
|
|
971
|
+
}[] | undefined;
|
|
972
|
+
deleted_classes?: string[] | undefined;
|
|
973
|
+
new_sqlite_classes?: string[] | undefined;
|
|
974
|
+
}>, "many">>>;
|
|
975
|
+
build: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
976
|
+
/**
|
|
977
|
+
* Build target environment.
|
|
978
|
+
* @example 'es2022'
|
|
979
|
+
*/
|
|
980
|
+
target: z.ZodOptional<z.ZodString>;
|
|
981
|
+
/** Enable minification for smaller bundle size */
|
|
982
|
+
minify: z.ZodOptional<z.ZodBoolean>;
|
|
983
|
+
/** Generate source maps for debugging */
|
|
984
|
+
sourcemap: z.ZodOptional<z.ZodBoolean>;
|
|
985
|
+
/**
|
|
986
|
+
* Additional Rolldown bundler options.
|
|
987
|
+
* @see https://rolldown.rs/
|
|
988
|
+
*/
|
|
989
|
+
rolldownOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
990
|
+
}, "strip", z.ZodTypeAny, {
|
|
991
|
+
target?: string | undefined;
|
|
992
|
+
minify?: boolean | undefined;
|
|
993
|
+
sourcemap?: boolean | undefined;
|
|
994
|
+
rolldownOptions?: Record<string, unknown> | undefined;
|
|
995
|
+
}, {
|
|
996
|
+
target?: string | undefined;
|
|
997
|
+
minify?: boolean | undefined;
|
|
998
|
+
sourcemap?: boolean | undefined;
|
|
999
|
+
rolldownOptions?: Record<string, unknown> | undefined;
|
|
1000
|
+
}>>>;
|
|
1001
|
+
wrangler: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
1002
|
+
/**
|
|
1003
|
+
* Arbitrary key-value pairs passed directly to wrangler.jsonc.
|
|
1004
|
+
* @example { placement: { mode: 'smart' } }
|
|
1005
|
+
*/
|
|
1006
|
+
passthrough: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1007
|
+
}, "strip", z.ZodTypeAny, {
|
|
1008
|
+
passthrough?: Record<string, unknown> | undefined;
|
|
1009
|
+
}, {
|
|
1010
|
+
passthrough?: Record<string, unknown> | undefined;
|
|
1011
|
+
}>>>;
|
|
1012
|
+
}, "strip", z.ZodTypeAny, {
|
|
1013
|
+
name?: string | undefined;
|
|
1014
|
+
compatibilityDate?: string | undefined;
|
|
1015
|
+
compatibilityFlags?: string[] | undefined;
|
|
1016
|
+
files?: {
|
|
1017
|
+
fetch?: string | false | undefined;
|
|
1018
|
+
queue?: string | false | undefined;
|
|
1019
|
+
scheduled?: string | false | undefined;
|
|
1020
|
+
email?: string | false | undefined;
|
|
1021
|
+
durableObjects?: string | false | undefined;
|
|
1022
|
+
entrypoints?: string | false | undefined;
|
|
1023
|
+
workflows?: string | false | undefined;
|
|
1024
|
+
routes?: false | {
|
|
1025
|
+
dir: string;
|
|
1026
|
+
prefix?: string | undefined;
|
|
1027
|
+
} | undefined;
|
|
1028
|
+
transport?: string | undefined;
|
|
1029
|
+
} | undefined;
|
|
1030
|
+
bindings?: {
|
|
1031
|
+
kv?: Record<string, string> | undefined;
|
|
1032
|
+
d1?: Record<string, string> | undefined;
|
|
1033
|
+
r2?: Record<string, string> | undefined;
|
|
1034
|
+
durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
|
|
1035
|
+
queues?: {
|
|
1036
|
+
producers?: Record<string, string> | undefined;
|
|
1037
|
+
consumers?: {
|
|
1038
|
+
queue: string;
|
|
1039
|
+
maxBatchSize?: number | undefined;
|
|
1040
|
+
maxBatchTimeout?: number | undefined;
|
|
1041
|
+
maxRetries?: number | undefined;
|
|
1042
|
+
deadLetterQueue?: string | undefined;
|
|
1043
|
+
maxConcurrency?: number | undefined;
|
|
1044
|
+
retryDelay?: number | undefined;
|
|
1045
|
+
}[] | undefined;
|
|
1046
|
+
} | undefined;
|
|
1047
|
+
services?: Record<string, {
|
|
1048
|
+
/** Target worker/service name */
|
|
1049
|
+
service: string;
|
|
1050
|
+
/** Optional environment (staging, production, etc.) */
|
|
1051
|
+
environment?: string | undefined;
|
|
1052
|
+
/** Optional entrypoint class name for named exports */
|
|
1053
|
+
entrypoint?: string | undefined;
|
|
1054
|
+
/** @internal Reference marker for ref() bindings */
|
|
1055
|
+
__ref?: unknown;
|
|
1056
|
+
}> | undefined;
|
|
1057
|
+
ai?: {
|
|
1058
|
+
binding: string;
|
|
1059
|
+
} | undefined;
|
|
1060
|
+
vectorize?: Record<string, {
|
|
1061
|
+
indexName: string;
|
|
1062
|
+
}> | undefined;
|
|
1063
|
+
hyperdrive?: Record<string, {
|
|
1064
|
+
id: string;
|
|
1065
|
+
}> | undefined;
|
|
1066
|
+
browser?: {
|
|
1067
|
+
binding: string;
|
|
1068
|
+
} | undefined;
|
|
1069
|
+
analyticsEngine?: Record<string, {
|
|
1070
|
+
dataset: string;
|
|
1071
|
+
}> | undefined;
|
|
1072
|
+
sendEmail?: Record<string, {
|
|
1073
|
+
destinationAddress?: string | undefined;
|
|
1074
|
+
}> | undefined;
|
|
1075
|
+
} | undefined;
|
|
1076
|
+
triggers?: {
|
|
1077
|
+
crons?: string[] | undefined;
|
|
1078
|
+
} | undefined;
|
|
1079
|
+
vars?: Record<string, string> | undefined;
|
|
1080
|
+
secrets?: Record<string, {
|
|
1081
|
+
required: boolean;
|
|
1082
|
+
}> | undefined;
|
|
1083
|
+
routes?: {
|
|
1084
|
+
pattern: string;
|
|
1085
|
+
zone_name?: string | undefined;
|
|
1086
|
+
zone_id?: string | undefined;
|
|
1087
|
+
custom_domain?: boolean | undefined;
|
|
1088
|
+
}[] | undefined;
|
|
1089
|
+
assets?: {
|
|
1090
|
+
directory: string;
|
|
1091
|
+
binding?: string | undefined;
|
|
1092
|
+
} | undefined;
|
|
1093
|
+
limits?: {
|
|
1094
|
+
cpu_ms?: number | undefined;
|
|
1095
|
+
} | undefined;
|
|
1096
|
+
observability?: {
|
|
1097
|
+
enabled?: boolean | undefined;
|
|
1098
|
+
head_sampling_rate?: number | undefined;
|
|
1099
|
+
} | undefined;
|
|
1100
|
+
migrations?: {
|
|
1101
|
+
tag: string;
|
|
1102
|
+
new_classes?: string[] | undefined;
|
|
1103
|
+
renamed_classes?: {
|
|
1104
|
+
from: string;
|
|
1105
|
+
to: string;
|
|
1106
|
+
}[] | undefined;
|
|
1107
|
+
deleted_classes?: string[] | undefined;
|
|
1108
|
+
new_sqlite_classes?: string[] | undefined;
|
|
1109
|
+
}[] | undefined;
|
|
1110
|
+
build?: {
|
|
1111
|
+
target?: string | undefined;
|
|
1112
|
+
minify?: boolean | undefined;
|
|
1113
|
+
sourcemap?: boolean | undefined;
|
|
1114
|
+
rolldownOptions?: Record<string, unknown> | undefined;
|
|
1115
|
+
} | undefined;
|
|
1116
|
+
wrangler?: {
|
|
1117
|
+
passthrough?: Record<string, unknown> | undefined;
|
|
1118
|
+
} | undefined;
|
|
1119
|
+
}, {
|
|
1120
|
+
name?: string | undefined;
|
|
1121
|
+
compatibilityDate?: string | undefined;
|
|
1122
|
+
compatibilityFlags?: string[] | undefined;
|
|
1123
|
+
files?: {
|
|
1124
|
+
fetch?: string | false | undefined;
|
|
1125
|
+
queue?: string | false | undefined;
|
|
1126
|
+
scheduled?: string | false | undefined;
|
|
1127
|
+
email?: string | false | undefined;
|
|
1128
|
+
durableObjects?: string | false | undefined;
|
|
1129
|
+
entrypoints?: string | false | undefined;
|
|
1130
|
+
workflows?: string | false | undefined;
|
|
1131
|
+
routes?: false | {
|
|
1132
|
+
dir: string;
|
|
1133
|
+
prefix?: string | undefined;
|
|
1134
|
+
} | undefined;
|
|
1135
|
+
transport?: string | undefined;
|
|
1136
|
+
} | undefined;
|
|
1137
|
+
bindings?: {
|
|
1138
|
+
kv?: Record<string, string> | undefined;
|
|
1139
|
+
d1?: Record<string, string> | undefined;
|
|
1140
|
+
r2?: Record<string, string> | undefined;
|
|
1141
|
+
durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
|
|
1142
|
+
queues?: {
|
|
1143
|
+
producers?: Record<string, string> | undefined;
|
|
1144
|
+
consumers?: {
|
|
1145
|
+
queue: string;
|
|
1146
|
+
maxBatchSize?: number | undefined;
|
|
1147
|
+
maxBatchTimeout?: number | undefined;
|
|
1148
|
+
maxRetries?: number | undefined;
|
|
1149
|
+
deadLetterQueue?: string | undefined;
|
|
1150
|
+
maxConcurrency?: number | undefined;
|
|
1151
|
+
retryDelay?: number | undefined;
|
|
1152
|
+
}[] | undefined;
|
|
1153
|
+
} | undefined;
|
|
1154
|
+
services?: Record<string, {
|
|
1155
|
+
/** Target worker/service name */
|
|
1156
|
+
service: string;
|
|
1157
|
+
/** Optional environment (staging, production, etc.) */
|
|
1158
|
+
environment?: string | undefined;
|
|
1159
|
+
/** Optional entrypoint class name for named exports */
|
|
1160
|
+
entrypoint?: string | undefined;
|
|
1161
|
+
/** @internal Reference marker for ref() bindings */
|
|
1162
|
+
__ref?: unknown;
|
|
1163
|
+
}> | undefined;
|
|
1164
|
+
ai?: {
|
|
1165
|
+
binding: string;
|
|
1166
|
+
} | undefined;
|
|
1167
|
+
vectorize?: Record<string, {
|
|
1168
|
+
indexName: string;
|
|
1169
|
+
}> | undefined;
|
|
1170
|
+
hyperdrive?: Record<string, {
|
|
1171
|
+
id: string;
|
|
1172
|
+
}> | undefined;
|
|
1173
|
+
browser?: {
|
|
1174
|
+
binding: string;
|
|
1175
|
+
} | undefined;
|
|
1176
|
+
analyticsEngine?: Record<string, {
|
|
1177
|
+
dataset: string;
|
|
1178
|
+
}> | undefined;
|
|
1179
|
+
sendEmail?: Record<string, {
|
|
1180
|
+
destinationAddress?: string | undefined;
|
|
1181
|
+
}> | undefined;
|
|
1182
|
+
} | undefined;
|
|
1183
|
+
triggers?: {
|
|
1184
|
+
crons?: string[] | undefined;
|
|
1185
|
+
} | undefined;
|
|
1186
|
+
vars?: Record<string, string> | undefined;
|
|
1187
|
+
secrets?: Record<string, {
|
|
1188
|
+
required?: boolean | undefined;
|
|
1189
|
+
}> | undefined;
|
|
1190
|
+
routes?: {
|
|
1191
|
+
pattern: string;
|
|
1192
|
+
zone_name?: string | undefined;
|
|
1193
|
+
zone_id?: string | undefined;
|
|
1194
|
+
custom_domain?: boolean | undefined;
|
|
1195
|
+
}[] | undefined;
|
|
1196
|
+
assets?: {
|
|
1197
|
+
directory: string;
|
|
1198
|
+
binding?: string | undefined;
|
|
1199
|
+
} | undefined;
|
|
1200
|
+
limits?: {
|
|
1201
|
+
cpu_ms?: number | undefined;
|
|
1202
|
+
} | undefined;
|
|
1203
|
+
observability?: {
|
|
1204
|
+
enabled?: boolean | undefined;
|
|
1205
|
+
head_sampling_rate?: number | undefined;
|
|
1206
|
+
} | undefined;
|
|
1207
|
+
migrations?: {
|
|
1208
|
+
tag: string;
|
|
1209
|
+
new_classes?: string[] | undefined;
|
|
1210
|
+
renamed_classes?: {
|
|
1211
|
+
from: string;
|
|
1212
|
+
to: string;
|
|
1213
|
+
}[] | undefined;
|
|
1214
|
+
deleted_classes?: string[] | undefined;
|
|
1215
|
+
new_sqlite_classes?: string[] | undefined;
|
|
1216
|
+
}[] | undefined;
|
|
1217
|
+
build?: {
|
|
1218
|
+
target?: string | undefined;
|
|
1219
|
+
minify?: boolean | undefined;
|
|
1220
|
+
sourcemap?: boolean | undefined;
|
|
1221
|
+
rolldownOptions?: Record<string, unknown> | undefined;
|
|
1222
|
+
} | undefined;
|
|
1223
|
+
wrangler?: {
|
|
1224
|
+
passthrough?: Record<string, unknown> | undefined;
|
|
1225
|
+
} | undefined;
|
|
1226
|
+
}>;
|
|
1227
|
+
/**
|
|
1228
|
+
* Main devflare configuration schema.
|
|
1229
|
+
*
|
|
1230
|
+
* This is the complete schema for `devflare.config.ts` files.
|
|
1231
|
+
* Use `defineConfig()` for type-safe configuration with autocompletion.
|
|
1232
|
+
*
|
|
1233
|
+
* @example Minimal configuration
|
|
1234
|
+
* ```ts
|
|
1235
|
+
* import { defineConfig } from 'devflare'
|
|
1236
|
+
*
|
|
1237
|
+
* export default defineConfig({
|
|
1238
|
+
* name: 'my-worker'
|
|
1239
|
+
* })
|
|
1240
|
+
* ```
|
|
1241
|
+
*
|
|
1242
|
+
* @example Full configuration
|
|
1243
|
+
* ```ts
|
|
1244
|
+
* export default defineConfig({
|
|
1245
|
+
* name: 'api-worker',
|
|
1246
|
+
* files: { fetch: 'src/fetch.ts' },
|
|
1247
|
+
* bindings: {
|
|
1248
|
+
* kv: { CACHE: 'cache-id' },
|
|
1249
|
+
* d1: { DB: 'database-id' },
|
|
1250
|
+
* durableObjects: { COUNTER: 'Counter' }
|
|
1251
|
+
* }
|
|
1252
|
+
* })
|
|
1253
|
+
* ```
|
|
1254
|
+
*/
|
|
1255
|
+
export declare const configSchema: z.ZodObject<{
|
|
1256
|
+
/**
|
|
1257
|
+
* Worker name (required).
|
|
1258
|
+
* Used as the deployment target and in URLs.
|
|
1259
|
+
* @example 'my-api-worker'
|
|
1260
|
+
*/
|
|
1261
|
+
name: z.ZodString;
|
|
1262
|
+
/**
|
|
1263
|
+
* Cloudflare account ID.
|
|
1264
|
+
* Required for remote bindings (AI, Vectorize, etc.).
|
|
1265
|
+
* Can also be set via CLOUDFLARE_ACCOUNT_ID environment variable.
|
|
1266
|
+
*/
|
|
1267
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
1268
|
+
/**
|
|
1269
|
+
* Cloudflare Workers compatibility date.
|
|
1270
|
+
* @default Current date (YYYY-MM-DD)
|
|
1271
|
+
* @see https://developers.cloudflare.com/workers/configuration/compatibility-dates/
|
|
1272
|
+
*/
|
|
1273
|
+
compatibilityDate: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1274
|
+
/**
|
|
1275
|
+
* Compatibility flags to enable additional features.
|
|
1276
|
+
* @default ['nodejs_compat', 'nodejs_als'] (always included)
|
|
1277
|
+
* @see https://developers.cloudflare.com/workers/configuration/compatibility-dates/#compatibility-flags
|
|
1278
|
+
*/
|
|
1279
|
+
compatibilityFlags: z.ZodEffects<z.ZodOptional<z.ZodArray<z.ZodString, "many">>, string[], string[] | undefined>;
|
|
1280
|
+
/**
|
|
1281
|
+
* File handlers configuration.
|
|
1282
|
+
* Maps handler types to source file paths.
|
|
1283
|
+
*/
|
|
1284
|
+
files: z.ZodOptional<z.ZodObject<{
|
|
1285
|
+
/**
|
|
1286
|
+
* Main fetch handler file path.
|
|
1287
|
+
* This handles HTTP requests to your worker.
|
|
1288
|
+
* @default 'src/fetch.{ts,js}'
|
|
1289
|
+
* @example 'src/fetch.ts'
|
|
1290
|
+
*/
|
|
1291
|
+
fetch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
1292
|
+
/**
|
|
1293
|
+
* Queue consumer handler file path.
|
|
1294
|
+
* Handles messages from Cloudflare Queues.
|
|
1295
|
+
* @default 'src/queue.ts'
|
|
1296
|
+
* @example 'src/queue.ts'
|
|
1297
|
+
*/
|
|
1298
|
+
queue: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
1299
|
+
/**
|
|
1300
|
+
* Scheduled (cron) handler file path.
|
|
1301
|
+
* Handles cron trigger invocations.
|
|
1302
|
+
* @default 'src/scheduled.ts'
|
|
1303
|
+
* @example 'src/scheduled.ts'
|
|
1304
|
+
*/
|
|
1305
|
+
scheduled: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
1306
|
+
/**
|
|
1307
|
+
* Email handler file path.
|
|
1308
|
+
* Handles incoming emails via Email Routing.
|
|
1309
|
+
* @default 'src/email.ts'
|
|
1310
|
+
* @example 'src/email.ts'
|
|
1311
|
+
*/
|
|
1312
|
+
email: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
1313
|
+
/**
|
|
1314
|
+
* Durable Object class discovery glob pattern.
|
|
1315
|
+
* Files matching this pattern are scanned for DO classes.
|
|
1316
|
+
* Respects `.gitignore` automatically.
|
|
1317
|
+
*
|
|
1318
|
+
* @default `**/do.*.{ts,js}` (recursive)
|
|
1319
|
+
* @example `**/do.*.{ts,js}` — Matches src/do.counter.ts, lib/do.chat.ts
|
|
1320
|
+
* @example `src/do.*.ts` — Legacy single-directory pattern
|
|
1321
|
+
*/
|
|
1322
|
+
durableObjects: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
1323
|
+
/**
|
|
1324
|
+
* WorkerEntrypoint class discovery glob pattern.
|
|
1325
|
+
* Files matching this pattern are scanned for named entrypoint classes.
|
|
1326
|
+
* Respects `.gitignore` automatically.
|
|
1327
|
+
*
|
|
1328
|
+
* Entrypoints enable typed cross-worker RPC via service bindings:
|
|
1329
|
+
* ```ts
|
|
1330
|
+
* // ep.admin.ts
|
|
1331
|
+
* export class AdminEntrypoint extends WorkerEntrypoint {
|
|
1332
|
+
* async getStats() { return { users: 100 } }
|
|
1333
|
+
* }
|
|
1334
|
+
*
|
|
1335
|
+
* // Consumer worker
|
|
1336
|
+
* const stats = await env.ADMIN_SERVICE.getStats()
|
|
1337
|
+
* ```
|
|
1338
|
+
*
|
|
1339
|
+
* @default `**/ep.*.{ts,js}` (recursive)
|
|
1340
|
+
* @example `**/ep.*.{ts,js}` — Matches src/ep.admin.ts, lib/ep.auth.ts
|
|
1341
|
+
* @example `src/ep.*.ts` — Legacy single-directory pattern
|
|
1342
|
+
*/
|
|
1343
|
+
entrypoints: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
1344
|
+
/**
|
|
1345
|
+
* Workflow class discovery glob pattern.
|
|
1346
|
+
* Files matching this pattern are scanned for Workflow classes.
|
|
1347
|
+
* Respects `.gitignore` automatically.
|
|
1348
|
+
*
|
|
1349
|
+
* Workflows enable durable multi-step execution with automatic retries:
|
|
1350
|
+
* ```ts
|
|
1351
|
+
* // wf.order-processor.ts
|
|
1352
|
+
* export class OrderProcessingWorkflow extends Workflow {
|
|
1353
|
+
* async run(event, step) {
|
|
1354
|
+
* const validated = await step.do('validate', () => validate(event.payload))
|
|
1355
|
+
* const charged = await step.do('charge', () => charge(validated))
|
|
1356
|
+
* return { orderId: charged.id }
|
|
1357
|
+
* }
|
|
1358
|
+
* }
|
|
1359
|
+
* ```
|
|
1360
|
+
*
|
|
1361
|
+
* @default `**/wf.*.{ts,js}` (recursive)
|
|
1362
|
+
* @example `**/wf.*.{ts,js}` — Matches src/wf.order.ts, lib/wf.pipeline.ts
|
|
1363
|
+
* @example `src/wf.*.ts` — Legacy single-directory pattern
|
|
1364
|
+
*/
|
|
1365
|
+
workflows: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
1366
|
+
/**
|
|
1367
|
+
* File-based routing configuration.
|
|
1368
|
+
* Enables automatic route discovery from a directory.
|
|
1369
|
+
*
|
|
1370
|
+
* Directory structure maps to URL paths:
|
|
1371
|
+
* ```
|
|
1372
|
+
* src/routes/
|
|
1373
|
+
* ├── index.ts → GET /
|
|
1374
|
+
* ├── users/
|
|
1375
|
+
* │ ├── index.ts → GET /users POST /users
|
|
1376
|
+
* │ ├── [id].ts → GET /users/:id
|
|
1377
|
+
* │ └── [id]/
|
|
1378
|
+
* │ └── posts.ts → GET /users/:id/posts
|
|
1379
|
+
* └── api/
|
|
1380
|
+
* └── health.ts → GET /api/health
|
|
1381
|
+
* ```
|
|
1382
|
+
*
|
|
1383
|
+
* Each file exports HTTP method handlers:
|
|
1384
|
+
* ```ts
|
|
1385
|
+
* export function GET(req: Request, env: Env) { ... }
|
|
1386
|
+
* export function POST(req: Request, env: Env) { ... }
|
|
1387
|
+
* ```
|
|
1388
|
+
*/
|
|
1389
|
+
routes: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
1390
|
+
/** Directory containing route files (e.g., 'src/routes') */
|
|
1391
|
+
dir: z.ZodString;
|
|
1392
|
+
/** Optional URL prefix for all routes (e.g., '/api') */
|
|
1393
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
1394
|
+
}, "strip", z.ZodTypeAny, {
|
|
1395
|
+
dir: string;
|
|
1396
|
+
prefix?: string | undefined;
|
|
1397
|
+
}, {
|
|
1398
|
+
dir: string;
|
|
1399
|
+
prefix?: string | undefined;
|
|
1400
|
+
}>, z.ZodLiteral<false>]>>;
|
|
1401
|
+
/**
|
|
1402
|
+
* Transport file for custom RPC serialization.
|
|
1403
|
+
* Implements SvelteKit-style encode/decode for complex types.
|
|
1404
|
+
* @default 'src/transport.ts'
|
|
1405
|
+
* @example 'src/transport.ts'
|
|
1406
|
+
*/
|
|
1407
|
+
transport: z.ZodOptional<z.ZodString>;
|
|
1408
|
+
}, "strip", z.ZodTypeAny, {
|
|
1409
|
+
fetch?: string | false | undefined;
|
|
1410
|
+
queue?: string | false | undefined;
|
|
1411
|
+
scheduled?: string | false | undefined;
|
|
1412
|
+
email?: string | false | undefined;
|
|
1413
|
+
durableObjects?: string | false | undefined;
|
|
1414
|
+
entrypoints?: string | false | undefined;
|
|
1415
|
+
workflows?: string | false | undefined;
|
|
1416
|
+
routes?: false | {
|
|
1417
|
+
dir: string;
|
|
1418
|
+
prefix?: string | undefined;
|
|
1419
|
+
} | undefined;
|
|
1420
|
+
transport?: string | undefined;
|
|
1421
|
+
}, {
|
|
1422
|
+
fetch?: string | false | undefined;
|
|
1423
|
+
queue?: string | false | undefined;
|
|
1424
|
+
scheduled?: string | false | undefined;
|
|
1425
|
+
email?: string | false | undefined;
|
|
1426
|
+
durableObjects?: string | false | undefined;
|
|
1427
|
+
entrypoints?: string | false | undefined;
|
|
1428
|
+
workflows?: string | false | undefined;
|
|
1429
|
+
routes?: false | {
|
|
1430
|
+
dir: string;
|
|
1431
|
+
prefix?: string | undefined;
|
|
1432
|
+
} | undefined;
|
|
1433
|
+
transport?: string | undefined;
|
|
1434
|
+
}>>;
|
|
1435
|
+
/**
|
|
1436
|
+
* Bindings to Cloudflare services.
|
|
1437
|
+
* KV, D1, R2, Durable Objects, Queues, Services, and more.
|
|
1438
|
+
*/
|
|
1439
|
+
bindings: z.ZodOptional<z.ZodObject<{
|
|
1440
|
+
/**
|
|
1441
|
+
* KV Namespace bindings.
|
|
1442
|
+
* Maps binding name to KV namespace ID.
|
|
1443
|
+
* @example { CACHE: 'cache-kv-namespace-id' }
|
|
1444
|
+
*/
|
|
1445
|
+
kv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1446
|
+
/**
|
|
1447
|
+
* D1 Database bindings.
|
|
1448
|
+
* Maps binding name to D1 database ID.
|
|
1449
|
+
* @example { DB: 'main-database-id' }
|
|
1450
|
+
*/
|
|
1451
|
+
d1: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1452
|
+
/**
|
|
1453
|
+
* R2 Bucket bindings.
|
|
1454
|
+
* Maps binding name to R2 bucket name.
|
|
1455
|
+
* @example { IMAGES: 'images-bucket' }
|
|
1456
|
+
*/
|
|
1457
|
+
r2: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1458
|
+
/**
|
|
1459
|
+
* Durable Object bindings.
|
|
1460
|
+
* Maps binding name to DO class configuration.
|
|
1461
|
+
* @example { COUNTER: 'Counter' } or { COUNTER: { className: 'Counter' } }
|
|
1462
|
+
*/
|
|
1463
|
+
durableObjects: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<DurableObjectBindingInput, z.ZodTypeDef, DurableObjectBindingInput>>>;
|
|
1464
|
+
/**
|
|
1465
|
+
* Queue bindings for producers and consumers.
|
|
1466
|
+
*/
|
|
1467
|
+
queues: z.ZodOptional<z.ZodObject<{
|
|
1468
|
+
/**
|
|
1469
|
+
* Queue producer bindings.
|
|
1470
|
+
* Maps binding name to queue name.
|
|
1471
|
+
* @example { TASK_QUEUE: 'task-queue' }
|
|
1472
|
+
*/
|
|
1473
|
+
producers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1474
|
+
/**
|
|
1475
|
+
* Queue consumer configurations.
|
|
1476
|
+
* Array of consumer configs for processing queue messages.
|
|
1477
|
+
*/
|
|
1478
|
+
consumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1479
|
+
/** Queue name to consume from */
|
|
1480
|
+
queue: z.ZodString;
|
|
1481
|
+
/**
|
|
1482
|
+
* Maximum messages per batch (1-100).
|
|
1483
|
+
* @default 10
|
|
1484
|
+
*/
|
|
1485
|
+
maxBatchSize: z.ZodOptional<z.ZodNumber>;
|
|
1486
|
+
/**
|
|
1487
|
+
* Maximum seconds to wait for a full batch.
|
|
1488
|
+
* @default 5
|
|
1489
|
+
*/
|
|
1490
|
+
maxBatchTimeout: z.ZodOptional<z.ZodNumber>;
|
|
1491
|
+
/**
|
|
1492
|
+
* Maximum retry attempts for failed messages.
|
|
1493
|
+
* @default 3
|
|
1494
|
+
*/
|
|
1495
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
1496
|
+
/** Queue name to send failed messages after max retries */
|
|
1497
|
+
deadLetterQueue: z.ZodOptional<z.ZodString>;
|
|
1498
|
+
/** Maximum concurrent batch invocations */
|
|
1499
|
+
maxConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
1500
|
+
/** Delay in seconds between retries */
|
|
1501
|
+
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
1502
|
+
}, "strip", z.ZodTypeAny, {
|
|
1503
|
+
queue: string;
|
|
1504
|
+
maxBatchSize?: number | undefined;
|
|
1505
|
+
maxBatchTimeout?: number | undefined;
|
|
1506
|
+
maxRetries?: number | undefined;
|
|
1507
|
+
deadLetterQueue?: string | undefined;
|
|
1508
|
+
maxConcurrency?: number | undefined;
|
|
1509
|
+
retryDelay?: number | undefined;
|
|
1510
|
+
}, {
|
|
1511
|
+
queue: string;
|
|
1512
|
+
maxBatchSize?: number | undefined;
|
|
1513
|
+
maxBatchTimeout?: number | undefined;
|
|
1514
|
+
maxRetries?: number | undefined;
|
|
1515
|
+
deadLetterQueue?: string | undefined;
|
|
1516
|
+
maxConcurrency?: number | undefined;
|
|
1517
|
+
retryDelay?: number | undefined;
|
|
1518
|
+
}>, "many">>;
|
|
1519
|
+
}, "strip", z.ZodTypeAny, {
|
|
1520
|
+
producers?: Record<string, string> | undefined;
|
|
1521
|
+
consumers?: {
|
|
1522
|
+
queue: string;
|
|
1523
|
+
maxBatchSize?: number | undefined;
|
|
1524
|
+
maxBatchTimeout?: number | undefined;
|
|
1525
|
+
maxRetries?: number | undefined;
|
|
1526
|
+
deadLetterQueue?: string | undefined;
|
|
1527
|
+
maxConcurrency?: number | undefined;
|
|
1528
|
+
retryDelay?: number | undefined;
|
|
1529
|
+
}[] | undefined;
|
|
1530
|
+
}, {
|
|
1531
|
+
producers?: Record<string, string> | undefined;
|
|
1532
|
+
consumers?: {
|
|
1533
|
+
queue: string;
|
|
1534
|
+
maxBatchSize?: number | undefined;
|
|
1535
|
+
maxBatchTimeout?: number | undefined;
|
|
1536
|
+
maxRetries?: number | undefined;
|
|
1537
|
+
deadLetterQueue?: string | undefined;
|
|
1538
|
+
maxConcurrency?: number | undefined;
|
|
1539
|
+
retryDelay?: number | undefined;
|
|
1540
|
+
}[] | undefined;
|
|
1541
|
+
}>>;
|
|
1542
|
+
/**
|
|
1543
|
+
* Service bindings to other Workers.
|
|
1544
|
+
* Enables RPC-style communication between workers.
|
|
1545
|
+
* @example { MATH: mathWorker.worker }
|
|
1546
|
+
*/
|
|
1547
|
+
services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<{
|
|
1548
|
+
/** Target worker/service name */
|
|
1549
|
+
service: string;
|
|
1550
|
+
/** Optional environment (staging, production, etc.) */
|
|
1551
|
+
environment?: string | undefined;
|
|
1552
|
+
/** Optional entrypoint class name for named exports */
|
|
1553
|
+
entrypoint?: string | undefined;
|
|
1554
|
+
/** @internal Reference marker for ref() bindings */
|
|
1555
|
+
__ref?: unknown;
|
|
1556
|
+
}, z.ZodTypeDef, {
|
|
1557
|
+
/** Target worker/service name */
|
|
1558
|
+
service: string;
|
|
1559
|
+
/** Optional environment (staging, production, etc.) */
|
|
1560
|
+
environment?: string | undefined;
|
|
1561
|
+
/** Optional entrypoint class name for named exports */
|
|
1562
|
+
entrypoint?: string | undefined;
|
|
1563
|
+
/** @internal Reference marker for ref() bindings */
|
|
1564
|
+
__ref?: unknown;
|
|
1565
|
+
}>>>;
|
|
1566
|
+
/**
|
|
1567
|
+
* Workers AI binding for ML inference.
|
|
1568
|
+
* @example { binding: 'AI' }
|
|
1569
|
+
*/
|
|
1570
|
+
ai: z.ZodOptional<z.ZodObject<{
|
|
1571
|
+
/** Binding name exposed in env (e.g., 'AI') */
|
|
1572
|
+
binding: z.ZodString;
|
|
1573
|
+
}, "strip", z.ZodTypeAny, {
|
|
1574
|
+
binding: string;
|
|
1575
|
+
}, {
|
|
1576
|
+
binding: string;
|
|
1577
|
+
}>>;
|
|
1578
|
+
/**
|
|
1579
|
+
* Vectorize index bindings for vector similarity search.
|
|
1580
|
+
* @example { EMBEDDINGS: { indexName: 'my-index' } }
|
|
1581
|
+
*/
|
|
1582
|
+
vectorize: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1583
|
+
/** Name of the Vectorize index */
|
|
1584
|
+
indexName: z.ZodString;
|
|
1585
|
+
}, "strip", z.ZodTypeAny, {
|
|
1586
|
+
indexName: string;
|
|
1587
|
+
}, {
|
|
1588
|
+
indexName: string;
|
|
1589
|
+
}>>>;
|
|
1590
|
+
/**
|
|
1591
|
+
* Hyperdrive bindings for accelerated PostgreSQL.
|
|
1592
|
+
* @example { DB: { id: 'hyperdrive-config-id' } }
|
|
1593
|
+
*/
|
|
1594
|
+
hyperdrive: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1595
|
+
/** Hyperdrive configuration ID */
|
|
1596
|
+
id: z.ZodString;
|
|
1597
|
+
}, "strip", z.ZodTypeAny, {
|
|
1598
|
+
id: string;
|
|
1599
|
+
}, {
|
|
1600
|
+
id: string;
|
|
1601
|
+
}>>>;
|
|
1602
|
+
/**
|
|
1603
|
+
* Browser Rendering binding for headless browser access.
|
|
1604
|
+
* @example { binding: 'BROWSER' }
|
|
1605
|
+
*/
|
|
1606
|
+
browser: z.ZodOptional<z.ZodObject<{
|
|
1607
|
+
/** Binding name exposed in env (e.g., 'BROWSER') */
|
|
1608
|
+
binding: z.ZodString;
|
|
1609
|
+
}, "strip", z.ZodTypeAny, {
|
|
1610
|
+
binding: string;
|
|
1611
|
+
}, {
|
|
1612
|
+
binding: string;
|
|
1613
|
+
}>>;
|
|
1614
|
+
/**
|
|
1615
|
+
* Analytics Engine bindings for event logging.
|
|
1616
|
+
* @example { ANALYTICS: { dataset: 'my-dataset' } }
|
|
1617
|
+
*/
|
|
1618
|
+
analyticsEngine: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1619
|
+
/** Analytics Engine dataset name */
|
|
1620
|
+
dataset: z.ZodString;
|
|
1621
|
+
}, "strip", z.ZodTypeAny, {
|
|
1622
|
+
dataset: string;
|
|
1623
|
+
}, {
|
|
1624
|
+
dataset: string;
|
|
1625
|
+
}>>>;
|
|
1626
|
+
/**
|
|
1627
|
+
* Email sending bindings.
|
|
1628
|
+
* @example { EMAIL: { destinationAddress: 'admin@example.com' } }
|
|
1629
|
+
*/
|
|
1630
|
+
sendEmail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1631
|
+
/** Default destination address (can be overridden per-send) */
|
|
1632
|
+
destinationAddress: z.ZodOptional<z.ZodString>;
|
|
1633
|
+
}, "strip", z.ZodTypeAny, {
|
|
1634
|
+
destinationAddress?: string | undefined;
|
|
1635
|
+
}, {
|
|
1636
|
+
destinationAddress?: string | undefined;
|
|
1637
|
+
}>>>;
|
|
1638
|
+
}, "strip", z.ZodTypeAny, {
|
|
1639
|
+
kv?: Record<string, string> | undefined;
|
|
1640
|
+
d1?: Record<string, string> | undefined;
|
|
1641
|
+
r2?: Record<string, string> | undefined;
|
|
1642
|
+
durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
|
|
1643
|
+
queues?: {
|
|
1644
|
+
producers?: Record<string, string> | undefined;
|
|
1645
|
+
consumers?: {
|
|
1646
|
+
queue: string;
|
|
1647
|
+
maxBatchSize?: number | undefined;
|
|
1648
|
+
maxBatchTimeout?: number | undefined;
|
|
1649
|
+
maxRetries?: number | undefined;
|
|
1650
|
+
deadLetterQueue?: string | undefined;
|
|
1651
|
+
maxConcurrency?: number | undefined;
|
|
1652
|
+
retryDelay?: number | undefined;
|
|
1653
|
+
}[] | undefined;
|
|
1654
|
+
} | undefined;
|
|
1655
|
+
services?: Record<string, {
|
|
1656
|
+
/** Target worker/service name */
|
|
1657
|
+
service: string;
|
|
1658
|
+
/** Optional environment (staging, production, etc.) */
|
|
1659
|
+
environment?: string | undefined;
|
|
1660
|
+
/** Optional entrypoint class name for named exports */
|
|
1661
|
+
entrypoint?: string | undefined;
|
|
1662
|
+
/** @internal Reference marker for ref() bindings */
|
|
1663
|
+
__ref?: unknown;
|
|
1664
|
+
}> | undefined;
|
|
1665
|
+
ai?: {
|
|
1666
|
+
binding: string;
|
|
1667
|
+
} | undefined;
|
|
1668
|
+
vectorize?: Record<string, {
|
|
1669
|
+
indexName: string;
|
|
1670
|
+
}> | undefined;
|
|
1671
|
+
hyperdrive?: Record<string, {
|
|
1672
|
+
id: string;
|
|
1673
|
+
}> | undefined;
|
|
1674
|
+
browser?: {
|
|
1675
|
+
binding: string;
|
|
1676
|
+
} | undefined;
|
|
1677
|
+
analyticsEngine?: Record<string, {
|
|
1678
|
+
dataset: string;
|
|
1679
|
+
}> | undefined;
|
|
1680
|
+
sendEmail?: Record<string, {
|
|
1681
|
+
destinationAddress?: string | undefined;
|
|
1682
|
+
}> | undefined;
|
|
1683
|
+
}, {
|
|
1684
|
+
kv?: Record<string, string> | undefined;
|
|
1685
|
+
d1?: Record<string, string> | undefined;
|
|
1686
|
+
r2?: Record<string, string> | undefined;
|
|
1687
|
+
durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
|
|
1688
|
+
queues?: {
|
|
1689
|
+
producers?: Record<string, string> | undefined;
|
|
1690
|
+
consumers?: {
|
|
1691
|
+
queue: string;
|
|
1692
|
+
maxBatchSize?: number | undefined;
|
|
1693
|
+
maxBatchTimeout?: number | undefined;
|
|
1694
|
+
maxRetries?: number | undefined;
|
|
1695
|
+
deadLetterQueue?: string | undefined;
|
|
1696
|
+
maxConcurrency?: number | undefined;
|
|
1697
|
+
retryDelay?: number | undefined;
|
|
1698
|
+
}[] | undefined;
|
|
1699
|
+
} | undefined;
|
|
1700
|
+
services?: Record<string, {
|
|
1701
|
+
/** Target worker/service name */
|
|
1702
|
+
service: string;
|
|
1703
|
+
/** Optional environment (staging, production, etc.) */
|
|
1704
|
+
environment?: string | undefined;
|
|
1705
|
+
/** Optional entrypoint class name for named exports */
|
|
1706
|
+
entrypoint?: string | undefined;
|
|
1707
|
+
/** @internal Reference marker for ref() bindings */
|
|
1708
|
+
__ref?: unknown;
|
|
1709
|
+
}> | undefined;
|
|
1710
|
+
ai?: {
|
|
1711
|
+
binding: string;
|
|
1712
|
+
} | undefined;
|
|
1713
|
+
vectorize?: Record<string, {
|
|
1714
|
+
indexName: string;
|
|
1715
|
+
}> | undefined;
|
|
1716
|
+
hyperdrive?: Record<string, {
|
|
1717
|
+
id: string;
|
|
1718
|
+
}> | undefined;
|
|
1719
|
+
browser?: {
|
|
1720
|
+
binding: string;
|
|
1721
|
+
} | undefined;
|
|
1722
|
+
analyticsEngine?: Record<string, {
|
|
1723
|
+
dataset: string;
|
|
1724
|
+
}> | undefined;
|
|
1725
|
+
sendEmail?: Record<string, {
|
|
1726
|
+
destinationAddress?: string | undefined;
|
|
1727
|
+
}> | undefined;
|
|
1728
|
+
}>>;
|
|
1729
|
+
/**
|
|
1730
|
+
* Trigger configuration (cron schedules).
|
|
1731
|
+
*/
|
|
1732
|
+
triggers: z.ZodOptional<z.ZodObject<{
|
|
1733
|
+
/**
|
|
1734
|
+
* Array of cron expressions for scheduled execution.
|
|
1735
|
+
*
|
|
1736
|
+
* Examples:
|
|
1737
|
+
* - `'0 0 * * *'` — Daily at midnight
|
|
1738
|
+
* - `'0/5 * * * *'` — Every 5 minutes
|
|
1739
|
+
* - `'0 9 * * 1'` — Every Monday at 9am
|
|
1740
|
+
*/
|
|
1741
|
+
crons: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1742
|
+
}, "strip", z.ZodTypeAny, {
|
|
1743
|
+
crons?: string[] | undefined;
|
|
1744
|
+
}, {
|
|
1745
|
+
crons?: string[] | undefined;
|
|
1746
|
+
}>>;
|
|
1747
|
+
/**
|
|
1748
|
+
* Environment variables.
|
|
1749
|
+
* Exposed via env.VAR_NAME in the worker.
|
|
1750
|
+
*/
|
|
1751
|
+
vars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1752
|
+
/**
|
|
1753
|
+
* Secret configuration.
|
|
1754
|
+
* Secrets are like vars but encrypted and not logged.
|
|
1755
|
+
*/
|
|
1756
|
+
secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1757
|
+
/**
|
|
1758
|
+
* Whether this secret is required for the worker to run.
|
|
1759
|
+
* If true, worker will fail to start if secret is missing.
|
|
1760
|
+
* @default true
|
|
1761
|
+
*/
|
|
1762
|
+
required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1763
|
+
}, "strip", z.ZodTypeAny, {
|
|
1764
|
+
required: boolean;
|
|
1765
|
+
}, {
|
|
1766
|
+
required?: boolean | undefined;
|
|
1767
|
+
}>>>;
|
|
1768
|
+
/**
|
|
1769
|
+
* Deployment routes.
|
|
1770
|
+
* URL patterns that trigger this worker.
|
|
1771
|
+
*/
|
|
1772
|
+
routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1773
|
+
/**
|
|
1774
|
+
* URL pattern to match (e.g., 'example.com/*').
|
|
1775
|
+
* Supports wildcards (*) for path matching.
|
|
1776
|
+
*/
|
|
1777
|
+
pattern: z.ZodString;
|
|
1778
|
+
/** Zone name to associate the route with */
|
|
1779
|
+
zone_name: z.ZodOptional<z.ZodString>;
|
|
1780
|
+
/** Zone ID to associate the route with (alternative to zone_name) */
|
|
1781
|
+
zone_id: z.ZodOptional<z.ZodString>;
|
|
1782
|
+
/** Whether this is a custom domain route */
|
|
1783
|
+
custom_domain: z.ZodOptional<z.ZodBoolean>;
|
|
1784
|
+
}, "strip", z.ZodTypeAny, {
|
|
1785
|
+
pattern: string;
|
|
1786
|
+
zone_name?: string | undefined;
|
|
1787
|
+
zone_id?: string | undefined;
|
|
1788
|
+
custom_domain?: boolean | undefined;
|
|
1789
|
+
}, {
|
|
1790
|
+
pattern: string;
|
|
1791
|
+
zone_name?: string | undefined;
|
|
1792
|
+
zone_id?: string | undefined;
|
|
1793
|
+
custom_domain?: boolean | undefined;
|
|
1794
|
+
}>, "many">>;
|
|
1795
|
+
/**
|
|
1796
|
+
* WebSocket routes for dev mode DO proxying.
|
|
1797
|
+
* Enables WebSocket connections to Durable Objects locally.
|
|
1798
|
+
*/
|
|
1799
|
+
wsRoutes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1800
|
+
/**
|
|
1801
|
+
* URL pattern to match for WebSocket upgrade requests.
|
|
1802
|
+
* @example '/chat/api'
|
|
1803
|
+
*/
|
|
1804
|
+
pattern: z.ZodString;
|
|
1805
|
+
/**
|
|
1806
|
+
* Durable Object namespace binding name to route to.
|
|
1807
|
+
* Must match a binding name in bindings.durableObjects.
|
|
1808
|
+
*/
|
|
1809
|
+
doNamespace: z.ZodString;
|
|
1810
|
+
/**
|
|
1811
|
+
* Query parameter name used to identify DO instances.
|
|
1812
|
+
* @default 'id'
|
|
1813
|
+
* @example `/chat/api?roomId=room123`
|
|
1814
|
+
*/
|
|
1815
|
+
idParam: z.ZodDefault<z.ZodString>;
|
|
1816
|
+
/**
|
|
1817
|
+
* Path to forward within the Durable Object.
|
|
1818
|
+
* @default '/websocket'
|
|
1819
|
+
*/
|
|
1820
|
+
forwardPath: z.ZodDefault<z.ZodString>;
|
|
1821
|
+
}, "strip", z.ZodTypeAny, {
|
|
1822
|
+
pattern: string;
|
|
1823
|
+
doNamespace: string;
|
|
1824
|
+
idParam: string;
|
|
1825
|
+
forwardPath: string;
|
|
1826
|
+
}, {
|
|
1827
|
+
pattern: string;
|
|
1828
|
+
doNamespace: string;
|
|
1829
|
+
idParam?: string | undefined;
|
|
1830
|
+
forwardPath?: string | undefined;
|
|
1831
|
+
}>, "many">>;
|
|
1832
|
+
/**
|
|
1833
|
+
* Static assets configuration.
|
|
1834
|
+
*/
|
|
1835
|
+
assets: z.ZodOptional<z.ZodObject<{
|
|
1836
|
+
/** Directory containing static assets (relative to config file) */
|
|
1837
|
+
directory: z.ZodString;
|
|
1838
|
+
/**
|
|
1839
|
+
* Optional binding name to access assets programmatically.
|
|
1840
|
+
* If provided, assets can be fetched via env[binding].fetch()
|
|
1841
|
+
*/
|
|
1842
|
+
binding: z.ZodOptional<z.ZodString>;
|
|
1843
|
+
}, "strip", z.ZodTypeAny, {
|
|
1844
|
+
directory: string;
|
|
1845
|
+
binding?: string | undefined;
|
|
1846
|
+
}, {
|
|
1847
|
+
directory: string;
|
|
1848
|
+
binding?: string | undefined;
|
|
1849
|
+
}>>;
|
|
1850
|
+
/**
|
|
1851
|
+
* Resource limits (CPU time).
|
|
1852
|
+
*/
|
|
1853
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
1854
|
+
/**
|
|
1855
|
+
* Maximum CPU time in milliseconds.
|
|
1856
|
+
* Only applicable to Workers with Usage Model set to Unbound.
|
|
1857
|
+
*/
|
|
1858
|
+
cpu_ms: z.ZodOptional<z.ZodNumber>;
|
|
1859
|
+
}, "strip", z.ZodTypeAny, {
|
|
1860
|
+
cpu_ms?: number | undefined;
|
|
1861
|
+
}, {
|
|
1862
|
+
cpu_ms?: number | undefined;
|
|
1863
|
+
}>>;
|
|
1864
|
+
/**
|
|
1865
|
+
* Observability settings (logging, tracing).
|
|
1866
|
+
*/
|
|
1867
|
+
observability: z.ZodOptional<z.ZodObject<{
|
|
1868
|
+
/** Enable Worker Logs */
|
|
1869
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1870
|
+
/**
|
|
1871
|
+
* Head sampling rate for logs (0-1).
|
|
1872
|
+
* 1.0 = log all requests, 0.1 = log 10% of requests.
|
|
1873
|
+
*/
|
|
1874
|
+
head_sampling_rate: z.ZodOptional<z.ZodNumber>;
|
|
1875
|
+
}, "strip", z.ZodTypeAny, {
|
|
1876
|
+
enabled?: boolean | undefined;
|
|
1877
|
+
head_sampling_rate?: number | undefined;
|
|
1878
|
+
}, {
|
|
1879
|
+
enabled?: boolean | undefined;
|
|
1880
|
+
head_sampling_rate?: number | undefined;
|
|
1881
|
+
}>>;
|
|
1882
|
+
/**
|
|
1883
|
+
* Durable Object migrations.
|
|
1884
|
+
* Required when changing DO class names or storage backends.
|
|
1885
|
+
*/
|
|
1886
|
+
migrations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1887
|
+
/**
|
|
1888
|
+
* Migration tag (version identifier).
|
|
1889
|
+
* Must be unique and in chronological order.
|
|
1890
|
+
* @example 'v1', 'v2'
|
|
1891
|
+
*/
|
|
1892
|
+
tag: z.ZodString;
|
|
1893
|
+
/**
|
|
1894
|
+
* New DO classes introduced in this migration.
|
|
1895
|
+
* Classes that didn't exist before.
|
|
1896
|
+
*/
|
|
1897
|
+
new_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1898
|
+
/**
|
|
1899
|
+
* Classes being renamed.
|
|
1900
|
+
* State is preserved during rename.
|
|
1901
|
+
*/
|
|
1902
|
+
renamed_classes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1903
|
+
from: z.ZodString;
|
|
1904
|
+
to: z.ZodString;
|
|
1905
|
+
}, "strip", z.ZodTypeAny, {
|
|
1906
|
+
from: string;
|
|
1907
|
+
to: string;
|
|
1908
|
+
}, {
|
|
1909
|
+
from: string;
|
|
1910
|
+
to: string;
|
|
1911
|
+
}>, "many">>;
|
|
1912
|
+
/**
|
|
1913
|
+
* Classes being deleted.
|
|
1914
|
+
* ⚠️ All state in these classes will be lost!
|
|
1915
|
+
*/
|
|
1916
|
+
deleted_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1917
|
+
/**
|
|
1918
|
+
* Classes migrating to SQLite storage backend.
|
|
1919
|
+
* Enables SQL API for these DO classes.
|
|
1920
|
+
*/
|
|
1921
|
+
new_sqlite_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1922
|
+
}, "strip", z.ZodTypeAny, {
|
|
1923
|
+
tag: string;
|
|
1924
|
+
new_classes?: string[] | undefined;
|
|
1925
|
+
renamed_classes?: {
|
|
1926
|
+
from: string;
|
|
1927
|
+
to: string;
|
|
1928
|
+
}[] | undefined;
|
|
1929
|
+
deleted_classes?: string[] | undefined;
|
|
1930
|
+
new_sqlite_classes?: string[] | undefined;
|
|
1931
|
+
}, {
|
|
1932
|
+
tag: string;
|
|
1933
|
+
new_classes?: string[] | undefined;
|
|
1934
|
+
renamed_classes?: {
|
|
1935
|
+
from: string;
|
|
1936
|
+
to: string;
|
|
1937
|
+
}[] | undefined;
|
|
1938
|
+
deleted_classes?: string[] | undefined;
|
|
1939
|
+
new_sqlite_classes?: string[] | undefined;
|
|
1940
|
+
}>, "many">>;
|
|
1941
|
+
/**
|
|
1942
|
+
* Build configuration for bundling.
|
|
1943
|
+
*/
|
|
1944
|
+
build: z.ZodOptional<z.ZodObject<{
|
|
1945
|
+
/**
|
|
1946
|
+
* Build target environment.
|
|
1947
|
+
* @example 'es2022'
|
|
1948
|
+
*/
|
|
1949
|
+
target: z.ZodOptional<z.ZodString>;
|
|
1950
|
+
/** Enable minification for smaller bundle size */
|
|
1951
|
+
minify: z.ZodOptional<z.ZodBoolean>;
|
|
1952
|
+
/** Generate source maps for debugging */
|
|
1953
|
+
sourcemap: z.ZodOptional<z.ZodBoolean>;
|
|
1954
|
+
/**
|
|
1955
|
+
* Additional Rolldown bundler options.
|
|
1956
|
+
* @see https://rolldown.rs/
|
|
1957
|
+
*/
|
|
1958
|
+
rolldownOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1959
|
+
}, "strip", z.ZodTypeAny, {
|
|
1960
|
+
target?: string | undefined;
|
|
1961
|
+
minify?: boolean | undefined;
|
|
1962
|
+
sourcemap?: boolean | undefined;
|
|
1963
|
+
rolldownOptions?: Record<string, unknown> | undefined;
|
|
1964
|
+
}, {
|
|
1965
|
+
target?: string | undefined;
|
|
1966
|
+
minify?: boolean | undefined;
|
|
1967
|
+
sourcemap?: boolean | undefined;
|
|
1968
|
+
rolldownOptions?: Record<string, unknown> | undefined;
|
|
1969
|
+
}>>;
|
|
1970
|
+
/**
|
|
1971
|
+
* Vite plugins to apply during build.
|
|
1972
|
+
*/
|
|
1973
|
+
plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
1974
|
+
/**
|
|
1975
|
+
* Environment-specific configuration overrides.
|
|
1976
|
+
* @example { staging: { vars: { DEBUG: 'true' } } }
|
|
1977
|
+
*/
|
|
1978
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1979
|
+
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
1980
|
+
compatibilityDate: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
1981
|
+
compatibilityFlags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
1982
|
+
files: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
1983
|
+
/**
|
|
1984
|
+
* Main fetch handler file path.
|
|
1985
|
+
* This handles HTTP requests to your worker.
|
|
1986
|
+
* @default 'src/fetch.{ts,js}'
|
|
1987
|
+
* @example 'src/fetch.ts'
|
|
1988
|
+
*/
|
|
1989
|
+
fetch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
1990
|
+
/**
|
|
1991
|
+
* Queue consumer handler file path.
|
|
1992
|
+
* Handles messages from Cloudflare Queues.
|
|
1993
|
+
* @default 'src/queue.ts'
|
|
1994
|
+
* @example 'src/queue.ts'
|
|
1995
|
+
*/
|
|
1996
|
+
queue: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
1997
|
+
/**
|
|
1998
|
+
* Scheduled (cron) handler file path.
|
|
1999
|
+
* Handles cron trigger invocations.
|
|
2000
|
+
* @default 'src/scheduled.ts'
|
|
2001
|
+
* @example 'src/scheduled.ts'
|
|
2002
|
+
*/
|
|
2003
|
+
scheduled: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
2004
|
+
/**
|
|
2005
|
+
* Email handler file path.
|
|
2006
|
+
* Handles incoming emails via Email Routing.
|
|
2007
|
+
* @default 'src/email.ts'
|
|
2008
|
+
* @example 'src/email.ts'
|
|
2009
|
+
*/
|
|
2010
|
+
email: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
2011
|
+
/**
|
|
2012
|
+
* Durable Object class discovery glob pattern.
|
|
2013
|
+
* Files matching this pattern are scanned for DO classes.
|
|
2014
|
+
* Respects `.gitignore` automatically.
|
|
2015
|
+
*
|
|
2016
|
+
* @default `**/do.*.{ts,js}` (recursive)
|
|
2017
|
+
* @example `**/do.*.{ts,js}` — Matches src/do.counter.ts, lib/do.chat.ts
|
|
2018
|
+
* @example `src/do.*.ts` — Legacy single-directory pattern
|
|
2019
|
+
*/
|
|
2020
|
+
durableObjects: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
2021
|
+
/**
|
|
2022
|
+
* WorkerEntrypoint class discovery glob pattern.
|
|
2023
|
+
* Files matching this pattern are scanned for named entrypoint classes.
|
|
2024
|
+
* Respects `.gitignore` automatically.
|
|
2025
|
+
*
|
|
2026
|
+
* Entrypoints enable typed cross-worker RPC via service bindings:
|
|
2027
|
+
* ```ts
|
|
2028
|
+
* // ep.admin.ts
|
|
2029
|
+
* export class AdminEntrypoint extends WorkerEntrypoint {
|
|
2030
|
+
* async getStats() { return { users: 100 } }
|
|
2031
|
+
* }
|
|
2032
|
+
*
|
|
2033
|
+
* // Consumer worker
|
|
2034
|
+
* const stats = await env.ADMIN_SERVICE.getStats()
|
|
2035
|
+
* ```
|
|
2036
|
+
*
|
|
2037
|
+
* @default `**/ep.*.{ts,js}` (recursive)
|
|
2038
|
+
* @example `**/ep.*.{ts,js}` — Matches src/ep.admin.ts, lib/ep.auth.ts
|
|
2039
|
+
* @example `src/ep.*.ts` — Legacy single-directory pattern
|
|
2040
|
+
*/
|
|
2041
|
+
entrypoints: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
2042
|
+
/**
|
|
2043
|
+
* Workflow class discovery glob pattern.
|
|
2044
|
+
* Files matching this pattern are scanned for Workflow classes.
|
|
2045
|
+
* Respects `.gitignore` automatically.
|
|
2046
|
+
*
|
|
2047
|
+
* Workflows enable durable multi-step execution with automatic retries:
|
|
2048
|
+
* ```ts
|
|
2049
|
+
* // wf.order-processor.ts
|
|
2050
|
+
* export class OrderProcessingWorkflow extends Workflow {
|
|
2051
|
+
* async run(event, step) {
|
|
2052
|
+
* const validated = await step.do('validate', () => validate(event.payload))
|
|
2053
|
+
* const charged = await step.do('charge', () => charge(validated))
|
|
2054
|
+
* return { orderId: charged.id }
|
|
2055
|
+
* }
|
|
2056
|
+
* }
|
|
2057
|
+
* ```
|
|
2058
|
+
*
|
|
2059
|
+
* @default `**/wf.*.{ts,js}` (recursive)
|
|
2060
|
+
* @example `**/wf.*.{ts,js}` — Matches src/wf.order.ts, lib/wf.pipeline.ts
|
|
2061
|
+
* @example `src/wf.*.ts` — Legacy single-directory pattern
|
|
2062
|
+
*/
|
|
2063
|
+
workflows: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
2064
|
+
/**
|
|
2065
|
+
* File-based routing configuration.
|
|
2066
|
+
* Enables automatic route discovery from a directory.
|
|
2067
|
+
*
|
|
2068
|
+
* Directory structure maps to URL paths:
|
|
2069
|
+
* ```
|
|
2070
|
+
* src/routes/
|
|
2071
|
+
* ├── index.ts → GET /
|
|
2072
|
+
* ├── users/
|
|
2073
|
+
* │ ├── index.ts → GET /users POST /users
|
|
2074
|
+
* │ ├── [id].ts → GET /users/:id
|
|
2075
|
+
* │ └── [id]/
|
|
2076
|
+
* │ └── posts.ts → GET /users/:id/posts
|
|
2077
|
+
* └── api/
|
|
2078
|
+
* └── health.ts → GET /api/health
|
|
2079
|
+
* ```
|
|
2080
|
+
*
|
|
2081
|
+
* Each file exports HTTP method handlers:
|
|
2082
|
+
* ```ts
|
|
2083
|
+
* export function GET(req: Request, env: Env) { ... }
|
|
2084
|
+
* export function POST(req: Request, env: Env) { ... }
|
|
2085
|
+
* ```
|
|
2086
|
+
*/
|
|
2087
|
+
routes: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
2088
|
+
/** Directory containing route files (e.g., 'src/routes') */
|
|
2089
|
+
dir: z.ZodString;
|
|
2090
|
+
/** Optional URL prefix for all routes (e.g., '/api') */
|
|
2091
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
2092
|
+
}, "strip", z.ZodTypeAny, {
|
|
2093
|
+
dir: string;
|
|
2094
|
+
prefix?: string | undefined;
|
|
2095
|
+
}, {
|
|
2096
|
+
dir: string;
|
|
2097
|
+
prefix?: string | undefined;
|
|
2098
|
+
}>, z.ZodLiteral<false>]>>;
|
|
2099
|
+
/**
|
|
2100
|
+
* Transport file for custom RPC serialization.
|
|
2101
|
+
* Implements SvelteKit-style encode/decode for complex types.
|
|
2102
|
+
* @default 'src/transport.ts'
|
|
2103
|
+
* @example 'src/transport.ts'
|
|
2104
|
+
*/
|
|
2105
|
+
transport: z.ZodOptional<z.ZodString>;
|
|
2106
|
+
}, "strip", z.ZodTypeAny, {
|
|
2107
|
+
fetch?: string | false | undefined;
|
|
2108
|
+
queue?: string | false | undefined;
|
|
2109
|
+
scheduled?: string | false | undefined;
|
|
2110
|
+
email?: string | false | undefined;
|
|
2111
|
+
durableObjects?: string | false | undefined;
|
|
2112
|
+
entrypoints?: string | false | undefined;
|
|
2113
|
+
workflows?: string | false | undefined;
|
|
2114
|
+
routes?: false | {
|
|
2115
|
+
dir: string;
|
|
2116
|
+
prefix?: string | undefined;
|
|
2117
|
+
} | undefined;
|
|
2118
|
+
transport?: string | undefined;
|
|
2119
|
+
}, {
|
|
2120
|
+
fetch?: string | false | undefined;
|
|
2121
|
+
queue?: string | false | undefined;
|
|
2122
|
+
scheduled?: string | false | undefined;
|
|
2123
|
+
email?: string | false | undefined;
|
|
2124
|
+
durableObjects?: string | false | undefined;
|
|
2125
|
+
entrypoints?: string | false | undefined;
|
|
2126
|
+
workflows?: string | false | undefined;
|
|
2127
|
+
routes?: false | {
|
|
2128
|
+
dir: string;
|
|
2129
|
+
prefix?: string | undefined;
|
|
2130
|
+
} | undefined;
|
|
2131
|
+
transport?: string | undefined;
|
|
2132
|
+
}>>>;
|
|
2133
|
+
bindings: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
2134
|
+
/**
|
|
2135
|
+
* KV Namespace bindings.
|
|
2136
|
+
* Maps binding name to KV namespace ID.
|
|
2137
|
+
* @example { CACHE: 'cache-kv-namespace-id' }
|
|
2138
|
+
*/
|
|
2139
|
+
kv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
2140
|
+
/**
|
|
2141
|
+
* D1 Database bindings.
|
|
2142
|
+
* Maps binding name to D1 database ID.
|
|
2143
|
+
* @example { DB: 'main-database-id' }
|
|
2144
|
+
*/
|
|
2145
|
+
d1: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
2146
|
+
/**
|
|
2147
|
+
* R2 Bucket bindings.
|
|
2148
|
+
* Maps binding name to R2 bucket name.
|
|
2149
|
+
* @example { IMAGES: 'images-bucket' }
|
|
2150
|
+
*/
|
|
2151
|
+
r2: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
2152
|
+
/**
|
|
2153
|
+
* Durable Object bindings.
|
|
2154
|
+
* Maps binding name to DO class configuration.
|
|
2155
|
+
* @example { COUNTER: 'Counter' } or { COUNTER: { className: 'Counter' } }
|
|
2156
|
+
*/
|
|
2157
|
+
durableObjects: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<DurableObjectBindingInput, z.ZodTypeDef, DurableObjectBindingInput>>>;
|
|
2158
|
+
/**
|
|
2159
|
+
* Queue bindings for producers and consumers.
|
|
2160
|
+
*/
|
|
2161
|
+
queues: z.ZodOptional<z.ZodObject<{
|
|
2162
|
+
/**
|
|
2163
|
+
* Queue producer bindings.
|
|
2164
|
+
* Maps binding name to queue name.
|
|
2165
|
+
* @example { TASK_QUEUE: 'task-queue' }
|
|
2166
|
+
*/
|
|
2167
|
+
producers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
2168
|
+
/**
|
|
2169
|
+
* Queue consumer configurations.
|
|
2170
|
+
* Array of consumer configs for processing queue messages.
|
|
2171
|
+
*/
|
|
2172
|
+
consumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2173
|
+
/** Queue name to consume from */
|
|
2174
|
+
queue: z.ZodString;
|
|
2175
|
+
/**
|
|
2176
|
+
* Maximum messages per batch (1-100).
|
|
2177
|
+
* @default 10
|
|
2178
|
+
*/
|
|
2179
|
+
maxBatchSize: z.ZodOptional<z.ZodNumber>;
|
|
2180
|
+
/**
|
|
2181
|
+
* Maximum seconds to wait for a full batch.
|
|
2182
|
+
* @default 5
|
|
2183
|
+
*/
|
|
2184
|
+
maxBatchTimeout: z.ZodOptional<z.ZodNumber>;
|
|
2185
|
+
/**
|
|
2186
|
+
* Maximum retry attempts for failed messages.
|
|
2187
|
+
* @default 3
|
|
2188
|
+
*/
|
|
2189
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
2190
|
+
/** Queue name to send failed messages after max retries */
|
|
2191
|
+
deadLetterQueue: z.ZodOptional<z.ZodString>;
|
|
2192
|
+
/** Maximum concurrent batch invocations */
|
|
2193
|
+
maxConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
2194
|
+
/** Delay in seconds between retries */
|
|
2195
|
+
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
2196
|
+
}, "strip", z.ZodTypeAny, {
|
|
2197
|
+
queue: string;
|
|
2198
|
+
maxBatchSize?: number | undefined;
|
|
2199
|
+
maxBatchTimeout?: number | undefined;
|
|
2200
|
+
maxRetries?: number | undefined;
|
|
2201
|
+
deadLetterQueue?: string | undefined;
|
|
2202
|
+
maxConcurrency?: number | undefined;
|
|
2203
|
+
retryDelay?: number | undefined;
|
|
2204
|
+
}, {
|
|
2205
|
+
queue: string;
|
|
2206
|
+
maxBatchSize?: number | undefined;
|
|
2207
|
+
maxBatchTimeout?: number | undefined;
|
|
2208
|
+
maxRetries?: number | undefined;
|
|
2209
|
+
deadLetterQueue?: string | undefined;
|
|
2210
|
+
maxConcurrency?: number | undefined;
|
|
2211
|
+
retryDelay?: number | undefined;
|
|
2212
|
+
}>, "many">>;
|
|
2213
|
+
}, "strip", z.ZodTypeAny, {
|
|
2214
|
+
producers?: Record<string, string> | undefined;
|
|
2215
|
+
consumers?: {
|
|
2216
|
+
queue: string;
|
|
2217
|
+
maxBatchSize?: number | undefined;
|
|
2218
|
+
maxBatchTimeout?: number | undefined;
|
|
2219
|
+
maxRetries?: number | undefined;
|
|
2220
|
+
deadLetterQueue?: string | undefined;
|
|
2221
|
+
maxConcurrency?: number | undefined;
|
|
2222
|
+
retryDelay?: number | undefined;
|
|
2223
|
+
}[] | undefined;
|
|
2224
|
+
}, {
|
|
2225
|
+
producers?: Record<string, string> | undefined;
|
|
2226
|
+
consumers?: {
|
|
2227
|
+
queue: string;
|
|
2228
|
+
maxBatchSize?: number | undefined;
|
|
2229
|
+
maxBatchTimeout?: number | undefined;
|
|
2230
|
+
maxRetries?: number | undefined;
|
|
2231
|
+
deadLetterQueue?: string | undefined;
|
|
2232
|
+
maxConcurrency?: number | undefined;
|
|
2233
|
+
retryDelay?: number | undefined;
|
|
2234
|
+
}[] | undefined;
|
|
2235
|
+
}>>;
|
|
2236
|
+
/**
|
|
2237
|
+
* Service bindings to other Workers.
|
|
2238
|
+
* Enables RPC-style communication between workers.
|
|
2239
|
+
* @example { MATH: mathWorker.worker }
|
|
2240
|
+
*/
|
|
2241
|
+
services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<{
|
|
2242
|
+
/** Target worker/service name */
|
|
2243
|
+
service: string;
|
|
2244
|
+
/** Optional environment (staging, production, etc.) */
|
|
2245
|
+
environment?: string | undefined;
|
|
2246
|
+
/** Optional entrypoint class name for named exports */
|
|
2247
|
+
entrypoint?: string | undefined;
|
|
2248
|
+
/** @internal Reference marker for ref() bindings */
|
|
2249
|
+
__ref?: unknown;
|
|
2250
|
+
}, z.ZodTypeDef, {
|
|
2251
|
+
/** Target worker/service name */
|
|
2252
|
+
service: string;
|
|
2253
|
+
/** Optional environment (staging, production, etc.) */
|
|
2254
|
+
environment?: string | undefined;
|
|
2255
|
+
/** Optional entrypoint class name for named exports */
|
|
2256
|
+
entrypoint?: string | undefined;
|
|
2257
|
+
/** @internal Reference marker for ref() bindings */
|
|
2258
|
+
__ref?: unknown;
|
|
2259
|
+
}>>>;
|
|
2260
|
+
/**
|
|
2261
|
+
* Workers AI binding for ML inference.
|
|
2262
|
+
* @example { binding: 'AI' }
|
|
2263
|
+
*/
|
|
2264
|
+
ai: z.ZodOptional<z.ZodObject<{
|
|
2265
|
+
/** Binding name exposed in env (e.g., 'AI') */
|
|
2266
|
+
binding: z.ZodString;
|
|
2267
|
+
}, "strip", z.ZodTypeAny, {
|
|
2268
|
+
binding: string;
|
|
2269
|
+
}, {
|
|
2270
|
+
binding: string;
|
|
2271
|
+
}>>;
|
|
2272
|
+
/**
|
|
2273
|
+
* Vectorize index bindings for vector similarity search.
|
|
2274
|
+
* @example { EMBEDDINGS: { indexName: 'my-index' } }
|
|
2275
|
+
*/
|
|
2276
|
+
vectorize: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2277
|
+
/** Name of the Vectorize index */
|
|
2278
|
+
indexName: z.ZodString;
|
|
2279
|
+
}, "strip", z.ZodTypeAny, {
|
|
2280
|
+
indexName: string;
|
|
2281
|
+
}, {
|
|
2282
|
+
indexName: string;
|
|
2283
|
+
}>>>;
|
|
2284
|
+
/**
|
|
2285
|
+
* Hyperdrive bindings for accelerated PostgreSQL.
|
|
2286
|
+
* @example { DB: { id: 'hyperdrive-config-id' } }
|
|
2287
|
+
*/
|
|
2288
|
+
hyperdrive: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2289
|
+
/** Hyperdrive configuration ID */
|
|
2290
|
+
id: z.ZodString;
|
|
2291
|
+
}, "strip", z.ZodTypeAny, {
|
|
2292
|
+
id: string;
|
|
2293
|
+
}, {
|
|
2294
|
+
id: string;
|
|
2295
|
+
}>>>;
|
|
2296
|
+
/**
|
|
2297
|
+
* Browser Rendering binding for headless browser access.
|
|
2298
|
+
* @example { binding: 'BROWSER' }
|
|
2299
|
+
*/
|
|
2300
|
+
browser: z.ZodOptional<z.ZodObject<{
|
|
2301
|
+
/** Binding name exposed in env (e.g., 'BROWSER') */
|
|
2302
|
+
binding: z.ZodString;
|
|
2303
|
+
}, "strip", z.ZodTypeAny, {
|
|
2304
|
+
binding: string;
|
|
2305
|
+
}, {
|
|
2306
|
+
binding: string;
|
|
2307
|
+
}>>;
|
|
2308
|
+
/**
|
|
2309
|
+
* Analytics Engine bindings for event logging.
|
|
2310
|
+
* @example { ANALYTICS: { dataset: 'my-dataset' } }
|
|
2311
|
+
*/
|
|
2312
|
+
analyticsEngine: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2313
|
+
/** Analytics Engine dataset name */
|
|
2314
|
+
dataset: z.ZodString;
|
|
2315
|
+
}, "strip", z.ZodTypeAny, {
|
|
2316
|
+
dataset: string;
|
|
2317
|
+
}, {
|
|
2318
|
+
dataset: string;
|
|
2319
|
+
}>>>;
|
|
2320
|
+
/**
|
|
2321
|
+
* Email sending bindings.
|
|
2322
|
+
* @example { EMAIL: { destinationAddress: 'admin@example.com' } }
|
|
2323
|
+
*/
|
|
2324
|
+
sendEmail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2325
|
+
/** Default destination address (can be overridden per-send) */
|
|
2326
|
+
destinationAddress: z.ZodOptional<z.ZodString>;
|
|
2327
|
+
}, "strip", z.ZodTypeAny, {
|
|
2328
|
+
destinationAddress?: string | undefined;
|
|
2329
|
+
}, {
|
|
2330
|
+
destinationAddress?: string | undefined;
|
|
2331
|
+
}>>>;
|
|
2332
|
+
}, "strip", z.ZodTypeAny, {
|
|
2333
|
+
kv?: Record<string, string> | undefined;
|
|
2334
|
+
d1?: Record<string, string> | undefined;
|
|
2335
|
+
r2?: Record<string, string> | undefined;
|
|
2336
|
+
durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
|
|
2337
|
+
queues?: {
|
|
2338
|
+
producers?: Record<string, string> | undefined;
|
|
2339
|
+
consumers?: {
|
|
2340
|
+
queue: string;
|
|
2341
|
+
maxBatchSize?: number | undefined;
|
|
2342
|
+
maxBatchTimeout?: number | undefined;
|
|
2343
|
+
maxRetries?: number | undefined;
|
|
2344
|
+
deadLetterQueue?: string | undefined;
|
|
2345
|
+
maxConcurrency?: number | undefined;
|
|
2346
|
+
retryDelay?: number | undefined;
|
|
2347
|
+
}[] | undefined;
|
|
2348
|
+
} | undefined;
|
|
2349
|
+
services?: Record<string, {
|
|
2350
|
+
/** Target worker/service name */
|
|
2351
|
+
service: string;
|
|
2352
|
+
/** Optional environment (staging, production, etc.) */
|
|
2353
|
+
environment?: string | undefined;
|
|
2354
|
+
/** Optional entrypoint class name for named exports */
|
|
2355
|
+
entrypoint?: string | undefined;
|
|
2356
|
+
/** @internal Reference marker for ref() bindings */
|
|
2357
|
+
__ref?: unknown;
|
|
2358
|
+
}> | undefined;
|
|
2359
|
+
ai?: {
|
|
2360
|
+
binding: string;
|
|
2361
|
+
} | undefined;
|
|
2362
|
+
vectorize?: Record<string, {
|
|
2363
|
+
indexName: string;
|
|
2364
|
+
}> | undefined;
|
|
2365
|
+
hyperdrive?: Record<string, {
|
|
2366
|
+
id: string;
|
|
2367
|
+
}> | undefined;
|
|
2368
|
+
browser?: {
|
|
2369
|
+
binding: string;
|
|
2370
|
+
} | undefined;
|
|
2371
|
+
analyticsEngine?: Record<string, {
|
|
2372
|
+
dataset: string;
|
|
2373
|
+
}> | undefined;
|
|
2374
|
+
sendEmail?: Record<string, {
|
|
2375
|
+
destinationAddress?: string | undefined;
|
|
2376
|
+
}> | undefined;
|
|
2377
|
+
}, {
|
|
2378
|
+
kv?: Record<string, string> | undefined;
|
|
2379
|
+
d1?: Record<string, string> | undefined;
|
|
2380
|
+
r2?: Record<string, string> | undefined;
|
|
2381
|
+
durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
|
|
2382
|
+
queues?: {
|
|
2383
|
+
producers?: Record<string, string> | undefined;
|
|
2384
|
+
consumers?: {
|
|
2385
|
+
queue: string;
|
|
2386
|
+
maxBatchSize?: number | undefined;
|
|
2387
|
+
maxBatchTimeout?: number | undefined;
|
|
2388
|
+
maxRetries?: number | undefined;
|
|
2389
|
+
deadLetterQueue?: string | undefined;
|
|
2390
|
+
maxConcurrency?: number | undefined;
|
|
2391
|
+
retryDelay?: number | undefined;
|
|
2392
|
+
}[] | undefined;
|
|
2393
|
+
} | undefined;
|
|
2394
|
+
services?: Record<string, {
|
|
2395
|
+
/** Target worker/service name */
|
|
2396
|
+
service: string;
|
|
2397
|
+
/** Optional environment (staging, production, etc.) */
|
|
2398
|
+
environment?: string | undefined;
|
|
2399
|
+
/** Optional entrypoint class name for named exports */
|
|
2400
|
+
entrypoint?: string | undefined;
|
|
2401
|
+
/** @internal Reference marker for ref() bindings */
|
|
2402
|
+
__ref?: unknown;
|
|
2403
|
+
}> | undefined;
|
|
2404
|
+
ai?: {
|
|
2405
|
+
binding: string;
|
|
2406
|
+
} | undefined;
|
|
2407
|
+
vectorize?: Record<string, {
|
|
2408
|
+
indexName: string;
|
|
2409
|
+
}> | undefined;
|
|
2410
|
+
hyperdrive?: Record<string, {
|
|
2411
|
+
id: string;
|
|
2412
|
+
}> | undefined;
|
|
2413
|
+
browser?: {
|
|
2414
|
+
binding: string;
|
|
2415
|
+
} | undefined;
|
|
2416
|
+
analyticsEngine?: Record<string, {
|
|
2417
|
+
dataset: string;
|
|
2418
|
+
}> | undefined;
|
|
2419
|
+
sendEmail?: Record<string, {
|
|
2420
|
+
destinationAddress?: string | undefined;
|
|
2421
|
+
}> | undefined;
|
|
2422
|
+
}>>>;
|
|
2423
|
+
triggers: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
2424
|
+
/**
|
|
2425
|
+
* Array of cron expressions for scheduled execution.
|
|
2426
|
+
*
|
|
2427
|
+
* Examples:
|
|
2428
|
+
* - `'0 0 * * *'` — Daily at midnight
|
|
2429
|
+
* - `'0/5 * * * *'` — Every 5 minutes
|
|
2430
|
+
* - `'0 9 * * 1'` — Every Monday at 9am
|
|
2431
|
+
*/
|
|
2432
|
+
crons: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2433
|
+
}, "strip", z.ZodTypeAny, {
|
|
2434
|
+
crons?: string[] | undefined;
|
|
2435
|
+
}, {
|
|
2436
|
+
crons?: string[] | undefined;
|
|
2437
|
+
}>>>;
|
|
2438
|
+
vars: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
2439
|
+
secrets: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2440
|
+
/**
|
|
2441
|
+
* Whether this secret is required for the worker to run.
|
|
2442
|
+
* If true, worker will fail to start if secret is missing.
|
|
2443
|
+
* @default true
|
|
2444
|
+
*/
|
|
2445
|
+
required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
2446
|
+
}, "strip", z.ZodTypeAny, {
|
|
2447
|
+
required: boolean;
|
|
2448
|
+
}, {
|
|
2449
|
+
required?: boolean | undefined;
|
|
2450
|
+
}>>>>;
|
|
2451
|
+
routes: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2452
|
+
/**
|
|
2453
|
+
* URL pattern to match (e.g., 'example.com/*').
|
|
2454
|
+
* Supports wildcards (*) for path matching.
|
|
2455
|
+
*/
|
|
2456
|
+
pattern: z.ZodString;
|
|
2457
|
+
/** Zone name to associate the route with */
|
|
2458
|
+
zone_name: z.ZodOptional<z.ZodString>;
|
|
2459
|
+
/** Zone ID to associate the route with (alternative to zone_name) */
|
|
2460
|
+
zone_id: z.ZodOptional<z.ZodString>;
|
|
2461
|
+
/** Whether this is a custom domain route */
|
|
2462
|
+
custom_domain: z.ZodOptional<z.ZodBoolean>;
|
|
2463
|
+
}, "strip", z.ZodTypeAny, {
|
|
2464
|
+
pattern: string;
|
|
2465
|
+
zone_name?: string | undefined;
|
|
2466
|
+
zone_id?: string | undefined;
|
|
2467
|
+
custom_domain?: boolean | undefined;
|
|
2468
|
+
}, {
|
|
2469
|
+
pattern: string;
|
|
2470
|
+
zone_name?: string | undefined;
|
|
2471
|
+
zone_id?: string | undefined;
|
|
2472
|
+
custom_domain?: boolean | undefined;
|
|
2473
|
+
}>, "many">>>;
|
|
2474
|
+
assets: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
2475
|
+
/** Directory containing static assets (relative to config file) */
|
|
2476
|
+
directory: z.ZodString;
|
|
2477
|
+
/**
|
|
2478
|
+
* Optional binding name to access assets programmatically.
|
|
2479
|
+
* If provided, assets can be fetched via env[binding].fetch()
|
|
2480
|
+
*/
|
|
2481
|
+
binding: z.ZodOptional<z.ZodString>;
|
|
2482
|
+
}, "strip", z.ZodTypeAny, {
|
|
2483
|
+
directory: string;
|
|
2484
|
+
binding?: string | undefined;
|
|
2485
|
+
}, {
|
|
2486
|
+
directory: string;
|
|
2487
|
+
binding?: string | undefined;
|
|
2488
|
+
}>>>;
|
|
2489
|
+
limits: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
2490
|
+
/**
|
|
2491
|
+
* Maximum CPU time in milliseconds.
|
|
2492
|
+
* Only applicable to Workers with Usage Model set to Unbound.
|
|
2493
|
+
*/
|
|
2494
|
+
cpu_ms: z.ZodOptional<z.ZodNumber>;
|
|
2495
|
+
}, "strip", z.ZodTypeAny, {
|
|
2496
|
+
cpu_ms?: number | undefined;
|
|
2497
|
+
}, {
|
|
2498
|
+
cpu_ms?: number | undefined;
|
|
2499
|
+
}>>>;
|
|
2500
|
+
observability: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
2501
|
+
/** Enable Worker Logs */
|
|
2502
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
2503
|
+
/**
|
|
2504
|
+
* Head sampling rate for logs (0-1).
|
|
2505
|
+
* 1.0 = log all requests, 0.1 = log 10% of requests.
|
|
2506
|
+
*/
|
|
2507
|
+
head_sampling_rate: z.ZodOptional<z.ZodNumber>;
|
|
2508
|
+
}, "strip", z.ZodTypeAny, {
|
|
2509
|
+
enabled?: boolean | undefined;
|
|
2510
|
+
head_sampling_rate?: number | undefined;
|
|
2511
|
+
}, {
|
|
2512
|
+
enabled?: boolean | undefined;
|
|
2513
|
+
head_sampling_rate?: number | undefined;
|
|
2514
|
+
}>>>;
|
|
2515
|
+
migrations: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2516
|
+
/**
|
|
2517
|
+
* Migration tag (version identifier).
|
|
2518
|
+
* Must be unique and in chronological order.
|
|
2519
|
+
* @example 'v1', 'v2'
|
|
2520
|
+
*/
|
|
2521
|
+
tag: z.ZodString;
|
|
2522
|
+
/**
|
|
2523
|
+
* New DO classes introduced in this migration.
|
|
2524
|
+
* Classes that didn't exist before.
|
|
2525
|
+
*/
|
|
2526
|
+
new_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2527
|
+
/**
|
|
2528
|
+
* Classes being renamed.
|
|
2529
|
+
* State is preserved during rename.
|
|
2530
|
+
*/
|
|
2531
|
+
renamed_classes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2532
|
+
from: z.ZodString;
|
|
2533
|
+
to: z.ZodString;
|
|
2534
|
+
}, "strip", z.ZodTypeAny, {
|
|
2535
|
+
from: string;
|
|
2536
|
+
to: string;
|
|
2537
|
+
}, {
|
|
2538
|
+
from: string;
|
|
2539
|
+
to: string;
|
|
2540
|
+
}>, "many">>;
|
|
2541
|
+
/**
|
|
2542
|
+
* Classes being deleted.
|
|
2543
|
+
* ⚠️ All state in these classes will be lost!
|
|
2544
|
+
*/
|
|
2545
|
+
deleted_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2546
|
+
/**
|
|
2547
|
+
* Classes migrating to SQLite storage backend.
|
|
2548
|
+
* Enables SQL API for these DO classes.
|
|
2549
|
+
*/
|
|
2550
|
+
new_sqlite_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2551
|
+
}, "strip", z.ZodTypeAny, {
|
|
2552
|
+
tag: string;
|
|
2553
|
+
new_classes?: string[] | undefined;
|
|
2554
|
+
renamed_classes?: {
|
|
2555
|
+
from: string;
|
|
2556
|
+
to: string;
|
|
2557
|
+
}[] | undefined;
|
|
2558
|
+
deleted_classes?: string[] | undefined;
|
|
2559
|
+
new_sqlite_classes?: string[] | undefined;
|
|
2560
|
+
}, {
|
|
2561
|
+
tag: string;
|
|
2562
|
+
new_classes?: string[] | undefined;
|
|
2563
|
+
renamed_classes?: {
|
|
2564
|
+
from: string;
|
|
2565
|
+
to: string;
|
|
2566
|
+
}[] | undefined;
|
|
2567
|
+
deleted_classes?: string[] | undefined;
|
|
2568
|
+
new_sqlite_classes?: string[] | undefined;
|
|
2569
|
+
}>, "many">>>;
|
|
2570
|
+
build: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
2571
|
+
/**
|
|
2572
|
+
* Build target environment.
|
|
2573
|
+
* @example 'es2022'
|
|
2574
|
+
*/
|
|
2575
|
+
target: z.ZodOptional<z.ZodString>;
|
|
2576
|
+
/** Enable minification for smaller bundle size */
|
|
2577
|
+
minify: z.ZodOptional<z.ZodBoolean>;
|
|
2578
|
+
/** Generate source maps for debugging */
|
|
2579
|
+
sourcemap: z.ZodOptional<z.ZodBoolean>;
|
|
2580
|
+
/**
|
|
2581
|
+
* Additional Rolldown bundler options.
|
|
2582
|
+
* @see https://rolldown.rs/
|
|
2583
|
+
*/
|
|
2584
|
+
rolldownOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2585
|
+
}, "strip", z.ZodTypeAny, {
|
|
2586
|
+
target?: string | undefined;
|
|
2587
|
+
minify?: boolean | undefined;
|
|
2588
|
+
sourcemap?: boolean | undefined;
|
|
2589
|
+
rolldownOptions?: Record<string, unknown> | undefined;
|
|
2590
|
+
}, {
|
|
2591
|
+
target?: string | undefined;
|
|
2592
|
+
minify?: boolean | undefined;
|
|
2593
|
+
sourcemap?: boolean | undefined;
|
|
2594
|
+
rolldownOptions?: Record<string, unknown> | undefined;
|
|
2595
|
+
}>>>;
|
|
2596
|
+
wrangler: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
2597
|
+
/**
|
|
2598
|
+
* Arbitrary key-value pairs passed directly to wrangler.jsonc.
|
|
2599
|
+
* @example { placement: { mode: 'smart' } }
|
|
2600
|
+
*/
|
|
2601
|
+
passthrough: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2602
|
+
}, "strip", z.ZodTypeAny, {
|
|
2603
|
+
passthrough?: Record<string, unknown> | undefined;
|
|
2604
|
+
}, {
|
|
2605
|
+
passthrough?: Record<string, unknown> | undefined;
|
|
2606
|
+
}>>>;
|
|
2607
|
+
}, "strip", z.ZodTypeAny, {
|
|
2608
|
+
name?: string | undefined;
|
|
2609
|
+
compatibilityDate?: string | undefined;
|
|
2610
|
+
compatibilityFlags?: string[] | undefined;
|
|
2611
|
+
files?: {
|
|
2612
|
+
fetch?: string | false | undefined;
|
|
2613
|
+
queue?: string | false | undefined;
|
|
2614
|
+
scheduled?: string | false | undefined;
|
|
2615
|
+
email?: string | false | undefined;
|
|
2616
|
+
durableObjects?: string | false | undefined;
|
|
2617
|
+
entrypoints?: string | false | undefined;
|
|
2618
|
+
workflows?: string | false | undefined;
|
|
2619
|
+
routes?: false | {
|
|
2620
|
+
dir: string;
|
|
2621
|
+
prefix?: string | undefined;
|
|
2622
|
+
} | undefined;
|
|
2623
|
+
transport?: string | undefined;
|
|
2624
|
+
} | undefined;
|
|
2625
|
+
bindings?: {
|
|
2626
|
+
kv?: Record<string, string> | undefined;
|
|
2627
|
+
d1?: Record<string, string> | undefined;
|
|
2628
|
+
r2?: Record<string, string> | undefined;
|
|
2629
|
+
durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
|
|
2630
|
+
queues?: {
|
|
2631
|
+
producers?: Record<string, string> | undefined;
|
|
2632
|
+
consumers?: {
|
|
2633
|
+
queue: string;
|
|
2634
|
+
maxBatchSize?: number | undefined;
|
|
2635
|
+
maxBatchTimeout?: number | undefined;
|
|
2636
|
+
maxRetries?: number | undefined;
|
|
2637
|
+
deadLetterQueue?: string | undefined;
|
|
2638
|
+
maxConcurrency?: number | undefined;
|
|
2639
|
+
retryDelay?: number | undefined;
|
|
2640
|
+
}[] | undefined;
|
|
2641
|
+
} | undefined;
|
|
2642
|
+
services?: Record<string, {
|
|
2643
|
+
/** Target worker/service name */
|
|
2644
|
+
service: string;
|
|
2645
|
+
/** Optional environment (staging, production, etc.) */
|
|
2646
|
+
environment?: string | undefined;
|
|
2647
|
+
/** Optional entrypoint class name for named exports */
|
|
2648
|
+
entrypoint?: string | undefined;
|
|
2649
|
+
/** @internal Reference marker for ref() bindings */
|
|
2650
|
+
__ref?: unknown;
|
|
2651
|
+
}> | undefined;
|
|
2652
|
+
ai?: {
|
|
2653
|
+
binding: string;
|
|
2654
|
+
} | undefined;
|
|
2655
|
+
vectorize?: Record<string, {
|
|
2656
|
+
indexName: string;
|
|
2657
|
+
}> | undefined;
|
|
2658
|
+
hyperdrive?: Record<string, {
|
|
2659
|
+
id: string;
|
|
2660
|
+
}> | undefined;
|
|
2661
|
+
browser?: {
|
|
2662
|
+
binding: string;
|
|
2663
|
+
} | undefined;
|
|
2664
|
+
analyticsEngine?: Record<string, {
|
|
2665
|
+
dataset: string;
|
|
2666
|
+
}> | undefined;
|
|
2667
|
+
sendEmail?: Record<string, {
|
|
2668
|
+
destinationAddress?: string | undefined;
|
|
2669
|
+
}> | undefined;
|
|
2670
|
+
} | undefined;
|
|
2671
|
+
triggers?: {
|
|
2672
|
+
crons?: string[] | undefined;
|
|
2673
|
+
} | undefined;
|
|
2674
|
+
vars?: Record<string, string> | undefined;
|
|
2675
|
+
secrets?: Record<string, {
|
|
2676
|
+
required: boolean;
|
|
2677
|
+
}> | undefined;
|
|
2678
|
+
routes?: {
|
|
2679
|
+
pattern: string;
|
|
2680
|
+
zone_name?: string | undefined;
|
|
2681
|
+
zone_id?: string | undefined;
|
|
2682
|
+
custom_domain?: boolean | undefined;
|
|
2683
|
+
}[] | undefined;
|
|
2684
|
+
assets?: {
|
|
2685
|
+
directory: string;
|
|
2686
|
+
binding?: string | undefined;
|
|
2687
|
+
} | undefined;
|
|
2688
|
+
limits?: {
|
|
2689
|
+
cpu_ms?: number | undefined;
|
|
2690
|
+
} | undefined;
|
|
2691
|
+
observability?: {
|
|
2692
|
+
enabled?: boolean | undefined;
|
|
2693
|
+
head_sampling_rate?: number | undefined;
|
|
2694
|
+
} | undefined;
|
|
2695
|
+
migrations?: {
|
|
2696
|
+
tag: string;
|
|
2697
|
+
new_classes?: string[] | undefined;
|
|
2698
|
+
renamed_classes?: {
|
|
2699
|
+
from: string;
|
|
2700
|
+
to: string;
|
|
2701
|
+
}[] | undefined;
|
|
2702
|
+
deleted_classes?: string[] | undefined;
|
|
2703
|
+
new_sqlite_classes?: string[] | undefined;
|
|
2704
|
+
}[] | undefined;
|
|
2705
|
+
build?: {
|
|
2706
|
+
target?: string | undefined;
|
|
2707
|
+
minify?: boolean | undefined;
|
|
2708
|
+
sourcemap?: boolean | undefined;
|
|
2709
|
+
rolldownOptions?: Record<string, unknown> | undefined;
|
|
2710
|
+
} | undefined;
|
|
2711
|
+
wrangler?: {
|
|
2712
|
+
passthrough?: Record<string, unknown> | undefined;
|
|
2713
|
+
} | undefined;
|
|
2714
|
+
}, {
|
|
2715
|
+
name?: string | undefined;
|
|
2716
|
+
compatibilityDate?: string | undefined;
|
|
2717
|
+
compatibilityFlags?: string[] | undefined;
|
|
2718
|
+
files?: {
|
|
2719
|
+
fetch?: string | false | undefined;
|
|
2720
|
+
queue?: string | false | undefined;
|
|
2721
|
+
scheduled?: string | false | undefined;
|
|
2722
|
+
email?: string | false | undefined;
|
|
2723
|
+
durableObjects?: string | false | undefined;
|
|
2724
|
+
entrypoints?: string | false | undefined;
|
|
2725
|
+
workflows?: string | false | undefined;
|
|
2726
|
+
routes?: false | {
|
|
2727
|
+
dir: string;
|
|
2728
|
+
prefix?: string | undefined;
|
|
2729
|
+
} | undefined;
|
|
2730
|
+
transport?: string | undefined;
|
|
2731
|
+
} | undefined;
|
|
2732
|
+
bindings?: {
|
|
2733
|
+
kv?: Record<string, string> | undefined;
|
|
2734
|
+
d1?: Record<string, string> | undefined;
|
|
2735
|
+
r2?: Record<string, string> | undefined;
|
|
2736
|
+
durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
|
|
2737
|
+
queues?: {
|
|
2738
|
+
producers?: Record<string, string> | undefined;
|
|
2739
|
+
consumers?: {
|
|
2740
|
+
queue: string;
|
|
2741
|
+
maxBatchSize?: number | undefined;
|
|
2742
|
+
maxBatchTimeout?: number | undefined;
|
|
2743
|
+
maxRetries?: number | undefined;
|
|
2744
|
+
deadLetterQueue?: string | undefined;
|
|
2745
|
+
maxConcurrency?: number | undefined;
|
|
2746
|
+
retryDelay?: number | undefined;
|
|
2747
|
+
}[] | undefined;
|
|
2748
|
+
} | undefined;
|
|
2749
|
+
services?: Record<string, {
|
|
2750
|
+
/** Target worker/service name */
|
|
2751
|
+
service: string;
|
|
2752
|
+
/** Optional environment (staging, production, etc.) */
|
|
2753
|
+
environment?: string | undefined;
|
|
2754
|
+
/** Optional entrypoint class name for named exports */
|
|
2755
|
+
entrypoint?: string | undefined;
|
|
2756
|
+
/** @internal Reference marker for ref() bindings */
|
|
2757
|
+
__ref?: unknown;
|
|
2758
|
+
}> | undefined;
|
|
2759
|
+
ai?: {
|
|
2760
|
+
binding: string;
|
|
2761
|
+
} | undefined;
|
|
2762
|
+
vectorize?: Record<string, {
|
|
2763
|
+
indexName: string;
|
|
2764
|
+
}> | undefined;
|
|
2765
|
+
hyperdrive?: Record<string, {
|
|
2766
|
+
id: string;
|
|
2767
|
+
}> | undefined;
|
|
2768
|
+
browser?: {
|
|
2769
|
+
binding: string;
|
|
2770
|
+
} | undefined;
|
|
2771
|
+
analyticsEngine?: Record<string, {
|
|
2772
|
+
dataset: string;
|
|
2773
|
+
}> | undefined;
|
|
2774
|
+
sendEmail?: Record<string, {
|
|
2775
|
+
destinationAddress?: string | undefined;
|
|
2776
|
+
}> | undefined;
|
|
2777
|
+
} | undefined;
|
|
2778
|
+
triggers?: {
|
|
2779
|
+
crons?: string[] | undefined;
|
|
2780
|
+
} | undefined;
|
|
2781
|
+
vars?: Record<string, string> | undefined;
|
|
2782
|
+
secrets?: Record<string, {
|
|
2783
|
+
required?: boolean | undefined;
|
|
2784
|
+
}> | undefined;
|
|
2785
|
+
routes?: {
|
|
2786
|
+
pattern: string;
|
|
2787
|
+
zone_name?: string | undefined;
|
|
2788
|
+
zone_id?: string | undefined;
|
|
2789
|
+
custom_domain?: boolean | undefined;
|
|
2790
|
+
}[] | undefined;
|
|
2791
|
+
assets?: {
|
|
2792
|
+
directory: string;
|
|
2793
|
+
binding?: string | undefined;
|
|
2794
|
+
} | undefined;
|
|
2795
|
+
limits?: {
|
|
2796
|
+
cpu_ms?: number | undefined;
|
|
2797
|
+
} | undefined;
|
|
2798
|
+
observability?: {
|
|
2799
|
+
enabled?: boolean | undefined;
|
|
2800
|
+
head_sampling_rate?: number | undefined;
|
|
2801
|
+
} | undefined;
|
|
2802
|
+
migrations?: {
|
|
2803
|
+
tag: string;
|
|
2804
|
+
new_classes?: string[] | undefined;
|
|
2805
|
+
renamed_classes?: {
|
|
2806
|
+
from: string;
|
|
2807
|
+
to: string;
|
|
2808
|
+
}[] | undefined;
|
|
2809
|
+
deleted_classes?: string[] | undefined;
|
|
2810
|
+
new_sqlite_classes?: string[] | undefined;
|
|
2811
|
+
}[] | undefined;
|
|
2812
|
+
build?: {
|
|
2813
|
+
target?: string | undefined;
|
|
2814
|
+
minify?: boolean | undefined;
|
|
2815
|
+
sourcemap?: boolean | undefined;
|
|
2816
|
+
rolldownOptions?: Record<string, unknown> | undefined;
|
|
2817
|
+
} | undefined;
|
|
2818
|
+
wrangler?: {
|
|
2819
|
+
passthrough?: Record<string, unknown> | undefined;
|
|
2820
|
+
} | undefined;
|
|
2821
|
+
}>>>;
|
|
2822
|
+
/**
|
|
2823
|
+
* Wrangler passthrough for unsupported options.
|
|
2824
|
+
*/
|
|
2825
|
+
wrangler: z.ZodOptional<z.ZodObject<{
|
|
2826
|
+
/**
|
|
2827
|
+
* Arbitrary key-value pairs passed directly to wrangler.jsonc.
|
|
2828
|
+
* @example { placement: { mode: 'smart' } }
|
|
2829
|
+
*/
|
|
2830
|
+
passthrough: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2831
|
+
}, "strip", z.ZodTypeAny, {
|
|
2832
|
+
passthrough?: Record<string, unknown> | undefined;
|
|
2833
|
+
}, {
|
|
2834
|
+
passthrough?: Record<string, unknown> | undefined;
|
|
2835
|
+
}>>;
|
|
2836
|
+
}, "strip", z.ZodTypeAny, {
|
|
2837
|
+
name: string;
|
|
2838
|
+
accountId?: string | undefined;
|
|
2839
|
+
compatibilityDate: string;
|
|
2840
|
+
compatibilityFlags: string[];
|
|
2841
|
+
files?: {
|
|
2842
|
+
fetch?: string | false | undefined;
|
|
2843
|
+
queue?: string | false | undefined;
|
|
2844
|
+
scheduled?: string | false | undefined;
|
|
2845
|
+
email?: string | false | undefined;
|
|
2846
|
+
durableObjects?: string | false | undefined;
|
|
2847
|
+
entrypoints?: string | false | undefined;
|
|
2848
|
+
workflows?: string | false | undefined;
|
|
2849
|
+
routes?: false | {
|
|
2850
|
+
dir: string;
|
|
2851
|
+
prefix?: string | undefined;
|
|
2852
|
+
} | undefined;
|
|
2853
|
+
transport?: string | undefined;
|
|
2854
|
+
} | undefined;
|
|
2855
|
+
bindings?: {
|
|
2856
|
+
kv?: Record<string, string> | undefined;
|
|
2857
|
+
d1?: Record<string, string> | undefined;
|
|
2858
|
+
r2?: Record<string, string> | undefined;
|
|
2859
|
+
durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
|
|
2860
|
+
queues?: {
|
|
2861
|
+
producers?: Record<string, string> | undefined;
|
|
2862
|
+
consumers?: {
|
|
2863
|
+
queue: string;
|
|
2864
|
+
maxBatchSize?: number | undefined;
|
|
2865
|
+
maxBatchTimeout?: number | undefined;
|
|
2866
|
+
maxRetries?: number | undefined;
|
|
2867
|
+
deadLetterQueue?: string | undefined;
|
|
2868
|
+
maxConcurrency?: number | undefined;
|
|
2869
|
+
retryDelay?: number | undefined;
|
|
2870
|
+
}[] | undefined;
|
|
2871
|
+
} | undefined;
|
|
2872
|
+
services?: Record<string, {
|
|
2873
|
+
/** Target worker/service name */
|
|
2874
|
+
service: string;
|
|
2875
|
+
/** Optional environment (staging, production, etc.) */
|
|
2876
|
+
environment?: string | undefined;
|
|
2877
|
+
/** Optional entrypoint class name for named exports */
|
|
2878
|
+
entrypoint?: string | undefined;
|
|
2879
|
+
/** @internal Reference marker for ref() bindings */
|
|
2880
|
+
__ref?: unknown;
|
|
2881
|
+
}> | undefined;
|
|
2882
|
+
ai?: {
|
|
2883
|
+
binding: string;
|
|
2884
|
+
} | undefined;
|
|
2885
|
+
vectorize?: Record<string, {
|
|
2886
|
+
indexName: string;
|
|
2887
|
+
}> | undefined;
|
|
2888
|
+
hyperdrive?: Record<string, {
|
|
2889
|
+
id: string;
|
|
2890
|
+
}> | undefined;
|
|
2891
|
+
browser?: {
|
|
2892
|
+
binding: string;
|
|
2893
|
+
} | undefined;
|
|
2894
|
+
analyticsEngine?: Record<string, {
|
|
2895
|
+
dataset: string;
|
|
2896
|
+
}> | undefined;
|
|
2897
|
+
sendEmail?: Record<string, {
|
|
2898
|
+
destinationAddress?: string | undefined;
|
|
2899
|
+
}> | undefined;
|
|
2900
|
+
} | undefined;
|
|
2901
|
+
triggers?: {
|
|
2902
|
+
crons?: string[] | undefined;
|
|
2903
|
+
} | undefined;
|
|
2904
|
+
vars?: Record<string, string> | undefined;
|
|
2905
|
+
secrets?: Record<string, {
|
|
2906
|
+
required: boolean;
|
|
2907
|
+
}> | undefined;
|
|
2908
|
+
routes?: {
|
|
2909
|
+
pattern: string;
|
|
2910
|
+
zone_name?: string | undefined;
|
|
2911
|
+
zone_id?: string | undefined;
|
|
2912
|
+
custom_domain?: boolean | undefined;
|
|
2913
|
+
}[] | undefined;
|
|
2914
|
+
wsRoutes?: {
|
|
2915
|
+
pattern: string;
|
|
2916
|
+
doNamespace: string;
|
|
2917
|
+
idParam: string;
|
|
2918
|
+
forwardPath: string;
|
|
2919
|
+
}[] | undefined;
|
|
2920
|
+
assets?: {
|
|
2921
|
+
directory: string;
|
|
2922
|
+
binding?: string | undefined;
|
|
2923
|
+
} | undefined;
|
|
2924
|
+
limits?: {
|
|
2925
|
+
cpu_ms?: number | undefined;
|
|
2926
|
+
} | undefined;
|
|
2927
|
+
observability?: {
|
|
2928
|
+
enabled?: boolean | undefined;
|
|
2929
|
+
head_sampling_rate?: number | undefined;
|
|
2930
|
+
} | undefined;
|
|
2931
|
+
migrations?: {
|
|
2932
|
+
tag: string;
|
|
2933
|
+
new_classes?: string[] | undefined;
|
|
2934
|
+
renamed_classes?: {
|
|
2935
|
+
from: string;
|
|
2936
|
+
to: string;
|
|
2937
|
+
}[] | undefined;
|
|
2938
|
+
deleted_classes?: string[] | undefined;
|
|
2939
|
+
new_sqlite_classes?: string[] | undefined;
|
|
2940
|
+
}[] | undefined;
|
|
2941
|
+
build?: {
|
|
2942
|
+
target?: string | undefined;
|
|
2943
|
+
minify?: boolean | undefined;
|
|
2944
|
+
sourcemap?: boolean | undefined;
|
|
2945
|
+
rolldownOptions?: Record<string, unknown> | undefined;
|
|
2946
|
+
} | undefined;
|
|
2947
|
+
plugins?: unknown[] | undefined;
|
|
2948
|
+
env?: Record<string, {
|
|
2949
|
+
name?: string | undefined;
|
|
2950
|
+
compatibilityDate?: string | undefined;
|
|
2951
|
+
compatibilityFlags?: string[] | undefined;
|
|
2952
|
+
files?: {
|
|
2953
|
+
fetch?: string | false | undefined;
|
|
2954
|
+
queue?: string | false | undefined;
|
|
2955
|
+
scheduled?: string | false | undefined;
|
|
2956
|
+
email?: string | false | undefined;
|
|
2957
|
+
durableObjects?: string | false | undefined;
|
|
2958
|
+
entrypoints?: string | false | undefined;
|
|
2959
|
+
workflows?: string | false | undefined;
|
|
2960
|
+
routes?: false | {
|
|
2961
|
+
dir: string;
|
|
2962
|
+
prefix?: string | undefined;
|
|
2963
|
+
} | undefined;
|
|
2964
|
+
transport?: string | undefined;
|
|
2965
|
+
} | undefined;
|
|
2966
|
+
bindings?: {
|
|
2967
|
+
kv?: Record<string, string> | undefined;
|
|
2968
|
+
d1?: Record<string, string> | undefined;
|
|
2969
|
+
r2?: Record<string, string> | undefined;
|
|
2970
|
+
durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
|
|
2971
|
+
queues?: {
|
|
2972
|
+
producers?: Record<string, string> | undefined;
|
|
2973
|
+
consumers?: {
|
|
2974
|
+
queue: string;
|
|
2975
|
+
maxBatchSize?: number | undefined;
|
|
2976
|
+
maxBatchTimeout?: number | undefined;
|
|
2977
|
+
maxRetries?: number | undefined;
|
|
2978
|
+
deadLetterQueue?: string | undefined;
|
|
2979
|
+
maxConcurrency?: number | undefined;
|
|
2980
|
+
retryDelay?: number | undefined;
|
|
2981
|
+
}[] | undefined;
|
|
2982
|
+
} | undefined;
|
|
2983
|
+
services?: Record<string, {
|
|
2984
|
+
/** Target worker/service name */
|
|
2985
|
+
service: string;
|
|
2986
|
+
/** Optional environment (staging, production, etc.) */
|
|
2987
|
+
environment?: string | undefined;
|
|
2988
|
+
/** Optional entrypoint class name for named exports */
|
|
2989
|
+
entrypoint?: string | undefined;
|
|
2990
|
+
/** @internal Reference marker for ref() bindings */
|
|
2991
|
+
__ref?: unknown;
|
|
2992
|
+
}> | undefined;
|
|
2993
|
+
ai?: {
|
|
2994
|
+
binding: string;
|
|
2995
|
+
} | undefined;
|
|
2996
|
+
vectorize?: Record<string, {
|
|
2997
|
+
indexName: string;
|
|
2998
|
+
}> | undefined;
|
|
2999
|
+
hyperdrive?: Record<string, {
|
|
3000
|
+
id: string;
|
|
3001
|
+
}> | undefined;
|
|
3002
|
+
browser?: {
|
|
3003
|
+
binding: string;
|
|
3004
|
+
} | undefined;
|
|
3005
|
+
analyticsEngine?: Record<string, {
|
|
3006
|
+
dataset: string;
|
|
3007
|
+
}> | undefined;
|
|
3008
|
+
sendEmail?: Record<string, {
|
|
3009
|
+
destinationAddress?: string | undefined;
|
|
3010
|
+
}> | undefined;
|
|
3011
|
+
} | undefined;
|
|
3012
|
+
triggers?: {
|
|
3013
|
+
crons?: string[] | undefined;
|
|
3014
|
+
} | undefined;
|
|
3015
|
+
vars?: Record<string, string> | undefined;
|
|
3016
|
+
secrets?: Record<string, {
|
|
3017
|
+
required: boolean;
|
|
3018
|
+
}> | undefined;
|
|
3019
|
+
routes?: {
|
|
3020
|
+
pattern: string;
|
|
3021
|
+
zone_name?: string | undefined;
|
|
3022
|
+
zone_id?: string | undefined;
|
|
3023
|
+
custom_domain?: boolean | undefined;
|
|
3024
|
+
}[] | undefined;
|
|
3025
|
+
assets?: {
|
|
3026
|
+
directory: string;
|
|
3027
|
+
binding?: string | undefined;
|
|
3028
|
+
} | undefined;
|
|
3029
|
+
limits?: {
|
|
3030
|
+
cpu_ms?: number | undefined;
|
|
3031
|
+
} | undefined;
|
|
3032
|
+
observability?: {
|
|
3033
|
+
enabled?: boolean | undefined;
|
|
3034
|
+
head_sampling_rate?: number | undefined;
|
|
3035
|
+
} | undefined;
|
|
3036
|
+
migrations?: {
|
|
3037
|
+
tag: string;
|
|
3038
|
+
new_classes?: string[] | undefined;
|
|
3039
|
+
renamed_classes?: {
|
|
3040
|
+
from: string;
|
|
3041
|
+
to: string;
|
|
3042
|
+
}[] | undefined;
|
|
3043
|
+
deleted_classes?: string[] | undefined;
|
|
3044
|
+
new_sqlite_classes?: string[] | undefined;
|
|
3045
|
+
}[] | undefined;
|
|
3046
|
+
build?: {
|
|
3047
|
+
target?: string | undefined;
|
|
3048
|
+
minify?: boolean | undefined;
|
|
3049
|
+
sourcemap?: boolean | undefined;
|
|
3050
|
+
rolldownOptions?: Record<string, unknown> | undefined;
|
|
3051
|
+
} | undefined;
|
|
3052
|
+
wrangler?: {
|
|
3053
|
+
passthrough?: Record<string, unknown> | undefined;
|
|
3054
|
+
} | undefined;
|
|
3055
|
+
}> | undefined;
|
|
3056
|
+
wrangler?: {
|
|
3057
|
+
passthrough?: Record<string, unknown> | undefined;
|
|
3058
|
+
} | undefined;
|
|
3059
|
+
}, {
|
|
3060
|
+
name: string;
|
|
3061
|
+
accountId?: string | undefined;
|
|
3062
|
+
compatibilityDate?: string | undefined;
|
|
3063
|
+
compatibilityFlags?: string[] | undefined;
|
|
3064
|
+
files?: {
|
|
3065
|
+
fetch?: string | false | undefined;
|
|
3066
|
+
queue?: string | false | undefined;
|
|
3067
|
+
scheduled?: string | false | undefined;
|
|
3068
|
+
email?: string | false | undefined;
|
|
3069
|
+
durableObjects?: string | false | undefined;
|
|
3070
|
+
entrypoints?: string | false | undefined;
|
|
3071
|
+
workflows?: string | false | undefined;
|
|
3072
|
+
routes?: false | {
|
|
3073
|
+
dir: string;
|
|
3074
|
+
prefix?: string | undefined;
|
|
3075
|
+
} | undefined;
|
|
3076
|
+
transport?: string | undefined;
|
|
3077
|
+
} | undefined;
|
|
3078
|
+
bindings?: {
|
|
3079
|
+
kv?: Record<string, string> | undefined;
|
|
3080
|
+
d1?: Record<string, string> | undefined;
|
|
3081
|
+
r2?: Record<string, string> | undefined;
|
|
3082
|
+
durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
|
|
3083
|
+
queues?: {
|
|
3084
|
+
producers?: Record<string, string> | undefined;
|
|
3085
|
+
consumers?: {
|
|
3086
|
+
queue: string;
|
|
3087
|
+
maxBatchSize?: number | undefined;
|
|
3088
|
+
maxBatchTimeout?: number | undefined;
|
|
3089
|
+
maxRetries?: number | undefined;
|
|
3090
|
+
deadLetterQueue?: string | undefined;
|
|
3091
|
+
maxConcurrency?: number | undefined;
|
|
3092
|
+
retryDelay?: number | undefined;
|
|
3093
|
+
}[] | undefined;
|
|
3094
|
+
} | undefined;
|
|
3095
|
+
services?: Record<string, {
|
|
3096
|
+
/** Target worker/service name */
|
|
3097
|
+
service: string;
|
|
3098
|
+
/** Optional environment (staging, production, etc.) */
|
|
3099
|
+
environment?: string | undefined;
|
|
3100
|
+
/** Optional entrypoint class name for named exports */
|
|
3101
|
+
entrypoint?: string | undefined;
|
|
3102
|
+
/** @internal Reference marker for ref() bindings */
|
|
3103
|
+
__ref?: unknown;
|
|
3104
|
+
}> | undefined;
|
|
3105
|
+
ai?: {
|
|
3106
|
+
binding: string;
|
|
3107
|
+
} | undefined;
|
|
3108
|
+
vectorize?: Record<string, {
|
|
3109
|
+
indexName: string;
|
|
3110
|
+
}> | undefined;
|
|
3111
|
+
hyperdrive?: Record<string, {
|
|
3112
|
+
id: string;
|
|
3113
|
+
}> | undefined;
|
|
3114
|
+
browser?: {
|
|
3115
|
+
binding: string;
|
|
3116
|
+
} | undefined;
|
|
3117
|
+
analyticsEngine?: Record<string, {
|
|
3118
|
+
dataset: string;
|
|
3119
|
+
}> | undefined;
|
|
3120
|
+
sendEmail?: Record<string, {
|
|
3121
|
+
destinationAddress?: string | undefined;
|
|
3122
|
+
}> | undefined;
|
|
3123
|
+
} | undefined;
|
|
3124
|
+
triggers?: {
|
|
3125
|
+
crons?: string[] | undefined;
|
|
3126
|
+
} | undefined;
|
|
3127
|
+
vars?: Record<string, string> | undefined;
|
|
3128
|
+
secrets?: Record<string, {
|
|
3129
|
+
required?: boolean | undefined;
|
|
3130
|
+
}> | undefined;
|
|
3131
|
+
routes?: {
|
|
3132
|
+
pattern: string;
|
|
3133
|
+
zone_name?: string | undefined;
|
|
3134
|
+
zone_id?: string | undefined;
|
|
3135
|
+
custom_domain?: boolean | undefined;
|
|
3136
|
+
}[] | undefined;
|
|
3137
|
+
wsRoutes?: {
|
|
3138
|
+
pattern: string;
|
|
3139
|
+
doNamespace: string;
|
|
3140
|
+
idParam?: string | undefined;
|
|
3141
|
+
forwardPath?: string | undefined;
|
|
3142
|
+
}[] | undefined;
|
|
3143
|
+
assets?: {
|
|
3144
|
+
directory: string;
|
|
3145
|
+
binding?: string | undefined;
|
|
3146
|
+
} | undefined;
|
|
3147
|
+
limits?: {
|
|
3148
|
+
cpu_ms?: number | undefined;
|
|
3149
|
+
} | undefined;
|
|
3150
|
+
observability?: {
|
|
3151
|
+
enabled?: boolean | undefined;
|
|
3152
|
+
head_sampling_rate?: number | undefined;
|
|
3153
|
+
} | undefined;
|
|
3154
|
+
migrations?: {
|
|
3155
|
+
tag: string;
|
|
3156
|
+
new_classes?: string[] | undefined;
|
|
3157
|
+
renamed_classes?: {
|
|
3158
|
+
from: string;
|
|
3159
|
+
to: string;
|
|
3160
|
+
}[] | undefined;
|
|
3161
|
+
deleted_classes?: string[] | undefined;
|
|
3162
|
+
new_sqlite_classes?: string[] | undefined;
|
|
3163
|
+
}[] | undefined;
|
|
3164
|
+
build?: {
|
|
3165
|
+
target?: string | undefined;
|
|
3166
|
+
minify?: boolean | undefined;
|
|
3167
|
+
sourcemap?: boolean | undefined;
|
|
3168
|
+
rolldownOptions?: Record<string, unknown> | undefined;
|
|
3169
|
+
} | undefined;
|
|
3170
|
+
plugins?: unknown[] | undefined;
|
|
3171
|
+
env?: Record<string, {
|
|
3172
|
+
name?: string | undefined;
|
|
3173
|
+
compatibilityDate?: string | undefined;
|
|
3174
|
+
compatibilityFlags?: string[] | undefined;
|
|
3175
|
+
files?: {
|
|
3176
|
+
fetch?: string | false | undefined;
|
|
3177
|
+
queue?: string | false | undefined;
|
|
3178
|
+
scheduled?: string | false | undefined;
|
|
3179
|
+
email?: string | false | undefined;
|
|
3180
|
+
durableObjects?: string | false | undefined;
|
|
3181
|
+
entrypoints?: string | false | undefined;
|
|
3182
|
+
workflows?: string | false | undefined;
|
|
3183
|
+
routes?: false | {
|
|
3184
|
+
dir: string;
|
|
3185
|
+
prefix?: string | undefined;
|
|
3186
|
+
} | undefined;
|
|
3187
|
+
transport?: string | undefined;
|
|
3188
|
+
} | undefined;
|
|
3189
|
+
bindings?: {
|
|
3190
|
+
kv?: Record<string, string> | undefined;
|
|
3191
|
+
d1?: Record<string, string> | undefined;
|
|
3192
|
+
r2?: Record<string, string> | undefined;
|
|
3193
|
+
durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
|
|
3194
|
+
queues?: {
|
|
3195
|
+
producers?: Record<string, string> | undefined;
|
|
3196
|
+
consumers?: {
|
|
3197
|
+
queue: string;
|
|
3198
|
+
maxBatchSize?: number | undefined;
|
|
3199
|
+
maxBatchTimeout?: number | undefined;
|
|
3200
|
+
maxRetries?: number | undefined;
|
|
3201
|
+
deadLetterQueue?: string | undefined;
|
|
3202
|
+
maxConcurrency?: number | undefined;
|
|
3203
|
+
retryDelay?: number | undefined;
|
|
3204
|
+
}[] | undefined;
|
|
3205
|
+
} | undefined;
|
|
3206
|
+
services?: Record<string, {
|
|
3207
|
+
/** Target worker/service name */
|
|
3208
|
+
service: string;
|
|
3209
|
+
/** Optional environment (staging, production, etc.) */
|
|
3210
|
+
environment?: string | undefined;
|
|
3211
|
+
/** Optional entrypoint class name for named exports */
|
|
3212
|
+
entrypoint?: string | undefined;
|
|
3213
|
+
/** @internal Reference marker for ref() bindings */
|
|
3214
|
+
__ref?: unknown;
|
|
3215
|
+
}> | undefined;
|
|
3216
|
+
ai?: {
|
|
3217
|
+
binding: string;
|
|
3218
|
+
} | undefined;
|
|
3219
|
+
vectorize?: Record<string, {
|
|
3220
|
+
indexName: string;
|
|
3221
|
+
}> | undefined;
|
|
3222
|
+
hyperdrive?: Record<string, {
|
|
3223
|
+
id: string;
|
|
3224
|
+
}> | undefined;
|
|
3225
|
+
browser?: {
|
|
3226
|
+
binding: string;
|
|
3227
|
+
} | undefined;
|
|
3228
|
+
analyticsEngine?: Record<string, {
|
|
3229
|
+
dataset: string;
|
|
3230
|
+
}> | undefined;
|
|
3231
|
+
sendEmail?: Record<string, {
|
|
3232
|
+
destinationAddress?: string | undefined;
|
|
3233
|
+
}> | undefined;
|
|
3234
|
+
} | undefined;
|
|
3235
|
+
triggers?: {
|
|
3236
|
+
crons?: string[] | undefined;
|
|
3237
|
+
} | undefined;
|
|
3238
|
+
vars?: Record<string, string> | undefined;
|
|
3239
|
+
secrets?: Record<string, {
|
|
3240
|
+
required?: boolean | undefined;
|
|
3241
|
+
}> | undefined;
|
|
3242
|
+
routes?: {
|
|
3243
|
+
pattern: string;
|
|
3244
|
+
zone_name?: string | undefined;
|
|
3245
|
+
zone_id?: string | undefined;
|
|
3246
|
+
custom_domain?: boolean | undefined;
|
|
3247
|
+
}[] | undefined;
|
|
3248
|
+
assets?: {
|
|
3249
|
+
directory: string;
|
|
3250
|
+
binding?: string | undefined;
|
|
3251
|
+
} | undefined;
|
|
3252
|
+
limits?: {
|
|
3253
|
+
cpu_ms?: number | undefined;
|
|
3254
|
+
} | undefined;
|
|
3255
|
+
observability?: {
|
|
3256
|
+
enabled?: boolean | undefined;
|
|
3257
|
+
head_sampling_rate?: number | undefined;
|
|
3258
|
+
} | undefined;
|
|
3259
|
+
migrations?: {
|
|
3260
|
+
tag: string;
|
|
3261
|
+
new_classes?: string[] | undefined;
|
|
3262
|
+
renamed_classes?: {
|
|
3263
|
+
from: string;
|
|
3264
|
+
to: string;
|
|
3265
|
+
}[] | undefined;
|
|
3266
|
+
deleted_classes?: string[] | undefined;
|
|
3267
|
+
new_sqlite_classes?: string[] | undefined;
|
|
3268
|
+
}[] | undefined;
|
|
3269
|
+
build?: {
|
|
3270
|
+
target?: string | undefined;
|
|
3271
|
+
minify?: boolean | undefined;
|
|
3272
|
+
sourcemap?: boolean | undefined;
|
|
3273
|
+
rolldownOptions?: Record<string, unknown> | undefined;
|
|
3274
|
+
} | undefined;
|
|
3275
|
+
wrangler?: {
|
|
3276
|
+
passthrough?: Record<string, unknown> | undefined;
|
|
3277
|
+
} | undefined;
|
|
3278
|
+
}> | undefined;
|
|
3279
|
+
wrangler?: {
|
|
3280
|
+
passthrough?: Record<string, unknown> | undefined;
|
|
3281
|
+
} | undefined;
|
|
3282
|
+
}>;
|
|
3283
|
+
/** Output type after Zod validation and transforms */
|
|
3284
|
+
export type DevflareConfig = z.infer<typeof configSchema>;
|
|
3285
|
+
/** Input type for defineConfig - before Zod transforms apply defaults */
|
|
3286
|
+
export type DevflareConfigInput = z.input<typeof configSchema>;
|
|
3287
|
+
export type DevflareEnvConfig = z.infer<typeof envConfigSchemaInner>;
|
|
3288
|
+
export type DurableObjectBinding = z.infer<typeof durableObjectBindingSchema>;
|
|
3289
|
+
export type QueueConsumer = z.infer<typeof queueConsumerSchema>;
|
|
3290
|
+
export type QueuesConfig = z.infer<typeof queuesConfigSchema>;
|
|
3291
|
+
export type ServiceBinding = z.infer<typeof serviceBindingSchema>;
|
|
3292
|
+
export type RouteConfig = z.infer<typeof routeConfigSchema>;
|
|
3293
|
+
export type WsRouteConfig = z.infer<typeof wsRouteConfigSchema>;
|
|
3294
|
+
export type AssetsConfig = z.infer<typeof assetsConfigSchema>;
|
|
3295
|
+
export type BuildConfig = z.infer<typeof buildConfigSchema>;
|
|
3296
|
+
export type MigrationConfig = z.infer<typeof migrationSchema>;
|
|
3297
|
+
/**
|
|
3298
|
+
* Normalized DO binding shape — consistent representation for all DO binding variants.
|
|
3299
|
+
* Used throughout devflare for DO configuration handling.
|
|
3300
|
+
*/
|
|
3301
|
+
export interface NormalizedDOBinding {
|
|
3302
|
+
/** The DO class name (e.g., 'Counter') */
|
|
3303
|
+
className: string;
|
|
3304
|
+
/** Optional script name — file path for local DOs, worker name for cross-worker DOs */
|
|
3305
|
+
scriptName?: string;
|
|
3306
|
+
/** Reference result for cross-worker DOs (from ref().DO_NAME) */
|
|
3307
|
+
__ref?: unknown;
|
|
3308
|
+
}
|
|
3309
|
+
/**
|
|
3310
|
+
* Normalize a DO binding to its object form.
|
|
3311
|
+
* Handles all DO binding variants:
|
|
3312
|
+
* - String: 'Counter' → { className: 'Counter' }
|
|
3313
|
+
* - Object: { className, scriptName? } → as-is
|
|
3314
|
+
* - Ref: { className, scriptName, __ref } → as-is (cross-worker DO)
|
|
3315
|
+
*/
|
|
3316
|
+
export declare function normalizeDOBinding(config: DurableObjectBinding): NormalizedDOBinding;
|
|
3317
|
+
export {};
|
|
3318
|
+
//# sourceMappingURL=schema.d.ts.map
|