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