UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

43 lines • 1.62 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Patterns = exports.BasePatterns = 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 BasePatterns = /* @__PURE__ */ (() => { class BasePatterns extends resource_1.APIResource { /** * Validates whether this pattern is a valid regular expression. Rejects it if the * regular expression is too complex or can match an unbounded-length string. The * regex will be rejected if it uses `*` or `+`. Bound the maximum number of * characters that can be matched using a range, e.g. `{1,100}`. * * @example * ```ts * const response = * await client.zeroTrust.dlp.patterns.validate({ * account_id: 'account_id', * regex: 'regex', * }); * ``` */ validate(params, options) { const { account_id, ...body } = params; return this._client.post((0, path_1.path) `/accounts/${account_id}/dlp/patterns/validate`, { body, ...options, })._thenUnwrap((obj) => obj.result); } } BasePatterns._key = Object.freeze([ 'zeroTrust', 'dlp', 'patterns', ]); return BasePatterns; })(); exports.BasePatterns = BasePatterns; class Patterns extends BasePatterns { } exports.Patterns = Patterns; //# sourceMappingURL=patterns.js.map