cloudflare
Version:
The official TypeScript library for the Cloudflare API
41 lines • 1.47 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Markdown = exports.BaseMarkdown = 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 BaseMarkdown = /* @__PURE__ */ (() => {
class BaseMarkdown extends resource_1.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((0, path_1.path) `/accounts/${account_id}/browser-rendering/markdown`, {
query: { cacheTTL },
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
}
BaseMarkdown._key = Object.freeze([
'browserRendering',
'markdown',
]);
return BaseMarkdown;
})();
exports.BaseMarkdown = BaseMarkdown;
class Markdown extends BaseMarkdown {
}
exports.Markdown = Markdown;
//# sourceMappingURL=markdown.js.map