@velajs/cloudflare 1.28.0 → 1.30.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.
Files changed (91) hide show
  1. package/CHANGELOG.md +113 -0
  2. package/README.md +190 -69
  3. package/dist/_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/decorate.js +9 -0
  4. package/dist/_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/decorateMetadata.js +6 -0
  5. package/dist/_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/decorateParam.js +8 -0
  6. package/dist/cloudflare-application.js +309 -0
  7. package/dist/cloudflare-application.js.map +1 -0
  8. package/dist/cloudflare-factory.js +109 -0
  9. package/dist/cloudflare-factory.js.map +1 -0
  10. package/dist/decorators/queue-consumer.js +39 -0
  11. package/dist/decorators/queue-consumer.js.map +1 -0
  12. package/dist/durable-objects.d.ts +11 -11
  13. package/dist/durable-objects.js +2 -512
  14. package/dist/environment.js +19 -0
  15. package/dist/environment.js.map +1 -0
  16. package/dist/index.d.ts +146 -111
  17. package/dist/index.js +21 -1130
  18. package/dist/nonce/durable-object-nonce.store.js +33 -0
  19. package/dist/nonce/durable-object-nonce.store.js.map +1 -0
  20. package/dist/nonce/nonce-validation.js +18 -0
  21. package/dist/nonce/nonce-validation.js.map +1 -0
  22. package/dist/nonce/nonce.durable-object.js +54 -0
  23. package/dist/nonce/nonce.durable-object.js.map +1 -0
  24. package/dist/{nonce.durable-object-DffHMRnU.d.ts → nonce.durable-object-Ci9AGssY.d.ts} +9 -7
  25. package/dist/queue/cloudflare-queues.js +215 -0
  26. package/dist/queue/cloudflare-queues.js.map +1 -0
  27. package/dist/queues.d.ts +48 -0
  28. package/dist/queues.js +2 -0
  29. package/dist/rate-limit/cloudflare-rate-limit.store.js +40 -0
  30. package/dist/rate-limit/cloudflare-rate-limit.store.js.map +1 -0
  31. package/dist/schedule-diagnostics.js +51 -0
  32. package/dist/schedule-diagnostics.js.map +1 -0
  33. package/dist/scheduled-event.js +68 -0
  34. package/dist/scheduled-event.js.map +1 -0
  35. package/dist/services/flagship-flag.driver.js +52 -0
  36. package/dist/services/flagship-flag.driver.js.map +1 -0
  37. package/dist/services/kv-cache.store.js +82 -0
  38. package/dist/services/kv-cache.store.js.map +1 -0
  39. package/dist/services/kv-flag.driver.js +62 -0
  40. package/dist/services/kv-flag.driver.js.map +1 -0
  41. package/dist/storage/r2-storage.driver.js +67 -0
  42. package/dist/storage/r2-storage.driver.js.map +1 -0
  43. package/dist/storage/storage-key-claim.js +74 -0
  44. package/dist/storage/storage-key-claim.js.map +1 -0
  45. package/dist/storage/storage-manager.service.js +38 -0
  46. package/dist/storage/storage-manager.service.js.map +1 -0
  47. package/dist/storage/storage.controller.js +64 -0
  48. package/dist/storage/storage.controller.js.map +1 -0
  49. package/dist/storage/storage.module.js +25 -0
  50. package/dist/storage/storage.module.js.map +1 -0
  51. package/dist/storage/storage.service.js +64 -0
  52. package/dist/storage/storage.service.js.map +1 -0
  53. package/dist/storage/storage.tokens.js +7 -0
  54. package/dist/storage/storage.tokens.js.map +1 -0
  55. package/dist/vela-env-DFvyoNT3.d.ts +9 -0
  56. package/dist/websocket/broadcast.js +32 -0
  57. package/dist/websocket/broadcast.js.map +1 -0
  58. package/dist/websocket/cf-room-registry.js +137 -0
  59. package/dist/websocket/cf-room-registry.js.map +1 -0
  60. package/dist/websocket/cf-ws-client.js +94 -0
  61. package/dist/websocket/cf-ws-client.js.map +1 -0
  62. package/dist/websocket/cloudflare-websocket.module.js +25 -0
  63. package/dist/websocket/cloudflare-websocket.module.js.map +1 -0
  64. package/dist/websocket/do-bootstrap.js +56 -0
  65. package/dist/websocket/do-bootstrap.js.map +1 -0
  66. package/dist/websocket/do-live.js +184 -0
  67. package/dist/websocket/do-live.js.map +1 -0
  68. package/dist/websocket/do-pitr.js +81 -0
  69. package/dist/websocket/do-pitr.js.map +1 -0
  70. package/dist/websocket/do-state.js +7 -0
  71. package/dist/websocket/do-state.js.map +1 -0
  72. package/dist/websocket/do-websocket-host.js +169 -0
  73. package/dist/websocket/do-websocket-host.js.map +1 -0
  74. package/dist/websocket/room-id.js +27 -0
  75. package/dist/websocket/room-id.js.map +1 -0
  76. package/dist/websocket/websocket-routing.js +133 -0
  77. package/dist/websocket/websocket-routing.js.map +1 -0
  78. package/dist/websocket/websocket.durable-object.js +138 -0
  79. package/dist/websocket/websocket.durable-object.js.map +1 -0
  80. package/dist/websocket/ws-attachment.js +79 -0
  81. package/dist/websocket/ws-attachment.js.map +1 -0
  82. package/dist/websocket/ws-server-holder.js +38 -0
  83. package/dist/websocket/ws-server-holder.js.map +1 -0
  84. package/package.json +14 -11
  85. package/dist/durable-objects.js.map +0 -1
  86. package/dist/index.js.map +0 -1
  87. package/dist/nonce-validation-CeVihShV.js +0 -517
  88. package/dist/nonce-validation-CeVihShV.js.map +0 -1
  89. package/dist/queue.d.ts +0 -32
  90. package/dist/queue.js +0 -78
  91. package/dist/queue.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,10 +1,15 @@
