Skip to content

Commit ee6d90f

Browse files
feat(api): api update
1 parent 8c65392 commit ee6d90f

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

.stats.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1712
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5b95965bcd85193fcb31b2d1961a75d944347439f615190f9e26ca8ec0fcc256.yml
3-
openapi_spec_hash: c2a3061d116c9e5216601ef7ae927414
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6a4a0d47e8ceab80534487c492d0dadf39a242ad7c586228e50cd19fe76488fc.yml
3+
openapi_spec_hash: 236c4734c35907f8f0a7c1f14eee05dd
44
config_hash: 04c03b2581e7a04107a02c6ae53e4e03

src/resources/workers/assets/upload.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ export class Upload extends APIResource {
1010
* https://developers.cloudflare.com/workers/static-assets/direct-upload/
1111
*/
1212
create(params: UploadCreateParams, options?: Core.RequestOptions): Core.APIPromise<UploadCreateResponse> {
13-
const { account_id, base64, ...body } = params;
13+
const { account_id, base64, body } = params;
1414
return (
1515
this._client.post(
1616
`/accounts/${account_id}/workers/assets/upload`,
17-
Core.multipartFormRequestOptions({ query: { base64 }, body, ...options }),
17+
Core.multipartFormRequestOptions({ query: { base64 }, body: body, ...options }),
1818
) as Core.APIPromise<{ result: UploadCreateResponse }>
1919
)._thenUnwrap((obj) => obj.result);
2020
}
@@ -39,11 +39,9 @@ export interface UploadCreateParams {
3939
base64: true;
4040

4141
/**
42-
* Body param: Base-64 encoded contents of the file. The content type of the file
43-
* should be included to ensure a valid "Content-Type" header is included in asset
44-
* responses.
42+
* Body param:
4543
*/
46-
'<any file hash>'?: Array<string>;
44+
body: Record<string, string>;
4745
}
4846

4947
export declare namespace Upload {

tests/api-resources/workers/assets/upload.test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ describe('resource upload', () => {
1414
const responsePromise = client.workers.assets.upload.create({
1515
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
1616
base64: true,
17+
body: { foo: 'string' },
1718
});
1819
const rawResponse = await responsePromise.asResponse();
1920
expect(rawResponse).toBeInstanceOf(Response);
@@ -28,7 +29,7 @@ describe('resource upload', () => {
2829
const response = await client.workers.assets.upload.create({
2930
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
3031
base64: true,
31-
'<any file hash>': ['string'],
32+
body: { foo: 'string' },
3233
});
3334
});
3435
});

0 commit comments

Comments
 (0)