Skip to content

Commit b5ea5a4

Browse files
committedJan 30, 2025
feat(api): api update (#3858)
1 parent 93e1b69 commit b5ea5a4

File tree

5 files changed

+13
-1
lines changed

5 files changed

+13
-1
lines changed
 

‎.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1508
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b9d1e410625002fb2fa27d7d00c232f2aea9c22f0141ccfbc717ed94aefb9804.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-db443ead2321c518913c39aebcf830d4ad1d7d8fd95d81971fa73c87efc17df9.yml

‎workers/script.go

+5
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,14 @@ type ScriptUpdateParamsMetadataAssetsConfig struct {
577577
// Determines the response when a request does not match a static asset, and there
578578
// is no Worker script.
579579
NotFoundHandling param.Field[ScriptUpdateParamsMetadataAssetsConfigNotFoundHandling] `json:"not_found_handling"`
580+
// When true, requests will always invoke the Worker script. Otherwise, attempt to
581+
// serve an asset matching the request, falling back to the Worker script.
582+
RunWorkerFirst param.Field[bool] `json:"run_worker_first"`
580583
// When true and the incoming request matches an asset, that will be served instead
581584
// of invoking the Worker script. When false, requests will always invoke the
582585
// Worker script.
586+
//
587+
// Deprecated: deprecated
583588
ServeDirectly param.Field[bool] `json:"serve_directly"`
584589
}
585590

‎workers/script_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func TestScriptUpdateWithOptionalParams(t *testing.T) {
3838
Config: cloudflare.F(workers.ScriptUpdateParamsMetadataAssetsConfig{
3939
HTMLHandling: cloudflare.F(workers.ScriptUpdateParamsMetadataAssetsConfigHTMLHandlingAutoTrailingSlash),
4040
NotFoundHandling: cloudflare.F(workers.ScriptUpdateParamsMetadataAssetsConfigNotFoundHandlingNone),
41+
RunWorkerFirst: cloudflare.F(false),
4142
ServeDirectly: cloudflare.F(true),
4243
}),
4344
JWT: cloudflare.F("jwt"),

‎workers_for_platforms/dispatchnamespacescript.go

+5
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,14 @@ type DispatchNamespaceScriptUpdateParamsMetadataAssetsConfig struct {
374374
// Determines the response when a request does not match a static asset, and there
375375
// is no Worker script.
376376
NotFoundHandling param.Field[DispatchNamespaceScriptUpdateParamsMetadataAssetsConfigNotFoundHandling] `json:"not_found_handling"`
377+
// When true, requests will always invoke the Worker script. Otherwise, attempt to
378+
// serve an asset matching the request, falling back to the Worker script.
379+
RunWorkerFirst param.Field[bool] `json:"run_worker_first"`
377380
// When true and the incoming request matches an asset, that will be served instead
378381
// of invoking the Worker script. When false, requests will always invoke the
379382
// Worker script.
383+
//
384+
// Deprecated: deprecated
380385
ServeDirectly param.Field[bool] `json:"serve_directly"`
381386
}
382387

‎workers_for_platforms/dispatchnamespacescript_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func TestDispatchNamespaceScriptUpdateWithOptionalParams(t *testing.T) {
4040
Config: cloudflare.F(workers_for_platforms.DispatchNamespaceScriptUpdateParamsMetadataAssetsConfig{
4141
HTMLHandling: cloudflare.F(workers_for_platforms.DispatchNamespaceScriptUpdateParamsMetadataAssetsConfigHTMLHandlingAutoTrailingSlash),
4242
NotFoundHandling: cloudflare.F(workers_for_platforms.DispatchNamespaceScriptUpdateParamsMetadataAssetsConfigNotFoundHandlingNone),
43+
RunWorkerFirst: cloudflare.F(false),
4344
ServeDirectly: cloudflare.F(true),
4445
}),
4546
JWT: cloudflare.F("jwt"),

0 commit comments

Comments
 (0)
Please sign in to comment.