cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
cf57c149a8aadb17dbd8ae427fc6f65c4e699989

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/index.ts

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