UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

41 lines • 1.49 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Content = exports.BaseContent = void 0; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../core/resource.js"); const path_1 = require("../../internal/utils/path.js"); var BaseContent = /* @__PURE__ */ (() => { class BaseContent extends resource_1.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((0, path_1.path) `/accounts/${account_id}/browser-rendering/content`, { query: { cacheTTL }, body, ...options, })._thenUnwrap((obj) => obj.result); } } BaseContent._key = Object.freeze([ 'browserRendering', 'content', ]); return BaseContent; })(); exports.BaseContent = BaseContent; class Content extends BaseContent { } exports.Content = Content; //# sourceMappingURL=content.js.map