UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

34 lines • 1.12 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 BaseLinks = /* @__PURE__ */ (() => { class BaseLinks extends APIResource { /** * Get links from a web page. * * @example * ```ts * const links = await client.browserRendering.links.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/links`, { query: { cacheTTL }, body, ...options, })._thenUnwrap((obj) => obj.result); } } BaseLinks._key = Object.freeze([ 'browserRendering', 'links', ]); return BaseLinks; })(); export class Links extends BaseLinks { } //# sourceMappingURL=links.mjs.map