cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v4.3.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/index.ts

842lines · 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 timeout: options.timeout ?? 60000 /* 1 minute */,
250 httpAgent: options.httpAgent,
251 maxRetries: options.maxRetries,
252 fetch: options.fetch,
253 });
254
255 this._options = options;
256
257 this.apiToken = apiToken;
258 this.apiKey = apiKey;
259 this.apiEmail = apiEmail;
260 this.userServiceKey = userServiceKey;
261 }
262
263 accounts: API.Accounts = new API.Accounts(this);
264 originCACertificates: API.OriginCACertificates = new API.OriginCACertificates(this);
265 ips: API.IPs = new API.IPs(this);
266 memberships: API.Memberships = new API.Memberships(this);
267 user: API.User = new API.User(this);
268 zones: API.Zones = new API.Zones(this);
269 loadBalancers: API.LoadBalancers = new API.LoadBalancers(this);
270 cache: API.Cache = new API.Cache(this);
271 ssl: API.SSL = new API.SSL(this);
272 acm: API.ACM = new API.ACM(this);
273 argo: API.Argo = new API.Argo(this);
274 certificateAuthorities: API.CertificateAuthorities = new API.CertificateAuthorities(this);
275 clientCertificates: API.ClientCertificates = new API.ClientCertificates(this);
276 customCertificates: API.CustomCertificates = new API.CustomCertificates(this);
277 customHostnames: API.CustomHostnames = new API.CustomHostnames(this);
278 customNameservers: API.CustomNameservers = new API.CustomNameservers(this);
279 dnsFirewall: API.DNSFirewall = new API.DNSFirewall(this);
280 dns: API.DNS = new API.DNS(this);
281 emailSecurity: API.EmailSecurity = new API.EmailSecurity(this);
282 emailRouting: API.EmailRouting = new API.EmailRouting(this);
283 filters: API.Filters = new API.Filters(this);
284 firewall: API.Firewall = new API.Firewall(this);
285 healthchecks: API.Healthchecks = new API.Healthchecks(this);
286 keylessCertificates: API.KeylessCertificates = new API.KeylessCertificates(this);
287 logpush: API.Logpush = new API.Logpush(this);
288 logs: API.Logs = new API.Logs(this);
289 originTLSClientAuth: API.OriginTLSClientAuth = new API.OriginTLSClientAuth(this);
290 pageRules: API.PageRules = new API.PageRules(this);
291 rateLimits: API.RateLimits = new API.RateLimits(this);
292 waitingRooms: API.WaitingRooms = new API.WaitingRooms(this);
293 web3: API.Web3 = new API.Web3(this);
294 workers: API.Workers = new API.Workers(this);
295 kv: API.KV = new API.KV(this);
296 durableObjects: API.DurableObjects = new API.DurableObjects(this);
297 queues: API.Queues = new API.Queues(this);
298 apiGateway: API.APIGateway = new API.APIGateway(this);
299 managedTransforms: API.ManagedTransforms = new API.ManagedTransforms(this);
300 pageShield: API.PageShield = new API.PageShield(this);
301 rulesets: API.Rulesets = new API.Rulesets(this);
302 urlNormalization: API.URLNormalization = new API.URLNormalization(this);
303 spectrum: API.Spectrum = new API.Spectrum(this);
304 addressing: API.Addressing = new API.Addressing(this);
305 auditLogs: API.AuditLogs = new API.AuditLogs(this);
306 billing: API.Billing = new API.Billing(this);
307 brandProtection: API.BrandProtection = new API.BrandProtection(this);
308 diagnostics: API.Diagnostics = new API.Diagnostics(this);
309 images: API.Images = new API.Images(this);
310 intel: API.Intel = new API.Intel(this);
311 magicTransit: API.MagicTransit = new API.MagicTransit(this);
312 magicNetworkMonitoring: API.MagicNetworkMonitoring = new API.MagicNetworkMonitoring(this);
313 magicCloudNetworking: API.MagicCloudNetworking = new API.MagicCloudNetworking(this);
314 networkInterconnects: API.NetworkInterconnects = new API.NetworkInterconnects(this);
315 mtlsCertificates: API.MTLSCertificates = new API.MTLSCertificates(this);
316 pages: API.Pages = new API.Pages(this);
317 registrar: API.Registrar = new API.Registrar(this);
318 requestTracers: API.RequestTracers = new API.RequestTracers(this);
319 rules: API.Rules = new API.Rules(this);
320 stream: API.Stream = new API.Stream(this);
321 alerting: API.Alerting = new API.Alerting(this);
322 d1: API.D1Resource = new API.D1Resource(this);
323 r2: API.R2 = new API.R2(this);
324 workersForPlatforms: API.WorkersForPlatforms = new API.WorkersForPlatforms(this);
325 zeroTrust: API.ZeroTrust = new API.ZeroTrust(this);
326 turnstile: API.Turnstile = new API.Turnstile(this);
327 hyperdrive: API.HyperdriveResource = new API.HyperdriveResource(this);
328 rum: API.RUM = new API.RUM(this);
329 vectorize: API.Vectorize = new API.Vectorize(this);
330 urlScanner: API.URLScanner = new API.URLScanner(this);
331 radar: API.Radar = new API.Radar(this);
332 botManagement: API.BotManagement = new API.BotManagement(this);
333 originPostQuantumEncryption: API.OriginPostQuantumEncryption = new API.OriginPostQuantumEncryption(this);
334 zaraz: API.Zaraz = new API.Zaraz(this);
335 speed: API.Speed = new API.Speed(this);
336 dcvDelegation: API.DCVDelegation = new API.DCVDelegation(this);
337 hostnames: API.Hostnames = new API.Hostnames(this);
338 snippets: API.Snippets = new API.Snippets(this);
339 calls: API.Calls = new API.Calls(this);
340 cloudforceOne: API.CloudforceOne = new API.CloudforceOne(this);
341 aiGateway: API.AIGateway = new API.AIGateway(this);
342 iam: API.IAM = new API.IAM(this);
343 cloudConnector: API.CloudConnector = new API.CloudConnector(this);
344 botnetFeed: API.BotnetFeed = new API.BotnetFeed(this);
345 securityTXT: API.SecurityTXT = new API.SecurityTXT(this);
346 workflows: API.Workflows = new API.Workflows(this);
347 resourceSharing: API.ResourceSharing = new API.ResourceSharing(this);
348 leakedCredentialChecks: API.LeakedCredentialChecks = new API.LeakedCredentialChecks(this);
349 contentScanning: API.ContentScanning = new API.ContentScanning(this);
350 abuseReports: API.AbuseReports = new API.AbuseReports(this);
351 ai: API.AI = new API.AI(this);
352 securityCenter: API.SecurityCenter = new API.SecurityCenter(this);
353 browserRendering: API.BrowserRendering = new API.BrowserRendering(this);
354 customPages: API.CustomPages = new API.CustomPages(this);
355 secretsStore: API.SecretsStore = new API.SecretsStore(this);
356 pipelines: API.Pipelines = new API.Pipelines(this);
357 schemaValidation: API.SchemaValidation = new API.SchemaValidation(this);
358
359 protected override defaultQuery(): Core.DefaultQuery | undefined {
360 return this._options.defaultQuery;
361 }
362
363 protected override defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers {
364 return {
365 ...super.defaultHeaders(opts),
366 'X-Auth-Key': this.apiKey,
367 'X-Auth-Email': this.apiEmail,
368 ...this._options.defaultHeaders,
369 };
370 }
371
372 protected override validateHeaders(headers: Core.Headers, customHeaders: Core.Headers) {
373 if (this.apiEmail && headers['x-auth-email']) {
374 return;
375 }
376 if (customHeaders['x-auth-email'] === null) {
377 return;
378 }
379
380 if (this.apiKey && headers['x-auth-key']) {
381 return;
382 }
383 if (customHeaders['x-auth-key'] === null) {
384 return;
385 }
386
387 if (this.apiToken && headers['authorization']) {
388 return;
389 }
390 if (customHeaders['authorization'] === null) {
391 return;
392 }
393
394 if (this.userServiceKey && headers['x-auth-user-service-key']) {
395 return;
396 }
397 if (customHeaders['x-auth-user-service-key'] === null) {
398 return;
399 }
400
401 throw new Error(
402 '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',
403 );
404 }
405
406 protected override authHeaders(opts: Core.FinalRequestOptions): Core.Headers {
407 const apiEmailAuth = this.apiEmailAuth(opts);
408 const apiKeyAuth = this.apiKeyAuth(opts);
409 const apiTokenAuth = this.apiTokenAuth(opts);
410 const userServiceKeyAuth = this.userServiceKeyAuth(opts);
411
412 if (
413 apiEmailAuth != null &&
414 !Core.isEmptyObj(apiEmailAuth) &&
415 apiKeyAuth != null &&
416 !Core.isEmptyObj(apiKeyAuth)
417 ) {
418 return { ...apiEmailAuth, ...apiKeyAuth };
419 }
420
421 if (apiTokenAuth != null && !Core.isEmptyObj(apiTokenAuth)) {
422 return apiTokenAuth;
423 }
424
425 if (userServiceKeyAuth != null && !Core.isEmptyObj(userServiceKeyAuth)) {
426 return userServiceKeyAuth;
427 }
428 return {};
429 }
430
431 protected apiEmailAuth(opts: Core.FinalRequestOptions): Core.Headers {
432 if (this.apiEmail == null) {
433 return {};
434 }
435 return { 'X-Auth-Email': this.apiEmail };
436 }
437
438 protected apiKeyAuth(opts: Core.FinalRequestOptions): Core.Headers {
439 if (this.apiKey == null) {
440 return {};
441 }
442 return { 'X-Auth-Key': this.apiKey };
443 }
444
445 protected apiTokenAuth(opts: Core.FinalRequestOptions): Core.Headers {
446 if (this.apiToken == null) {
447 return {};
448 }
449 return { Authorization: `Bearer ${this.apiToken}` };
450 }
451
452 protected userServiceKeyAuth(opts: Core.FinalRequestOptions): Core.Headers {
453 if (this.userServiceKey == null) {
454 return {};
455 }
456 return { 'X-Auth-User-Service-Key': this.userServiceKey };
457 }
458
459 protected override stringifyQuery(query: Record<string, unknown>): string {
460 return qs.stringify(query, { allowDots: true, arrayFormat: 'repeat' });
461 }
462
463 static Cloudflare = this;
464 static DEFAULT_TIMEOUT = 60000; // 1 minute
465
466 static CloudflareError = Errors.CloudflareError;
467 static APIError = Errors.APIError;
468 static APIConnectionError = Errors.APIConnectionError;
469 static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
470 static APIUserAbortError = Errors.APIUserAbortError;
471 static NotFoundError = Errors.NotFoundError;
472 static ConflictError = Errors.ConflictError;
473 static RateLimitError = Errors.RateLimitError;
474 static BadRequestError = Errors.BadRequestError;
475 static AuthenticationError = Errors.AuthenticationError;
476 static InternalServerError = Errors.InternalServerError;
477 static PermissionDeniedError = Errors.PermissionDeniedError;
478 static UnprocessableEntityError = Errors.UnprocessableEntityError;
479
480 static toFile = Uploads.toFile;
481 static fileFromPath = Uploads.fileFromPath;
482}
483
484Cloudflare.Accounts = Accounts;
485Cloudflare.OriginCACertificates = OriginCACertificates;
486Cloudflare.IPs = IPs;
487Cloudflare.Memberships = Memberships;
488Cloudflare.User = User;
489Cloudflare.Zones = Zones;
490Cloudflare.LoadBalancers = LoadBalancers;
491Cloudflare.Cache = Cache;
492Cloudflare.SSL = SSL;
493Cloudflare.ACM = ACM;
494Cloudflare.Argo = Argo;
495Cloudflare.CertificateAuthorities = CertificateAuthorities;
496Cloudflare.ClientCertificates = ClientCertificates;
497Cloudflare.CustomCertificates = CustomCertificates;
498Cloudflare.CustomHostnames = CustomHostnames;
499Cloudflare.CustomNameservers = CustomNameservers;
500Cloudflare.DNSFirewall = DNSFirewall;
501Cloudflare.DNS = DNS;
502Cloudflare.EmailSecurity = EmailSecurity;
503Cloudflare.EmailRouting = EmailRouting;
504Cloudflare.Filters = Filters;
505Cloudflare.Firewall = Firewall;
506Cloudflare.Healthchecks = Healthchecks;
507Cloudflare.KeylessCertificates = KeylessCertificates;
508Cloudflare.Logpush = Logpush;
509Cloudflare.Logs = Logs;
510Cloudflare.OriginTLSClientAuth = OriginTLSClientAuth;
511Cloudflare.PageRules = PageRules;
512Cloudflare.RateLimits = RateLimits;
513Cloudflare.WaitingRooms = WaitingRooms;
514Cloudflare.Web3 = Web3;
515Cloudflare.Workers = Workers;
516Cloudflare.KV = KV;
517Cloudflare.DurableObjects = DurableObjects;
518Cloudflare.Queues = Queues;
519Cloudflare.APIGateway = APIGateway;
520Cloudflare.ManagedTransforms = ManagedTransforms;
521Cloudflare.PageShield = PageShield;
522Cloudflare.Rulesets = Rulesets;
523Cloudflare.URLNormalization = URLNormalization;
524Cloudflare.Spectrum = Spectrum;
525Cloudflare.Addressing = Addressing;
526Cloudflare.AuditLogs = AuditLogs;
527Cloudflare.Billing = Billing;
528Cloudflare.BrandProtection = BrandProtection;
529Cloudflare.Diagnostics = Diagnostics;
530Cloudflare.Images = Images;
531Cloudflare.Intel = Intel;
532Cloudflare.MagicTransit = MagicTransit;
533Cloudflare.MagicNetworkMonitoring = MagicNetworkMonitoring;
534Cloudflare.MagicCloudNetworking = MagicCloudNetworking;
535Cloudflare.NetworkInterconnects = NetworkInterconnects;
536Cloudflare.MTLSCertificates = MTLSCertificates;
537Cloudflare.Pages = Pages;
538Cloudflare.Registrar = Registrar;
539Cloudflare.RequestTracers = RequestTracers;
540Cloudflare.Rules = Rules;
541Cloudflare.Stream = Stream;
542Cloudflare.Alerting = Alerting;
543Cloudflare.D1Resource = D1Resource;
544Cloudflare.R2 = R2;
545Cloudflare.WorkersForPlatforms = WorkersForPlatforms;
546Cloudflare.ZeroTrust = ZeroTrust;
547Cloudflare.Turnstile = Turnstile;
548Cloudflare.HyperdriveResource = HyperdriveResource;
549Cloudflare.RUM = RUM;
550Cloudflare.Vectorize = Vectorize;
551Cloudflare.URLScanner = URLScanner;
552Cloudflare.Radar = Radar;
553Cloudflare.BotManagement = BotManagement;
554Cloudflare.OriginPostQuantumEncryption = OriginPostQuantumEncryption;
555Cloudflare.Zaraz = Zaraz;
556Cloudflare.Speed = Speed;
557Cloudflare.DCVDelegation = DCVDelegation;
558Cloudflare.Hostnames = Hostnames;
559Cloudflare.Snippets = Snippets;
560Cloudflare.Calls = Calls;
561Cloudflare.CloudforceOne = CloudforceOne;
562Cloudflare.AIGateway = AIGateway;
563Cloudflare.IAM = IAM;
564Cloudflare.CloudConnector = CloudConnector;
565Cloudflare.BotnetFeed = BotnetFeed;
566Cloudflare.SecurityTXT = SecurityTXT;
567Cloudflare.Workflows = Workflows;
568Cloudflare.ResourceSharing = ResourceSharing;
569Cloudflare.LeakedCredentialChecks = LeakedCredentialChecks;
570Cloudflare.ContentScanning = ContentScanning;
571Cloudflare.AbuseReports = AbuseReports;
572Cloudflare.AI = AI;
573Cloudflare.SecurityCenter = SecurityCenter;
574Cloudflare.BrowserRendering = BrowserRendering;
575Cloudflare.CustomPages = CustomPages;
576Cloudflare.SecretsStore = SecretsStore;
577Cloudflare.Pipelines = Pipelines;
578Cloudflare.SchemaValidation = SchemaValidation;
579export declare namespace Cloudflare {
580 export type RequestOptions = Core.RequestOptions;
581
582 export import V4PagePagination = Pagination.V4PagePagination;
583 export {
584 type V4PagePaginationParams as V4PagePaginationParams,
585 type V4PagePaginationResponse as V4PagePaginationResponse,
586 };
587
588 export import V4PagePaginationArray = Pagination.V4PagePaginationArray;
589 export {
590 type V4PagePaginationArrayParams as V4PagePaginationArrayParams,
591 type V4PagePaginationArrayResponse as V4PagePaginationArrayResponse,
592 };
593
594 export import CursorPagination = Pagination.CursorPagination;
595 export {
596 type CursorPaginationParams as CursorPaginationParams,
597 type CursorPaginationResponse as CursorPaginationResponse,
598 };
599
600 export import CursorLimitPagination = Pagination.CursorLimitPagination;
601 export {
602 type CursorLimitPaginationParams as CursorLimitPaginationParams,
603 type CursorLimitPaginationResponse as CursorLimitPaginationResponse,
604 };
605
606 export import SinglePage = Pagination.SinglePage;
607 export { type SinglePageResponse as SinglePageResponse };
608
609 export { Accounts as Accounts };
610
611 export { OriginCACertificates as OriginCACertificates };
612
613 export { IPs as IPs };
614
615 export { Memberships as Memberships };
616
617 export { User as User };
618
619 export { Zones as Zones };
620
621 export { LoadBalancers as LoadBalancers };
622
623 export { Cache as Cache };
624
625 export { SSL as SSL };
626
627 export { ACM as ACM };
628
629 export { Argo as Argo };
630
631 export { CertificateAuthorities as CertificateAuthorities };
632
633 export { ClientCertificates as ClientCertificates };
634
635 export { CustomCertificates as CustomCertificates };
636
637 export { CustomHostnames as CustomHostnames };
638
639 export { CustomNameservers as CustomNameservers };
640
641 export { DNSFirewall as DNSFirewall };
642
643 export { DNS as DNS };
644
645 export { EmailSecurity as EmailSecurity };
646
647 export { EmailRouting as EmailRouting };
648
649 export { Filters as Filters };
650
651 export { Firewall as Firewall };
652
653 export { Healthchecks as Healthchecks };
654
655 export { KeylessCertificates as KeylessCertificates };
656
657 export { Logpush as Logpush };
658
659 export { Logs as Logs };
660
661 export { OriginTLSClientAuth as OriginTLSClientAuth };
662
663 export { PageRules as PageRules };
664
665 export { RateLimits as RateLimits };
666
667 export { WaitingRooms as WaitingRooms };
668
669 export { Web3 as Web3 };
670
671 export { Workers as Workers };
672
673 export { KV as KV };
674
675 export { DurableObjects as DurableObjects };
676
677 export { Queues as Queues };
678
679 export { APIGateway as APIGateway };
680
681 export { ManagedTransforms as ManagedTransforms };
682
683 export { PageShield as PageShield };
684
685 export { Rulesets as Rulesets };
686
687 export { URLNormalization as URLNormalization };
688
689 export { Spectrum as Spectrum };
690
691 export { Addressing as Addressing };
692
693 export { AuditLogs as AuditLogs };
694
695 export { Billing as Billing };
696
697 export { BrandProtection as BrandProtection };
698
699 export { Diagnostics as Diagnostics };
700
701 export { Images as Images };
702
703 export { Intel as Intel };
704
705 export { MagicTransit as MagicTransit };
706
707 export { MagicNetworkMonitoring as MagicNetworkMonitoring };
708
709 export { MagicCloudNetworking as MagicCloudNetworking };
710
711 export { NetworkInterconnects as NetworkInterconnects };
712
713 export { MTLSCertificates as MTLSCertificates };
714
715 export { Pages as Pages };
716
717 export { Registrar as Registrar };
718
719 export { RequestTracers as RequestTracers };
720
721 export { Rules as Rules };
722
723 export { Stream as Stream };
724
725 export { Alerting as Alerting };
726
727 export { D1Resource as D1Resource };
728
729 export { R2 as R2 };
730
731 export { WorkersForPlatforms as WorkersForPlatforms };
732
733 export { ZeroTrust as ZeroTrust };
734
735 export { Turnstile as Turnstile };
736
737 export { HyperdriveResource as HyperdriveResource };
738
739 export { RUM as RUM };
740
741 export { Vectorize as Vectorize };
742
743 export { URLScanner as URLScanner };
744
745 export { Radar as Radar };
746
747 export { BotManagement as BotManagement };
748
749 export { OriginPostQuantumEncryption as OriginPostQuantumEncryption };
750
751 export { Zaraz as Zaraz };
752
753 export { Speed as Speed };
754
755 export { DCVDelegation as DCVDelegation };
756
757 export { Hostnames as Hostnames };
758
759 export { Snippets as Snippets };
760
761 export { Calls as Calls };
762
763 export { CloudforceOne as CloudforceOne };
764
765 export { AIGateway as AIGateway };
766
767 export { IAM as IAM };
768
769 export { CloudConnector as CloudConnector };
770
771 export { BotnetFeed as BotnetFeed };
772
773 export { SecurityTXT as SecurityTXT };
774
775 export { Workflows as Workflows };
776
777 export { ResourceSharing as ResourceSharing };
778
779 export { LeakedCredentialChecks as LeakedCredentialChecks };
780
781 export { ContentScanning as ContentScanning };
782
783 export { AbuseReports as AbuseReports };
784
785 export { AI as AI };
786
787 export { SecurityCenter as SecurityCenter };
788
789 export { BrowserRendering as BrowserRendering };
790
791 export { CustomPages as CustomPages };
792
793 export { SecretsStore as SecretsStore };
794
795 export { Pipelines as Pipelines };
796
797 export { SchemaValidation as SchemaValidation };
798
799 export type ASN = API.ASN;
800 export type AuditLog = API.AuditLog;
801 export type CertificateCA = API.CertificateCA;
802 export type CertificateRequestType = API.CertificateRequestType;
803 export type CloudflareTunnel = API.CloudflareTunnel;
804 export type ErrorData = API.ErrorData;
805 export type Identifier = API.Identifier;
806 export type LoadBalancerPreview = API.LoadBalancerPreview;
807 export type Member = API.Member;
808 export type PaginationInfo = API.PaginationInfo;
809 export type Permission = API.Permission;
810 export type PermissionGrant = API.PermissionGrant;
811 export type RatePlan = API.RatePlan;
812 export type ResponseInfo = API.ResponseInfo;
813 export type Result = API.Result;
814 export type Role = API.Role;
815 export type SortDirection = API.SortDirection;
816 export type Subscription = API.Subscription;
817 export type SubscriptionComponent = API.SubscriptionComponent;
818 export type SubscriptionZone = API.SubscriptionZone;
819 export type Token = API.Token;
820 export type TokenConditionCIDRList = API.TokenConditionCIDRList;
821 export type TokenPolicy = API.TokenPolicy;
822 export type TokenValue = API.TokenValue;
823}
824
825export { toFile, fileFromPath } from './uploads';
826export {
827 CloudflareError,
828 APIError,
829 APIConnectionError,
830 APIConnectionTimeoutError,
831 APIUserAbortError,
832 NotFoundError,
833 ConflictError,
834 RateLimitError,
835 BadRequestError,
836 AuthenticationError,
837 InternalServerError,
838 PermissionDeniedError,
839 UnprocessableEntityError,
840} from './error';
841
842export default Cloudflare;
843