cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
d7ceaf9231c07bfbc8d023eb38e4d68695d97fdf

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/index.ts

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