UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

36 lines • 1.29 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../core/resource.mjs"; import { path } from "../../internal/utils/path.mjs"; export var BaseContent = /* @__PURE__ */ (() => { class BaseContent extends APIResource { /** * Fetches rendered HTML content from provided URL or HTML. Check available options * like `gotoOptions` and `waitFor*` to control page load behaviour. * * @example * ```ts * const content = * await client.browserRendering.content.create({ * account_id: 'account_id', * url: 'https://www.example.com/', * }); * ``` */ create(params, options) { const { account_id, cacheTTL, ...body } = params; return this._client.post(path `/accounts/${account_id}/browser-rendering/content`, { query: { cacheTTL }, body, ...options, })._thenUnwrap((obj) => obj.result); } } BaseContent._key = Object.freeze([ 'browserRendering', 'content', ]); return BaseContent; })(); export class Content extends BaseContent { } //# sourceMappingURL=content.mjs.map