cloudflare
Version:
The official TypeScript library for the Cloudflare API
50 lines • 1.82 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 BaseRobots = /* @__PURE__ */ (() => {
class BaseRobots extends APIResource {
/**
* Fetches and parses robots.txt files for multiple domains within a zone in a
* single request. Each domain must belong to the specified zone. Results are keyed
* by hostname.
*
* @example
* ```ts
* const response = await client.aiAudit.robots.bulkGet({
* zone_id: 'zone_id',
* body: ['example.com', 'blog.example.com'],
* });
* ```
*/
bulkGet(params, options) {
const { zone_id, body } = params;
return this._client.post(path `/zones/${zone_id}/ai-audit/robots/bulk`, {
body: body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Fetches and parses the robots.txt file for a zone or a specific subdomain within
* the zone. Returns parsed user-agent rules, content signals, and sitemaps.
*
* @example
* ```ts
* const robot = await client.aiAudit.robots.get({
* zone_id: 'zone_id',
* });
* ```
*/
get(params, options) {
const { zone_id, ...query } = params;
return this._client.get(path `/zones/${zone_id}/ai-audit/robots`, { query, ...options })._thenUnwrap((obj) => obj.result);
}
}
BaseRobots._key = Object.freeze([
'aiAudit',
'robots',
]);
return BaseRobots;
})();
export class Robots extends BaseRobots {
}
//# sourceMappingURL=robots.mjs.map