Skip to content

Commit

Permalink
feat(api): api update (#2353)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Jan 23, 2025
1 parent 37a0243 commit c21a799
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1508
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b9d1e410625002fb2fa27d7d00c232f2aea9c22f0141ccfbc717ed94aefb9804.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-db443ead2321c518913c39aebcf830d4ad1d7d8fd95d81971fa73c87efc17df9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,15 @@ export namespace ScriptUpdateParams {
not_found_handling?: 'none' | '404-page' | 'single-page-application';

/**
* When true and the incoming request matches an asset, that will be served instead
* of invoking the Worker script. When false, requests will always invoke the
* Worker script.
* When true, requests will always invoke the Worker script. Otherwise, attempt to
* serve an asset matching the request, falling back to the Worker script.
*/
run_worker_first?: boolean;

/**
* @deprecated When true and the incoming request matches an asset, that will be
* served instead of invoking the Worker script. When false, requests will always
* invoke the Worker script.
*/
serve_directly?: boolean;
}
Expand Down
12 changes: 9 additions & 3 deletions src/resources/workers/scripts/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,15 @@ export namespace ScriptUpdateParams {
not_found_handling?: 'none' | '404-page' | 'single-page-application';

/**
* When true and the incoming request matches an asset, that will be served instead
* of invoking the Worker script. When false, requests will always invoke the
* Worker script.
* When true, requests will always invoke the Worker script. Otherwise, attempt to
* serve an asset matching the request, falling back to the Worker script.
*/
run_worker_first?: boolean;

/**
* @deprecated When true and the incoming request matches an asset, that will be
* served instead of invoking the Worker script. When false, requests will always
* invoke the Worker script.
*/
serve_directly?: boolean;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ describe('resource scripts', () => {
config: {
html_handling: 'auto-trailing-slash',
not_found_handling: 'none',
run_worker_first: false,
serve_directly: true,
},
jwt: 'jwt',
Expand Down
7 changes: 6 additions & 1 deletion tests/api-resources/workers/scripts/scripts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ describe('resource scripts', () => {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
metadata: {
assets: {
config: { html_handling: 'auto-trailing-slash', not_found_handling: 'none', serve_directly: true },
config: {
html_handling: 'auto-trailing-slash',
not_found_handling: 'none',
run_worker_first: false,
serve_directly: true,
},
jwt: 'jwt',
},
bindings: [{ name: 'MY_ENV_VAR', type: 'plain_text' }],
Expand Down

0 comments on commit c21a799

Please sign in to comment.