cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
953cc492e714cfda9711f67ff4bfbf22845f40eb

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/index.ts

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