cloudflare
Version:
The official TypeScript library for the Cloudflare API
177 lines • 12.3 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
import * as AdvancedDDoSAPI from 'cloudflare/resources/zones/settings/advanced-ddos';
import * as AlwaysOnlineAPI from 'cloudflare/resources/zones/settings/always-online';
import * as AlwaysUseHTTPSAPI from 'cloudflare/resources/zones/settings/always-use-https';
import * as AutomaticHTTPSRewritesAPI from 'cloudflare/resources/zones/settings/automatic-https-rewrites';
import * as AutomaticPlatformOptimizationAPI from 'cloudflare/resources/zones/settings/automatic-platform-optimization';
import * as BrotliAPI from 'cloudflare/resources/zones/settings/brotli';
import * as BrowserCacheTTLAPI from 'cloudflare/resources/zones/settings/browser-cache-ttl';
import * as BrowserCheckAPI from 'cloudflare/resources/zones/settings/browser-check';
import * as CacheLevelAPI from 'cloudflare/resources/zones/settings/cache-level';
import * as ChallengeTTLAPI from 'cloudflare/resources/zones/settings/challenge-ttl';
import * as CiphersAPI from 'cloudflare/resources/zones/settings/ciphers';
import * as DevelopmentModeAPI from 'cloudflare/resources/zones/settings/development-mode';
import * as EarlyHintsAPI from 'cloudflare/resources/zones/settings/early-hints';
import * as EmailObfuscationAPI from 'cloudflare/resources/zones/settings/email-obfuscation';
import * as FontSettingsAPI from 'cloudflare/resources/zones/settings/font-settings';
import * as H2PrioritizationAPI from 'cloudflare/resources/zones/settings/h2-prioritization';
import * as HotlinkProtectionAPI from 'cloudflare/resources/zones/settings/hotlink-protection';
import * as HTTP2API from 'cloudflare/resources/zones/settings/http2';
import * as HTTP3API from 'cloudflare/resources/zones/settings/http3';
import * as ImageResizingAPI from 'cloudflare/resources/zones/settings/image-resizing';
import * as IPGeolocationAPI from 'cloudflare/resources/zones/settings/ip-geolocation';
import * as IPV6API from 'cloudflare/resources/zones/settings/ipv6';
import * as MinTLSVersionAPI from 'cloudflare/resources/zones/settings/min-tls-version';
import * as MinifyAPI from 'cloudflare/resources/zones/settings/minify';
import * as MirageAPI from 'cloudflare/resources/zones/settings/mirage';
import * as MobileRedirectAPI from 'cloudflare/resources/zones/settings/mobile-redirect';
import * as NELAPI from 'cloudflare/resources/zones/settings/nel';
import * as OpportunisticEncryptionAPI from 'cloudflare/resources/zones/settings/opportunistic-encryption';
import * as OpportunisticOnionAPI from 'cloudflare/resources/zones/settings/opportunistic-onion';
import * as OrangeToOrangeAPI from 'cloudflare/resources/zones/settings/orange-to-orange';
import * as OriginErrorPagePassThruAPI from 'cloudflare/resources/zones/settings/origin-error-page-pass-thru';
import * as OriginMaxHTTPVersionAPI from 'cloudflare/resources/zones/settings/origin-max-http-version';
import * as PolishAPI from 'cloudflare/resources/zones/settings/polish';
import * as PrefetchPreloadAPI from 'cloudflare/resources/zones/settings/prefetch-preload';
import * as ProxyReadTimeoutAPI from 'cloudflare/resources/zones/settings/proxy-read-timeout';
import * as PseudoIPV4API from 'cloudflare/resources/zones/settings/pseudo-ipv4';
import * as ResponseBufferingAPI from 'cloudflare/resources/zones/settings/response-buffering';
import * as RocketLoaderAPI from 'cloudflare/resources/zones/settings/rocket-loader';
import * as SecurityHeadersAPI from 'cloudflare/resources/zones/settings/security-headers';
import * as SecurityLevelAPI from 'cloudflare/resources/zones/settings/security-level';
import * as ServerSideExcludesAPI from 'cloudflare/resources/zones/settings/server-side-excludes';
import * as SortQueryStringForCacheAPI from 'cloudflare/resources/zones/settings/sort-query-string-for-cache';
import * as SSLAPI from 'cloudflare/resources/zones/settings/ssl';
import * as SSLRecommenderAPI from 'cloudflare/resources/zones/settings/ssl-recommender';
import * as TLS1_3API from 'cloudflare/resources/zones/settings/tls-1-3';
import * as TLSClientAuthAPI from 'cloudflare/resources/zones/settings/tls-client-auth';
import * as TrueClientIPHeaderAPI from 'cloudflare/resources/zones/settings/true-client-ip-header';
import * as WAFAPI from 'cloudflare/resources/zones/settings/waf';
import * as WebPAPI from 'cloudflare/resources/zones/settings/webp';
import * as WebsocketAPI from 'cloudflare/resources/zones/settings/websocket';
import * as ZeroRTTAPI from 'cloudflare/resources/zones/settings/zero-rtt';
export class Settings extends APIResource {
constructor() {
super(...arguments);
this.zeroRTT = new ZeroRTTAPI.ZeroRTT(this._client);
this.advancedDDoS = new AdvancedDDoSAPI.AdvancedDDoS(this._client);
this.alwaysOnline = new AlwaysOnlineAPI.AlwaysOnline(this._client);
this.alwaysUseHTTPS = new AlwaysUseHTTPSAPI.AlwaysUseHTTPS(this._client);
this.automaticHTTPSRewrites = new AutomaticHTTPSRewritesAPI.AutomaticHTTPSRewrites(this._client);
this.automaticPlatformOptimization = new AutomaticPlatformOptimizationAPI.AutomaticPlatformOptimization(this._client);
this.brotli = new BrotliAPI.Brotli(this._client);
this.browserCacheTTL = new BrowserCacheTTLAPI.BrowserCacheTTL(this._client);
this.browserCheck = new BrowserCheckAPI.BrowserCheck(this._client);
this.cacheLevel = new CacheLevelAPI.CacheLevel(this._client);
this.challengeTTL = new ChallengeTTLAPI.ChallengeTTL(this._client);
this.ciphers = new CiphersAPI.Ciphers(this._client);
this.developmentMode = new DevelopmentModeAPI.DevelopmentMode(this._client);
this.earlyHints = new EarlyHintsAPI.EarlyHints(this._client);
this.emailObfuscation = new EmailObfuscationAPI.EmailObfuscation(this._client);
this.h2Prioritization = new H2PrioritizationAPI.H2Prioritization(this._client);
this.hotlinkProtection = new HotlinkProtectionAPI.HotlinkProtection(this._client);
this.http2 = new HTTP2API.HTTP2(this._client);
this.http3 = new HTTP3API.HTTP3(this._client);
this.imageResizing = new ImageResizingAPI.ImageResizing(this._client);
this.ipGeolocation = new IPGeolocationAPI.IPGeolocation(this._client);
this.ipv6 = new IPV6API.IPV6(this._client);
this.minTLSVersion = new MinTLSVersionAPI.MinTLSVersion(this._client);
this.minify = new MinifyAPI.Minify(this._client);
this.mirage = new MirageAPI.Mirage(this._client);
this.mobileRedirect = new MobileRedirectAPI.MobileRedirect(this._client);
this.nel = new NELAPI.NEL(this._client);
this.opportunisticEncryption = new OpportunisticEncryptionAPI.OpportunisticEncryption(this._client);
this.opportunisticOnion = new OpportunisticOnionAPI.OpportunisticOnion(this._client);
this.orangeToOrange = new OrangeToOrangeAPI.OrangeToOrange(this._client);
this.originErrorPagePassThru = new OriginErrorPagePassThruAPI.OriginErrorPagePassThru(this._client);
this.originMaxHTTPVersion = new OriginMaxHTTPVersionAPI.OriginMaxHTTPVersion(this._client);
this.polish = new PolishAPI.Polish(this._client);
this.prefetchPreload = new PrefetchPreloadAPI.PrefetchPreload(this._client);
this.proxyReadTimeout = new ProxyReadTimeoutAPI.ProxyReadTimeout(this._client);
this.pseudoIPV4 = new PseudoIPV4API.PseudoIPV4(this._client);
this.responseBuffering = new ResponseBufferingAPI.ResponseBuffering(this._client);
this.rocketLoader = new RocketLoaderAPI.RocketLoader(this._client);
this.securityHeaders = new SecurityHeadersAPI.SecurityHeaders(this._client);
this.securityLevel = new SecurityLevelAPI.SecurityLevel(this._client);
this.serverSideExcludes = new ServerSideExcludesAPI.ServerSideExcludes(this._client);
this.sortQueryStringForCache = new SortQueryStringForCacheAPI.SortQueryStringForCache(this._client);
this.ssl = new SSLAPI.SSL(this._client);
this.sslRecommender = new SSLRecommenderAPI.SSLRecommender(this._client);
this.tls1_3 = new TLS1_3API.TLS1_3(this._client);
this.tlsClientAuth = new TLSClientAuthAPI.TLSClientAuth(this._client);
this.trueClientIPHeader = new TrueClientIPHeaderAPI.TrueClientIPHeader(this._client);
this.waf = new WAFAPI.WAF(this._client);
this.WebP = new WebPAPI.WebP(this._client);
this.websocket = new WebsocketAPI.Websocket(this._client);
this.fontSettings = new FontSettingsAPI.FontSettings(this._client);
}
/**
* Edit settings for a zone.
*/
edit(params, options) {
const { zone_id, ...body } = params;
return this._client.patch(`/zones/${zone_id}/settings`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Available settings for your user in relation to a zone.
*/
get(params, options) {
const { zone_id } = params;
return this._client.get(`/zones/${zone_id}/settings`, options)._thenUnwrap((obj) => obj.result);
}
}
(function (Settings) {
Settings.ZeroRTT = ZeroRTTAPI.ZeroRTT;
Settings.AdvancedDDoS = AdvancedDDoSAPI.AdvancedDDoS;
Settings.AlwaysOnline = AlwaysOnlineAPI.AlwaysOnline;
Settings.AlwaysUseHTTPS = AlwaysUseHTTPSAPI.AlwaysUseHTTPS;
Settings.AutomaticHTTPSRewrites = AutomaticHTTPSRewritesAPI.AutomaticHTTPSRewrites;
Settings.AutomaticPlatformOptimization = AutomaticPlatformOptimizationAPI.AutomaticPlatformOptimization;
Settings.Brotli = BrotliAPI.Brotli;
Settings.BrowserCacheTTL = BrowserCacheTTLAPI.BrowserCacheTTL;
Settings.BrowserCheck = BrowserCheckAPI.BrowserCheck;
Settings.CacheLevel = CacheLevelAPI.CacheLevel;
Settings.ChallengeTTL = ChallengeTTLAPI.ChallengeTTL;
Settings.Ciphers = CiphersAPI.Ciphers;
Settings.DevelopmentMode = DevelopmentModeAPI.DevelopmentMode;
Settings.EarlyHints = EarlyHintsAPI.EarlyHints;
Settings.EmailObfuscation = EmailObfuscationAPI.EmailObfuscation;
Settings.H2Prioritization = H2PrioritizationAPI.H2Prioritization;
Settings.HotlinkProtection = HotlinkProtectionAPI.HotlinkProtection;
Settings.HTTP2 = HTTP2API.HTTP2;
Settings.HTTP3 = HTTP3API.HTTP3;
Settings.ImageResizing = ImageResizingAPI.ImageResizing;
Settings.IPGeolocation = IPGeolocationAPI.IPGeolocation;
Settings.IPV6 = IPV6API.IPV6;
Settings.MinTLSVersion = MinTLSVersionAPI.MinTLSVersion;
Settings.Minify = MinifyAPI.Minify;
Settings.Mirage = MirageAPI.Mirage;
Settings.MobileRedirect = MobileRedirectAPI.MobileRedirect;
Settings.NEL = NELAPI.NEL;
Settings.OpportunisticEncryption = OpportunisticEncryptionAPI.OpportunisticEncryption;
Settings.OpportunisticOnion = OpportunisticOnionAPI.OpportunisticOnion;
Settings.OrangeToOrange = OrangeToOrangeAPI.OrangeToOrange;
Settings.OriginErrorPagePassThru = OriginErrorPagePassThruAPI.OriginErrorPagePassThru;
Settings.OriginMaxHTTPVersion = OriginMaxHTTPVersionAPI.OriginMaxHTTPVersion;
Settings.Polish = PolishAPI.Polish;
Settings.PrefetchPreload = PrefetchPreloadAPI.PrefetchPreload;
Settings.ProxyReadTimeout = ProxyReadTimeoutAPI.ProxyReadTimeout;
Settings.PseudoIPV4 = PseudoIPV4API.PseudoIPV4;
Settings.ResponseBuffering = ResponseBufferingAPI.ResponseBuffering;
Settings.RocketLoader = RocketLoaderAPI.RocketLoader;
Settings.SecurityHeaders = SecurityHeadersAPI.SecurityHeaders;
Settings.SecurityLevel = SecurityLevelAPI.SecurityLevel;
Settings.ServerSideExcludes = ServerSideExcludesAPI.ServerSideExcludes;
Settings.SortQueryStringForCache = SortQueryStringForCacheAPI.SortQueryStringForCache;
Settings.SSL = SSLAPI.SSL;
Settings.SSLRecommender = SSLRecommenderAPI.SSLRecommender;
Settings.TLS1_3 = TLS1_3API.TLS1_3;
Settings.TLSClientAuth = TLSClientAuthAPI.TLSClientAuth;
Settings.TrueClientIPHeader = TrueClientIPHeaderAPI.TrueClientIPHeader;
Settings.WAF = WAFAPI.WAF;
Settings.WebP = WebPAPI.WebP;
Settings.Websocket = WebsocketAPI.Websocket;
Settings.FontSettings = FontSettingsAPI.FontSettings;
})(Settings || (Settings = {}));
//# sourceMappingURL=settings.mjs.map