cloudflare/cloudflare-typescript

Public

mirrored from https://github.com/cloudflare/cloudflare-typescriptAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
9f68a33862c8dddd549f7a35bf28069517e64eee

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/index.ts

853lines · modecode

1// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3import { type Agent } from './_shims/index';
4import * as qs from './internal/qs';
5import * as Core from './core';
6import * as Errors from './error';
7import * as Pagination from './pagination';
8import {
9 type CursorLimitPaginationParams,
10 CursorLimitPaginationResponse,
11 type CursorPaginationParams,
12 CursorPaginationResponse,
13 SinglePageResponse,
14 type V4PagePaginationArrayParams,
15 V4PagePaginationArrayResponse,
16 type V4PagePaginationParams,
17 V4PagePaginationResponse,
18} from './pagination';
19import * as Uploads from './uploads';
20import * as API from './resources/index';
21import { AbuseReports } from './resources/abuse-reports';
22import { AuditLogs } from './resources/audit-logs';
23import { BotManagement } from './resources/bot-management';
24import { ClientCertificates } from './resources/client-certificates';
25import { CustomNameservers } from './resources/custom-nameservers';
26import { CustomPages } from './resources/custom-pages';
27import { DCVDelegation } from './resources/dcv-delegation';
28import { Filters } from './resources/filters';
29import { IPs } from './resources/ips';
30import { KeylessCertificates } from './resources/keyless-certificates';
31import { ManagedTransforms } from './resources/managed-transforms';
32import { Memberships } from './resources/memberships';
33import { OriginCACertificates } from './resources/origin-ca-certificates';
34import { OriginPostQuantumEncryption } from './resources/origin-post-quantum-encryption';
35import { PageRules } from './resources/page-rules';
36import { Pipelines } from './resources/pipelines';
37import { RateLimits } from './resources/rate-limits';
38import { SecurityTXT } from './resources/security-txt';
39import { URLNormalization } from './resources/url-normalization';
40import { Accounts } from './resources/accounts/accounts';
41import { ACM } from './resources/acm/acm';
42import { Addressing } from './resources/addressing/addressing';
43import { AIGateway } from './resources/ai-gateway/ai-gateway';
44import { AI } from './resources/ai/ai';
45import { Alerting } from './resources/alerting/alerting';
46import { APIGateway } from './resources/api-gateway/api-gateway';
47import { Argo } from './resources/argo/argo';
48import { Billing } from './resources/billing/billing';
49import { BotnetFeed } from './resources/botnet-feed/botnet-feed';
50import { BrandProtection } from './resources/brand-protection/brand-protection';
51import { BrowserRendering } from './resources/browser-rendering/browser-rendering';
52import { Cache } from './resources/cache/cache';
53import { Calls } from './resources/calls/calls';
54import { CertificateAuthorities } from './resources/certificate-authorities/certificate-authorities';
55import { CloudConnector } from './resources/cloud-connector/cloud-connector';
56import { CloudforceOne } from './resources/cloudforce-one/cloudforce-one';
57import { ContentScanning } from './resources/content-scanning/content-scanning';
58import { CustomCertificates } from './resources/custom-certificates/custom-certificates';
59import { CustomHostnames } from './resources/custom-hostnames/custom-hostnames';
60import { D1Resource } from './resources/d1/d1';
61import { Diagnostics } from './resources/diagnostics/diagnostics';
62import { DNSFirewall } from './resources/dns-firewall/dns-firewall';
63import { DNS } from './resources/dns/dns';
64import { DurableObjects } from './resources/durable-objects/durable-objects';
65import { EmailRouting } from './resources/email-routing/email-routing';
66import { EmailSecurity } from './resources/email-security/email-security';
67import { Firewall } from './resources/firewall/firewall';
68import { Healthchecks } from './resources/healthchecks/healthchecks';
69import { Hostnames } from './resources/hostnames/hostnames';
70import { HyperdriveResource } from './resources/hyperdrive/hyperdrive';
71import { IAM } from './resources/iam/iam';
72import { Images } from './resources/images/images';
73import { Intel } from './resources/intel/intel';
74import { KV } from './resources/kv/kv';
75import { LeakedCredentialChecks } from './resources/leaked-credential-checks/leaked-credential-checks';
76import { LoadBalancers } from './resources/load-balancers/load-balancers';
77import { Logpush } from './resources/logpush/logpush';
78import { Logs } from './resources/logs/logs';
79import { MagicCloudNetworking } from './resources/magic-cloud-networking/magic-cloud-networking';
80import { MagicNetworkMonitoring } from './resources/magic-network-monitoring/magic-network-monitoring';
81import { MagicTransit } from './resources/magic-transit/magic-transit';
82import { MTLSCertificates } from './resources/mtls-certificates/mtls-certificates';
83import { NetworkInterconnects } from './resources/network-interconnects/network-interconnects';
84import { OriginTLSClientAuth } from './resources/origin-tls-client-auth/origin-tls-client-auth';
85import { PageShield } from './resources/page-shield/page-shield';
86import { Pages } from './resources/pages/pages';
87import { Queues } from './resources/queues/queues';
88import { R2 } from './resources/r2/r2';
89import { Radar } from './resources/radar/radar';
90import { Registrar } from './resources/registrar/registrar';
91import { RequestTracers } from './resources/request-tracers/request-tracers';
92import { ResourceSharing } from './resources/resource-sharing/resource-sharing';
93import { Rules } from './resources/rules/rules';
94import { Rulesets } from './resources/rulesets/rulesets';
95import { RUM } from './resources/rum/rum';
96import { SchemaValidation } from './resources/schema-validation/schema-validation';
97import { SecretsStore } from './resources/secrets-store/secrets-store';
98import { SecurityCenter } from './resources/security-center/security-center';
99import { Snippets } from './resources/snippets/snippets';
100import { Spectrum } from './resources/spectrum/spectrum';
101import { Speed } from './resources/speed/speed';
102import { SSL } from './resources/ssl/ssl';
103import { Stream } from './resources/stream/stream';
104import { Turnstile } from './resources/turnstile/turnstile';
105import { URLScanner } from './resources/url-scanner/url-scanner';
106import { User } from './resources/user/user';
107import { Vectorize } from './resources/vectorize/vectorize';
108import { WaitingRooms } from './resources/waiting-rooms/waiting-rooms';
109import { Web3 } from './resources/web3/web3';
110import { WorkersForPlatforms } from './resources/workers-for-platforms/workers-for-platforms';
111import { Workers } from './resources/workers/workers';
112import { Workflows } from './resources/workflows/workflows';
113import { Zaraz } from './resources/zaraz/zaraz';
114import { ZeroTrust } from './resources/zero-trust/zero-trust';
115import { Zones } from './resources/zones/zones';
116
117export interface ClientOptions {
118 /**
119 * The preferred authorization scheme for interacting with the Cloudflare API. [Create a token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/).
120 */
121 apiToken?: string | null | undefined;
122
123 /**
124 * The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
125 */
126 apiKey?: string | null | undefined;
127
128 /**
129 * The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
130 */
131 apiEmail?: string | null | undefined;
132
133 /**
134 * Used when interacting with the Origin CA certificates API. [View/change your key](https://developers.cloudflare.com/fundamentals/api/get-started/ca-keys/#viewchange-your-origin-ca-keys).
135 */
136 userServiceKey?: string | null | undefined;
137
138 /**
139 * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
140 *
141 * Defaults to process.env['CLOUDFLARE_BASE_URL'].
142 */
143 baseURL?: string | null | undefined;
144
145 /**
146 * Define the API version to target for the requests, e.g., "2025-01-01"
147 */
148 apiVersion?: string | null;
149
150 /**
151 * The maximum amount of time (in milliseconds) that the client should wait for a response
152 * from the server before timing out a single request.
153 *
154 * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
155 * much longer than this timeout before the promise succeeds or fails.
156 *
157 * @unit milliseconds
158 */
159 timeout?: number | undefined;
160
161 /**
162 * An HTTP agent used to manage HTTP(S) connections.
163 *
164 * If not provided, an agent will be constructed by default in the Node.js environment,
165 * otherwise no agent is used.
166 */
167 httpAgent?: Agent | undefined;
168
169 /**
170 * Specify a custom `fetch` function implementation.
171 *
172 * If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
173 * defined globally.
174 */
175 fetch?: Core.Fetch | undefined;
176
177 /**
178 * The maximum number of times that the client will retry a request in case of a
179 * temporary failure, like a network error or a 5XX error from the server.
180 *
181 * @default 2
182 */
183 maxRetries?: number | undefined;
184
185 /**
186 * Default headers to include with every request to the API.
187 *
188 * These can be removed in individual requests by explicitly setting the
189 * header to `undefined` or `null` in request options.
190 */
191 defaultHeaders?: Core.Headers | undefined;
192
193 /**
194 * Default query parameters to include with every request to the API.
195 *
196 * These can be removed in individual requests by explicitly setting the
197 * param to `undefined` in request options.
198 */
199 defaultQuery?: Core.DefaultQuery | undefined;
200}
201
202/**
203 * API Client for interfacing with the Cloudflare API.
204 */
205export class Cloudflare extends Core.APIClient {
206 apiToken: string | null;
207 apiKey: string | null;
208 apiEmail: string | null;
209 userServiceKey: string | null;
210
211 private _options: ClientOptions;
212
213 /**
214 * API Client for interfacing with the Cloudflare API.
215 *
216 * @param {string | null | undefined} [opts.apiToken=process.env['CLOUDFLARE_API_TOKEN'] ?? null]
217 * @param {string | null | undefined} [opts.apiKey=process.env['CLOUDFLARE_API_KEY'] ?? null]
218 * @param {string | null | undefined} [opts.apiEmail=process.env['CLOUDFLARE_EMAIL'] ?? null]
219 * @param {string | null | undefined} [opts.userServiceKey=process.env['CLOUDFLARE_API_USER_SERVICE_KEY'] ?? null]
220 * @param {string} [opts.baseURL=process.env['CLOUDFLARE_BASE_URL'] ?? https://api.cloudflare.com/client/v4] - Override the default base URL for the API.
221 * @param {string | null} [opts.apiVersion] - Define the version to target for the API.
222 * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
223 * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
224 * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
225 * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
226 * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
227 * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
228 */
229 constructor({
230 baseURL = Core.readEnv('CLOUDFLARE_BASE_URL'),
231 apiVersion = null,
232 apiToken = Core.readEnv('CLOUDFLARE_API_TOKEN') ?? null,
233 apiKey = Core.readEnv('CLOUDFLARE_API_KEY') ?? null,
234 apiEmail = Core.readEnv('CLOUDFLARE_EMAIL') ?? null,
235 userServiceKey = Core.readEnv('CLOUDFLARE_API_USER_SERVICE_KEY') ?? null,
236 ...opts
237 }: ClientOptions = {}) {
238 const options: ClientOptions = {
239 apiToken,
240 apiKey,
241 apiEmail,
242 userServiceKey,
243 ...opts,
244 baseURL: baseURL || `https://api.cloudflare.com/client/v4`,
245 apiVersion: apiVersion || new Date().toISOString().slice(0, 10),
246 };
247
248 super({
249 baseURL: options.baseURL!,
250 apiVersion: options.apiVersion!,
251 baseURLOverridden: baseURL ? baseURL !== 'https://api.cloudflare.com/client/v4' : false,
252 timeout: options.timeout ?? 60000 /* 1 minute */,
253 httpAgent: options.httpAgent,
254 maxRetries: options.maxRetries,
255 fetch: options.fetch,
256 });
257
258 this._options = options;
259
260 this.apiToken = apiToken;
261 this.apiKey = apiKey;
262 this.apiEmail = apiEmail;
263 this.userServiceKey = userServiceKey;
264 }
265
266 accounts: API.Accounts = new API.Accounts(this);
267 originCACertificates: API.OriginCACertificates = new API.OriginCACertificates(this);
268 ips: API.IPs = new API.IPs(this);
269 memberships: API.Memberships = new API.Memberships(this);
270 user: API.User = new API.User(this);
271 zones: API.Zones = new API.Zones(this);
272 loadBalancers: API.LoadBalancers = new API.LoadBalancers(this);
273 cache: API.Cache = new API.Cache(this);
274 ssl: API.SSL = new API.SSL(this);
275 acm: API.ACM = new API.ACM(this);
276 argo: API.Argo = new API.Argo(this);
277 certificateAuthorities: API.CertificateAuthorities = new API.CertificateAuthorities(this);
278 clientCertificates: API.ClientCertificates = new API.ClientCertificates(this);
279 customCertificates: API.CustomCertificates = new API.CustomCertificates(this);
280 customHostnames: API.CustomHostnames = new API.CustomHostnames(this);
281 customNameservers: API.CustomNameservers = new API.CustomNameservers(this);
282 dnsFirewall: API.DNSFirewall = new API.DNSFirewall(this);
283 dns: API.DNS = new API.DNS(this);
284 emailSecurity: API.EmailSecurity = new API.EmailSecurity(this);
285 emailRouting: API.EmailRouting = new API.EmailRouting(this);
286 filters: API.Filters = new API.Filters(this);
287 firewall: API.Firewall = new API.Firewall(this);
288 healthchecks: API.Healthchecks = new API.Healthchecks(this);
289 keylessCertificates: API.KeylessCertificates = new API.KeylessCertificates(this);
290 logpush: API.Logpush = new API.Logpush(this);
291 logs: API.Logs = new API.Logs(this);
292 originTLSClientAuth: API.OriginTLSClientAuth = new API.OriginTLSClientAuth(this);
293 pageRules: API.PageRules = new API.PageRules(this);
294 rateLimits: API.RateLimits = new API.RateLimits(this);
295 waitingRooms: API.WaitingRooms = new API.WaitingRooms(this);
296 web3: API.Web3 = new API.Web3(this);
297 workers: API.Workers = new API.Workers(this);
298 kv: API.KV = new API.KV(this);
299 durableObjects: API.DurableObjects = new API.DurableObjects(this);
300 queues: API.Queues = new API.Queues(this);
301 apiGateway: API.APIGateway = new API.APIGateway(this);
302 managedTransforms: API.ManagedTransforms = new API.ManagedTransforms(this);
303 pageShield: API.PageShield = new API.PageShield(this);
304 rulesets: API.Rulesets = new API.Rulesets(this);
305 urlNormalization: API.URLNormalization = new API.URLNormalization(this);
306 spectrum: API.Spectrum = new API.Spectrum(this);
307 addressing: API.Addressing = new API.Addressing(this);
308 auditLogs: API.AuditLogs = new API.AuditLogs(this);
309 billing: API.Billing = new API.Billing(this);
310 brandProtection: API.BrandProtection = new API.BrandProtection(this);
311 diagnostics: API.Diagnostics = new API.Diagnostics(this);
312 images: API.Images = new API.Images(this);
313 intel: API.Intel = new API.Intel(this);
314 magicTransit: API.MagicTransit = new API.MagicTransit(this);
315 magicNetworkMonitoring: API.MagicNetworkMonitoring = new API.MagicNetworkMonitoring(this);
316 magicCloudNetworking: API.MagicCloudNetworking = new API.MagicCloudNetworking(this);
317 networkInterconnects: API.NetworkInterconnects = new API.NetworkInterconnects(this);
318 mtlsCertificates: API.MTLSCertificates = new API.MTLSCertificates(this);
319 pages: API.Pages = new API.Pages(this);
320 registrar: API.Registrar = new API.Registrar(this);
321 requestTracers: API.RequestTracers = new API.RequestTracers(this);
322 rules: API.Rules = new API.Rules(this);
323 stream: API.Stream = new API.Stream(this);
324 alerting: API.Alerting = new API.Alerting(this);
325 d1: API.D1Resource = new API.D1Resource(this);
326 r2: API.R2 = new API.R2(this);
327 workersForPlatforms: API.WorkersForPlatforms = new API.WorkersForPlatforms(this);
328 zeroTrust: API.ZeroTrust = new API.ZeroTrust(this);
329 turnstile: API.Turnstile = new API.Turnstile(this);
330 hyperdrive: API.HyperdriveResource = new API.HyperdriveResource(this);
331 rum: API.RUM = new API.RUM(this);
332 vectorize: API.Vectorize = new API.Vectorize(this);
333 urlScanner: API.URLScanner = new API.URLScanner(this);
334 radar: API.Radar = new API.Radar(this);
335 botManagement: API.BotManagement = new API.BotManagement(this);
336 originPostQuantumEncryption: API.OriginPostQuantumEncryption = new API.OriginPostQuantumEncryption(this);
337 zaraz: API.Zaraz = new API.Zaraz(this);
338 speed: API.Speed = new API.Speed(this);
339 dcvDelegation: API.DCVDelegation = new API.DCVDelegation(this);
340 hostnames: API.Hostnames = new API.Hostnames(this);
341 snippets: API.Snippets = new API.Snippets(this);
342 calls: API.Calls = new API.Calls(this);
343 cloudforceOne: API.CloudforceOne = new API.CloudforceOne(this);
344 aiGateway: API.AIGateway = new API.AIGateway(this);
345 iam: API.IAM = new API.IAM(this);
346 cloudConnector: API.CloudConnector = new API.CloudConnector(this);
347 botnetFeed: API.BotnetFeed = new API.BotnetFeed(this);
348 securityTXT: API.SecurityTXT = new API.SecurityTXT(this);
349 workflows: API.Workflows = new API.Workflows(this);
350 resourceSharing: API.ResourceSharing = new API.ResourceSharing(this);
351 leakedCredentialChecks: API.LeakedCredentialChecks = new API.LeakedCredentialChecks(this);
352 contentScanning: API.ContentScanning = new API.ContentScanning(this);
353 abuseReports: API.AbuseReports = new API.AbuseReports(this);
354 ai: API.AI = new API.AI(this);
355 securityCenter: API.SecurityCenter = new API.SecurityCenter(this);
356 browserRendering: API.BrowserRendering = new API.BrowserRendering(this);
357 customPages: API.CustomPages = new API.CustomPages(this);
358 secretsStore: API.SecretsStore = new API.SecretsStore(this);
359 pipelines: API.Pipelines = new API.Pipelines(this);
360 schemaValidation: API.SchemaValidation = new API.SchemaValidation(this);
361
362 /**
363 * Check whether the base URL is set to its default.
364 */
365 #baseURLOverridden(): boolean {
366 return this.baseURL !== 'https://api.cloudflare.com/client/v4';
367 }
368
369 protected override defaultQuery(): Core.DefaultQuery | undefined {
370 return this._options.defaultQuery;
371 }
372
373 protected override defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers {
374 return {
375 ...super.defaultHeaders(opts),
376 'X-Auth-Key': this.apiKey,
377 'X-Auth-Email': this.apiEmail,
378 ...this._options.defaultHeaders,
379 };
380 }
381
382 protected override validateHeaders(headers: Core.Headers, customHeaders: Core.Headers) {
383 if (this.apiEmail && headers['x-auth-email']) {
384 return;
385 }
386 if (customHeaders['x-auth-email'] === null) {
387 return;
388 }
389
390 if (this.apiKey && headers['x-auth-key']) {
391 return;
392 }
393 if (customHeaders['x-auth-key'] === null) {
394 return;
395 }
396
397 if (this.apiToken && headers['authorization']) {
398 return;
399 }
400 if (customHeaders['authorization'] === null) {
401 return;
402 }
403
404 if (this.userServiceKey && headers['x-auth-user-service-key']) {
405 return;
406 }
407 if (customHeaders['x-auth-user-service-key'] === null) {
408 return;
409 }
410
411 throw new Error(
412 'Could not resolve authentication method. Expected one of apiEmail, apiKey, apiToken or userServiceKey to be set. Or for one of the "X-Auth-Email", "X-Auth-Key", "Authorization" or "X-Auth-User-Service-Key" headers to be explicitly omitted',
413 );
414 }
415
416 protected override authHeaders(opts: Core.FinalRequestOptions): Core.Headers {
417 const apiEmailAuth = this.apiEmailAuth(opts);
418 const apiKeyAuth = this.apiKeyAuth(opts);
419 const apiTokenAuth = this.apiTokenAuth(opts);
420 const userServiceKeyAuth = this.userServiceKeyAuth(opts);
421
422 if (
423 apiEmailAuth != null &&
424 !Core.isEmptyObj(apiEmailAuth) &&
425 apiKeyAuth != null &&
426 !Core.isEmptyObj(apiKeyAuth)
427 ) {
428 return { ...apiEmailAuth, ...apiKeyAuth };
429 }
430
431 if (apiTokenAuth != null && !Core.isEmptyObj(apiTokenAuth)) {
432 return apiTokenAuth;
433 }
434
435 if (userServiceKeyAuth != null && !Core.isEmptyObj(userServiceKeyAuth)) {
436 return userServiceKeyAuth;
437 }
438 return {};
439 }
440
441 protected apiEmailAuth(opts: Core.FinalRequestOptions): Core.Headers {
442 if (this.apiEmail == null) {
443 return {};
444 }
445 return { 'X-Auth-Email': this.apiEmail };
446 }
447
448 protected apiKeyAuth(opts: Core.FinalRequestOptions): Core.Headers {
449 if (this.apiKey == null) {
450 return {};
451 }
452 return { 'X-Auth-Key': this.apiKey };
453 }
454
455 protected apiTokenAuth(opts: Core.FinalRequestOptions): Core.Headers {
456 if (this.apiToken == null) {
457 return {};
458 }
459 return { Authorization: `Bearer ${this.apiToken}` };
460 }
461
462 protected userServiceKeyAuth(opts: Core.FinalRequestOptions): Core.Headers {
463 if (this.userServiceKey == null) {
464 return {};
465 }
466 return { 'X-Auth-User-Service-Key': this.userServiceKey };
467 }
468
469 protected override stringifyQuery(query: Record<string, unknown>): string {
470 return qs.stringify(query, { allowDots: true, arrayFormat: 'repeat' });
471 }
472
473 static Cloudflare = this;
474 static DEFAULT_TIMEOUT = 60000; // 1 minute
475
476 static CloudflareError = Errors.CloudflareError;
477 static APIError = Errors.APIError;
478 static APIConnectionError = Errors.APIConnectionError;
479 static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
480 static APIUserAbortError = Errors.APIUserAbortError;
481 static NotFoundError = Errors.NotFoundError;
482 static ConflictError = Errors.ConflictError;
483 static RateLimitError = Errors.RateLimitError;
484 static BadRequestError = Errors.BadRequestError;
485 static AuthenticationError = Errors.AuthenticationError;
486 static InternalServerError = Errors.InternalServerError;
487 static PermissionDeniedError = Errors.PermissionDeniedError;
488 static UnprocessableEntityError = Errors.UnprocessableEntityError;
489
490 static toFile = Uploads.toFile;
491 static fileFromPath = Uploads.fileFromPath;
492}
493
494Cloudflare.Accounts = Accounts;
495Cloudflare.OriginCACertificates = OriginCACertificates;
496Cloudflare.IPs = IPs;
497Cloudflare.Memberships = Memberships;
498Cloudflare.User = User;
499Cloudflare.Zones = Zones;
500Cloudflare.LoadBalancers = LoadBalancers;
501Cloudflare.Cache = Cache;
502Cloudflare.SSL = SSL;
503Cloudflare.ACM = ACM;
504Cloudflare.Argo = Argo;
505Cloudflare.CertificateAuthorities = CertificateAuthorities;
506Cloudflare.ClientCertificates = ClientCertificates;
507Cloudflare.CustomCertificates = CustomCertificates;
508Cloudflare.CustomHostnames = CustomHostnames;
509Cloudflare.CustomNameservers = CustomNameservers;
510Cloudflare.DNSFirewall = DNSFirewall;
511Cloudflare.DNS = DNS;
512Cloudflare.EmailSecurity = EmailSecurity;
513Cloudflare.EmailRouting = EmailRouting;
514Cloudflare.Filters = Filters;
515Cloudflare.Firewall = Firewall;
516Cloudflare.Healthchecks = Healthchecks;
517Cloudflare.KeylessCertificates = KeylessCertificates;
518Cloudflare.Logpush = Logpush;
519Cloudflare.Logs = Logs;
520Cloudflare.OriginTLSClientAuth = OriginTLSClientAuth;
521Cloudflare.PageRules = PageRules;
522Cloudflare.RateLimits = RateLimits;
523Cloudflare.WaitingRooms = WaitingRooms;
524Cloudflare.Web3 = Web3;
525Cloudflare.Workers = Workers;
526Cloudflare.KV = KV;
527Cloudflare.DurableObjects = DurableObjects;
528Cloudflare.Queues = Queues;
529Cloudflare.APIGateway = APIGateway;
530Cloudflare.ManagedTransforms = ManagedTransforms;
531Cloudflare.PageShield = PageShield;
532Cloudflare.Rulesets = Rulesets;
533Cloudflare.URLNormalization = URLNormalization;
534Cloudflare.Spectrum = Spectrum;
535Cloudflare.Addressing = Addressing;
536Cloudflare.AuditLogs = AuditLogs;
537Cloudflare.Billing = Billing;
538Cloudflare.BrandProtection = BrandProtection;
539Cloudflare.Diagnostics = Diagnostics;
540Cloudflare.Images = Images;
541Cloudflare.Intel = Intel;
542Cloudflare.MagicTransit = MagicTransit;
543Cloudflare.MagicNetworkMonitoring = MagicNetworkMonitoring;
544Cloudflare.MagicCloudNetworking = MagicCloudNetworking;
545Cloudflare.NetworkInterconnects = NetworkInterconnects;
546Cloudflare.MTLSCertificates = MTLSCertificates;
547Cloudflare.Pages = Pages;
548Cloudflare.Registrar = Registrar;
549Cloudflare.RequestTracers = RequestTracers;
550Cloudflare.Rules = Rules;
551Cloudflare.Stream = Stream;
552Cloudflare.Alerting = Alerting;
553Cloudflare.D1Resource = D1Resource;
554Cloudflare.R2 = R2;
555Cloudflare.WorkersForPlatforms = WorkersForPlatforms;
556Cloudflare.ZeroTrust = ZeroTrust;
557Cloudflare.Turnstile = Turnstile;
558Cloudflare.HyperdriveResource = HyperdriveResource;
559Cloudflare.RUM = RUM;
560Cloudflare.Vectorize = Vectorize;
561Cloudflare.URLScanner = URLScanner;
562Cloudflare.Radar = Radar;
563Cloudflare.BotManagement = BotManagement;
564Cloudflare.OriginPostQuantumEncryption = OriginPostQuantumEncryption;
565Cloudflare.Zaraz = Zaraz;
566Cloudflare.Speed = Speed;
567Cloudflare.DCVDelegation = DCVDelegation;
568Cloudflare.Hostnames = Hostnames;
569Cloudflare.Snippets = Snippets;
570Cloudflare.Calls = Calls;
571Cloudflare.CloudforceOne = CloudforceOne;
572Cloudflare.AIGateway = AIGateway;
573Cloudflare.IAM = IAM;
574Cloudflare.CloudConnector = CloudConnector;
575Cloudflare.BotnetFeed = BotnetFeed;
576Cloudflare.SecurityTXT = SecurityTXT;
577Cloudflare.Workflows = Workflows;
578Cloudflare.ResourceSharing = ResourceSharing;
579Cloudflare.LeakedCredentialChecks = LeakedCredentialChecks;
580Cloudflare.ContentScanning = ContentScanning;
581Cloudflare.AbuseReports = AbuseReports;
582Cloudflare.AI = AI;
583Cloudflare.SecurityCenter = SecurityCenter;
584Cloudflare.BrowserRendering = BrowserRendering;
585Cloudflare.CustomPages = CustomPages;
586Cloudflare.SecretsStore = SecretsStore;
587Cloudflare.Pipelines = Pipelines;
588Cloudflare.SchemaValidation = SchemaValidation;
589
590export declare namespace Cloudflare {
591 export type RequestOptions = Core.RequestOptions;
592
593 export import V4PagePagination = Pagination.V4PagePagination;
594 export {
595 type V4PagePaginationParams as V4PagePaginationParams,
596 type V4PagePaginationResponse as V4PagePaginationResponse,
597 };
598
599 export import V4PagePaginationArray = Pagination.V4PagePaginationArray;
600 export {
601 type V4PagePaginationArrayParams as V4PagePaginationArrayParams,
602 type V4PagePaginationArrayResponse as V4PagePaginationArrayResponse,
603 };
604
605 export import CursorPagination = Pagination.CursorPagination;
606 export {
607 type CursorPaginationParams as CursorPaginationParams,
608 type CursorPaginationResponse as CursorPaginationResponse,
609 };
610
611 export import CursorLimitPagination = Pagination.CursorLimitPagination;
612 export {
613 type CursorLimitPaginationParams as CursorLimitPaginationParams,
614 type CursorLimitPaginationResponse as CursorLimitPaginationResponse,
615 };
616
617 export import SinglePage = Pagination.SinglePage;
618 export { type SinglePageResponse as SinglePageResponse };
619
620 export { Accounts as Accounts };
621
622 export { OriginCACertificates as OriginCACertificates };
623
624 export { IPs as IPs };
625
626 export { Memberships as Memberships };
627
628 export { User as User };
629
630 export { Zones as Zones };
631
632 export { LoadBalancers as LoadBalancers };
633
634 export { Cache as Cache };
635
636 export { SSL as SSL };
637
638 export { ACM as ACM };
639
640 export { Argo as Argo };
641
642 export { CertificateAuthorities as CertificateAuthorities };
643
644 export { ClientCertificates as ClientCertificates };
645
646 export { CustomCertificates as CustomCertificates };
647
648 export { CustomHostnames as CustomHostnames };
649
650 export { CustomNameservers as CustomNameservers };
651
652 export { DNSFirewall as DNSFirewall };
653
654 export { DNS as DNS };
655
656 export { EmailSecurity as EmailSecurity };
657
658 export { EmailRouting as EmailRouting };
659
660 export { Filters as Filters };
661
662 export { Firewall as Firewall };
663
664 export { Healthchecks as Healthchecks };
665
666 export { KeylessCertificates as KeylessCertificates };
667
668 export { Logpush as Logpush };
669
670 export { Logs as Logs };
671
672 export { OriginTLSClientAuth as OriginTLSClientAuth };
673
674 export { PageRules as PageRules };
675
676 export { RateLimits as RateLimits };
677
678 export { WaitingRooms as WaitingRooms };
679
680 export { Web3 as Web3 };
681
682 export { Workers as Workers };
683
684 export { KV as KV };
685
686 export { DurableObjects as DurableObjects };
687
688 export { Queues as Queues };
689
690 export { APIGateway as APIGateway };
691
692 export { ManagedTransforms as ManagedTransforms };
693
694 export { PageShield as PageShield };
695
696 export { Rulesets as Rulesets };
697
698 export { URLNormalization as URLNormalization };
699
700 export { Spectrum as Spectrum };
701
702 export { Addressing as Addressing };
703
704 export { AuditLogs as AuditLogs };
705
706 export { Billing as Billing };
707
708 export { BrandProtection as BrandProtection };
709
710 export { Diagnostics as Diagnostics };
711
712 export { Images as Images };
713
714 export { Intel as Intel };
715
716 export { MagicTransit as MagicTransit };
717
718 export { MagicNetworkMonitoring as MagicNetworkMonitoring };
719
720 export { MagicCloudNetworking as MagicCloudNetworking };
721
722 export { NetworkInterconnects as NetworkInterconnects };
723
724 export { MTLSCertificates as MTLSCertificates };
725
726 export { Pages as Pages };
727
728 export { Registrar as Registrar };
729
730 export { RequestTracers as RequestTracers };
731
732 export { Rules as Rules };
733
734 export { Stream as Stream };
735
736 export { Alerting as Alerting };
737
738 export { D1Resource as D1Resource };
739
740 export { R2 as R2 };
741
742 export { WorkersForPlatforms as WorkersForPlatforms };
743
744 export { ZeroTrust as ZeroTrust };
745
746 export { Turnstile as Turnstile };
747
748 export { HyperdriveResource as HyperdriveResource };
749
750 export { RUM as RUM };
751
752 export { Vectorize as Vectorize };
753
754 export { URLScanner as URLScanner };
755
756 export { Radar as Radar };
757
758 export { BotManagement as BotManagement };
759
760 export { OriginPostQuantumEncryption as OriginPostQuantumEncryption };
761
762 export { Zaraz as Zaraz };
763
764 export { Speed as Speed };
765
766 export { DCVDelegation as DCVDelegation };
767
768 export { Hostnames as Hostnames };
769
770 export { Snippets as Snippets };
771
772 export { Calls as Calls };
773
774 export { CloudforceOne as CloudforceOne };
775
776 export { AIGateway as AIGateway };
777
778 export { IAM as IAM };
779
780 export { CloudConnector as CloudConnector };
781
782 export { BotnetFeed as BotnetFeed };
783
784 export { SecurityTXT as SecurityTXT };
785
786 export { Workflows as Workflows };
787
788 export { ResourceSharing as ResourceSharing };
789
790 export { LeakedCredentialChecks as LeakedCredentialChecks };
791
792 export { ContentScanning as ContentScanning };
793
794 export { AbuseReports as AbuseReports };
795
796 export { AI as AI };
797
798 export { SecurityCenter as SecurityCenter };
799
800 export { BrowserRendering as BrowserRendering };
801
802 export { CustomPages as CustomPages };
803
804 export { SecretsStore as SecretsStore };
805
806 export { Pipelines as Pipelines };
807
808 export { SchemaValidation as SchemaValidation };
809
810 export type ASN = API.ASN;
811 export type AuditLog = API.AuditLog;
812 export type CertificateCA = API.CertificateCA;
813 export type CertificateRequestType = API.CertificateRequestType;
814 export type CloudflareTunnel = API.CloudflareTunnel;
815 export type ErrorData = API.ErrorData;
816 export type Identifier = API.Identifier;
817 export type LoadBalancerPreview = API.LoadBalancerPreview;
818 export type Member = API.Member;
819 export type PaginationInfo = API.PaginationInfo;
820 export type Permission = API.Permission;
821 export type PermissionGrant = API.PermissionGrant;
822 export type RatePlan = API.RatePlan;
823 export type ResponseInfo = API.ResponseInfo;
824 export type Result = API.Result;
825 export type Role = API.Role;
826 export type SortDirection = API.SortDirection;
827 export type Subscription = API.Subscription;
828 export type SubscriptionComponent = API.SubscriptionComponent;
829 export type SubscriptionZone = API.SubscriptionZone;
830 export type Token = API.Token;
831 export type TokenConditionCIDRList = API.TokenConditionCIDRList;
832 export type TokenPolicy = API.TokenPolicy;
833 export type TokenValue = API.TokenValue;
834}
835
836export { toFile, fileFromPath } from './uploads';
837export {
838 CloudflareError,
839 APIError,
840 APIConnectionError,
841 APIConnectionTimeoutError,
842 APIUserAbortError,
843 NotFoundError,
844 ConflictError,
845 RateLimitError,
846 BadRequestError,
847 AuthenticationError,
848 InternalServerError,
849 PermissionDeniedError,
850 UnprocessableEntityError,
851} from './error';
852
853export default Cloudflare;
854