cloudflare/cloudflare-typescript

Public

mirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
jhutchings1-patch-1

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/index.ts

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