cloudflare
Version:
The official TypeScript library for the Cloudflare API
55 lines • 2.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Robots = exports.BaseRobots = 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 BaseRobots = /* @__PURE__ */ (() => {
class BaseRobots extends resource_1.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((0, path_1.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((0, path_1.path) `/zones/${zone_id}/ai-audit/robots`, { query, ...options })._thenUnwrap((obj) => obj.result);
}
}
BaseRobots._key = Object.freeze([
'aiAudit',
'robots',
]);
return BaseRobots;
})();
exports.BaseRobots = BaseRobots;
class Robots extends BaseRobots {
}
exports.Robots = Robots;
//# sourceMappingURL=robots.js.map