cloudflare
Version:
The official TypeScript library for the Cloudflare API
62 lines • 2.79 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Rules = exports.BaseRules = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../../core/resource.js");
const pagination_1 = require("../../../../core/pagination.js");
const path_1 = require("../../../../internal/utils/path.js");
var BaseRules = /* @__PURE__ */ (() => {
class BaseRules extends resource_1.APIResource {
/**
* Fetches WAF rules in a WAF package.
*
* **Note:** Applies only to the
* [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
*
* @deprecated
*/
list(packageID, params, options) {
const { zone_id, ...query } = params;
return this._client.getAPIList((0, path_1.path) `/zones/${zone_id}/firewall/waf/packages/${packageID}/rules`, (pagination_1.V4PagePaginationArray), { query, ...options });
}
/**
* Updates a WAF rule. You can only update the mode/action of the rule.
*
* **Note:** Applies only to the
* [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
*
* @deprecated
*/
edit(ruleID, params, options) {
const { zone_id, package_id, ...body } = params;
return this._client.patch((0, path_1.path) `/zones/${zone_id}/firewall/waf/packages/${package_id}/rules/${ruleID}`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Fetches the details of a WAF rule in a WAF package.
*
* **Note:** Applies only to the
* [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
*
* @deprecated
*/
get(ruleID, params, options) {
const { zone_id, package_id } = params;
return this._client.get((0, path_1.path) `/zones/${zone_id}/firewall/waf/packages/${package_id}/rules/${ruleID}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseRules._key = Object.freeze([
'firewall',
'waf',
'packages',
'rules',
]);
return BaseRules;
})();
exports.BaseRules = BaseRules;
class Rules extends BaseRules {
}
exports.Rules = Rules;
//# sourceMappingURL=rules.js.map