cloudflare
Version:
The official TypeScript library for the Cloudflare API
15 lines • 757 B
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../resource.mjs";
import * as Core from "../../../core.mjs";
export class Upload extends APIResource {
/**
* Upload assets ahead of creating a Worker version. To learn more about the direct
* uploads of assets, see
* https://developers.cloudflare.com/workers/static-assets/direct-upload/
*/
create(params, options) {
const { account_id, base64, ...body } = params;
return this._client.post(`/accounts/${account_id}/workers/assets/upload`, Core.multipartFormRequestOptions({ query: { base64 }, body, ...options }))._thenUnwrap((obj) => obj.result);
}
}
//# sourceMappingURL=upload.mjs.map