cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
688cc84e2eb65a70d463e953e7aca4bb4db64349

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/index.ts

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