UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

63 lines • 2.84 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Groups = exports.BaseGroups = 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 BaseGroups = /* @__PURE__ */ (() => { class BaseGroups extends resource_1.APIResource { /** * Fetches the WAF rule groups 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}/groups`, (pagination_1.V4PagePaginationArray), { query, ...options }); } /** * Updates a WAF rule group. You can update the state (`mode` parameter) of a rule * group. * * **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(groupID, 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}/groups/${groupID}`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * Fetches the details of a WAF rule group. * * **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(groupID, params, options) { const { zone_id, package_id } = params; return this._client.get((0, path_1.path) `/zones/${zone_id}/firewall/waf/packages/${package_id}/groups/${groupID}`, options)._thenUnwrap((obj) => obj.result); } } BaseGroups._key = Object.freeze([ 'firewall', 'waf', 'packages', 'groups', ]); return BaseGroups; })(); exports.BaseGroups = BaseGroups; class Groups extends BaseGroups { } exports.Groups = Groups; //# sourceMappingURL=groups.js.map