1
- import { a as DoPitrId, c as DoPitrUnavailableError, d as isDoPitrUnavailable, f as readDoPitrBookmark, i as DoPitrBookmarkRead, l as VelaDoPitrRpc, n as DoPitrArmOptions, o as DoPitrNamespace, p as CloudflareRoot, r as DoPitrArmResult, s as DoPitrStorage, t as VelaNonceDurableObject, u as armDoPitr } from "./nonce.durable-object-DffHMRnU.js";
2
- import { AsyncCacheStore, CacheEntry, CacheEntryReader, CacheEntryWriter, CacheInvalidationStore, DynamicModule, InjectionToken, NonceStore, RuntimeAdapter, ThrottlerStore, Type, VelaApplication, VelaMiddlewareHandler, VelaSecurityOptions } from "@velajs/vela";
3
- import { BroadcastCommand, ConnectedSocket, MessageBody, OnGatewayConnection, OnGatewayDisconnect, OnGatewayInit, SubscribeMessage, WebSocketGateway, WebSocketGatewayOptions, WebSocketSendGate, WebSocketServer, WsClient, WsDispatcher, WsException, WsMessage, WsResponse, WsServer } from "@velajs/vela/websocket";
4
- import { DownloadResult, PresignMethod, PresignedUrlResult, StorageBody, StorageDriver, UploadOptions, UploadResult } from "@velajs/vela/storage";
5
- import { CommitStamp, CursorLog, InvalidationCommand, LiveDriver, LiveEngine, LiveInvalidationSink, ResumeVerdict } from "@velajs/vela/live";
1
+ import "./vela-env-DFvyoNT3.js";
2
+ import { a as DoPitrId, c as DoPitrUnavailableError, d as isDoPitrUnavailable, f as readDoPitrBookmark, i as DoPitrBookmarkRead, l as VelaDoPitrRpc, n as DoPitrArmOptions, o as DoPitrNamespace, p as CloudflareRoot, r as DoPitrArmResult, s as DoPitrStorage, t as VelaNonceDurableObject, u as armDoPitr } from "./nonce.durable-object-Ci9AGssY.js";
3
+ import { DynamicModule, InjectionToken, Type, VelaApplication, VelaEnv, VelaMiddlewareHandler, VelaSecurityOptions } from "@velajs/vela";
4
+ import { BroadcastCommand, WebSocketGatewayOptions } from "@velajs/vela/websocket";
5
+ import { CommitStamp, CursorLog, InvalidationCommand, LiveDriver, LiveInvalidationSink, ResumeVerdict } from "@velajs/vela/live";
6
6
  import { Context, ExecutionContext } from "hono";
