UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

109 lines • 5.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OriginTLSComplianceModes = exports.BaseOriginTLSComplianceModes = 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 BaseOriginTLSComplianceModes = /* @__PURE__ */ (() => { class BaseOriginTLSComplianceModes extends resource_1.APIResource { /** * Replace the entire set of TLS compliance modes for the zone with the list * provided in the request body. PUT performs a full replace, not a merge — any * modes not present in the request body are removed. The request body must be of * the form `{"value": ["fips", "pqh"]}`. Currently supported modes are `fips` and * `pqh`; an empty list clears the constraint. Future modes (e.g. `cnsa2`) may be * added; clients should treat unknown values as opaque strings. Invalid mode * values are rejected with a 4xx response. * * @example * ```ts * const originTLSComplianceMode = * await client.originTLSComplianceModes.update({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * value: ['fips', 'pqh'], * }); * ``` */ update(params, options) { const { zone_id, ...body } = params; return this._client.put((0, path_1.path) `/zones/${zone_id}/settings/origin_tls_compliance_modes`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * Delete the Origin TLS Compliance Modes setting for the zone, removing any * configured compliance constraint. After deletion, Cloudflare's default behavior * applies (no compliance filtering of the key-exchange algorithm list sent to the * origin). * * @example * ```ts * const originTLSComplianceMode = * await client.originTLSComplianceModes.delete({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * }); * ``` */ delete(params, options) { const { zone_id } = params; return this._client.delete((0, path_1.path) `/zones/${zone_id}/settings/origin_tls_compliance_modes`, options)._thenUnwrap((obj) => obj.result); } /** * Update the set of TLS compliance modes for the zone. PATCH performs a full * replace of the modes list, not a merge — the request body is treated as the * complete new list, and any modes not present in it are removed. (To remove a * single mode from an existing configuration, send the updated list without it.) * The request body must be of the form `{"value": ["fips", "pqh"]}`. Currently * supported modes are `fips` and `pqh`; an empty list clears the constraint. * Future modes (e.g. `cnsa2`) may be added; clients should treat unknown values as * opaque strings. Invalid mode values are rejected with a 4xx response. * * @example * ```ts * const response = await client.originTLSComplianceModes.edit( * { * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * value: ['fips', 'pqh'], * }, * ); * ``` */ edit(params, options) { const { zone_id, ...body } = params; return this._client.patch((0, path_1.path) `/zones/${zone_id}/settings/origin_tls_compliance_modes`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * Origin TLS Compliance Modes constrains the set of TLS key-exchange algorithms * Cloudflare may use when establishing the TLS connection to the zone's origin. * The value is a list of named compliance modes (currently `fips` and `pqh`). * Multiple modes are combined as the intersection of their permitted algorithm * lists. An empty list (or no rule configured) means no compliance constraint is * applied. * * @example * ```ts * const originTLSComplianceMode = * await client.originTLSComplianceModes.get({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * }); * ``` */ get(params, options) { const { zone_id } = params; return this._client.get((0, path_1.path) `/zones/${zone_id}/settings/origin_tls_compliance_modes`, options)._thenUnwrap((obj) => obj.result); } } BaseOriginTLSComplianceModes._key = Object.freeze([ 'originTLSComplianceModes', ]); return BaseOriginTLSComplianceModes; })(); exports.BaseOriginTLSComplianceModes = BaseOriginTLSComplianceModes; class OriginTLSComplianceModes extends BaseOriginTLSComplianceModes { } exports.OriginTLSComplianceModes = OriginTLSComplianceModes; //# sourceMappingURL=origin-tls-compliance-modes.js.map