devflare 1.0.0-next.22 → 1.0.0-next.23
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/LLM.md +144 -5
- package/dist/account-j8nfggg4.js +475 -0
- package/dist/account-qhe8vtds.js +475 -0
- package/dist/bridge/miniflare.d.ts +1 -1
- package/dist/bridge/miniflare.d.ts.map +1 -1
- package/dist/browser.d.ts +13 -13
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +4 -2
- package/dist/build-vy95gy3f.js +54 -0
- package/dist/build-yzx0gsaj.js +54 -0
- package/dist/cli/commands/build-artifacts.d.ts.map +1 -1
- package/dist/cli/commands/config.d.ts.map +1 -1
- package/dist/cli/commands/type-generation/generator.d.ts +4 -2
- package/dist/cli/commands/type-generation/generator.d.ts.map +1 -1
- package/dist/cli/commands/types.d.ts.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/config/compiler/types.d.ts +1 -1
- package/dist/config/compiler/types.d.ts.map +1 -1
- package/dist/config/define.d.ts +7 -4
- package/dist/config/define.d.ts.map +1 -1
- package/dist/config/env-vars.d.ts +309 -0
- package/dist/config/env-vars.d.ts.map +1 -0
- package/dist/config/index.d.ts +2 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/local-dev-vars.d.ts +2 -2
- package/dist/config/local-dev-vars.d.ts.map +1 -1
- package/dist/config/schema-env.d.ts +6 -6
- package/dist/config/schema-types-bindings-platform.d.ts +378 -0
- package/dist/config/schema-types-bindings-platform.d.ts.map +1 -0
- package/dist/config/schema-types-bindings-resources.d.ts +551 -0
- package/dist/config/schema-types-bindings-resources.d.ts.map +1 -0
- package/dist/config/schema-types-bindings.d.ts +254 -0
- package/dist/config/schema-types-bindings.d.ts.map +1 -0
- package/dist/config/schema-types-build.d.ts +86 -0
- package/dist/config/schema-types-build.d.ts.map +1 -0
- package/dist/config/schema-types-runtime.d.ts +882 -0
- package/dist/config/schema-types-runtime.d.ts.map +1 -0
- package/dist/config/schema-types.d.ts +377 -0
- package/dist/config/schema-types.d.ts.map +1 -0
- package/dist/config/schema.d.ts +14 -15
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config-entry.d.ts +2 -0
- package/dist/config-entry.d.ts.map +1 -1
- package/dist/config-entry.js +3 -1
- package/dist/config-gq5jh4cx.js +105 -0
- package/dist/config-vec13050.js +105 -0
- package/dist/deploy-01j0ep5n.js +1055 -0
- package/dist/deploy-tjypkhg7.js +1055 -0
- package/dist/dev-bh581ew3.js +2597 -0
- package/dist/dev-gn5y93z9.js +2597 -0
- package/dist/dev-server/server.d.ts.map +1 -1
- package/dist/doctor-h5q28qt1.js +259 -0
- package/dist/doctor-khk550tw.js +259 -0
- package/dist/env.d.ts +10 -0
- package/dist/env.d.ts.map +1 -1
- package/dist/index-0bv2qjs1.js +1555 -0
- package/dist/index-3tkzn06q.js +413 -0
- package/dist/index-8fyz6gcm.js +699 -0
- package/dist/index-97z629zr.js +109 -0
- package/dist/index-b28c4yr4.js +1205 -0
- package/dist/index-c8p4njqy.js +479 -0
- package/dist/index-cr06zrgw.js +1033 -0
- package/dist/index-cwjjdtgn.js +74 -0
- package/dist/index-dref9ecb.js +476 -0
- package/dist/index-e151t4ge.js +895 -0
- package/dist/index-e7kakw0j.js +1033 -0
- package/dist/index-f1g5jdm8.js +1426 -0
- package/dist/index-f46984zs.js +1554 -0
- package/dist/index-grk8pzhr.js +185 -0
- package/dist/index-hzmpecq9.js +52 -0
- package/dist/index-j1csb7gb.js +581 -0
- package/dist/index-j7x7f72h.js +185 -0
- package/dist/index-jkqbjwt2.js +476 -0
- package/dist/index-mh5renra.js +895 -0
- package/dist/index-p9xq83p7.js +147 -0
- package/dist/index-q15nj71j.js +52 -0
- package/dist/index-qqp65pyv.js +699 -0
- package/dist/index-s0fmwxbk.js +74 -0
- package/dist/index-stzx8nc4.js +111 -0
- package/dist/index-th4vrnbk.js +1205 -0
- package/dist/index-vtcmsgaf.js +581 -0
- package/dist/index-x2k3awjs.js +147 -0
- package/dist/index-x8x547tz.js +1426 -0
- package/dist/index-xxxd0mvw.js +109 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -6
- package/dist/login-280p2cm9.js +77 -0
- package/dist/login-4n266whq.js +77 -0
- package/dist/previews-3m3ffpaw.js +1337 -0
- package/dist/previews-tr8sm03d.js +1337 -0
- package/dist/productions-62y489ff.js +505 -0
- package/dist/productions-cgn3fz7d.js +505 -0
- package/dist/runtime/exports.d.ts +23 -0
- package/dist/runtime/exports.d.ts.map +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +5 -3
- package/dist/secrets-4050kqf5.js +91 -0
- package/dist/secrets-p112cajt.js +91 -0
- package/dist/sveltekit/index.js +4 -4
- package/dist/test/index.js +23 -11
- package/dist/test/resolve-service-bindings.d.ts +1 -1
- package/dist/test/resolve-service-bindings.d.ts.map +1 -1
- package/dist/test/simple-context-lifecycle.d.ts.map +1 -1
- package/dist/types-apmt10yj.js +705 -0
- package/dist/types-ttrrgdfj.js +705 -0
- package/dist/vite/index.js +5 -5
- package/dist/vite/plugin-context.d.ts.map +1 -1
- package/dist/vite/plugin-programmatic.d.ts.map +1 -1
- package/dist/worker-2k1jyr6p.js +513 -0
- package/dist/worker-jqgn6jyj.js +513 -0
- package/package.json +1 -1
|
@@ -0,0 +1,882 @@
|
|
|
1
|
+
export interface PreviewConfigInput {
|
|
2
|
+
/**
|
|
3
|
+
* Whether preview-generated config should include cron triggers.
|
|
4
|
+
*
|
|
5
|
+
* @default `false`
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* previews: { includeCrons: true }
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
includeCrons?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Source file discovery for Worker handlers and generated support files.
|
|
16
|
+
*/
|
|
17
|
+
export interface FilesConfigInput {
|
|
18
|
+
/**
|
|
19
|
+
* HTTP fetch entrypoint source file or `false` to disable fetch handler
|
|
20
|
+
* discovery.
|
|
21
|
+
*
|
|
22
|
+
* @default Auto-discovered from conventional fetch handler paths.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* files: { fetch: 'src/fetch.ts' }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
fetch?: string | false;
|
|
30
|
+
/**
|
|
31
|
+
* Queue handler source file or `false` to disable queue handler discovery.
|
|
32
|
+
*
|
|
33
|
+
* @default Auto-discovered from conventional queue handler paths.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* files: { queue: 'src/queue.ts' }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
queue?: string | false;
|
|
41
|
+
/**
|
|
42
|
+
* Scheduled event handler source file or `false` to disable scheduled
|
|
43
|
+
* handler discovery.
|
|
44
|
+
*
|
|
45
|
+
* @default Auto-discovered from conventional scheduled handler paths.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* files: { scheduled: 'src/scheduled.ts' }
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
scheduled?: string | false;
|
|
53
|
+
/**
|
|
54
|
+
* Email event handler source file or `false` to disable email handler
|
|
55
|
+
* discovery.
|
|
56
|
+
*
|
|
57
|
+
* @default Auto-discovered from conventional email handler paths.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* files: { email: 'src/email.ts' }
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
email?: string | false;
|
|
65
|
+
/**
|
|
66
|
+
* Tail event handler source file or `false` to disable tail handler
|
|
67
|
+
* discovery.
|
|
68
|
+
*
|
|
69
|
+
* @default Auto-discovered from conventional tail handler paths.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* files: { tail: 'src/tail.ts' }
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
tail?: string | false;
|
|
77
|
+
/**
|
|
78
|
+
* Durable Object source file glob or `false` to disable Durable Object
|
|
79
|
+
* class discovery.
|
|
80
|
+
*
|
|
81
|
+
* @default Auto-discovered from conventional Durable Object file paths.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* files: { durableObjects: 'src/do.*.ts' }
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
durableObjects?: string | false;
|
|
89
|
+
/**
|
|
90
|
+
* Named WorkerEntrypoint source file glob or `false` to disable entrypoint
|
|
91
|
+
* discovery.
|
|
92
|
+
*
|
|
93
|
+
* @default Auto-discovered from conventional entrypoint file paths.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* files: { entrypoints: 'src/ep.*.ts' }
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
entrypoints?: string | false;
|
|
101
|
+
/**
|
|
102
|
+
* Workflow source file glob or `false` to disable workflow discovery.
|
|
103
|
+
*
|
|
104
|
+
* @default Auto-discovered from conventional workflow file paths.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* files: { workflows: 'src/wf.*.ts' }
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
workflows?: string | false;
|
|
112
|
+
/**
|
|
113
|
+
* Built-in route-file discovery configuration or `false` to disable route
|
|
114
|
+
* file discovery.
|
|
115
|
+
*
|
|
116
|
+
* @default Auto-discovered from conventional route file paths.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* files: {
|
|
121
|
+
* routes: { dir: 'src/routes', prefix: '/api' }
|
|
122
|
+
* }
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
routes?: RouteTreeConfigInput | false;
|
|
126
|
+
/**
|
|
127
|
+
* Internal transport worker source file. Set `null` to suppress transport
|
|
128
|
+
* file generation when a command supports doing so.
|
|
129
|
+
*
|
|
130
|
+
* @default Devflare-managed transport file.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```ts
|
|
134
|
+
* files: { transport: 'src/.devflare/transport.ts' }
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
transport?: string | null;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Built-in file router discovery configuration.
|
|
141
|
+
*/
|
|
142
|
+
export interface RouteTreeConfigInput {
|
|
143
|
+
/**
|
|
144
|
+
* Directory containing route files.
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```ts
|
|
148
|
+
* routes: { dir: 'src/routes' }
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
dir: string;
|
|
152
|
+
/**
|
|
153
|
+
* URL prefix added before discovered route paths.
|
|
154
|
+
*
|
|
155
|
+
* @default No prefix.
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```ts
|
|
159
|
+
* routes: { dir: 'src/routes', prefix: '/api' }
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
prefix?: string;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Trigger configuration for scheduled events.
|
|
166
|
+
*/
|
|
167
|
+
export interface TriggersConfigInput {
|
|
168
|
+
/**
|
|
169
|
+
* Cron expressions that invoke the Worker scheduled handler.
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```ts
|
|
173
|
+
* triggers: { crons: ['0 * * * *'] }
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
176
|
+
crons?: string[];
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Wrangler module rule configuration.
|
|
180
|
+
*/
|
|
181
|
+
export interface ModuleRuleConfigInput {
|
|
182
|
+
/**
|
|
183
|
+
* Module rule type.
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```ts
|
|
187
|
+
* type: 'Text'
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
190
|
+
type: 'ESModule' | 'CommonJS' | 'CompiledWasm' | 'Text' | 'Data';
|
|
191
|
+
/**
|
|
192
|
+
* Glob patterns matched by this module rule.
|
|
193
|
+
*
|
|
194
|
+
* @example
|
|
195
|
+
* ```ts
|
|
196
|
+
* globs: ['content/*.txt']
|
|
197
|
+
* ```
|
|
198
|
+
*/
|
|
199
|
+
globs: string[];
|
|
200
|
+
/**
|
|
201
|
+
* Whether Wrangler should continue evaluating later rules after this one.
|
|
202
|
+
*
|
|
203
|
+
* @default Wrangler default behavior.
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* ```ts
|
|
207
|
+
* fallthrough: true
|
|
208
|
+
* ```
|
|
209
|
+
*/
|
|
210
|
+
fallthrough?: boolean;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Tail Worker consumer configuration.
|
|
214
|
+
*/
|
|
215
|
+
export type TailConsumerConfigInput = string | TailConsumerObjectConfigInput;
|
|
216
|
+
/**
|
|
217
|
+
* Tail Worker consumer object form.
|
|
218
|
+
*/
|
|
219
|
+
export interface TailConsumerObjectConfigInput {
|
|
220
|
+
/**
|
|
221
|
+
* Tail Worker service name.
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* ```ts
|
|
225
|
+
* service: 'trace-worker'
|
|
226
|
+
* ```
|
|
227
|
+
*/
|
|
228
|
+
service: string;
|
|
229
|
+
/**
|
|
230
|
+
* Optional Tail Worker environment.
|
|
231
|
+
*
|
|
232
|
+
* @default Target worker default environment.
|
|
233
|
+
*
|
|
234
|
+
* @example
|
|
235
|
+
* ```ts
|
|
236
|
+
* environment: 'production'
|
|
237
|
+
* ```
|
|
238
|
+
*/
|
|
239
|
+
environment?: string;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Secret declaration options.
|
|
243
|
+
*/
|
|
244
|
+
export interface SecretConfigInput {
|
|
245
|
+
/**
|
|
246
|
+
* Whether the secret is required during validation.
|
|
247
|
+
*
|
|
248
|
+
* @default `true`
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* ```ts
|
|
252
|
+
* secrets: { API_TOKEN: { required: true } }
|
|
253
|
+
* ```
|
|
254
|
+
*/
|
|
255
|
+
required?: boolean;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Cloudflare Worker route configuration.
|
|
259
|
+
*/
|
|
260
|
+
export interface RouteConfigInput {
|
|
261
|
+
/**
|
|
262
|
+
* Route pattern handled by the Worker.
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* ```ts
|
|
266
|
+
* { pattern: 'api.example.com/*' }
|
|
267
|
+
* ```
|
|
268
|
+
*/
|
|
269
|
+
pattern: string;
|
|
270
|
+
/**
|
|
271
|
+
* Zone name for the route.
|
|
272
|
+
*
|
|
273
|
+
* @default Cloudflare resolves the zone from the route pattern when
|
|
274
|
+
* possible.
|
|
275
|
+
*
|
|
276
|
+
* @example
|
|
277
|
+
* ```ts
|
|
278
|
+
* { pattern: 'api.example.com/*', zone_name: 'example.com' }
|
|
279
|
+
* ```
|
|
280
|
+
*/
|
|
281
|
+
zone_name?: string;
|
|
282
|
+
/**
|
|
283
|
+
* Zone ID for the route.
|
|
284
|
+
*
|
|
285
|
+
* @default Cloudflare resolves the zone from the route pattern when
|
|
286
|
+
* possible.
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* ```ts
|
|
290
|
+
* { pattern: 'api.example.com/*', zone_id: 'zone-id' }
|
|
291
|
+
* ```
|
|
292
|
+
*/
|
|
293
|
+
zone_id?: string;
|
|
294
|
+
/**
|
|
295
|
+
* Whether this route is a custom domain route instead of a wildcard route.
|
|
296
|
+
*
|
|
297
|
+
* @default `false`
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* ```ts
|
|
301
|
+
* routes: [
|
|
302
|
+
* { pattern: 'worker.example.com', custom_domain: true }
|
|
303
|
+
* ]
|
|
304
|
+
* ```
|
|
305
|
+
*/
|
|
306
|
+
custom_domain?: boolean;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Local WebSocket route for Durable Object proxying.
|
|
310
|
+
*/
|
|
311
|
+
export interface WsRouteConfigInput {
|
|
312
|
+
/**
|
|
313
|
+
* Local route pattern.
|
|
314
|
+
*
|
|
315
|
+
* @example
|
|
316
|
+
* ```ts
|
|
317
|
+
* pattern: '/rooms/:id'
|
|
318
|
+
* ```
|
|
319
|
+
*/
|
|
320
|
+
pattern: string;
|
|
321
|
+
/**
|
|
322
|
+
* Durable Object namespace binding name that should receive the socket.
|
|
323
|
+
*
|
|
324
|
+
* @example
|
|
325
|
+
* ```ts
|
|
326
|
+
* doNamespace: 'ROOM'
|
|
327
|
+
* ```
|
|
328
|
+
*/
|
|
329
|
+
doNamespace: string;
|
|
330
|
+
/**
|
|
331
|
+
* Route parameter used as the Durable Object ID.
|
|
332
|
+
*
|
|
333
|
+
* @default `'id'`
|
|
334
|
+
*
|
|
335
|
+
* @example
|
|
336
|
+
* ```ts
|
|
337
|
+
* idParam: 'roomId'
|
|
338
|
+
* ```
|
|
339
|
+
*/
|
|
340
|
+
idParam?: string;
|
|
341
|
+
/**
|
|
342
|
+
* Path forwarded to the Durable Object when the socket is proxied.
|
|
343
|
+
*
|
|
344
|
+
* @default `'/websocket'`
|
|
345
|
+
*
|
|
346
|
+
* @example
|
|
347
|
+
* ```ts
|
|
348
|
+
* forwardPath: '/connect'
|
|
349
|
+
* ```
|
|
350
|
+
*/
|
|
351
|
+
forwardPath?: string;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Static assets configuration.
|
|
355
|
+
*/
|
|
356
|
+
export interface AssetsConfigInput {
|
|
357
|
+
/**
|
|
358
|
+
* Directory containing static assets.
|
|
359
|
+
*
|
|
360
|
+
* @example
|
|
361
|
+
* ```ts
|
|
362
|
+
* assets: { directory: './dist' }
|
|
363
|
+
* ```
|
|
364
|
+
*/
|
|
365
|
+
directory: string;
|
|
366
|
+
/**
|
|
367
|
+
* Optional asset binding name exposed to the Worker.
|
|
368
|
+
*
|
|
369
|
+
* @default Wrangler default binding behavior.
|
|
370
|
+
*
|
|
371
|
+
* @example
|
|
372
|
+
* ```ts
|
|
373
|
+
* assets: { directory: './dist', binding: 'ASSETS' }
|
|
374
|
+
* ```
|
|
375
|
+
*/
|
|
376
|
+
binding?: string;
|
|
377
|
+
/**
|
|
378
|
+
* HTML path handling behavior.
|
|
379
|
+
*
|
|
380
|
+
* @default Wrangler default behavior.
|
|
381
|
+
*
|
|
382
|
+
* @example
|
|
383
|
+
* ```ts
|
|
384
|
+
* html_handling: 'auto-trailing-slash'
|
|
385
|
+
* ```
|
|
386
|
+
*/
|
|
387
|
+
html_handling?: 'auto-trailing-slash' | 'force-trailing-slash' | 'drop-trailing-slash' | 'none';
|
|
388
|
+
/**
|
|
389
|
+
* Not-found handling behavior.
|
|
390
|
+
*
|
|
391
|
+
* @default Wrangler default behavior.
|
|
392
|
+
*
|
|
393
|
+
* @example
|
|
394
|
+
* ```ts
|
|
395
|
+
* not_found_handling: 'single-page-application'
|
|
396
|
+
* ```
|
|
397
|
+
*/
|
|
398
|
+
not_found_handling?: 'single-page-application' | '404-page' | 'none';
|
|
399
|
+
/**
|
|
400
|
+
* Whether the Worker should run before serving assets, or the asset path
|
|
401
|
+
* patterns that should run the Worker first.
|
|
402
|
+
*
|
|
403
|
+
* @default Wrangler default behavior.
|
|
404
|
+
*
|
|
405
|
+
* @example
|
|
406
|
+
* ```ts
|
|
407
|
+
* run_worker_first: ['/api/*']
|
|
408
|
+
* ```
|
|
409
|
+
*/
|
|
410
|
+
run_worker_first?: boolean | string[];
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Cloudflare Container configuration.
|
|
414
|
+
*/
|
|
415
|
+
export interface ContainerConfigInput {
|
|
416
|
+
/**
|
|
417
|
+
* Container class name exported by the Worker.
|
|
418
|
+
*
|
|
419
|
+
* @example
|
|
420
|
+
* ```ts
|
|
421
|
+
* className: 'RendererContainer'
|
|
422
|
+
* ```
|
|
423
|
+
*/
|
|
424
|
+
className: string;
|
|
425
|
+
/**
|
|
426
|
+
* Container image reference or build target.
|
|
427
|
+
*
|
|
428
|
+
* @example
|
|
429
|
+
* ```ts
|
|
430
|
+
* image: './Dockerfile'
|
|
431
|
+
* ```
|
|
432
|
+
*/
|
|
433
|
+
image: string;
|
|
434
|
+
/**
|
|
435
|
+
* Maximum number of container instances.
|
|
436
|
+
*
|
|
437
|
+
* @default Cloudflare Containers default behavior.
|
|
438
|
+
*
|
|
439
|
+
* @example
|
|
440
|
+
* ```ts
|
|
441
|
+
* maxInstances: 3
|
|
442
|
+
* ```
|
|
443
|
+
*/
|
|
444
|
+
maxInstances?: number;
|
|
445
|
+
/**
|
|
446
|
+
* Container instance type.
|
|
447
|
+
*
|
|
448
|
+
* @default Cloudflare Containers default behavior.
|
|
449
|
+
*
|
|
450
|
+
* @example
|
|
451
|
+
* ```ts
|
|
452
|
+
* instanceType: 'standard'
|
|
453
|
+
* ```
|
|
454
|
+
*/
|
|
455
|
+
instanceType?: string;
|
|
456
|
+
/**
|
|
457
|
+
* Optional generated container name.
|
|
458
|
+
*
|
|
459
|
+
* @default Devflare derives the name from the class when possible.
|
|
460
|
+
*
|
|
461
|
+
* @example
|
|
462
|
+
* ```ts
|
|
463
|
+
* name: 'renderer'
|
|
464
|
+
* ```
|
|
465
|
+
*/
|
|
466
|
+
name?: string;
|
|
467
|
+
/**
|
|
468
|
+
* Docker build context.
|
|
469
|
+
*
|
|
470
|
+
* @default Container image path default.
|
|
471
|
+
*
|
|
472
|
+
* @example
|
|
473
|
+
* ```ts
|
|
474
|
+
* imageBuildContext: './containers/renderer'
|
|
475
|
+
* ```
|
|
476
|
+
*/
|
|
477
|
+
imageBuildContext?: string;
|
|
478
|
+
/**
|
|
479
|
+
* Build-time variables for the container image.
|
|
480
|
+
*
|
|
481
|
+
* @default No image variables.
|
|
482
|
+
*
|
|
483
|
+
* @example
|
|
484
|
+
* ```ts
|
|
485
|
+
* imageVars: { NODE_ENV: 'production' }
|
|
486
|
+
* ```
|
|
487
|
+
*/
|
|
488
|
+
imageVars?: Record<string, string>;
|
|
489
|
+
/**
|
|
490
|
+
* Active grace period in seconds during rollout.
|
|
491
|
+
*
|
|
492
|
+
* @default Cloudflare Containers default behavior.
|
|
493
|
+
*
|
|
494
|
+
* @example
|
|
495
|
+
* ```ts
|
|
496
|
+
* rolloutActiveGracePeriod: 60
|
|
497
|
+
* ```
|
|
498
|
+
*/
|
|
499
|
+
rolloutActiveGracePeriod?: number;
|
|
500
|
+
/**
|
|
501
|
+
* Rollout step percentage or step percentages.
|
|
502
|
+
*
|
|
503
|
+
* @default Cloudflare Containers default behavior.
|
|
504
|
+
*
|
|
505
|
+
* @example
|
|
506
|
+
* ```ts
|
|
507
|
+
* rolloutStepPercentage: [10, 50, 100]
|
|
508
|
+
* ```
|
|
509
|
+
*/
|
|
510
|
+
rolloutStepPercentage?: number | number[];
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* Worker placement configuration.
|
|
514
|
+
*/
|
|
515
|
+
export type PlacementConfigInput = SmartPlacementConfigInput | TargetedRegionPlacementConfigInput | TargetedHostPlacementConfigInput | TargetedHostnamePlacementConfigInput;
|
|
516
|
+
/**
|
|
517
|
+
* Smart Placement configuration.
|
|
518
|
+
*/
|
|
519
|
+
export interface SmartPlacementConfigInput {
|
|
520
|
+
/**
|
|
521
|
+
* Smart Placement mode.
|
|
522
|
+
*
|
|
523
|
+
* @example
|
|
524
|
+
* ```ts
|
|
525
|
+
* mode: 'smart'
|
|
526
|
+
* ```
|
|
527
|
+
*/
|
|
528
|
+
mode: 'off' | 'smart';
|
|
529
|
+
/**
|
|
530
|
+
* Optional placement hint. Only valid when `mode` is `smart`.
|
|
531
|
+
*
|
|
532
|
+
* @default No placement hint.
|
|
533
|
+
*
|
|
534
|
+
* @example
|
|
535
|
+
* ```ts
|
|
536
|
+
* hint: 'wnam'
|
|
537
|
+
* ```
|
|
538
|
+
*/
|
|
539
|
+
hint?: string;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Targeted placement by Cloudflare region.
|
|
543
|
+
*/
|
|
544
|
+
export interface TargetedRegionPlacementConfigInput {
|
|
545
|
+
/**
|
|
546
|
+
* Targeted placement mode.
|
|
547
|
+
*
|
|
548
|
+
* @default `'targeted'`
|
|
549
|
+
*
|
|
550
|
+
* @example
|
|
551
|
+
* ```ts
|
|
552
|
+
* mode: 'targeted'
|
|
553
|
+
* ```
|
|
554
|
+
*/
|
|
555
|
+
mode?: 'targeted';
|
|
556
|
+
/**
|
|
557
|
+
* Target Cloudflare region.
|
|
558
|
+
*
|
|
559
|
+
* @example
|
|
560
|
+
* ```ts
|
|
561
|
+
* region: 'wnam'
|
|
562
|
+
* ```
|
|
563
|
+
*/
|
|
564
|
+
region: string;
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Targeted placement by host.
|
|
568
|
+
*/
|
|
569
|
+
export interface TargetedHostPlacementConfigInput {
|
|
570
|
+
/**
|
|
571
|
+
* Targeted placement mode.
|
|
572
|
+
*
|
|
573
|
+
* @default `'targeted'`
|
|
574
|
+
*
|
|
575
|
+
* @example
|
|
576
|
+
* ```ts
|
|
577
|
+
* mode: 'targeted'
|
|
578
|
+
* ```
|
|
579
|
+
*/
|
|
580
|
+
mode?: 'targeted';
|
|
581
|
+
/**
|
|
582
|
+
* Target host.
|
|
583
|
+
*
|
|
584
|
+
* @example
|
|
585
|
+
* ```ts
|
|
586
|
+
* host: 'db.internal'
|
|
587
|
+
* ```
|
|
588
|
+
*/
|
|
589
|
+
host: string;
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Targeted placement by hostname.
|
|
593
|
+
*/
|
|
594
|
+
export interface TargetedHostnamePlacementConfigInput {
|
|
595
|
+
/**
|
|
596
|
+
* Targeted placement mode.
|
|
597
|
+
*
|
|
598
|
+
* @default `'targeted'`
|
|
599
|
+
*
|
|
600
|
+
* @example
|
|
601
|
+
* ```ts
|
|
602
|
+
* mode: 'targeted'
|
|
603
|
+
* ```
|
|
604
|
+
*/
|
|
605
|
+
mode?: 'targeted';
|
|
606
|
+
/**
|
|
607
|
+
* Target hostname.
|
|
608
|
+
*
|
|
609
|
+
* @example
|
|
610
|
+
* ```ts
|
|
611
|
+
* hostname: 'api.example.com'
|
|
612
|
+
* ```
|
|
613
|
+
*/
|
|
614
|
+
hostname: string;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* Worker resource limits.
|
|
618
|
+
*/
|
|
619
|
+
export interface LimitsConfigInput {
|
|
620
|
+
/**
|
|
621
|
+
* CPU time limit in milliseconds.
|
|
622
|
+
*
|
|
623
|
+
* @default Cloudflare Workers account and plan default.
|
|
624
|
+
*
|
|
625
|
+
* @example
|
|
626
|
+
* ```ts
|
|
627
|
+
* cpu_ms: 50
|
|
628
|
+
* ```
|
|
629
|
+
*/
|
|
630
|
+
cpu_ms?: number;
|
|
631
|
+
/**
|
|
632
|
+
* Subrequest limit.
|
|
633
|
+
*
|
|
634
|
+
* @default Cloudflare Workers account and plan default.
|
|
635
|
+
*
|
|
636
|
+
* @example
|
|
637
|
+
* ```ts
|
|
638
|
+
* subrequests: 1000
|
|
639
|
+
* ```
|
|
640
|
+
*/
|
|
641
|
+
subrequests?: number;
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* Worker logs and traces observability settings.
|
|
645
|
+
*/
|
|
646
|
+
export interface ObservabilityConfigInput {
|
|
647
|
+
/**
|
|
648
|
+
* Enable observability.
|
|
649
|
+
*
|
|
650
|
+
* @default Cloudflare default behavior.
|
|
651
|
+
*
|
|
652
|
+
* @example
|
|
653
|
+
* ```ts
|
|
654
|
+
* enabled: true
|
|
655
|
+
* ```
|
|
656
|
+
*/
|
|
657
|
+
enabled?: boolean;
|
|
658
|
+
/**
|
|
659
|
+
* Head sampling rate from `0` to `1`.
|
|
660
|
+
*
|
|
661
|
+
* @default Cloudflare default sampling behavior.
|
|
662
|
+
*
|
|
663
|
+
* @example
|
|
664
|
+
* ```ts
|
|
665
|
+
* head_sampling_rate: 0.1
|
|
666
|
+
* ```
|
|
667
|
+
*/
|
|
668
|
+
head_sampling_rate?: number;
|
|
669
|
+
/**
|
|
670
|
+
* Log-specific observability settings.
|
|
671
|
+
*
|
|
672
|
+
* @default Cloudflare default log behavior.
|
|
673
|
+
*
|
|
674
|
+
* @example
|
|
675
|
+
* ```ts
|
|
676
|
+
* logs: { enabled: true, invocation_logs: true }
|
|
677
|
+
* ```
|
|
678
|
+
*/
|
|
679
|
+
logs?: ObservabilityLogsConfigInput;
|
|
680
|
+
/**
|
|
681
|
+
* Trace-specific observability settings.
|
|
682
|
+
*
|
|
683
|
+
* @default Cloudflare default trace behavior.
|
|
684
|
+
*
|
|
685
|
+
* @example
|
|
686
|
+
* ```ts
|
|
687
|
+
* traces: { enabled: true, head_sampling_rate: 0.05 }
|
|
688
|
+
* ```
|
|
689
|
+
*/
|
|
690
|
+
traces?: ObservabilityTracesConfigInput;
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Worker log observability settings.
|
|
694
|
+
*/
|
|
695
|
+
export interface ObservabilityLogsConfigInput {
|
|
696
|
+
/**
|
|
697
|
+
* Enable log collection.
|
|
698
|
+
*
|
|
699
|
+
* @default Cloudflare default log behavior.
|
|
700
|
+
*
|
|
701
|
+
* @example
|
|
702
|
+
* ```ts
|
|
703
|
+
* enabled: true
|
|
704
|
+
* ```
|
|
705
|
+
*/
|
|
706
|
+
enabled?: boolean;
|
|
707
|
+
/**
|
|
708
|
+
* Log head sampling rate from `0` to `1`.
|
|
709
|
+
*
|
|
710
|
+
* @default Cloudflare default sampling behavior.
|
|
711
|
+
*
|
|
712
|
+
* @example
|
|
713
|
+
* ```ts
|
|
714
|
+
* head_sampling_rate: 0.1
|
|
715
|
+
* ```
|
|
716
|
+
*/
|
|
717
|
+
head_sampling_rate?: number;
|
|
718
|
+
/**
|
|
719
|
+
* Include invocation logs.
|
|
720
|
+
*
|
|
721
|
+
* @default Cloudflare default log behavior.
|
|
722
|
+
*
|
|
723
|
+
* @example
|
|
724
|
+
* ```ts
|
|
725
|
+
* invocation_logs: true
|
|
726
|
+
* ```
|
|
727
|
+
*/
|
|
728
|
+
invocation_logs?: boolean;
|
|
729
|
+
/**
|
|
730
|
+
* Persist logs.
|
|
731
|
+
*
|
|
732
|
+
* @default Cloudflare default persistence behavior.
|
|
733
|
+
*
|
|
734
|
+
* @example
|
|
735
|
+
* ```ts
|
|
736
|
+
* persist: true
|
|
737
|
+
* ```
|
|
738
|
+
*/
|
|
739
|
+
persist?: boolean;
|
|
740
|
+
/**
|
|
741
|
+
* Log destination names.
|
|
742
|
+
*
|
|
743
|
+
* @default Cloudflare default destinations.
|
|
744
|
+
*
|
|
745
|
+
* @example
|
|
746
|
+
* ```ts
|
|
747
|
+
* destinations: ['cloudflare']
|
|
748
|
+
* ```
|
|
749
|
+
*/
|
|
750
|
+
destinations?: string[];
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Worker trace observability settings.
|
|
754
|
+
*/
|
|
755
|
+
export interface ObservabilityTracesConfigInput {
|
|
756
|
+
/**
|
|
757
|
+
* Enable trace collection.
|
|
758
|
+
*
|
|
759
|
+
* @default Cloudflare default trace behavior.
|
|
760
|
+
*
|
|
761
|
+
* @example
|
|
762
|
+
* ```ts
|
|
763
|
+
* enabled: true
|
|
764
|
+
* ```
|
|
765
|
+
*/
|
|
766
|
+
enabled?: boolean;
|
|
767
|
+
/**
|
|
768
|
+
* Trace head sampling rate from `0` to `1`.
|
|
769
|
+
*
|
|
770
|
+
* @default Cloudflare default sampling behavior.
|
|
771
|
+
*
|
|
772
|
+
* @example
|
|
773
|
+
* ```ts
|
|
774
|
+
* head_sampling_rate: 0.1
|
|
775
|
+
* ```
|
|
776
|
+
*/
|
|
777
|
+
head_sampling_rate?: number;
|
|
778
|
+
/**
|
|
779
|
+
* Persist traces.
|
|
780
|
+
*
|
|
781
|
+
* @default Cloudflare default persistence behavior.
|
|
782
|
+
*
|
|
783
|
+
* @example
|
|
784
|
+
* ```ts
|
|
785
|
+
* persist: true
|
|
786
|
+
* ```
|
|
787
|
+
*/
|
|
788
|
+
persist?: boolean;
|
|
789
|
+
/**
|
|
790
|
+
* Trace destination names.
|
|
791
|
+
*
|
|
792
|
+
* @default Cloudflare default destinations.
|
|
793
|
+
*
|
|
794
|
+
* @example
|
|
795
|
+
* ```ts
|
|
796
|
+
* destinations: ['cloudflare']
|
|
797
|
+
* ```
|
|
798
|
+
*/
|
|
799
|
+
destinations?: string[];
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* Durable Object migration configuration.
|
|
803
|
+
*/
|
|
804
|
+
export interface MigrationConfigInput {
|
|
805
|
+
/**
|
|
806
|
+
* Unique migration tag.
|
|
807
|
+
*
|
|
808
|
+
* @example
|
|
809
|
+
* ```ts
|
|
810
|
+
* tag: 'v1'
|
|
811
|
+
* ```
|
|
812
|
+
*/
|
|
813
|
+
tag: string;
|
|
814
|
+
/**
|
|
815
|
+
* New Durable Object class names using legacy storage.
|
|
816
|
+
*
|
|
817
|
+
* @default No new legacy-storage classes.
|
|
818
|
+
*
|
|
819
|
+
* @example
|
|
820
|
+
* ```ts
|
|
821
|
+
* new_classes: ['Counter']
|
|
822
|
+
* ```
|
|
823
|
+
*/
|
|
824
|
+
new_classes?: string[];
|
|
825
|
+
/**
|
|
826
|
+
* Renamed Durable Object classes.
|
|
827
|
+
*
|
|
828
|
+
* @default No renamed classes.
|
|
829
|
+
*
|
|
830
|
+
* @example
|
|
831
|
+
* ```ts
|
|
832
|
+
* renamed_classes: [{ from: 'OldCounter', to: 'Counter' }]
|
|
833
|
+
* ```
|
|
834
|
+
*/
|
|
835
|
+
renamed_classes?: RenamedClassMigrationInput[];
|
|
836
|
+
/**
|
|
837
|
+
* Deleted Durable Object class names.
|
|
838
|
+
*
|
|
839
|
+
* @default No deleted classes.
|
|
840
|
+
*
|
|
841
|
+
* @example
|
|
842
|
+
* ```ts
|
|
843
|
+
* deleted_classes: ['OldCounter']
|
|
844
|
+
* ```
|
|
845
|
+
*/
|
|
846
|
+
deleted_classes?: string[];
|
|
847
|
+
/**
|
|
848
|
+
* New Durable Object class names using SQLite storage.
|
|
849
|
+
*
|
|
850
|
+
* @default No new SQLite classes.
|
|
851
|
+
*
|
|
852
|
+
* @example
|
|
853
|
+
* ```ts
|
|
854
|
+
* new_sqlite_classes: ['Counter']
|
|
855
|
+
* ```
|
|
856
|
+
*/
|
|
857
|
+
new_sqlite_classes?: string[];
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* Durable Object class rename migration entry.
|
|
861
|
+
*/
|
|
862
|
+
export interface RenamedClassMigrationInput {
|
|
863
|
+
/**
|
|
864
|
+
* Previous Durable Object class name.
|
|
865
|
+
*
|
|
866
|
+
* @example
|
|
867
|
+
* ```ts
|
|
868
|
+
* from: 'OldCounter'
|
|
869
|
+
* ```
|
|
870
|
+
*/
|
|
871
|
+
from: string;
|
|
872
|
+
/**
|
|
873
|
+
* New Durable Object class name.
|
|
874
|
+
*
|
|
875
|
+
* @example
|
|
876
|
+
* ```ts
|
|
877
|
+
* to: 'Counter'
|
|
878
|
+
* ```
|
|
879
|
+
*/
|
|
880
|
+
to: string;
|
|
881
|
+
}
|
|
882
|
+
//# sourceMappingURL=schema-types-runtime.d.ts.map
|