Skip to content

Commit b4de192

Browse files
feat(api): api update
1 parent d90839b commit b4de192

5 files changed

Lines changed: 22 additions & 4 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1759
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2960e6379741ec36e2d9ce4951603341a209d327c23b8dd612059d5d54d6a462.yml
3-
openapi_spec_hash: 20d3ceeadc6efd9590f482c695bf82ab
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa63baaf2c1412979e523b2d379b69688e66d1c142c257ba10c6b8cfd454ae71.yml
3+
openapi_spec_hash: 3acb03ed76d72e2ad13ade8064e2bb98
44
config_hash: 920bb1b417565d337cbdb7c39e77be5b

src/cloudflare/types/workers/script_update_params.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,21 @@ class MetadataAssetsConfig(TypedDict, total=False):
7878
is no Worker script.
7979
"""
8080

81-
run_worker_first: List[str]
81+
run_worker_first: Union[List[str], bool]
8282
"""Contains a list path rules to control routing to either the Worker or assets.
8383
8484
Glob (\\**) and negative (!) rules are supported. Rules must start with either '/'
8585
or '!/'. At least one non-negative rule must be provided, and negative rules
8686
have higher precedence than non-negative rules.
8787
"""
8888

89+
serve_directly: bool
90+
"""
91+
When true and the incoming request matches an asset, that will be served instead
92+
of invoking the Worker script. When false, requests will always invoke the
93+
Worker script.
94+
"""
95+
8996

9097
class MetadataAssets(TypedDict, total=False):
9198
config: MetadataAssetsConfig

src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,21 @@ class MetadataAssetsConfig(TypedDict, total=False):
8181
is no Worker script.
8282
"""
8383

84-
run_worker_first: List[str]
84+
run_worker_first: Union[List[str], bool]
8585
"""Contains a list path rules to control routing to either the Worker or assets.
8686
8787
Glob (\\**) and negative (!) rules are supported. Rules must start with either '/'
8888
or '!/'. At least one non-negative rule must be provided, and negative rules
8989
have higher precedence than non-negative rules.
9090
"""
9191

92+
serve_directly: bool
93+
"""
94+
When true and the incoming request matches an asset, that will be served instead
95+
of invoking the Worker script. When false, requests will always invoke the
96+
Worker script.
97+
"""
98+
9299

93100
class MetadataAssets(TypedDict, total=False):
94101
config: MetadataAssetsConfig

tests/api_resources/workers/test_scripts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
4545
"html_handling": "auto-trailing-slash",
4646
"not_found_handling": "404-page",
4747
"run_worker_first": ["string"],
48+
"serve_directly": True,
4849
},
4950
"jwt": "jwt",
5051
},
@@ -325,6 +326,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
325326
"html_handling": "auto-trailing-slash",
326327
"not_found_handling": "404-page",
327328
"run_worker_first": ["string"],
329+
"serve_directly": True,
328330
},
329331
"jwt": "jwt",
330332
},

tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
4646
"html_handling": "auto-trailing-slash",
4747
"not_found_handling": "404-page",
4848
"run_worker_first": ["string"],
49+
"serve_directly": True,
4950
},
5051
"jwt": "jwt",
5152
},
@@ -327,6 +328,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
327328
"html_handling": "auto-trailing-slash",
328329
"not_found_handling": "404-page",
329330
"run_worker_first": ["string"],
331+
"serve_directly": True,
330332
},
331333
"jwt": "jwt",
332334
},

0 commit comments

Comments
 (0)