7
+ import { RuntimeAdapter } from "@velajs/vela/module-kit";
8
+ import { DownloadResult, PresignMethod, PresignedUrlResult, StorageBody, StorageDriver, UploadOptions, UploadResult } from "@velajs/vela/storage";
9
+ import { AsyncCacheStore, CacheEntry, CacheEntryReader, CacheEntryWriter, CacheInvalidationStore } from "@velajs/vela/cache";
7
10
  import { FeatureFlagDriver, FlagContext } from "@velajs/feature-flags";
11
+ import { ThrottlerStore } from "@velajs/vela/throttler";
12
+ import { NonceStore } from "@velajs/vela/security";
8
13
  //#region src/websocket/room-id.d.ts
9
14
  /** Stable, collision-free Durable Object name for one gateway's room. */
10
15
  export declare function durableObjectRoomName(gatewayPath: string, roomId: string): string;
@@ -14,8 +19,63 @@ interface WsGatewayRoute {
14
19
  path: string;
15
20
  binding: string;
16
21
  options: WebSocketGatewayOptions;
22
+ /** Container module that declares the gateway; its authenticator resolves from here. */
23
+ moduleId?: string;
17
24
  }
18
25
  //#endregion
26
+ //#region src/scheduled-event.d.ts
27
+ /**
28
+ * The event a Worker's `scheduled()` export receives. The native
29
+ * `ScheduledController` satisfies it; direct calls (tests, scripts) may omit
30
+ * `scheduledTime`, which then defaults to the current time, and `noRetry`.
31
+ */
32
+ interface ScheduledEvent {
33
+ readonly cron: string;
34
+ readonly scheduledTime?: number;
35
+ noRetry?(): void;
36
+ }
37
+ /** The Cloudflare trigger behind the current scheduled invocation. */
38
+ interface CloudflareScheduledEvent {
39
+ /** The trigger's exact cron string; it equals the invocation's `expression`. */
40
+ readonly cron: string;
41
+ /** The platform's scheduled time in Unix milliseconds. */
42
+ readonly scheduledTime: number;
43
+ /**
44
+ * Ask Cloudflare not to retry this trigger if the invocation fails. Already
45
+ * bound to the native controller, so it can be passed around or destructured.
46
+ * A no-op for direct calls that supplied no controller.
47
+ */
48
+ readonly noRetry: () => void;
49
+ }
50
+ /**
51
+ * Request-scoped Cloudflare view of the scheduled trigger, seeded into each
52
+ * `@Cron` job's invocation scope by the Cloudflare adapter. Inject it where a
53
+ * job needs platform controls such as `noRetry()`; the job's argument stays
54
+ * the portable `ScheduleInvocation`. It resolves only inside a scheduled
55
+ * invocation; resolving it anywhere else throws. A cron job fired on demand
56
+ * (Studio's run-now) receives a synthetic event: `cron` is the job's
57
+ * expression and `noRetry()` does nothing.
58
+ *
59
+ * The token provides itself as request-scoped in every container, so a class
60
+ * that injects it is request-scoped wherever the graph boots (a Worker, a
61
+ * Durable Object, the CLI or a testing module) and is built only for an
62
+ * invocation, never at bootstrap.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * @Injectable({ scope: Scope.REQUEST })
67
+ * class Reports {
68
+ * constructor(@Inject(CLOUDFLARE_SCHEDULED_EVENT) private readonly trigger: CloudflareScheduledEvent) {}
69
+ *
70
+ * @Cron('0 3 * * *', { dialect: 'cloudflare' })
71
+ * async nightly(tick: CronInvocation) {
72
+ * if (!(await this.upstreamAvailable(tick.signal))) this.trigger.noRetry();
73
+ * }
74
+ * }
75
+ * ```
76
+ */
77
+ export declare const CLOUDFLARE_SCHEDULED_EVENT: InjectionToken<CloudflareScheduledEvent>;
78
+ //#endregion
19
79
  //#region src/cloudflare-application.d.ts
