wrangler 2.0.3 → 2.0.7

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/src/worker.ts CHANGED
@@ -105,6 +105,7 @@ interface CfDurableObject {
105
105
  name: string;
106
106
  class_name: string;
107
107
  script_name?: string;
108
+ environment?: string;
108
109
  }
109
110
 
110
111
  interface CfR2Bucket {
@@ -112,6 +113,12 @@ interface CfR2Bucket {
112
113
  bucket_name: string;
113
114
  }
114
115
 
116
+ interface CfService {
117
+ binding: string;
118
+ service: string;
119
+ environment?: string;
120
+ }
121
+
115
122
  interface CfUnsafeBinding {
116
123
  name: string;
117
124
  type: string;
@@ -157,6 +164,7 @@ export interface CfWorkerInit {
157
164
  data_blobs: CfDataBlobBindings | undefined;
158
165
  durable_objects: { bindings: CfDurableObject[] } | undefined;
159
166
  r2_buckets: CfR2Bucket[] | undefined;
167
+ services: CfService[] | undefined;
160
168
  unsafe: CfUnsafeBinding[] | undefined;
161
169
  };
162
170
  migrations: CfDurableObjectMigrations | undefined;
@@ -8,8 +8,23 @@
8
8
  * Learn more at https://developers.cloudflare.com/workers/
9
9
  */
10
10
 
11
+ export interface Env {
12
+ // Example binding to KV. Learn more at https://developers.cloudflare.com/workers/runtime-apis/kv/
13
+ // MY_KV_NAMESPACE: KVNamespace;
14
+ //
15
+ // Example binding to Durable Object. Learn more at https://developers.cloudflare.com/workers/runtime-apis/durable-objects/
16
+ // MY_DURABLE_OBJECT: DurableObjectNamespace;
17
+ //
18
+ // Example binding to R2. Learn more at https://developers.cloudflare.com/workers/runtime-apis/r2/
19
+ // MY_BUCKET: R2Bucket;
20
+ }
21
+
11
22
  export default {
12
- async fetch(request: Request): Promise<Response> {
23
+ async fetch(
24
+ request: Request,
25
+ env: Env,
26
+ ctx: ExecutionContext
27
+ ): Promise<Response> {
13
28
  return new Response("Hello World!");
14
29
  },
15
30
  };