Skip to content

Commit 8f604ac

Browse files
stainless-app[bot]stainless-bot
authored andcommittedDec 3, 2024·
feat(api): api update (#3694)
1 parent bc08700 commit 8f604ac

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed
 

‎.stats.yml

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

‎workers/script.go

+4
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,10 @@ type ScriptUpdateParamsBodyObjectMetadataAssetsConfig struct {
457457
// Determines the response when a request does not match a static asset, and there
458458
// is no Worker script.
459459
NotFoundHandling param.Field[ScriptUpdateParamsBodyObjectMetadataAssetsConfigNotFoundHandling] `json:"not_found_handling"`
460+
// When true and the incoming request matches an asset, that will be served instead
461+
// of invoking the Worker script. When false, requests will always invoke the
462+
// Worker script.
463+
ServeDirectly param.Field[bool] `json:"serve_directly"`
460464
}
461465

462466
func (r ScriptUpdateParamsBodyObjectMetadataAssetsConfig) MarshalJSON() (data []byte, err error) {

‎workers/script_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func TestScriptUpdateWithOptionalParams(t *testing.T) {
4444
Config: cloudflare.F(workers.ScriptUpdateParamsBodyObjectMetadataAssetsConfig{
4545
HTMLHandling: cloudflare.F(workers.ScriptUpdateParamsBodyObjectMetadataAssetsConfigHTMLHandlingAutoTrailingSlash),
4646
NotFoundHandling: cloudflare.F(workers.ScriptUpdateParamsBodyObjectMetadataAssetsConfigNotFoundHandlingNone),
47+
ServeDirectly: cloudflare.F(true),
4748
}),
4849
JWT: cloudflare.F("jwt"),
4950
}),

‎workers_for_platforms/dispatchnamespacescript.go

+4
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,10 @@ type DispatchNamespaceScriptUpdateParamsBodyObjectMetadataAssetsConfig struct {
334334
// Determines the response when a request does not match a static asset, and there
335335
// is no Worker script.
336336
NotFoundHandling param.Field[DispatchNamespaceScriptUpdateParamsBodyObjectMetadataAssetsConfigNotFoundHandling] `json:"not_found_handling"`
337+
// When true and the incoming request matches an asset, that will be served instead
338+
// of invoking the Worker script. When false, requests will always invoke the
339+
// Worker script.
340+
ServeDirectly param.Field[bool] `json:"serve_directly"`
337341
}
338342

339343
func (r DispatchNamespaceScriptUpdateParamsBodyObjectMetadataAssetsConfig) MarshalJSON() (data []byte, err error) {

‎workers_for_platforms/dispatchnamespacescript_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func TestDispatchNamespaceScriptUpdateWithOptionalParams(t *testing.T) {
4444
Config: cloudflare.F(workers_for_platforms.DispatchNamespaceScriptUpdateParamsBodyObjectMetadataAssetsConfig{
4545
HTMLHandling: cloudflare.F(workers_for_platforms.DispatchNamespaceScriptUpdateParamsBodyObjectMetadataAssetsConfigHTMLHandlingAutoTrailingSlash),
4646
NotFoundHandling: cloudflare.F(workers_for_platforms.DispatchNamespaceScriptUpdateParamsBodyObjectMetadataAssetsConfigNotFoundHandlingNone),
47+
ServeDirectly: cloudflare.F(true),
4748
}),
4849
JWT: cloudflare.F("jwt"),
4950
}),

0 commit comments

Comments
 (0)
Please sign in to comment.