20
80
  /**
21
81
  * Options accepted by {@link CloudflareApplication.mountOpenApi}.
@@ -28,15 +88,16 @@ type MountOpenApiOptions = Parameters<VelaApplication['mountOpenApi']>[0];
28
88
  /**
29
89
  * Wraps VelaApplication with Cloudflare-specific handlers:
30
90
  * - `fetch` — HTTP request handler (from Hono)
31
- * - `scheduled` — Cron trigger handler (matches `@Scheduled()` decorators
32
- * AND vela's own `@Cron()` jobs)
33
- * - `queue` — Queue consumer handler (matches `@QueueConsumer()` decorators)
91
+ * - `scheduled` — Cron trigger handler (runs the `@Cron()` jobs whose
92
+ * expression is the trigger's exact string)
93
+ * - `queue` — Queue consumer handler (`@QueueConsumer()` by physical queue,
94
+ * then `QueueModule`'s native consumer)
34
95
  * - `mountOpenApi` — Serve an OpenAPI document (and optional Scalar UI) on
35
96
  * the underlying Hono app
36
97
  *
37
98
  * @example
38
99
  * ```ts
39
- * const app = await createCloudflareApp(AppModule, { env, envToken: ENV });
100
+ * const app = await createCloudflareApp(AppModule, { env });
40
101
  * export default {
41
102
  * fetch: app.fetch,
42
103
  * scheduled: app.scheduled.bind(app),
@@ -47,18 +108,18 @@ type MountOpenApiOptions = Parameters<VelaApplication['mountOpenApi']>[0];
47
108
  * @example
48
109
  * ```ts
49
110
  * // Serve OpenAPI docs alongside your routes
50
- * const app = await createCloudflareApp(AppModule, { env, envToken: ENV });
111
+ * const app = await createCloudflareApp(AppModule, { env });
51
112
  * const document = createOpenApiDocument(AppModule);
52
113
  * app.mountOpenApi({ document, ui: 'scalar' });
53
114
  * // GET /openapi.json -> JSON document
54
115
  * // GET /scalar -> Scalar UI (loads from CDN)
55
116
  * ```
56
117
  */
