cloudflare
Version:
The official TypeScript library for the Cloudflare API
36 lines • 1.27 kB
JavaScript
// 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 BaseMarkdown = /* @__PURE__ */ (() => {
class BaseMarkdown extends APIResource {
/**
* Gets markdown of a webpage from provided URL or HTML. Control page loading with
* `gotoOptions` and `waitFor*` options.
*
* @example
* ```ts
* const markdown =
* await client.browserRendering.markdown.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/markdown`, {
query: { cacheTTL },
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
}
BaseMarkdown._key = Object.freeze([
'browserRendering',
'markdown',
]);
return BaseMarkdown;
})();
export class Markdown extends BaseMarkdown {
}
//# sourceMappingURL=markdown.mjs.map