2525# to see and restrict what each Worker can access. Instead, the default is that a Worker has
2626# access to no privileged resources at all, and you must explicitly declare "bindings" to give
2727# it access to specific resources. A binding gives the Worker a JavaScript API object that points
28- # to a specific resource. This means that by changing config alone, you can fully controll which
28+ # to a specific resource. This means that by changing config alone, you can fully control which
2929# resources an Worker connects to. (You can even disallow access to the public internet, although
3030# public internet access is granted by default.)
3131#
3939# 2. added to `tryImportBulitin` in workerd.c++ (grep for '"/workerd/workerd.capnp"').
4040using Cxx = import "/capnp/c++. capnp" ;
4141$Cxx.namespace("workerd::server::config" );
42+ $Cxx.allowCancellation;
4243
4344struct Config {
4445 # Top-level configuration for a workerd instance.
@@ -206,7 +207,7 @@ struct Worker {
206207 # event handlers.
207208 #
208209 # The value of this field is the raw source code. When using Cap'n Proto text format, use the
209- # `embed` directive to read the code from an exnternal file:
210+ # `embed` directive to read the code from an external file:
210211 #
211212 # serviceWorkerScript = embed "worker.js"
212213
@@ -271,6 +272,10 @@ struct Worker {
271272 # Pyodide (https://pyodide.org/en/stable/usage/packages-in-pyodide.html). All packages listed
272273 # will be installed prior to the execution of the worker.
273274 }
275+
276+ namedExports @10 :List(Text) ;
277+ # For commonJsModule and nodeJsCompatModule, this is a list of named exports that the
278+ # module expects to be exported once the evaluation is complete.
274279 }
275280
276281 compatibilityDate @3 :Text ;
@@ -345,7 +350,7 @@ struct Worker {
345350
346351 kvNamespace @11 :ServiceDesignator ;
347352 # A KV namespace, implemented by the named service. The Worker sees a KvNamespace-typed
348- # binding. Requests to the namespace will be converted into HTTP requests targetting the
353+ # binding. Requests to the namespace will be converted into HTTP requests targeting the
349354 # given service name.
350355
351356 r2Bucket @12 :ServiceDesignator ;
@@ -358,7 +363,7 @@ struct Worker {
358363
359364 queue @15 :ServiceDesignator ;
360365 # A Queue binding, implemented by the named service. Requests to the
361- # namespace will be converted into HTTP requests targetting the given
366+ # namespace will be converted into HTTP requests targeting the given
362367 # service name.
363368
364369 fromEnvironment @16 :Text ;
@@ -520,7 +525,7 @@ struct Worker {
520525 }
521526 }
522527
523- globalOutbound @6 :ServiceDesignator = ( name = "internet" ) ;
528+ globalOutbound @6 :ServiceDesignator = "internet" ;
524529 # Where should the global "fetch" go to? The default is the service called "internet", which
525530 # should usually be configured to talk to the public internet.
526531
@@ -555,10 +560,10 @@ struct Worker {
555560 # Instances of this class are ephemeral -- they have no durable storage at all. The
556561 # `state.storage` API will not be present. Additionally, this namespace will allow arbitrary
557562 # strings as IDs. There are no `idFromName()` nor `newUniqueId()` methods; `get()` takes any
558- # string as a paremeter .
563+ # string as a parameter .
559564 #
560565 # Ephemeral objects are NOT globally unique, only "locally" unique, for some definition of
561- # "local". For exmaple , on Cloudflare's network, these objects are unique per-colo.
566+ # "local". For example , on Cloudflare's network, these objects are unique per-colo.
562567 #
563568 # WARNING: Cloudflare Workers currently limits this feature to Cloudflare-internal users
564569 # only, because using them correctly requires deep understanding of Cloudflare network
@@ -574,6 +579,14 @@ struct Worker {
574579 # pinned to memory forever, so we provide this flag to change the default behavior.
575580 #
576581 # Note that this is only supported in Workerd; production Durable Objects cannot toggle eviction.
582+
583+ enableSql @4 :Bool ;
584+ # Whether or not Durable Objects in this namespace can use the `storage.sql` API to execute SQL
585+ # queries.
586+ #
587+ # workerd uses SQLite to back all Durable Objects, but the SQL API is hidden by default to
588+ # emulate behavior of traditional DO namespaces on Cloudflare that aren't SQLite-backed. This
589+ # flag should be enabled when testing code that will run on a SQLite-backed namespace.
577590 }
578591
579592 durableObjectUniqueKeyModifier @8 :Text ;
@@ -730,7 +743,7 @@ struct DiskDirectory {
730743 # particular, no attempt is made to guess the `Content-Type` header. You normally would wrap
731744 # this in a Worker that fills in the metadata in the way you want.
732745 #
733- # A GET request targetting a directory (rather than a file) will return a basic JSAN directory
746+ # A GET request targeting a directory (rather than a file) will return a basic JSAN directory
734747 # listing like:
735748 #
736749 # [{"name":"foo","type":"file"},{"name":"bar","type":"directory"}]
@@ -921,4 +934,4 @@ struct Extension {
921934 esModule @2 :Text ;
922935 # Raw source code of ES module.
923936 }
924- }
937+ }
0 commit comments