Skip to content

Commit 397c60f

Browse files
feat: [AI-1972] - Move fetch v2 handler into /v1/fetch
1 parent 95c8dfa commit 397c60f

3 files changed

Lines changed: 17 additions & 2 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: 21
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/browserbase-1821faac6d1422fea15b3ba1f88c0f5f00c43464524e17d3fd1efd1ea148b7c4.yml
3-
openapi_spec_hash: 1e3fba074314f557dc6973cf97ea6a69
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/browserbase-3032c74460ad9c1c4b0a1b2d9107c556f292974a8ce12d525660a9cf31f10bc1.yml
3+
openapi_spec_hash: 8ac1c673ce4e72b88bbbf30100b95e8f
44
config_hash: cf04ecfb8dad5fbd8b85be25d6e9ec55

src/resources/fetch-api.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,23 @@ export interface FetchAPICreateParams {
6161
*/
6262
allowRedirects?: boolean;
6363

64+
/**
65+
* Output format for the response content. `raw` (default) returns the response
66+
* body unchanged; `json` returns structured data (requires `schema`); `markdown`
67+
* returns the page as markdown.
68+
*/
69+
format?: 'raw' | 'json' | 'markdown';
70+
6471
/**
6572
* Whether to enable proxy support for the request
6673
*/
6774
proxies?: boolean;
75+
76+
/**
77+
* JSON Schema describing the desired structure of the response. Only used when
78+
* `format` is `json`.
79+
*/
80+
schema?: { [key: string]: unknown };
6881
}
6982

7083
export declare namespace FetchAPI {

tests/api-resources/fetch-api.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ describe('resource fetchAPI', () => {
2525
url: 'https://example.com',
2626
allowInsecureSsl: true,
2727
allowRedirects: true,
28+
format: 'raw',
2829
proxies: true,
30+
schema: { foo: 'bar' },
2931
});
3032
});
3133
});

0 commit comments

Comments
 (0)