57
- export declare class CloudflareApplication<T extends object = object> {
118
+ export declare class CloudflareApplication {
58
119
  #private;
59
- readonly env: T;
60
- constructor(app: VelaApplication, env: T);
61
- readonly fetch: (request: Request, env: T, ctx?: ExecutionContext) => Promise<Response>;
120
+ readonly env: VelaEnv;
121
+ constructor(app: VelaApplication, env: VelaEnv);
122
+ readonly fetch: (request: Request, env: VelaEnv, ctx?: ExecutionContext) => Promise<Response>;
62
123
  getHonoApp(): ReturnType<VelaApplication['getHonoApp']>;
63
124
  /**
64
125
  * Resolve a provider from the application's DI container (delegates to
@@ -68,7 +129,7 @@ export declare class CloudflareApplication<T extends object = object> {
68
129
  *
69
130
  * @example
70
131
  * ```ts
71
- * const app = await createCloudflareApp(AppModule, { env, envToken: ENV });
132
+ * const app = await createCloudflareApp(AppModule, { env });
72
133
  * const auth = app.get(BetterAuthService);
73
134
  * ```
74
135
  */
@@ -83,9 +144,9 @@ export declare class CloudflareApplication<T extends object = object> {
83
144
  *
84
145
  * @example
85
146
  * ```ts
86
- * import { createOpenApiDocument } from '@velajs/vela';
147
+ * import { createOpenApiDocument } from '@velajs/vela/openapi';
87
148
  *
88
- * const app = await createCloudflareApp(AppModule, { env, envToken: ENV });
149
+ * const app = await createCloudflareApp(AppModule, { env });
89
150
  * const document = createOpenApiDocument(AppModule, {
90
151
  * info: { title: 'My API', version: '1.0.0' },
91
152
  * });
@@ -104,75 +165,104 @@ export declare class CloudflareApplication<T extends object = object> {
104
165
  /** @internal — upgrade routes discovered from the application's gateways. */
105
166
  getWsGatewayRoutes(): WsGatewayRoute[];
106
167
  /**
107
- * Handle Cloudflare scheduled (cron) events.
108
- * Matches the event's cron expression to `@Scheduled()` and vela `@Cron()`
109
- * handlers read from `app.entrypoints`; each handler runs inside a fresh
110
- * request-scoped child (request-scoped providers rebuild per tick).
168
+ * Handle a Cloudflare cron trigger. Runs every core `@Cron()` job whose
169
+ * expression is exactly `event.cron` (the trigger string is compared as
170
+ * delivered, never re-evaluated) through `invokeScheduledJob`, the dispatch
171
+ * primitive every runtime shares. Each job receives only its
172
+ * `ScheduleInvocation`, runs in a fresh invocation scope seeded with
173
+ * {@link CLOUDFLARE_SCHEDULED_EVENT}, and honors signed `ScheduleModule`
174
+ * dispatch. The trigger settles after every matching job and its managed
175
+ * work (`EXECUTION_LIFETIME.waitUntil`/`defer`) settle; failures reject it.
111
176
  */
112
- scheduled(event: {
113
- cron: string;
114
- scheduledTime?: number;
115
- }, env: T, ctx: {
177
+ scheduled(event: ScheduledEvent, env: VelaEnv, _ctx?: {
116
178
  waitUntil: (promise: Promise<unknown>) => void;
117
179
  }): Promise<void>;
118
180
  /**
119
- * Run one entrypoint handler inside a fresh request scope, through the
120
- * shared guard → interceptor pipeline (components declared with
181
+ * Run one queue consumer inside a fresh request scope, through the shared
182
+ * guard → interceptor pipeline (components declared with
121
183
  * `@UseGuards`/`@UseInterceptors`/`@UseFilters` on the consumer class or
122
184
  * method). HTTP-global components deliberately do NOT apply — an HTTP auth
123
- * guard has no business rejecting a queue batch. Unclaimed errors rethrow
124
- * so the platform's retry semantics stay intact.
185
+ * guard has no business rejecting a queue batch. Unclaimed errors are
186
+ * reported once (`QueueModule`'s consumer reports its own) and rethrow so
187
+ * the platform's retry semantics stay intact.
125
188
  */
126
189
  private dispatchEntrypoint;
127
190
  /**
128
- * Handle Cloudflare Queue consumer events.
129
- * Matches the batch queue name to `@QueueConsumer()` handlers read from
130
- * `app.entrypoints`; each batch is processed inside a fresh request-scoped
131
- * child (request-scoped providers rebuild per batch — no boot-time captives).
191
+ * Handle Cloudflare Queue consumer events. `@QueueConsumer()` handlers read
192
+ * from `app.entrypoints` claim a batch by its physical queue name and
193
+ * receive it whole. A batch no handler claims goes to `QueueModule`'s native
194
+ * consumer (`cloudflareQueues()` from `@velajs/cloudflare/queues`), which
195
+ * routes each job by its logical queue. Each dispatch runs inside a fresh
196
+ * request-scoped child (request-scoped providers rebuild per batch — no
197
+ * boot-time captives). A batch nothing claims rejects: resolving would let
198
+ * Cloudflare acknowledge every message implicitly.
132
199
  */
133
200
  queue(batch: {
134
201
  queue: string;
135
202
  messages: readonly unknown[];
136
- }, env: T, ctx: {
203
+ }, env: VelaEnv, ctx: {
137
204
  waitUntil: (promise: Promise<unknown>) => void;
138
205
  }): Promise<void>;
206
+ /**
207
+ * A raw `@QueueConsumer` owns its physical queue's batches and must not carry
208
+ * jobs of a queue registered with `QueueModule`: those reach their
209
+ * `@Processor` only if the raw handler dispatches them itself, while
210
+ * `cloudflareQueues()` delivers registered queues. Warn once per physical and
211
+ * logical queue (unless diagnostics are silent); the raw consumer still
212
+ * receives and settles the batch.
213
+ */
214
+ private warnRawJobs;
215
+ /**
216
+ * Abort the signals of scheduled jobs still running, wait for them and their
217
+ * managed work to settle, then close the application.
218
+ */
139
219
  close(signal?: string): Promise<void>;
140
220
  }
141
221
  //#endregion
142
222
  //#region src/cloudflare-factory.d.ts
143
- interface CloudflareWorkerOptions<T extends object> {
144
- /** Global typed DI token for the platform's native environment. */
145
- envToken: InjectionToken<T>;
223
+ interface CloudflareWorkerOptions {
146
224
  globalPrefix?: string;
147
225
  security?: VelaSecurityOptions;
148
- /** Build request middleware from the same typed native environment as DI. */
149
- middleware?: (env: NoInfer<T>) => VelaMiddlewareHandler[];
226
+ /** Build request middleware from the same native environment DI receives as ENV. */
227
+ middleware?: (env: VelaEnv) => VelaMiddlewareHandler[];
228
+ /** Further runtime adapters, composed after the Cloudflare adapter for each application. */
229
+ adapters?: RuntimeAdapter[];
150
230
  }
151
- interface CreateCloudflareAppOptions<T extends object> extends CloudflareWorkerOptions<T> {
231
+ interface CreateCloudflareAppOptions extends CloudflareWorkerOptions {
152
232
  /** Supply the platform environment inside fetch/queue/scheduled or a DO constructor. */
153
- env: NoInfer<T>;
233
+ env: VelaEnv;
154
234
  }
155
- /** Bind an application to one environment before provider factories and lifecycle hooks. */
156
- export declare function cloudflareAdapter<T extends object>(options: CreateCloudflareAppOptions<T>): RuntimeAdapter;
157
- /** Build an application for one native Workers environment. Call inside a platform event. */
158
- export declare function createCloudflareApp<T extends object>(rootModule: CloudflareRoot<NoInfer<T>>, options: CreateCloudflareAppOptions<T>): Promise<CloudflareApplication<T>>;
159
235
  /**
160
- * Worker entrypoint with one bootstrap per environment identity. Weak keys let
161
- * obsolete environments and secrets be collected. Concurrent cold events share
162
- * construction; failed construction is evicted so the next event can retry.
236
+ * Bind an application to one environment: seeded as the global ENV before
237
+ * provider factories and lifecycle hooks, and asserted on every request. The
238
+ * adapter also supplies the `InternalDispatcher` transport, so signed queue and
239
+ * schedule dispatch re-enter this application's routes, and reports schedule
240
+ * declarations a cron trigger cannot honor through the diagnostics policy.
163
241
  */
164
- export declare function createCloudflareWorker<T extends object>(rootModule: CloudflareRoot<NoInfer<T>>, options: CloudflareWorkerOptions<T>): {
165
- fetch(request: Request, env: T, ctx: ExecutionContext): Promise<Response>;
166
- scheduled(event: {
167
- cron: string;
168
- scheduledTime?: number;
169
- }, env: T, ctx: {
242
+ export declare function cloudflareAdapter(options: {
243
+ env: VelaEnv;
244
+ }): RuntimeAdapter;
245
+ /**
246
+ * Build an application for one native Workers environment. Call inside a platform event.
247
+ * The root is static: a module class or a `DynamicModule` declared at module scope.
248
+ * Read bindings in providers (`@InjectEnv()`) and module factories
249
+ * (`forRootAsync({ inject: [ENV], useFactory })`), which run for each application.
250
+ */
251
+ export declare function createCloudflareApp(rootModule: CloudflareRoot, options: CreateCloudflareAppOptions): Promise<CloudflareApplication>;
252
+ /**
253
+ * Worker entrypoint with one bootstrap per environment identity. Concurrent cold
254
+ * events share construction; failed construction is evicted so the next event
255
+ * can retry. Weak keys stop this cache from retaining a replaced environment.
256
+ */
257
+ export declare function createCloudflareWorker(rootModule: CloudflareRoot, options?: CloudflareWorkerOptions): {
258
+ fetch(request: Request, env: VelaEnv, ctx: ExecutionContext): Promise<Response>;
259
+ scheduled(event: ScheduledEvent, env: VelaEnv, ctx?: {
170
260
  waitUntil: (promise: Promise<unknown>) => void;
171
261
  }): Promise<void>;
172
262
  queue(batch: {
173
263
  queue: string;
174
264
  messages: readonly unknown[];
175
- }, env: T, ctx: {
265
+ }, env: VelaEnv, ctx: {
176
266
  waitUntil: (promise: Promise<unknown>) => void;
177
267
  }): Promise<void>;
178
268
  };
@@ -403,60 +493,6 @@ export declare class KvFlagDriver implements FeatureFlagDriver {
403
493
  /** Convenience factory for {@link KvFlagDriver}. */
404
494
  export declare function kvFlagDriver(kv: KVNamespace, options?: KvFlagDriverOptions): KvFlagDriver;
405
495
  //#endregion
406
- //#region src/decorators/env.d.ts
407
- /**
408
- * Parameter decorator to inject Cloudflare environment bindings.
409
- *
410
- * Without arguments, returns the entire `env` object.
411
- * With a binding name, returns that specific binding.
412
- *
413
- * @example
414
- * ```ts
415
- * @Get()
416
- * handle(@Env() env: WorkerEnv) { ... }
417
- *
418
- * @Get()
419
- * handle(@Env('MY_KV') kv: KVNamespace) { ... }
420
- * ```
421
- */
422
- export declare const Env: (data?: string | undefined, ...pipes: import("@velajs/vela").PipeType[]) => ParameterDecorator;
423
- //#endregion
424
- //#region src/decorators/scheduled.d.ts
425
- interface ScheduledMetadata {
426
- cron: string;
427
- methodName: string;
428
- }
429
- /** Compatible with the existing programmatic scheduled() entrypoint. */
430
- interface ScheduledEvent {
431
- readonly cron: string;
432
- readonly scheduledTime?: number;
433
- }
434
- /** Native controller passed unchanged to a Worker handler. Call noRetry on its receiver. */
435
- interface ScheduledController extends ScheduledEvent {
436
- readonly scheduledTime: number;
437
- noRetry(): void;
438
- }
439
- interface ScheduledContext {
440
- waitUntil(promise: Promise<unknown>): void;
441
- }
442
- type ScheduledHandler<Env extends object = object> = (controller: ScheduledController, env: Env, context: ScheduledContext) => void | Promise<void>;
443
- export declare function parseScheduledMetadata(value: unknown): ScheduledMetadata;
444
- /**
445
- * Marks a method as a scheduled (cron) handler.
446
- *
447
- * @example
448
- * ```ts
449
- * @Injectable()
450
- * class WorkerService {
451
- * @Scheduled('0 * * * *')
452
- * async hourlyCron() {
453
- * console.log('Running hourly');
454
- * }
455
- * }
456
- * ```
457
- */
458
- export declare function Scheduled(cron: string): MethodDecorator;
459
- //#endregion
460
496
  //#region src/decorators/queue-consumer.d.ts
461
497
  interface QueueConsumerMetadata {
462
498
  queueName: string;
@@ -645,5 +681,4 @@ interface DurableObjectNonceStoreOptions {
645
681
  */
646
682
  export declare function durableObjectNonceStore(options: DurableObjectNonceStoreOptions): NonceStore;
647
683
  //#endregion
648
- export { type BroadcastNamespace, type CfLiveDriver, type CloudflareRateLimitBinding, type CloudflareRateLimitStoreOptions, type CloudflareRoot, type CloudflareWorkerOptions, ConnectedSocket, type CreateCloudflareAppOptions, type DiskConfig, type DoPitrArmOptions, type DoPitrArmResult, type DoPitrBookmarkRead, type DoPitrId, type DoPitrNamespace, type DoPitrStorage, DoPitrUnavailableError, type DurableObjectLiveOptions, type DurableObjectNonceNamespace, type DurableObjectNonceStoreOptions, type FlagshipBinding, type FlagshipFlagDriverOptions, type KvFlagDriverOptions, type LiveNamespace, MessageBody, type MountOpenApiOptions, type OnGatewayConnection, type OnGatewayDisconnect, type OnGatewayInit, type PresignedUrlConfig, type QueueConsumerMetadata, type ScheduledContext, type ScheduledController, type ScheduledEvent, type ScheduledHandler, type ScheduledMetadata, type StorageModuleOptions, SubscribeMessage, type VelaDoPitrRpc, WebSocketGateway, WebSocketServer, type WsClient, WsException, type WsGatewayRoute, type WsMessage, type WsResponse, type WsServer, armDoPitr, isDoPitrUnavailable, readDoPitrBookmark };
649
- //# sourceMappingURL=index.d.ts.map
684
+ export { type BroadcastNamespace, type CfLiveDriver, type CloudflareRateLimitBinding, type CloudflareRateLimitStoreOptions, type CloudflareRoot, type CloudflareScheduledEvent, type CloudflareWorkerOptions, type CreateCloudflareAppOptions, type DiskConfig, type DoPitrArmOptions, type DoPitrArmResult, type DoPitrBookmarkRead, type DoPitrId, type DoPitrNamespace, type DoPitrStorage, DoPitrUnavailableError, type DurableObjectLiveOptions, type DurableObjectNonceNamespace, type DurableObjectNonceStoreOptions, type FlagshipBinding, type FlagshipFlagDriverOptions, type KvFlagDriverOptions, type LiveNamespace, type MountOpenApiOptions, type PresignedUrlConfig, type QueueConsumerMetadata, type ScheduledEvent, type StorageModuleOptions, type VelaDoPitrRpc, type WsGatewayRoute, armDoPitr, isDoPitrUnavailable, readDoPitrBookmark };